]> sjero.net Git - linphone/commitdiff
refer improvements
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 22 Oct 2010 12:44:20 +0000 (14:44 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 22 Oct 2010 12:44:20 +0000 (14:44 +0200)
coreapi/callbacks.c
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/private.h
coreapi/sal_eXosip2_presence.c
mediastreamer2

index 9f7cd26582d02187740d5d2efcca2c0b3322ceed..cc49391d9c47e74e37198053a4d7fe1f5381c481 100644 (file)
@@ -343,7 +343,6 @@ static void call_updating(SalOp *op){
                        linphone_call_set_state (call,prevstate,"Connected (streams running)");
                }
        }
-       if (lc->current_call==NULL) linphone_core_start_pending_refered_calls (lc);
 }
 
 static void call_terminated(SalOp *op, const char *from){
@@ -556,7 +555,11 @@ static void refer_received(Sal *sal, SalOp *op, const char *referto){
                        lc->vtable.display_status(lc,msg);
                        ms_free(msg);
                }
-               if (lc->current_call==NULL) linphone_core_start_pending_refered_calls (lc);
+               if (call->state!=LinphoneCallPaused){
+                       ms_message("Automatically pausing current call to accept transfer.");
+                       linphone_core_pause_call(lc,call);
+               }
+               linphone_core_start_refered_call(lc,call);
                sal_call_accept_refer(op);
        }else if (lc->vtable.refer_received){
                lc->vtable.refer_received(lc,referto);
index 1cdc41ffe039855b3721dc2abd4883c4a6dfe934..4ec373fd786346ea53d24692e95b35b668aabf17 100644 (file)
@@ -224,7 +224,6 @@ static void linphone_call_set_terminated(LinphoneCall *call){
        if (call == lc->current_call){
                ms_message("Resetting the current call");
                lc->current_call=NULL;
-               linphone_core_start_pending_refered_calls(lc);
        }
 
        if (linphone_core_del_call(lc,call) != 0){
index 9abea19a0a7b75a86ce91a5c6869669c1f348d73..438fdaa26c639cfdaf6fbbdebb2c638e92cadf5b 100644 (file)
@@ -1839,19 +1839,14 @@ const char * linphone_core_get_route(LinphoneCore *lc){
        return route;
 }
 
-void linphone_core_start_pending_refered_calls(LinphoneCore *lc){
-       MSList *elem;
-       for(elem=lc->calls;elem!=NULL;elem=elem->next){
-               LinphoneCall *call=(LinphoneCall*)elem->data;
-               if (call->refer_pending){
-                       LinphoneCallParams *cp=linphone_core_create_default_call_parameters(lc);
-                       cp->referer=call;
-                       ms_message("Starting new call to refered address %s",call->refer_to);
-                       call->refer_pending=FALSE;
-                       linphone_core_invite_with_params(lc,call->refer_to,cp);
-                       linphone_call_params_destroy(cp);
-                       break;
-               }
+void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call){
+       if (call->refer_pending){
+               LinphoneCallParams *cp=linphone_core_create_default_call_parameters(lc);
+               cp->referer=call;
+               ms_message("Starting new call to refered address %s",call->refer_to);
+               call->refer_pending=FALSE;
+               linphone_core_invite_with_params(lc,call->refer_to,cp);
+               linphone_call_params_destroy(cp);
        }
 }
 
@@ -2425,7 +2420,6 @@ int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *the_call)
        lc->current_call=NULL;
        if (call->audiostream || call->videostream)
                linphone_call_stop_media_streams (call);
-       linphone_core_start_pending_refered_calls(lc);
        return 0;
 }
 
index b41c772dd490c8fb7e1140ddd56b63578b5079cc..029405edd7347a376f975d30fb6410728c12979d 100644 (file)
@@ -197,7 +197,7 @@ void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float
 void linphone_core_stop_waiting(LinphoneCore *lc);
 
 int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphoneProxyConfig *dest_proxy);
-void linphone_core_start_pending_refered_calls(LinphoneCore *lc);
+void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call);
 extern SalCallbacks linphone_sal_callbacks;
 void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg,LinphoneError error);
 
index 1e7409f19bfb74d22dd540e987517a1f438d5582..675a45117abbf59e9a6eaa744d7d7dcd563ea5c0 100644 (file)
@@ -627,6 +627,7 @@ int sal_publish(SalOp *op, const char *from, const char *to, SalPresenceStatus p
          ms_message("Failed to send publish request.");
          return -1;
        }
+       sal_add_other(sal_op_get_sal(op),op,pub);
        return 0;
 }
 
index bf8706f50f26e17b3ecc1501e70b712ec11d0dc3..dcf3eba1afa5615cb01b52b1136d8aa0d224aca2 160000 (submodule)
@@ -1 +1 @@
-Subproject commit bf8706f50f26e17b3ecc1501e70b712ec11d0dc3
+Subproject commit dcf3eba1afa5615cb01b52b1136d8aa0d224aca2