]> sjero.net Git - linphone/commitdiff
Merge branch 'dev_lsd' into dev_multicall
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 31 May 2010 15:27:37 +0000 (17:27 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 31 May 2010 15:27:37 +0000 (17:27 +0200)
Conflicts:
coreapi/callbacks.c
coreapi/linphonecore.c

1  2 
coreapi/Makefile.am
coreapi/callbacks.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/private.h
mediastreamer2

index b497c1ea1817bca30c99393cd1ca72b6715a9151,44f7532a85af7047df108bd7d83915f946c19038..7044420ec16dfc2ea0eab5aa0f7720a513fbcd25
@@@ -33,9 -33,9 +33,10 @@@ liblinphone_la_SOURCES=
        lpconfig.c lpconfig.h \
        chat.c \
        general_state.c \
 +      linphonecall.c \
        sipsetup.c sipsetup.h \
-       siplogin.c
+       siplogin.c \
+       lsd.c linphonecore_utils.h
  
  
  liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
index 1af84c194131735b10daaffafb3df59e6e917ead,6f86c9bbb2c9e2ab617271a002ab59d2393502e4..4b53ffdad3d2078097bfca75f97ac51a8a11ef01
@@@ -117,21 -99,15 +117,21 @@@ static void call_received(SalOp *h)
            lc->vtable.display_status(lc,barmesg);
  
        /* play the ring */
 -      if (lc->sound_conf.ring_sndcard!=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);
 +      if (lc->sound_conf.ring_sndcard!=NULL && !linphone_core_in_call(lc)){
-               if(lc->ringstream==NULL)
-               {
++              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,lc->sound_conf.ring_sndcard);
++                      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,lc->call);
 -      if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,tmp);
 +      linphone_core_init_media_streams(lc,call);
 +      if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,call);
        ms_free(barmesg);
        ms_free(tmp);
  }
@@@ -323,11 -248,11 +324,13 @@@ static void call_terminated(SalOp *op, 
                ring_stop(lc->ringstream);
                lc->ringstream=NULL;
        }
 -      linphone_core_stop_media_streams(lc,lc->call);
 +      if(call == linphone_core_get_current_call(lc))
 +              linphone_core_stop_media_streams(lc,call);
