From 2338c9467457ada5bf2ecd036e76d042cece9d57 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 29 Jan 2016 17:48:55 +0100 Subject: [PATCH 1/4] fix routing of quality reporting publishes --- coreapi/bellesip_sal/sal_address_impl.c | 5 +++++ coreapi/quality_reporting.c | 24 +++++++++++++++--------- include/sal/sal.h | 1 + 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/coreapi/bellesip_sal/sal_address_impl.c b/coreapi/bellesip_sal/sal_address_impl.c index b6ed5b77e..8b8b75417 100644 --- a/coreapi/bellesip_sal/sal_address_impl.c +++ b/coreapi/bellesip_sal/sal_address_impl.c @@ -208,6 +208,11 @@ void sal_address_set_uri_params(SalAddress *addr, const char *params){ belle_sip_parameters_set(parameters,params); } +bool_t sal_address_has_uri_param(SalAddress *addr, const char *name){ + belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr))); + belle_sip_parameters_has_parameter(parameters, name); +} + void sal_address_set_header(SalAddress *addr, const char *header_name, const char *header_value){ belle_sip_uri_set_header(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr)),header_name, header_value); } diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index 5f01ab99b..ea4ba3f6e 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -271,8 +271,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report, int ret = 0; LinphoneEvent *lev; LinphoneAddress *request_uri; - char * domain; - const char* route; + const char* collector_uri; /*if we are on a low bandwidth network, do not send reports to not overload it*/ if (linphone_call_params_low_bandwidth_enabled(linphone_call_get_current_params(call))){ @@ -353,14 +352,21 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report, } - route = linphone_proxy_config_get_quality_reporting_collector(call->dest_proxy); - domain = ms_strdup_printf("sip:%s", linphone_proxy_config_get_domain(call->dest_proxy)); - request_uri = linphone_address_new(route ? route : domain); - ms_free(domain); + collector_uri = linphone_proxy_config_get_quality_reporting_collector(call->dest_proxy); + if (!collector_uri){ + collector_uri = ms_strdup_printf("sip:%s", linphone_proxy_config_get_domain(call->dest_proxy)); + } + request_uri = linphone_address_new(collector_uri); lev=linphone_core_create_publish(call->core, request_uri, "vq-rtcpxr", expires); - if (route) { - ms_message("Publishing report with custom route %s", route); - sal_op_set_route(lev->op, route); + /* Special exception for quality report PUBLISH: if the collector_uri has any transport related parameters + * (port, transport, maddr), then it is sent directly. + * Otherwise it is routed as any LinphoneEvent publish, following proxy config policy. + **/ + if (sal_address_has_uri_param((SalAddress*)request_uri, "transport") || + sal_address_has_uri_param((SalAddress*)request_uri, "maddr") || + linphone_address_get_port(request_uri) != 0) { + ms_message("Publishing report with custom route %s", collector_uri); + sal_op_set_route(lev->op, collector_uri); } if (linphone_event_send_publish(lev, content) != 0){ diff --git a/include/sal/sal.h b/include/sal/sal.h index ca06b1d13..5a7e59138 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -126,6 +126,7 @@ void sal_address_set_transport_name(SalAddress* addr,const char* transport); void sal_address_set_method_param(SalAddress *addr, const char *method); void sal_address_set_params(SalAddress *addr, const char *params); void sal_address_set_uri_params(SalAddress *addr, const char *params); +bool_t sal_address_has_uri_param(SalAddress *addr, const char *name); bool_t sal_address_is_ipv6(const SalAddress *addr); bool_t sal_address_is_sip(const SalAddress *addr); void sal_address_set_password(SalAddress *addr, const char *passwd); From 058c8fdc6bbb25b5c15d619156b7abce13a1fd56 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 29 Jan 2016 17:51:00 +0100 Subject: [PATCH 2/4] fix bug in last commit --- coreapi/bellesip_sal/sal_address_impl.c | 2 +- mediastreamer2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_address_impl.c b/coreapi/bellesip_sal/sal_address_impl.c index 8b8b75417..505ee95e3 100644 --- a/coreapi/bellesip_sal/sal_address_impl.c +++ b/coreapi/bellesip_sal/sal_address_impl.c @@ -210,7 +210,7 @@ void sal_address_set_uri_params(SalAddress *addr, const char *params){ bool_t sal_address_has_uri_param(SalAddress *addr, const char *name){ belle_sip_parameters_t* parameters = BELLE_SIP_PARAMETERS(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(addr))); - belle_sip_parameters_has_parameter(parameters, name); + return belle_sip_parameters_has_parameter(parameters, name); } void sal_address_set_header(SalAddress *addr, const char *header_name, const char *header_value){ diff --git a/mediastreamer2 b/mediastreamer2 index 64777b9d0..bce674252 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 64777b9d01fc114e62efe24390e3868821fd5271 +Subproject commit bce6742522a3cc32e26f13aef68123f941bd77ab From 89c76ba9238355ea3104598387360d220de1855f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sat, 30 Jan 2016 21:57:52 +0100 Subject: [PATCH 3/4] fix specfile --- linphone.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/linphone.spec.in b/linphone.spec.in index fa5541a0a..a92ec864e 100644 --- a/linphone.spec.in +++ b/linphone.spec.in @@ -100,6 +100,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/lpc2xml_test %{_bindir}/xml2lpc_test %{_bindir}/lp-gen-wrappers +%{_bindir}/lp-sendmsg %{_includedir}/linphone %{_libdir}/*.a %{_libdir}/*.la From 395c7a38bbb1cbabbbf80344bb91b871206b5d0c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 31 Jan 2016 09:08:06 +0100 Subject: [PATCH 4/4] set longer timeout for getting registered, don't send a REGISTER to an AT&T machine. --- tester/call_tester.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 8eb458f93..32a16075f 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -547,14 +547,14 @@ static void call_outbound_with_multiple_proxy(void) { // set first LPC to unreacheable proxy addr linphone_proxy_config_edit(lpc); - linphone_proxy_config_set_server_addr(lpc,"12.13.14.15:5223;transport=udp"); - linphone_proxy_config_set_route(lpc, "12.13.14.15:5223;transport=udp;lr"); + linphone_proxy_config_set_server_addr(lpc,"sip:linphone.org:9016;transport=udp"); + linphone_proxy_config_set_route(lpc, "sip:linphone.org:9016;transport=udp;lr"); linphone_proxy_config_done(lpc); - BC_ASSERT_TRUE(wait_for_until(pauline->lc, NULL, &pauline->stat.number_of_LinphoneRegistrationOk, 1, 2000)); + BC_ASSERT_TRUE(wait_for_until(pauline->lc, NULL, &pauline->stat.number_of_LinphoneRegistrationOk, 1, 10000)); BC_ASSERT_TRUE(wait_for_until(marie->lc, NULL, &marie->stat.number_of_LinphoneRegistrationProgress, 2, 200)); - BC_ASSERT_TRUE(wait_for_until(marie->lc, NULL, &marie->stat.number_of_LinphoneRegistrationOk, 1, 2000)); + BC_ASSERT_TRUE(wait_for_until(marie->lc, NULL, &marie->stat.number_of_LinphoneRegistrationOk, 1, 10000)); // calling marie should go through the second proxy config BC_ASSERT_TRUE(call(marie, pauline));