[asterisk-dev] [svn-commits] file: branch 12 r405019 - /branches/12/res/res_pjsip_nat.c

Olle E. Johansson oej at edvina.net
Tue Jan 7 09:10:10 CST 2014


On 07 Jan 2014, at 15:55, SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:

> if (endpoint->nat.rewrite_contact && (contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL)) &&
> -		(PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
> +		!contact->star && (PJSIP_URI_SCHEME_IS_SIP(contact->uri) || PJSIP_URI_SCHEME_IS_SIPS(contact->uri))) {
> 		pjsip_sip_uri *uri = pjsip_uri_get_uri(contact->uri);
> 
> 		pj_cstr(&uri->host, rdata->pkt_info.src_name);
> 

Seems like this code assumes that SIP only have SIP: and SIPS: as URI's. We should actually be quite transparent in the schemas supported - especially proxys but also b2bua's like Asterisk. Tel: uri's are not unknown. In the security area we are discussing improved end-2-end security which may end up using a new SIP uri.

Instead of testing with two functions for two classes of schemas a table could be used? That would be more extensible. And please implement tel: support :-)

/O


More information about the asterisk-dev mailing list