[asterisk-dev] [Code Review] Adjust formats of chan_local when channel we proxying changes

David Vossel reviewboard at asterisk.org
Wed Jul 27 09:56:05 CDT 2011


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



/trunk/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1137/#comment7781>

    ast_bridged_channel can not be called within chan_local with a local channel pvt locked... This is by no means something anyone should be expected to know. It is safe to unlock and relock the pvt here since we have a reference to it.
    
    unlock(p);
    bridge = bridged(ast);
    lock(p);



/trunk/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1137/#comment7782>

    This is a bit complex, but here's what I understand is happening here.
    
    ast is == p->owner.
    
    When ast_bridged_channel(ast) is called you are either getting p->chan, or p->chan->_bridge depending on if p->chan is bridged or not as well.
    
    If that is the case, it is not safe for us to modify the nativeformats of a channel we don't have control of the tech_pvt for... For example how are we to know if the bridged channel is a local channel, a SIP channel or an, IAX channel, and how are we to know it is capable of transmitting and receiving whatever native formats we set it to?



/trunk/channels/chan_local.c
<https://reviewboard.asterisk.org/r/1137/#comment7783>

    ast is locked here, ast and the tech_pvt must be unlocked before grabbing p->chan's lock.


- David


On July 24, 2011, 6:56 a.m., irroot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1137/
> -----------------------------------------------------------
> 
> (Updated July 24, 2011, 6:56 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This is a most annoying pain and tripped me up no end testing the T38 gateway patch for res_fax.
> 
> Scenario :-
> 
> i have a Linksys 2102 on a fax machine that uses G.729 and switches to ALAW on CNG and then negotiates T.38
> this is awesome as i can now Chat/Fax from same terminal using most effective bandwidth [these are to be deployed
> on sugar cane farms surrounding the kruger park here in south africa over wi-fi]
> 
> for testing purposes im using a local channel into T.30 fax app in res_fax.
> 
> Problem :-
> 
> when the device reinvites ALAW then T.38 it leaves the nativeformat on chan_local as G.729 this will not work
> as it is transcoding the FAX from G.729 to SLIN this will not work and took me a while to spot the problem.
> 
> Soloution :-
> 
> Check the format on the proxy and adjust it if it changes this should be what Local does been a proxy of the channel
> it should follow changes ...
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_local.c 329388 
> 
> Diff: https://reviewboard.asterisk.org/r/1137/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> irroot
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110727/e11c3857/attachment.htm>


More information about the asterisk-dev mailing list