[Asterisk-Users] how to execute something after Dial() ?

Simone Cittadini mymailforlists at gmail.com
Fri Sep 2 07:26:07 MST 2005


let's suppose I have this dialplan :

exten => _X.,1,Playtones(ring)
exten => _X.,2,Dial(CAPI/contr1/${EXTEN},,g)
exten => _X.,3,AGI(update)

where "update" updates some db tables we have based on the type of extension

Now, from the wiki :

If the /g/ option is specified, and the called party hangs up before the 
calling party, then Dial exits with a return code of 0 to continue 
execution at priority n+1.
Dial returns -1 if the originating channel hangs up, or if the call is 
bridged and either of the parties in the bridge terminate the call.

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 ?



More information about the asterisk-users mailing list