[asterisk-dev] Need to run an AGI from dialplan only upon call hold

Tilghman Lesher tilghman at meg.abyt.es
Fri Aug 31 00:23:21 CDT 2012


On Thu, Aug 30, 2012 at 8:02 PM, uma udupi <umaudupi at yahoo.com> wrote:
> Steve Edwards wrote:
> > On Thu, 30 Aug 2012, uma udupi wrote:
> >
> >> 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
> >
> > man 2 kill ?
>
> hmmm I was hoping for a more graceful way to do it from chan_sip.c

You may be deceiving yourself about the kill API.  While it sounds
like a nasty kludge, it, in fact, is the Linux API to send a signal,
which can be intercepted by the AGI process and will allow the process
to shut down cleanly.  Given that you're talking about signalling
between processes, it is one of the only ways to accomplish this, and
it can be done very cleanly.

-Tilghman



More information about the asterisk-dev mailing list