]> sjero.net Git - linphone/commitdiff
Merge branch 'master' into dev_multicall
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 9 Aug 2010 07:55:45 +0000 (09:55 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 9 Aug 2010 07:55:45 +0000 (09:55 +0200)
Conflicts:
console/commands.c
coreapi/callbacks.c
coreapi/linphonecore.c
coreapi/sal_eXosip2.c
mediastreamer2

1  2 
console/commands.c
coreapi/callbacks.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/proxy.c
coreapi/sal_eXosip2.c
mediastreamer2
pixmaps/Makefile.am

index e6cdca2006e2a622ab862a036045c01dbfdc5e89,b46edc1944dbc4b1d2aba3e5136a16c07d56781f..9f10a4831d757cd96d8d8188bbf4403f5961811c
@@@ -76,10 -79,10 +79,12 @@@ static int lpc_cmd_duration(LinphoneCor
  static int lpc_cmd_status(LinphoneCore *lc, char *args);
  static int lpc_cmd_ports(LinphoneCore *lc, char *args);
  static int lpc_cmd_speak(LinphoneCore *lc, char *args);
- static int lpc_cmd_codec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_acodec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_vcodec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_codec(int type, 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);
@@@ -224,19 -223,18 +229,23 @@@ 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" }, 
+     { "codec", lpc_cmd_acodec, "Audio codec configuration",
+             "'codec list' : list audio codecs\n"
+             "'codec enable <index>' : enable available audio codec\n"
+             "'codec disable <index>' : disable audio codec" },
+     { "vcodec", lpc_cmd_vcodec, "Video codec configuration",
+             "'vcodec list' : list video codecs\n"
+             "'vcodec enable <index>' : enable available video codec\n"
+             "'vcodec disable <index>' : disable video codec" },
 -    { "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" },
 +      { "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, 
index 48e2db00580f23383ea90b3cc86006b9eacd73ac,c94388a9c7c6ca5b15f42feabdf6599e5091bfdc..36f21d5a5667db1912914ad6762de7d6ade6ca06
@@@ -120,21 -99,16 +120,24 @@@ static void call_received(SalOp *h)
            lc->vtable.display_status(lc,barmesg);
  
        /* play the ring */
 -      if (lc->sound_conf.ring_sndcard!=NULL){
 -              ms_message("Starting local ring...");
 -              lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,lc->sound_conf.ring_sndcard);
 +      if (lc->sound_conf.ring_sndcard!=NULL && !linphone_core_in_call(lc)){
 +              if(lc->ringstream==NULL){
 +                      MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
 +                      ms_message("Starting local ring...");
 +                      lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard);
 +              }
 +              else
 +              {
 +                      ms_message("the local ring is already started");
 +              }
        }
 -      linphone_call_set_state(call,LCStateRinging);
 +      call->state=LinphoneCallRinging;
        sal_call_notify_ringing(h);
-       linphone_core_init_media_streams(lc,call);
+ #if !(__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)
+       linphone_core_init_media_streams(lc,lc->call);
+ #endif
 -      if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,tmp);
 +      if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,call);
++#endif
        ms_free(barmesg);
        ms_free(tmp);
  }
