<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Matthew</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>I made some changes in chan_sip.c to call an AGI (based on some configuration) instead of ast_moh_start(), using pbx_exec() upon receiving AST_CONTROL_HOLD indication. My AGI program plays an IVR, and also takes input. Now if the caller UNHOLDs, I would like to send some signal to the AGI and hence it could exit immediately and release the RTP channels. I don't know if this is even possible, could not locate any functions to do this. Please advice</span></div><div
style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Thanks,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Uma<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span></span></div><div><br></div> <div style="font-family: times new roman, new york, times, serif;
font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Matthew Jordan <mjordan@digium.com><br> <b><span style="font-weight: bold;">To:</span></b> Asterisk Developers Mailing List <asterisk-dev@lists.digium.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, August 28, 2012 7:05 A<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [asterisk-dev] Need to run an AGI from dialplan only upon call hold<br> </font> </div> <br>
<br><br>----- Original Message ----- <br><br>> From: "uma udupi" <<a ymailto="mailto:umaudupi@yahoo.com" href="mailto:umaudupi@yahoo.com">umaudupi@yahoo.com</a>><br>> To: "uma udupi" <<a ymailto="mailto:umaudupi@yahoo.com" href="mailto:umaudupi@yahoo.com">umaudupi@yahoo.com</a>>, <a ymailto="mailto:asterisk-dev@lists.digium.com" href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>,<br>> "Asterisk Developers Mailing List" <<a ymailto="mailto:asterisk-dev@lists.digium.com" href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>><br>> Sent: Tuesday, August 28, 2012 7:15:50 AM<br>> Subject: Re: [asterisk-dev] Need to run an AGI from dialplan only<br>> upon call hold<br><br>> Hello<br><br>> I need help on this one. Could anyone suggest what can be done to<br>> trigger "something" upon HOLD? I hope this is the right mailling<br>> list for this topic. If not please
let me know where can I take<br>> this.<br><br><snip><br><br>> I'm new to Asterisk. I need to call (from dialplan) a macro or a<br>> gosub or an AGI upon one of the connected party in a bridged call<br>> (on sip trunk) puts the call on HOLD. Anyhelp greatly appreciated<br><br>There is no functionality that I'm aware of in Asterisk that would allow<br>this scenario. It could certainly be written.<br><br>> PS: I looked into app_dial.c if I can capture AST_CONTROL_HOLD event,<br>> and call a macro, however once ast_bridge_call() is called, Dial app<br>> does not get mid-call events on the call (like<br>> AST_CONTROL_HOLD/AST_CONTROL_UNHOLD)<br><br>Once two channels are bridged, the application that 'helped' those channels<br>get bridged - be it app_dial or some other mechanism - is no longer responsible<br>for servicing the frames on those channels. The various bridging<br>implementations handle it after that
point. This could be in the channel<br>technology itself, in ast_generic_bridge, or in one of the bridging<br>layer implementations (only used by app_confbridge (Asterisk 10 and later) and<br>app_page (Asterisk 11 and later)).<br><br>You could explore having an option that would cause some portion of dialplan<br>to be executed on a channel when an AST_CONTROL_HOLD frame is received by any<br>one of the various bridging implementations; however, that would be quite an<br>extensive feature given the different types of bridging available in Asterisk.<br><br>If you don't need to use AGI, or you don't need to execute your logic<br>immediately in the dialplan, you could try a different approach and use<br>AMI. An external application could listen for the Bridge and MusicOnHold<br>events. The Bridge event will tell you when two channels are bridged<br>together. Any MusicOnHold events after that should indicate that one<br>of the
channels was either put on Hold or taken off Hold.<br><br>You would need to have res_musiconhold loaded and configured for this<br>scenario to work, but would much easier and less intrusive to implement than<br>altering Asterisk.<br><br>--<br>Matthew Jordan<br>Digium, Inc. | Engineering Manager<br>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>Check us out at: http://digium.com & http://asterisk.org<br><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> http://lists.digium.com/mailman/listinfo/asterisk-dev<br><br><br> </div> </div> </div></body></html>