do not put contact_params (from proxy config) into calls, message or subscribes. They are only valid for REGISTERs.

This commit is contained in:
Simon Morlat 2013-09-02 17:42:08 +02:00
parent e1c0e1aa4f
commit 7c16a6d9db
2 changed files with 15 additions and 13 deletions

View file

@ -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);
}
}

View file

@ -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);
}
}
}
/**