[asterisk-users] Executing dialplan after the call normaly ended

Steve Totaro stotaro at totarotechnologies.com
Fri Sep 12 06:46:26 CDT 2008


On Fri, Sep 12, 2008 at 7:35 AM, Gergo Csibra <csibra at gmail.com> wrote:
> Hi,
>
> The Dial command has the g option, voip-info.org says:
>
> "If the g option is specified, and the called party hangs up before
> the calling party, then Dial continues execution at priority n+1."
>
> and this works well. But I need to continue the execution if the
> caller hangs up first too.
>
> What do I need to do?
>
> --
> Best regards,
>  Gergo                            mailto:csibra at gmail.com
>
>

You can use the h extension to continue.  Retaining channel variables
is iffy.  I have an application where I use the h extension to execute
System() which still has the channel variables from the call, to
create a .call file and drop it into the /outgoing/ directory.

It works perfectly.  I will probably modify it slightly to create the
.call file in a tmp dir and then create a cron job to move it since
this seems to be a "Best Practice" but it works fine the way it is for
low volume usage.

The above was the only solution to be able to Dial after hangup, while
keeping the channel variables.  Obviously, Dial on the h exten will
create a nasty loop.  Goto() another context worked but the OK but
dial gets "Cancel", I suspect because there is only one leg of a call.
 Using a local channel for dial, I lost channel variables.

I tried using Goto() in the h extension which worked fine but it seems
that channel variables disappear after the first exten priority after
the h exten.

Thanks,
Steve Totaro



More information about the asterisk-users mailing list