-       lc->vtable.show(lc);
-       lc->vtable.display_status(lc,_("Call terminated."));
+       if (lc->vtable.show!=NULL)
+               lc->vtable.show(lc);
+       if (lc->vtable.display_status!=NULL)
+               lc->vtable.display_status(lc,_("Call terminated."));
 +      linphone_call_set_terminated(call);
        gstate_new_state(lc, GSTATE_CALL_END, NULL);
        if (lc->vtable.bye_recv!=NULL){
                LinphoneAddress *addr=linphone_address_new(from);
index a1589933d1e0d14ea86c8fa6263868bcec204837,7aad0800f56d5f78b81b7117dbf598d5f94a9416..ce01bfc01abb0817d522ca835ef9d1463c8f712f
@@@ -155,16 -300,29 +156,17 @@@ void linphone_call_log_completed(Linpho
        LinphoneCore *lc=call->core;
        
        calllog->duration=time(NULL)-call->start_time;
 -      switch(call->state){
 -              case LCStateInit:
 -              case LCStatePreEstablishing:
 -                      calllog->status=LinphoneCallAborted;
 -                      break;
 -              case LCStateRinging:
 -                      if (calllog->dir==LinphoneCallIncoming){
 -                              char *info;
 -                              calllog->status=LinphoneCallMissed;
 -                              lc->missed_calls++;
 -                              info=ortp_strdup_printf(ngettext("You have missed %i call.",
 -                            "You have missed %i calls.", lc->missed_calls),
 -                        lc->missed_calls);
 +      
 +      if (status==LinphoneCallMissed){
 +              char *info;
 +              lc->missed_calls++;
 +              info=ortp_strdup_printf(ngettext("You have missed %i call.",
 +                    "You have missed %i calls.", lc->missed_calls),
 +                lc->missed_calls);
-               lc->vtable.display_status(lc,info);
+                               if (lc->vtable.display_status!=NULL)
+                                       lc->vtable.display_status(lc,info);
 -                              ms_free(info);
 -                      }
 -                      else calllog->status=LinphoneCallAborted;
 -                      break;
 -              case LCStateAVRunning:
 -                      calllog->status=LinphoneCallSuccess;
 -                      break;
 -      }
 +              ms_free(info);
 +      }else calllog->status=status;
        lc->call_logs=ms_list_prepend(lc->call_logs,(void *)calllog);
        if (ms_list_size(lc->call_logs)>lc->max_call_logs){
                MSList *elem,*prevelem=NULL;
@@@ -1378,22 -1543,10 +1391,23 @@@ static void display_bandwidth(RtpSessio
        (vs!=NULL) ? (rtp_session_compute_send_bandwidth(vs)*1e-3) : 0);
  }
  
 -static void linphone_core_disconnected(LinphoneCore *lc){
 +static void linphone_core_disconnected(LinphoneCore *lc, LinphoneCall *call){
 +      char temp[256];
 +      char *from;
 +      if(call)
 +              from = linphone_call_get_remote_address_as_string(call);
 +      if(from)
 +      {
 +              snprintf(temp,sizeof(temp),"Remote end %s seems to have disconnected, the call is going to be closed.",from);
 +              free(from);
 +      }               
 +      else
 +      {
 +              snprintf(temp,sizeof(temp),"Remote end seems to have disconnected, the call is going to be closed.");
 +      }
+       if (lc->vtable.display_warning!=NULL)
 -              lc->vtable.display_warning(lc,_("Remote end seems to have disconnected, the call is going to be closed."));
 -      linphone_core_terminate_call(lc,NULL);
 +      lc->vtable.display_warning(lc,temp);
 +      linphone_core_terminate_call(lc,call);//TODO failure ??
  }
  
  static void monitor_network_state(LinphoneCore *lc, time_t curtime){
@@@ -1620,11 -1758,11 +1635,13 @@@ LinphoneAddress * linphone_core_interpr
        LinphoneAddress *uri;
        
        if (is_enum(url,&enum_domain)){
-               lc->vtable.display_status(lc,_("Looking for telephone number destination..."));
+               if (lc->vtable.display_status!=NULL)
+                       lc->vtable.display_status(lc,_("Looking for telephone number destination..."));
                if (enum_lookup(enum_domain,&enumres)<0){
-                       lc->vtable.display_status(lc,_("Could not resolve this number."));
+                       if (lc->vtable.display_status!=NULL)
+                               lc->vtable.display_status(lc,_("Could not resolve this number."));
 +                      if(lc->vtable.failure_recv)
 +                              lc->vtable.failure_recv(lc,NULL,400);
                        ms_free(enum_domain);
                        return NULL;
                }
@@@ -1818,10 -1956,11 +1836,11 @@@ int linphone_core_start_invite(Linphone
        
        if (err<0){
                ms_warning("Could not initiate call.");
-               lc->vtable.display_status(lc,_("could not call"));
+               if (lc->vtable.display_status!=NULL)
+                       lc->vtable.display_status(lc,_("could not call"));
 -              linphone_core_stop_media_streams(lc,call);
 -              linphone_call_destroy(call);
 -              lc->call=NULL;
 +              if(call == linphone_core_get_current_call(lc))
 +                      linphone_core_stop_media_streams(lc,call);
 +              linphone_call_unref(call);
        }else gstate_new_state(lc, GSTATE_CALL_OUT_INVITE, real_url);
        ms_free(real_url);
        ms_free(from);
@@@ -2353,12 -2452,11 +2374,13 @@@ int linphone_core_terminate_call(Linpho
                ring_stop(lc->ringstream);
                lc->ringstream=NULL;
        }
 -      linphone_core_stop_media_streams(lc,call);
 +      if(call == linphone_core_get_current_call(lc))
 +              linphone_core_stop_media_streams(lc,call);
-       lc->vtable.display_status(lc,_("Call ended") );
+       if (lc->vtable.display_status!=NULL)
+               lc->vtable.display_status(lc,_("Call ended") );
        gstate_new_state(lc, GSTATE_CALL_END, NULL);
 -      linphone_call_destroy(call);
 +      linphone_call_set_terminated(call);
 +      linphone_call_unref(call);
        return 0;
  }
  
Simple merge
Simple merge
diff --cc mediastreamer2
index 57896d513f6fbf41fde3c777931ebc744e53e366,57896d513f6fbf41fde3c777931ebc744e53e366..6445a4897dfffc2331015e4a3a1dadc60d4a7261
@@@ -1,1 -1,1 +1,1 @@@
--Subproject commit 57896d513f6fbf41fde3c777931ebc744e53e366
++Subproject commit 6445a4897dfffc2331015e4a3a1dadc60d4a7261