[asterisk-dev] [Code Review] Add new SIP-specific option to the CHANNEL function to retrieve source RTP address/port. Fix crashes that could happen when getting remote RTP address/port

Mark Michelson mmichelson at digium.com
Thu Mar 4 15:33:16 CST 2010


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

(Updated 2010-03-04 15:33:16.249406)


Review request for Asterisk Developers.


Changes
-------

REALLY get rid of the trailing whitespace :)


Summary
-------

This patch accomplishes two objectives:

1. It adds a new option to the CHANNEL() function to retrieve RTP source address and port for a given stream.
2. It fixes crashes that could occur when attempting to retrieve RTP destination address and port when given a non-existent stream.

Note that even if I get a "Ship it!" on this code, I'm not necessarily going to commit it until I also have an automated test in place for it. Likely this will be an external test in a separate repo and will be submitted as a separate review.


Diffs (updated)
-----

  /trunk/channels/sip/dialplan_functions.c 250728 

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


Testing
-------

Using manager's GetVar action, I retrieved the destination and source RTP audio addresses and ports and verified that they are what I expect. Out of curiosity, I tried to see what would happen if I requested an RTP address/port for a nonexistent stream, such as a video stream during an audio-only call. This is how I found the crash. Now, with my fix in place, there is no crash, and an empty string is returned in such a case.


Thanks,

Mark




More information about the asterisk-dev mailing list