[asterisk-dev] [Code Review] 2833: res_pjsip_messaging: Register message technology as pjsip

Kevin Harwell reviewboard at asterisk.org
Thu Sep 12 16:58:19 CDT 2013



> On Sept. 12, 2013, 7:48 p.m., opticron wrote:
> > branches/12/res/res_pjsip_messaging.c, lines 260-262
> > <https://reviewboard.asterisk.org/r/2833/diff/1/?file=45700#file45700line260>
> >
> >     This does not handle the case where 'pjsip' occurs somewhere beyond the scheme in the URI.
> 
> Kevin Harwell wrote:
>     I may be misunderstanding, but don't we only care about the scheme part?  If someone places 'pjsip' some other place in the uri that's fine.
> 
> opticron wrote:
>     You are correct, we only care about the scheme part, but the function is provided with the whole URI. If I provide the URI "sip:alice at server_pjsip:25060", Bad Things will happen. The colon you added to the strstr call narrows the scope of the problem a little, but it still exists.

That scenario will never occur.  That particular example would call into the message tech registered as 'sip' (currently handled by chan_sip).  res_pjsip_messaging's message tech is registered as 'pjsip', so any messages that need to be routed to res_pjsip_messaging have to be prefixed as following: pjsip:alice at server_pjsip:25060.  So the code should always copy correctly.

Any malformed uri before/beyond that will not be parsed correctly by the pjsip library, so the 'to' will end up being invalid and the message won't be sent.


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2833/#review9686
-----------------------------------------------------------


On Sept. 12, 2013, 8:34 p.m., Kevin Harwell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2833/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2013, 8:34 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-22445
>     https://issues.asterisk.org/jira/browse/ASTERISK-22445
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> pjsip's message technology was being registered as 'sip', which was causing it to not load due it conflicting with chan_sip's registered 'sip' technology for messaging.  It now registers as 'pjsip'.  However, due to this change the "to" field for outgoing pjsip messages need to be prefixed with 'pjsip:' instead of 'sip:'.  Incoming messages to res_pjsip_messaging will automatically have their "to" fields altered in order to accommodate the change.  Outgoing messages also handle changing it back to 'sip' before being sent so the pjsip library will properly handle it.
> 
> 
> Diffs
> -----
> 
>   branches/12/res/res_pjsip_messaging.c 398225 
> 
> Diff: https://reviewboard.asterisk.org/r/2833/diff/
> 
> 
> Testing
> -------
> 
> Updated the pjsip messaging testsuite tests and made sure passed.
> 
> 
> Thanks,
> 
> Kevin Harwell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130912/afe34938/attachment.htm>


More information about the asterisk-dev mailing list