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

Joshua Colp jcolp at digium.com
Tue Jan 7 09:27:15 CST 2014


Olle E. Johansson wrote:
> 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.

Hrm, I've been trying to think of the best place to express this 
information but I'm coming up empty. I'm not sure it's something for the 
config documentation, maybe more the wiki.

> 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 :-)

The code above stems from PJSIP itself and is used to determine what 
structure PJSIP has used to store the parsed URI for manipulation. I'm 
not sure a table would buy us anything in this area. As a developer you 
would still need to know what structure was used and what it looks like.

Cheers,

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list