From 7c16a6d9db09346fe5f4050a7593160ae782584c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 2 Sep 2013 17:42:08 +0200 Subject: [PATCH] do not put contact_params (from proxy config) into calls, message or subscribes. They are only valid for REGISTERs. --- coreapi/linphonecall.c | 15 +++++---------- coreapi/linphonecore.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 606d073e1..db5af1ba7 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2628,11 +2628,7 @@ static LinphoneAddress *get_fixed_contact(LinphoneCore *lc, LinphoneCall *call , } void linphone_call_set_contact_op(LinphoneCall* call) { -#ifndef USE_BELLESIP - char *contact; -#else LinphoneAddress *contact; -#endif if (call->dest_proxy == NULL) { /* Try to define the destination proxy if it has not already been done to have a correct contact field in the SIP messages */ @@ -2641,11 +2637,10 @@ void linphone_call_set_contact_op(LinphoneCall* call) { contact=get_fixed_contact(call->core,call,call->dest_proxy); if (contact){ + SalTransport tport=sal_address_get_transport((SalAddress*)contact); + sal_address_clean((SalAddress*)contact); /* clean out contact_params that come from proxy config*/ + sal_address_set_transport((SalAddress*)contact,tport); sal_op_set_contact(call->op, contact); -#ifndef USE_BELLESIP - ms_free(contact); -#else - linphone_address_destroy(contact); -#endif -} + linphone_address_destroy(contact); + } } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index eaebda6fe..111354375 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2615,10 +2615,17 @@ void linphone_configure_op(LinphoneCore *lc, SalOp *op, const LinphoneAddress *d sal_op_set_to_address(op,dest); sal_op_set_from(op,identity); sal_op_set_sent_custom_header(op,headers); - if (with_contact && proxy && proxy->op && sal_op_get_contact(proxy->op)){ - sal_op_set_contact(op,sal_op_get_contact(proxy->op)); + if (with_contact && proxy && proxy->op){ + const SalAddress *contact; + if ((contact=sal_op_get_contact(proxy->op))){ + SalTransport tport=sal_address_get_transport((SalAddress*)contact); + SalAddress *new_contact=sal_address_clone(contact); + sal_address_clean(new_contact); /* clean out contact_params that come from proxy config*/ + sal_address_set_transport(new_contact,tport); + sal_op_set_contact(op,new_contact); + sal_address_destroy(new_contact); + } } - } /**