[asterisk-dev] [Code Review] 3588: chan_sip: Flip the order of variables supplied to SIPNotify

Jonathan Rose reviewboard at asterisk.org
Fri Jun 6 16:08:01 CDT 2014


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

(Updated June 6, 2014, 4:08 p.m.)


Review request for Asterisk Developers, Matt Jordan and Mark Michelson.


Changes
-------

Now, this is a story all about how
My list got flipped-turned upside down
And I'd like to take a minute
Just sit right there
I'll tell you how to make bad references to Fresh Prince of Belair

s/flip/reverse/


Repository: Asterisk


Description
-------

While working on https://reviewboard.asterisk.org/r/3587/ I noticed a problem with the following Action:

Action: PJSIPNotify
Endpoint: pj123
Variable: var1=val1
Variable: var2=val2
Variable: var3=val3,var4=val4,var5=val5

When this was received, the order of the variables was reversed.

This alone wouldn't be a big deal, but it means that if multiple Content variables are specified, they also will be reversed and that is unlikely to be anticipated.

I checked this problem against SIPNotify as well, and it occurs there too, so I'm fixing it there first.

This patch keeps the existing functionality of astman_get_variables so that people who use that API don't have their own work-arounds mangled. I've turned the original function into a wrapper to a more fully featured function that allows the intended order to be specified. The original function will still return the list in its current (reversed) order.


Diffs (updated)
-----

  /branches/1.8/main/manager.c 415300 
  /branches/1.8/main/config.c 415300 
  /branches/1.8/include/asterisk/manager.h 415300 
  /branches/1.8/include/asterisk/config.h 415300 
  /branches/1.8/channels/chan_sip.c 415300 

Diff: https://reviewboard.asterisk.org/r/3588/diff/


Testing
-------

Tested the following action:

Action: SIPNotify
Channel: 123
Variable: var1=val1
Variable: var2=val2
Variable: var3=val3,var4=val4,var5=val5

to confirm correct order of the additional headers.  Also checked

Action: SIPNotify
Channel: 123
Variable: Content=item1
Variable: Content=item2
Variable: Content=item3,Content=item4,Content=item5

to verify that the order of items in the body was correct.


Thanks,

Jonathan Rose

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140606/881cb9ec/attachment-0001.html>


More information about the asterisk-dev mailing list