]> sjero.net Git - linphone/commitdiff
Merge branch 'master' into dev_multicall
authorSimon Morlat <simon.morlat@linphone.org>
Thu, 17 Jun 2010 10:35:47 +0000 (12:35 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Thu, 17 Jun 2010 10:35:47 +0000 (12:35 +0200)
Conflicts:
console/commands.c
coreapi/linphonecore.c
coreapi/linphonecore.h

1  2 
console/commands.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/private.h
coreapi/sal.h
coreapi/sal_eXosip2.c

index 73e1b2b5425a49cacb2143b3b8c20701e26afbeb,967e035786b5827e140b5b47afaeed586211b646..e6cdca2006e2a622ab862a036045c01dbfdc5e89
@@@ -78,8 -78,9 +78,11 @@@ static int lpc_cmd_ports(LinphoneCore *
  static int lpc_cmd_speak(LinphoneCore *lc, char *args);
  static int lpc_cmd_codec(LinphoneCore *lc, char *args);
  static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args);
 +static int lpc_cmd_pause(LinphoneCore *lc, char *args);
 +static int lpc_cmd_resume(LinphoneCore *lc, char *args);
+ static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args);
+ static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args);
+ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args);
  
  /* Command handler helpers */
  static void linphonec_proxy_add(LinphoneCore *lc);
@@@ -221,20 -218,23 +224,28 @@@ LPC_COMMAND commands[] = 
                        "'speak <voice name> <sentence>'        : speak a text using the specified espeak voice.\n"
                        "Example for english voice: 'speak default Hello my friend !'"
        },
--    { "codec", lpc_cmd_codec, "Codec configuration",
--            "'codec list' : list codecs\n"  
--            "'codec enable <index>' : enable available codec\n"  
--            "'codec disable <index>' : disable codecs" }, 
--    { "ec", lpc_cmd_echocancellation, "Echo cancellation",
--            "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n"
--            "'ec off' : turn echo cancellation (EC) off\n"
--            "'ec show' : show EC status" },
-     { "pause", lpc_cmd_pause, "pause a call",
-               "'pause' : pause the current call\n"},
-     { "resume", lpc_cmd_resume, "resume a call",
-               "'resume' : resume the unique call\n"
-               "'resume <sip:XXX@XXX.XXX.XXX.XXX>' : hold off the call with cid <cid>\n"},
++      { "codec", lpc_cmd_codec, "Codec configuration",
++          "'codec list' : list codecs\n"  
++          "'codec enable <index>' : enable available codec\n"  
++          "'codec disable <index>' : disable codecs" }, 
++      { "ec", lpc_cmd_echocancellation, "Echo cancellation",
++          "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n"
++          "'ec off' : turn echo cancellation (EC) off\n"
++          "'ec show' : show EC status" },
++      { "pause", lpc_cmd_pause, "pause a call",
++              "'pause' : pause the current call\n"},
++      { "resume", lpc_cmd_resume, "resume a call",
++              "'resume' : resume the unique call\n"
++              "'resume <sip:XXX@XXX.XXX.XXX.XXX>' : hold off the call with cid <cid>\n"},
+       { "mute", lpc_cmd_mute_mic, 
+         "Mute microphone and suspend voice transmission."},
+       { "unmute", lpc_cmd_unmute_mic, 
 -        "Unmute microphone and resume voice transmission."},
++                "Unmute microphone and resume voice transmission."},
+       { "nortp-on-audio-mute", lpc_cmd_rtp_no_xmit_on_audio_mute,
 -        "Set the rtp_no_xmit_on_audio_mute configuration parameter",
 -        "   If set to 1 then rtp transmission will be muted when\n"
 -        "   audio is muted , otherwise rtp is always sent."}, 
 -      { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL }
