[asterisk-users] Macro with DIALSTATUS

Philipp Kempgen philipp.kempgen at amooma.de
Wed May 20 12:29:01 CDT 2009


Azher Mughal schrieb:

> I am trying to pass DIALSTATUS to a Macro so that i can set a
> variable when a call is placed (call is placed via a call file to
> another extension first). Basically i don't want to dial a number
> where a call is already bridged and thats why i am setting a variable.
> 
> [macro-afterdial];
> exten => s,1,Goto(s-${ARG1},1)
> exten => s-ANSWER,1,SetGlobalVar(NUM${ARG2} = "ACTIVE")
> 
> exten => 30,3,Dial(SIP/provider/${num}|15|gM(afterdial^${DIALSTATUS}^1))
> exten => 30,4,SetGlobalVar(NUM1 = "foo")
> 
> 
> Asterisk execute the Macro but on the cli i can see, but dialstatus
> is somehow not passed to the macro:
> 
>  Executing [s at macro-afterdial:1] Goto("SIP/8172-0a1136a8", "s-|1")
> in new stack
>     -- Goto (macro-afterdial,s-,1)
> 
> Any hints ? or some other technique ?

I don't really understand what you are trying to achive.
Dial() sets DIALSTATUS when it's done, i.e. after the call is hung up.
However the macro passed to Dial() using the M argument will be
executed even before the call is connected so DIALSTATUS is not
available at that time.


    Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
-- 



More information about the asterisk-users mailing list