op->sdp_answer=NULL;
op->reinvite=FALSE;
op->call_id=NULL;
+ op->masquerade_via=FALSE;
return op;
}
osip_contact_t *ctt=NULL;
char *tmp;
char port[20];
+ SalAddress *addr;
if (extract_received_rport(last_answer,&received,&rport)==-1) return FALSE;
osip_message_get_contact(orig_request,0,&ctt);
}
snprintf(port,sizeof(port),"%i",rport);
ctt->url->port=osip_strdup(port);
- masquerade_via(msg,received,port);
+ if (op->masquerade_via) masquerade_via(msg,received,port);
eXosip_register_send_register(op->rid,msg);
eXosip_unlock();
osip_contact_to_str(ctt,&tmp);
+ addr=sal_address_new(tmp);
+ osip_free(tmp);
+ sal_address_clean(addr);
+ tmp=sal_address_as_string(addr);
sal_op_set_contact(op,tmp);
ms_message("Resending new register with updated contact %s",tmp);
ms_free(tmp);
case 407:
return process_authentication(sal,ev);
break;
+ case 606: /*Not acceptable, workaround for proxies that don't like private addresses
+ in vias, such as ekiga.net
+ On the opposite, freephonie.net bugs when via are masqueraded.
+ */
+ op->masquerade_via=TRUE;
default:
/* if contact is up to date, process the failure, otherwise resend a new register with
updated contact first, just in case the faillure is due to incorrect contact */
void sal_address_clean(SalAddress *addr){
osip_generic_param_freelist(& ((osip_from_t*)addr)->gen_params);
+ osip_uri_param_freelist(& ((osip_from_t*)addr)->url->url_params);
}
char *sal_address_as_string(const SalAddress *u){