++                "Set the rtp_no_xmit_on_audio_mute configuration parameter",
++                "   If set to 1 then rtp transmission will be muted when\n"
++                "   audio is muted , otherwise rtp is always sent."}, 
 +    { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL }
  };
  
  /***************************************************************************
@@@ -1984,6 -1833,41 +1997,38 @@@ static int lpc_cmd_echocancellation(Lin
      return 1;
  }
  
 -  if ( lc->call != NULL )
 -    linphone_core_mute_mic(lc, 1);
 -  return 1;
+ static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args)
+ {
 -static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args)
 -{
 -  if ( lc->call != NULL )
 -    linphone_core_mute_mic(lc, 0);
 -  return 1;
++      linphone_core_mute_mic(lc, 1);
++      return 1;
+ }
++static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args){
++      linphone_core_mute_mic(lc, 0);
++      return 1;
+ }
+ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args)
+ {
+   bool_t rtp_xmit_off=FALSE;
+   char *status;
+   gstate_t call_state=linphone_core_get_state(lc,GSTATE_GROUP_CALL);
+   if(args){
+     if(strstr(args,"1"))rtp_xmit_off=TRUE;
+     if(call_state == GSTATE_CALL_IDLE)
+       linphone_core_set_rtp_no_xmit_on_audio_mute(lc,rtp_xmit_off);
+     else 
+       linphonec_out("nortp-on-audio-mute: call in progress - cannot change state\n");
+   }
+   rtp_xmit_off=linphone_core_get_rtp_no_xmit_on_audio_mute(lc);
+   if(rtp_xmit_off)status="off";
+   else status="on";
+   linphonec_out("rtp transmit %s when audio muted\n",status);
+   return 1;
+ }
  /***************************************************************************
   *
   *  Command table management funx
index 51171d9f5989e7b12715e5249a225838b0e241d5,a68acd244b62181519936cff96e211d6ad8fe160..3423dd87c968797d2684f763c10ffa9d281709bd
@@@ -478,19 -628,14 +478,20 @@@ static void sip_config_read(LinphoneCor
  {
        char *contact;
        const char *tmpstr;
-       int port;
+       LCSipTransports tr;
        int i,tmp;
        int ipv6;
-       
-       port=lp_config_get_int(lc->config,"sip","use_info",0);
-       linphone_core_set_use_info_for_dtmf(lc,port);
 +
+       tmp=lp_config_get_int(lc->config,"sip","use_info",0);
+       linphone_core_set_use_info_for_dtmf(lc,tmp);
 +      if (lp_config_get_int(lc->config,"sip","use_session_timers",0)==1){
 +              sal_use_session_timers(lc->sal,200);
 +      }
-       port=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
-       linphone_core_set_use_rfc2833_for_dtmf(lc,port);
 +
++
+       tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
+       linphone_core_set_use_rfc2833_for_dtmf(lc,tmp);
  
        ipv6=lp_config_get_int(lc->config,"sip","use_ipv6",-1);
        if (ipv6==-1){
@@@ -1971,10 -2159,14 +2066,17 @@@ bool_t linphone_core_inc_invite_pending
        return FALSE;
  }
  
+ #ifdef TEST_EXT_RENDERER
+ static void rendercb(void *data, const MSPicture *local, const MSPicture *remote){
+       ms_message("rendercb, local buffer=%p, remote buffer=%p",
+                  local ? local->planes[0] : NULL, remote? remote->planes[0] : NULL);
+ }
+ #endif
  void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
 +#ifdef PRINTF_DEBUG
 +      printf("%s(%d)\n",__FUNCTION__,__LINE__);
 +#endif
        SalMediaDescription *md=call->localdesc;
        lc->audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc));
        if (linphone_core_echo_limiter_enabled(lc)){
Simple merge
index e67ccc130d8e63833b04578b5b267ec4f71bfa8d,43f4e0f083aba282141d2f413cdcc772f8642ff8..2a55b428f4272bf255155a3611f7a4ac312c5cdc
@@@ -397,20 -402,7 +401,21 @@@ struct _LinphoneCor
        bool_t preview_finished;
        bool_t auto_net_state_mon;
        bool_t network_reachable;
+         bool_t audio_muted;
  };
  
 +bool_t linphone_core_can_we_add_call(LinphoneCore *lc);
 +int linphone_core_add_call( LinphoneCore *lc, LinphoneCall *call);
 +int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call);
 +int linphone_core_set_as_current_call(LinphoneCore *lc, LinphoneCall *call);
 +int linphone_core_unset_the_current_call(LinphoneCore *lc);
 +int linphone_core_get_calls_nb(const LinphoneCore *lc);
 +
 +#define HOLD_OFF      (0)
 +#define HOLD_ON               (1)
 +
 +#ifndef NB_MAX_CALLS
 +#define NB_MAX_CALLS  (10)
 +#endif
 +
  #endif /* _PRIVATE_H */
diff --cc coreapi/sal.h
Simple merge
index 69f74664278a10a22b4d4fa65ce29c2bf2243df4,bd3e7e664069bf47ef7ecec9e1762ea4ae136b8c..2a2c85516480425dfb747d8ce84918fc68514437
@@@ -1756,41 -1758,19 +1782,54 @@@ void sal_address_destroy(SalAddress *u)
  }
  
  void sal_set_keepalive_period(Sal *ctx,unsigned int value) {
+       ctx->keepalive_period=value;
        eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &value);
  }
+ const char * sal_address_get_port(const SalAddress *addr) {
+       const osip_from_t *u=(const osip_from_t*)addr;
+       return null_if_empty(u->url->port);
+ }
+ int sal_address_get_port_int(const SalAddress *uri) {
+       const char* port = sal_address_get_port(uri);
+       if (port != NULL) {
+               return atoi(port);
+       } else {
+               return 5060;
+       }
+ }
  
 +/**
 + * Send a re-Invite used to hold the current call
 + *
 + * @ingroup call_control
 + * @param lc the LinphoneCore object
 + * @param url the destination of the call (sip address).
 +**/
 +int sal_call_hold(SalOp *h, bool_t holdon)
 +{
 +      int err=0;
 +
 +      osip_message_t *reinvite;
 +      if(eXosip_call_build_request(h->did,"INVITE",&reinvite) != OSIP_SUCCESS)
 +              return -1;
 +      if(reinvite==NULL)
 +              return -2;
 +      osip_message_set_subject(reinvite,osip_strdup("Phone Call Hold"));
 +      osip_message_set_allow(reinvite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO");
 +      if (h->base.root->session_expires!=0){
 +              osip_message_set_header(reinvite, "Session-expires", "200");
 +              osip_message_set_supported(reinvite, "timer");
 +      }
 +      //add something to say that the distant sip phone will be in sendonly/sendrecv mode
 +      if (h->base.local_media){
 +              h->sdp_offering=TRUE;
 +              set_hold_status_to_desc(h->base.local_media,holdon);
 +              set_sdp_from_desc(reinvite,h->base.local_media);
 +      }else h->sdp_offering=FALSE;
 +      eXosip_lock();
 +      err = eXosip_call_send_request(h->did, reinvite);
 +      eXosip_unlock();
 +      
 +      return err;
 +}
 +