[Asterisk-Users] Re: how to execute something after Dial() ?
Tony Mountifield
tony at softins.clara.co.uk
Fri Sep 2 08:25:12 MST 2005
In article <431860FF.6040903 at gmail.com>,
Simone Cittadini <mymailforlists at gmail.com> wrote:
> So I may use the "h" extension, but also from the wiki :
>
> Use with great care: Apparently some channel variables get destroyed
> when the call is hung up, and those variables aren't available anymore
> (or have inconsistent values) when the h extension is being called.
> Therefore you shouldn't rely on this special extension for
> billing/calling card purposes.
>
> So? how can I have the update AGI reliably executed even if the calling
> hangups first ?
That warning looks too non-specific and based on fearful hearsay. I would
respond to it: "show me the code, and say which variables are affected."
If it's true, it is a bug that needs fixing. Or perhaps it just used to
be, and got fixed.
I have used DeadAGI in the h extension to do tidyup and logging with no
problems at all. The channel variables I created while the call was being
set up (e.g. CALLID) have always been available while processing h, and h
is invoked even if it is the caller that hangs up.
The thing that you should *never* do in the 'h' extension is call Hangup
itself, since I have found that can cause 'h' to get invoked again. I have
seen the incorrect and unnecessary example of "exten => h,1,Hangup" far
too many times.
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-users
mailing list