[asterisk-dev] [svn-commits] mmichelson: branch 12 r399083 - in /branches/12: include/asterisk/ res/

Joshua Colp jcolp at digium.com
Fri Sep 13 10:01:13 CDT 2013


Olle E. Johansson wrote:
>
> 13 sep 2013 kl. 16:49 skrev SVN commits to the Digium repositories
> <svn-commits at lists.digium.com <mailto:svn-commits at lists.digium.com>>:
>
>> +contact.slen = pj_ansi_snprintf(contact.ptr, PJSIP_MAX_URL_SIZE,
>> +"<%s:%s%.*s%s:%d%s%s>",
>> +(pjsip_transport_get_flag_from_type(type) & PJSIP_TRANSPORT_SECURE) ?
>> "sips" : "sip",
>> +(type & PJSIP_TRANSPORT_IPV6) ? "[" : "",
>> +(int)rdata->tp_info.transport->local_name.host.slen,
>> +rdata->tp_info.transport->local_name.host.ptr,
>> +(type & PJSIP_TRANSPORT_IPV6) ? "]" : "",
>> +rdata->tp_info.transport->local_name.port,
>> +(type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ?
>> ";transport=" : "",
>> +(type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ?
>> pjsip_transport_get_type_name(type) : "");
>> +
>
> Sorry for not being awake during the review. Obvious questions:
>
> - When do you add ;transport ?
> - When do you use sips: ?

I assume you mean the code since this can't be set by the user. 
Transports within pjsip have different properties about them - whether 
they are secure, whether they are TCP, UDP, TLS, etc. The code above 
uses these properties to know what to add and when. This code is based 
on code that already existed within the pjsua library itself.

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