[asterisk-dev] [Code Review] 3753: media_formats: Prevent crash during masquerade
rmudgett
reviewboard at asterisk.org
Sun Jul 13 20:11:24 CDT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3753/#review12614
-----------------------------------------------------------
Ship it!
/team/group/media_formats-reviewed-trunk/main/channel.c
<https://reviewboard.asterisk.org/r/3753/#comment22899>
This may have been wrong anyway for the surviving channel. After a masquerade, the surviving channel could be using the preferred codec instead of what was negotiated.
The guts of SIP/100 (clonechan) masquerades into SIP/200 (original) for call pickup.
SIP/100 (codec list: gsm, alaw) and was using alaw
After the pickup masquerade it would be using gsm.
- rmudgett
On July 11, 2014, 9:53 p.m., Matt Jordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3753/
> -----------------------------------------------------------
>
> (Updated July 11, 2014, 9:53 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> When a masquerade occurs, a newly created channel replaces an existing channel and steals its private data structure. This includes swapping the formats and capabilities.
>
> Since the newly created channel only contains ast_format_none, this causes an assert to fire when the masqueraded channel is destroyed.
>
> Removing the assert isn't a good idea. However, there's also no real need to do the accessing that fires the asserts either: the masqueraded channel will be destroyed, the references will be cleaned up appropriately, and life will go on. free_translation is also called in a channel destructor, and again, things will be cleaned up appropriately without going through the accessors that have the asserts.
>
>
> Diffs
> -----
>
> /team/group/media_formats-reviewed-trunk/main/channel.c 418435
>
> Diff: https://reviewboard.asterisk.org/r/3753/diff/
>
>
> Testing
> -------
>
> The crashing test (tests/apps/dial/dial_dtmf_hangup_cancel) now passes
>
>
> Thanks,
>
> Matt Jordan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140714/8b53ebc9/attachment-0001.html>
More information about the asterisk-dev
mailing list