[Asterisk-Users] AGI Variable problem

Moises Silva moises.silva at gmail.com
Sat Oct 15 07:47:00 MST 2005


kind of difficutl to help you if you dont provide the script or relevant
info about your php.ini configuration, stuff related to the output buffer.

I used to do programming with phpagi class, but then i came up with
something more simple and usefull for my purposes.

http://galileo.ivsol.net/scripts/AgiPhp5.php

only works with php, but with small modifications can work with php4.

best regards

On 10/13/05, René Enskat [Teamware GmbH] <ren at teamware-gmbh.de> wrote:
>
> 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><
> 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"
>
> _______________________________________________
> --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"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051015/266c16d6/attachment.htm


More information about the asterisk-users mailing list