[asterisk-users] PHP/AGI/SetVar Issue

Philipp Kempgen philipp.kempgen at amooma.de
Fri Jun 5 06:51:04 CDT 2009


Peder schrieb:

> Here is the part from the agi that sets the variables:
> 
> echo ' EXEC SetVar ISLOCALCONTEXT="'.$row['context'].'"';
> echo ' EXEC SetVar ISLOCALDID="'.$row['did'].'"';
> 
> If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
> 
>  -- Executing NoOp("SIP/3333-081d2c38", "CONTEXT2") in new stack
>  -- Executing NoOp("SIP/3333-081d2c38", "") in new stack
> 
> If I flip their order in the agi, then ISLOCALDID gets set, but not
> ISLOCALCONTEXT:
> 
>  -- Executing NoOp("SIP/3333-081d8d78", "") in new stack
>  -- Executing NoOp("SIP/3333-081d8d78", "4444") in new stack
> 
> Any idea what I am missing?  Only the first "exec setvar" gets run and the
> other one appears to just be ignored.  I just want to be able to set 2-3
> variables and then return to the dialplan.  Please note that I do not want
> to use phpagi so don't tell me to use that, I want to figure out why it
> doesn't work this way.

Send a newline ("\n") after each command.
Remove the blank (" ") before the commands.
And maybe use SET VARIABLE instead of EXEC SetVar.


    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