<div dir="ltr"><div dir="ltr">On Wed, Dec 27, 2023 at 5:23 PM <<a href="mailto:asterisk@phreaknet.org">asterisk@phreaknet.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">A few questions about the native bridging framework:<br>
<br>
In contrast to DAHDI conferencing, which still requires manually <br>
servicing each channel in the conference, in whatever arbitrary threads <br>
desired, the bridging API is more "event oriented". I have a couple <br>
questions about the latter:<br>
<br>
* Is there any way to retain control of a channel in a bridge and<br>
service it manually, e.g. call ast_waitfor/ast_read on it? It seems<br>
when a channel is imparted to a bridge, a thread is always created,<br>
with the only difference being you don't need to join it later with<br>
AST_BRIDGE_IMPART_CHAN_INDEPENDENT. I'm pretty sure the answer is<br>
'no', since that's the entire point of native bridging, but just<br>
want to confirm that... (and that the bridging framework requires 1<br>
thread per channel)<br></blockquote><div><br></div><div>No. Servicing is yielded to the bridge on being put into a bridge. Control can be temporarily yielded to a different thread using ast_bridge_suspend and returned to the bridge using ast_bridge_unsuspend while in a bridge.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
* There are a couple functions for hooking into the bridge, e.g.<br>
ast_bridge_dtmf_hook for DTMF events and ast_bridge_interval_hook<br>
periodically. I don't see anything more generic than this, though.<br>
Say that for certain channels in the bridge I wanted to intercept<br>
the voice frames from the bridge and modify them. I suppose you just<br>
use framehooks as usual on the channel? I'm guessing there's no<br>
difference in behavior, and that ast_bridge_dtmf_hook is purely a<br>
convenience function.<br></blockquote><div><br></div><div>Framehooks would be used for that purpose. DTMF hooks aren't strictly a convenience, because they are aware of the threading model of bridging and can do things within the confines of the bridge without leaving it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
* Is there any current way to detect if a channel is muted in a<br>
bridge? There's an ast_channel_suppress API, but no API to read the<br>
datastore, and I don't see anything else that seems relevant to<br>
determining this. Not sure if I've missed something... would code<br>
need to be added to do this?<br></blockquote><div><br></div><div>There is no explicit API for the bridge level muting to check, but provided the channel lock was held you could probably grab the ast_bridge_channel using ast_channel_get_bridge_channel, and then look at the features, and check mute. If the suppress API method is used instead to mute it and an API doesn't exist for that, then it would have to be extended.</div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Director of Engineering | Asterisk Project Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>