From 55af0b6aa58ed9b9a78c97f0a2667fa2a64b6df7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 9 Dec 2013 14:01:02 +0100 Subject: [PATCH] fix transport selection for outgoing messages when the proxy config selected has sips. --- coreapi/linphonecore.c | 16 +++++----------- gtk/propertybox.c | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index e36410d09..5698d2272 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2417,18 +2417,12 @@ static MSList *make_routes_for_proxy(LinphoneProxyConfig *proxy, const LinphoneA ret=ms_list_append(ret,sal_address_clone((SalAddress*)srv_route)); } if (ret==NULL){ - /*still no route, so try to build a route from proxy transport + identity host, - *in order to force using the transport required for this proxy, if any.*/ + /*if the proxy address matches the domain part of the destination, then use the same transport + * as the one used for registration. This is done by forcing a route to this proxy.*/ SalAddress *proxy_addr=sal_address_new(linphone_proxy_config_get_addr(proxy)); - const char *transport=sal_address_get_transport_name(proxy_addr); - if (transport){ - SalAddress *route=sal_address_new(NULL); - sal_address_set_domain(route,sal_address_get_domain((SalAddress*)dest)); - sal_address_set_port(route,sal_address_get_port((SalAddress*)dest)); - sal_address_set_transport_name(route,transport); - ret=ms_list_append(ret,route); - } - sal_address_destroy(proxy_addr); + if (strcmp(sal_address_get_domain(proxy_addr),linphone_address_get_domain(dest))==0){ + ret=ms_list_append(ret,proxy_addr); + }else sal_address_destroy(proxy_addr); } return ret; } diff --git a/gtk/propertybox.c b/gtk/propertybox.c index dd6424dac..8579fc2f4 100644 --- a/gtk/propertybox.c +++ b/gtk/propertybox.c @@ -1139,7 +1139,6 @@ static gboolean apply_transports(PortConfigCtx *ctx){ linphone_core_get_sip_transports(lc,&tp); tp.udp_port=ctx->tp.udp_port; tp.tcp_port=ctx->tp.tcp_port; - g_message("new transports: %i, %i, %i",(int)tp.udp_port,(int)tp.tcp_port,(int)tp.tls_port); linphone_core_set_sip_transports(lc,&tp); g_object_set_data(G_OBJECT(mw),"port_config",NULL); return FALSE;