[asterisk-users] PHP/AGI/SetVar Issue

Philipp Kempgen philipp.kempgen at amooma.de
Fri Jun 5 11:46:20 CDT 2009


Peder schrieb:
> I've tried all of that and it still doesn't work right.  I'm sure it's
> something dumb, but I just can't figure it out.  I've even made it simpler:
> 
> echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3\n';
> echo 'SET VARIABLE ISLOCALDID 4444\n';
> 
> and this produces the following:
> 
>     -- Executing NoOp("SIP/3333-081cf2d8", "CONTEXT3nSET") in new stack
>     -- Executing NoOp("SIP/3333-081cf2d8", "") in new stack

PHP evaluates escape sequences (like \n) in string literals in
double "" quotes but not in single '' quotes.

Any of the alternatives in following should work:

echo "SET VARIABLE ISLOCALCONTEXT CONTEXT3\n";
echo "SET VARIABLE ISLOCALDID 4444\n";

or

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3',"\n";
echo 'SET VARIABLE ISLOCALDID 4444',"\n";

or

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
echo "\n";
echo 'SET VARIABLE ISLOCALDID 4444';
echo "\n";


    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