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

Paul Belanger paul.belanger at polybeacon.com
Tue Jan 7 13:58:31 CST 2014


On 14-01-07 10:10 AM, 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.
>
> 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 :-)
>
IMO, these are also perfect candidates for parsing unit tests.  It would 
have been great to also see us add something to better increase out code 
coverage.

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: 
https://twitter.com/pabelanger



More information about the asterisk-dev mailing list