[Asterisk-Users] AGI Variable problem
René Enskat [Teamware GmbH]
ren at teamware-gmbh.de
Thu Oct 13 09:52:42 MST 2005
The ("/var/lib/asterisk/agi-bin/phpagi.php") is the newest form the site
updated today, and i wrote the script like other examples and i can't find a
syntax mistake inside extension.conf and the php script .(
On Thu, 13 Oct 2005 09:32:14 -0500
Moises Silva <moises.silva at gmail.com> wrote:
> for some reason your script is not executing the get_var correctly, as you
> can see in the output, asterisk is saying: "invalid or unknown command".
>
> check the internals of your script, the most common reason is that you are
> mispelling the command.
>
> best regards
>
> On 10/13/05, René Enskat [Teamware GmbH] <ren at teamware-gmbh.de> wrote:
>>
>>
>> Hello all,
>>
>> I try to use a agi script to get a variable from * und put them into a
>> script which gives me another variablke and put this in *.
>> My problem is now it seems the var ID is empty coz i always jump into
>> the result 0 loop.
>> The $MSN should be in the SetCIDNum.
>>
>> #!/usr/bin/php -q
>>
>> <?php
>> include("/var/lib/asterisk/agi-bin/phpagi.php");
>> $agi = new AGI();
>>
>> $ID = $agi->get_variable("SIPUSER");
>>
>> if ($ID['result'] == 0) {
>> $agi->verbose("SIPUSER not set -- nothing to do");
>> exit(1);
>> }
>>
>> $agi->set_variable("MSN", exec("/var/lib/asterisk/agi-bin/msn4sip 111
>> 222 333 " .$ID['data']));
>> ?>
>>
>> Output from asterisk:
>> -- Executing SetVar("SIP/31-79e2", "SIPUSER=31") in new stack
>> -- Executing AGI("SIP/31-79e2", "msn4sip.agi") in new stack
>> -- Launched AGI Script /var/lib/asterisk/agi-bin/msn4sip.agi
>> msn4sip.agi: Arrayn(n [code] => 510n [result] => n [data] =>
>> Invalid or unknown commandn)n
>> msn4sip.agi: SIPUSER not set -- nothing to do
>> -- AGI Script msn4sip.agi completed, returning 0
>> -- Executing SetLanguage("SIP/31-79e2", "de") in new stack
>> -- Executing SetCIDNum("SIP/31-79e2", "") in new stack
>>
>>
>>
>> _______________________________________________
>> --Bandwidth and Colocation sponsored by Easynews.com <http://Easynews.com>--
>>
>> Asterisk-Users mailing list
>> Asterisk-Users at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
> --
> "Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"
More information about the asterisk-users
mailing list