]> sjero.net Git - linphone/commitdiff
fix missing "lr" causing old fashioned outbound proxy routing
authorSimon Morlat <simon.morlat@linphone.org>
Tue, 14 Feb 2012 09:41:20 +0000 (10:41 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Tue, 14 Feb 2012 10:00:02 +0000 (11:00 +0100)
coreapi/linphonecall.c
coreapi/proxy.c
coreapi/sal_eXosip2.c
coreapi/sal_eXosip2_presence.c

index 15672211fb86f5b9354fe3aa6225e51e5c9b5943..31c9cbfcbdfbf1d1421a0cd4f228ae7178f62102 100644 (file)
@@ -350,7 +350,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
                 we get a chance to discover our nat'd address before answering.*/
                call->ping_op=sal_op_new(lc->sal);
                from_str=linphone_address_as_string_uri_only(from);
-               sal_op_set_route(call->ping_op,sal_op_get_network_origin(call->op));
+               sal_op_set_route(call->ping_op,sal_op_get_network_origin(op));
                sal_op_set_user_pointer(call->ping_op,call);
                sal_ping(call->ping_op,linphone_core_find_best_identity(lc,from,NULL),from_str);
                ms_free(from_str);
index c708dcf40884a555eb8ff85065295542e5b75594..a01f1ffd0d37e7f12fad6b3226dd74932550e4df 100644 (file)
@@ -172,16 +172,20 @@ int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route)
                obj->reg_route=NULL;
        }
        if (route!=NULL){
-               LinphoneAddress *addr;
+               SalAddress *addr;
+               char *tmp;
                /*try to prepend 'sip:' */
                if (strstr(route,"sip:")==NULL){
-                       obj->reg_route=ms_strdup_printf("sip:%s",route);
-               }else obj->reg_route=ms_strdup(route);
-               addr=linphone_address_new(obj->reg_route);
-               if (addr==NULL){
-                       ms_free(obj->reg_route);
-                       obj->reg_route=NULL;
-               }else linphone_address_destroy(addr);
+                       tmp=ms_strdup_printf("sip:%s",route);
+               }else tmp=ms_strdup(route);
+               addr=sal_address_new(tmp);
+               if (addr!=NULL){
+                       sal_address_destroy(addr);
+               }else{
+                       ms_free(tmp);
+                       tmp=NULL;
+               }
+               obj->reg_route=tmp;
        }
        return 0;
 }
index ace208e1b7454015ce7387adc5cfaa1d261c4897..1c7fd5b519c00d58e38e7f2a6f8632e65768aee4 100644 (file)
@@ -717,8 +717,8 @@ int sal_ping(SalOp *op, const char *from, const char *to){
        
        sal_op_set_from(op,from);
        sal_op_set_to(op,to);
+       sal_exosip_fix_route(op);
 
-       /*bug here: eXosip2 does not honor the route argument*/
        eXosip_options_build_request (&options, sal_op_get_to(op),
                        sal_op_get_from(op),sal_op_get_route(op));
        if (options){
@@ -2216,10 +2216,10 @@ void sal_address_set_param(SalAddress *u,const char* name,const char* value) {
        osip_uri_param_t *param=NULL;
     osip_uri_uparam_get_byname(((osip_from_t*)u)->url,(char*)name,&param);
     if (param == NULL){
-        osip_uri_uparam_add    (((osip_from_t*)u)->url,ms_strdup(name),ms_strdup(value));
+        osip_uri_uparam_add    (((osip_from_t*)u)->url,ms_strdup(name),value ? ms_strdup(value) : NULL);
     } else {
         osip_free(param->gvalue);
-        param->gvalue=osip_strdup(value);
+        param->gvalue=value ? osip_strdup(value) : NULL;
     }
     
 }
index 4a18c4611bbe46b27c1d04b5cad44cc8f035fec3..f79866a0a8d60b5890ab8aab213814b559a22e25 100644 (file)
@@ -92,6 +92,7 @@ int sal_text_send(SalOp *op, const char *from, const char *to, const char *msg){
                if (to)
                        sal_op_set_to(op,to);
 
+               sal_exosip_fix_route(op);
                eXosip_lock();
                eXosip_message_build_request(&sip,"MESSAGE",sal_op_get_to(op),
                        sal_op_get_from(op),sal_op_get_route(op));