@@@ -372,11 -273,13 +375,11 @@@ static void call_failure(SalOp *op, Sal
        /*char *retrymsg=_("%s. Retry after %i minute(s).");*/
        char *msg600=_("User does not want to be disturbed.");
        char *msg603=_("Call declined.");
-       char *msg=(char*)details;
+       const char *msg=details;
 -      LinphoneCall *call=lc->call;
 +      LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
 +      LinphoneGeneralStateContext gctx;
  
 -      if (sal_op_get_user_pointer(op)!=lc->call){
 -              ms_warning("call_failure: ignoring.");
 -              return;
 -      }
 +      gctx.call=call;
        if (lc->vtable.show) lc->vtable.show(lc);
  
        if (error==SalErrorNoResponse){
index fa2e0815c84fd8988a20cd4e2af465971a63049a,55b9a75532ca1ce6a7bd3f303795608ea9806b37..54b9d6d08dccb87eb52c7e637959fe4afc52d2c0
@@@ -2445,12 -2515,12 +2453,14 @@@ int linphone_core_accept_call(LinphoneC
        contact=get_fixed_contact(lc,call,cfg);
        if (contact)
                sal_op_set_contact(call->op,contact);
-       
+ #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
+       linphone_core_init_media_streams(lc,call);
+ #endif
        sal_call_accept(call->op);
 -      lc->vtable.display_status(lc,_("Connected."));
 -      gstate_new_state(lc, GSTATE_CALL_IN_CONNECTED, NULL);
 +      if (lc->vtable.display_status!=NULL)
 +              lc->vtable.display_status(lc,_("Connected."));
 +      gctx.call=call;
 +      gstate_new_state(lc, GSTATE_CALL_IN_CONNECTED, gctx, NULL);
        call->resultdesc=sal_call_get_final_media_description(call->op);
        if (call->resultdesc){
                sal_media_description_ref(call->resultdesc);
@@@ -3914,106 -3807,28 +3924,131 @@@ void linphone_core_destroy(LinphoneCor
        linphone_core_uninit(lc);
        ms_free(lc);
  }
 +/**
 + * Get the number of Call
 + *
 + * @ingroup call_control
 +**/
 +int linphone_core_get_calls_nb(const LinphoneCore *lc)
 +{
 +      int returned;
 +      if(lc->calls == NULL)
 +      {
 +              returned = 0;
 +      }
 +      else
 +      {
 +              returned = ms_list_size(lc->calls);
 +      }
 +      return returned;
 +}
 +
 +/**
 + * Check if we do not have exceed the number of simultaneous call
 + *
 + * @ingroup call_control
 +**/
 +bool_t linphone_core_can_we_add_call(LinphoneCore *lc)
 +{
 +      if(linphone_core_get_calls_nb(lc) < NB_MAX_CALLS)
 +              return TRUE;
 +      ms_error("Maximum amount of simultaneous calls reached !");
 +      return FALSE;
 +}
 +
 +/**
 + * Unset the current call
 + *
 + * @ingroup call_control
 +**/
 +int linphone_core_unset_the_current_call(LinphoneCore *lc)
 +{
 +      if(lc->current_call == NULL)
 +              return -1;
 +      lc->current_call = NULL;
 +      ms_message("Current call unset\n");
 +      return 0;
 +}
 +
 +/**
 + * Set the call in parameter as the new current call
 + *
 + * @ingroup call_control
 +**/
 +int linphone_core_set_as_current_call(LinphoneCore *lc, LinphoneCall *call)
 +{
 +      if(lc->current_call != NULL)
 +              return -1;
 +      lc->current_call = call;
 +      return 0;
 +}
 +
 +/**
 + * Add the call in the LinphoneCall list
 + *
 + * @ingroup call_control
 +**/
 +int linphone_core_add_call( LinphoneCore *lc, LinphoneCall *call)
 +{
 +      if(linphone_core_can_we_add_call(lc))
 +      {
 +              MSList *the_calls = lc->calls;
 +              the_calls = ms_list_append(the_calls,call);
 +              lc->calls = the_calls;
 +              return 0;
 +      }
 +      return -1;
 +}
 +
 +/**
 + * Add the call in the LinphoneCall list
 + *
 + * @ingroup call_control
 +**/
 +int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call)
 +{
 +      MSList *it;
 +
 +      MSList *the_calls = lc->calls;
 +      if(call == linphone_core_get_current_call(lc))
 +      {
 +              linphone_core_unset_the_current_call(lc);
 +      }       
 +      it=ms_list_find(the_calls,call);
 +      if (it) 
 +      {
 +              the_calls = ms_list_remove_link(the_calls,it);
 +      }
 +      else
 +      {
 +              ms_warning("could not find the call into the list\n");
 +              return -1;
 +      }
 +      lc->calls = the_calls;
 +      return 0;
 +}
+ static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) {
+       const MSList *elem;
+       for(elem=from;elem!=NULL;elem=elem->next){
+               PayloadType *pt=(PayloadType*)elem->data;
+               if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && rate==pt->clock_rate) {
+                       return pt;
+               }
+       }
+       return NULL;
+ }
+ PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) {
+       PayloadType* result = find_payload_type_from_list(type, rate, linphone_core_get_audio_codecs(lc));
+       if (result)  {
+               return result;
+       } else {
+               result = find_payload_type_from_list(type, rate, linphone_core_get_video_codecs(lc));
+               if (result) {
+                       return result;
+               }
+       }
+       //not found
+       return NULL;
+ }
Simple merge
diff --cc coreapi/proxy.c
Simple merge
Simple merge
diff --cc mediastreamer2
index bc6cdb650a9fc76d00380221eb0198ba4bb96812,4b5164714c2cf77a284f0213fc79e9b147e8563a..0000000000000000000000000000000000000000
deleted file mode 160000,160000
+++ /dev/null
@@@ -1,1 -1,1 +1,0 @@@
- Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812
 -Subproject commit 4b5164714c2cf77a284f0213fc79e9b147e8563a
Simple merge