Commit 444ec1ac authored by Simon Morlat's avatar Simon Morlat
Browse files

Rewrite commit a858005c from master branch (Don't unregister previous contact...

Rewrite commit a858005c from master branch (Don't unregister previous contact by default. It is causing troubles with +sip.instance)
parent a4b0da8a
......@@ -457,20 +457,16 @@ void linphone_proxy_config_apply(LinphoneProxyConfig *cfg,LinphoneCore *lc){
void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig * cfg){
LinphoneAddress *contact_addr = NULL;
{
const SalAddress *sal_addr = cfg->op && cfg->state == LinphoneRegistrationOk
? cfg->op->get_contact_address()
: NULL;
if (sal_addr) {
char *buf = sal_address_as_string(sal_addr);
contact_addr = buf ? linphone_address_new(buf) : NULL;
ms_free(buf);
}
const SalAddress *sal_addr = cfg->op && cfg->state == LinphoneRegistrationOk ? cfg->op->get_contact_address() : NULL;
if (sal_addr) {
char *buf = sal_address_as_string(sal_addr);
contact_addr = buf ? linphone_address_new(buf) : NULL;
ms_free(buf);
}
/*with udp, there is a risk of port reuse, so I prefer to not do anything for now*/
if (contact_addr) {
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp) {
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp && lp_config_get_int(cfg->lc->config, "sip", "unregister_previous_contact", 0)) {
if (cfg->pending_contact)
linphone_address_unref(cfg->pending_contact);
cfg->pending_contact=contact_addr;
......@@ -1589,4 +1585,4 @@ bool_t linphone_proxy_config_is_push_notification_allowed(const LinphoneProxyCon
void linphone_proxy_config_set_push_notification_allowed(LinphoneProxyConfig *cfg, bool_t is_allowed) {
cfg->push_notification_allowed = is_allowed;
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment