[asterisk-dev] [Code Review]: Fixes for sending SIP MESSAGE outside of calls.

rmudgett reviewboard at asterisk.org
Fri Jan 20 20:05:09 CST 2012



> On Jan. 20, 2012, 6:56 p.m., Mark Michelson wrote:
> > /branches/10/channels/chan_sip.c, lines 7330-7332
> > <https://reviewboard.asterisk.org/r/1683/diff/1/?file=23497#file23497line7330>
> >
> >     Can you get away with using const char * for these types?

Yes, yes I can.


> On Jan. 20, 2012, 6:56 p.m., Mark Michelson wrote:
> > /branches/10/channels/chan_sip.c, lines 16615-16617
> > <https://reviewboard.asterisk.org/r/1683/diff/1/?file=23497#file23497line16615>
> >
> >     You can skip this step if sip_cfg.compactheaders is true. It's not necessary, but it would save you the trouble of converting to the full names just to have them converted back to the short names when the message is sent out.

It is needed.  This is done on the receiving side.  The header name is passed up to the dialplan so the dialplan does not have to worry about aliases.  The sip_cfg.compactheaders applies to outgoing messages.


> On Jan. 20, 2012, 6:56 p.m., Mark Michelson wrote:
> > /branches/10/channels/chan_sip.c, lines 24637-24672
> > <https://reviewboard.asterisk.org/r/1683/diff/1/?file=23497#file23497line24637>
> >
> >     You should also block Supported, Require, and CSeq. Since there could potentially be additional headers we haven't thought about here, it may be a good idea to put all the disallowed headers into an array and add a function to see if the header to add is one we don't allow. It would be easier to expand an array than to continue the if chain currently there.

This is the list of headers that are added by the code path to send the MESSAGE packet.  CSeq is already in the list. :)

I'll make a routine to scan an array of blocked headers.


- rmudgett


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


On Jan. 20, 2012, 3:55 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1683/
> -----------------------------------------------------------
> 
> (Updated Jan. 20, 2012, 3:55 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Fixes done by this patch:
> * Expand SIP short header names so the dialplan and other code only has to deal with the full names.
> 
> * Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA function in the authorization attempt.
> 
> * Block user from adding standard headers that are added automatically. (To, From,...)
> 
> * Pass up better From header contents for SIP to use.  Now is in the "display-name" <URI> format expected by MessageSend.
> 
> * Decrement Max-Forwards header if the user transferred it from an incoming message.
> 
> * Allow the user to override the Content-Type header contents sent by MessageSend.
> 
> * Documents what SIP expects in the MessageSend(from) parameter.
> 
> 
> This addresses bugs ASTERISK-18917, ASTERISK-18992 and ASTERISK-19058.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18917
>     https://issues.asterisk.org/jira/browse/ASTERISK-18992
>     https://issues.asterisk.org/jira/browse/ASTERISK-19058
> 
> 
> Diffs
> -----
> 
>   /branches/10/channels/sip/include/sip.h 351950 
>   /branches/10/main/message.c 351950 
>   /branches/10/channels/chan_sip.c 351950 
> 
> Diff: https://reviewboard.asterisk.org/r/1683/diff
> 
> 
> Testing
> -------
> 
> Updated SIP MESSAGE external tests with more cases that cover some of the items fixed.  The tests pass.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120121/630402ca/attachment-0001.htm>


More information about the asterisk-dev mailing list