[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
Wed Mar 24 09:18:16 CDT 2010


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



/trunk/channels/sip/dialplan_functions.c
<https://reviewboard.asterisk.org/r/542/#comment3818>

    This is a blatant error on my part. Instead of p->trtp, the first parameter should be stream. New diff coming shortly.


- Mark


On 2010-03-04 15:33:16, Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/542/
> -----------------------------------------------------------
> 
> (Updated 2010-03-04 15:33:16)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> 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
> -----
> 
>   /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