[asterisk-users] How to pass variable back and forth from dialplan to php file?
bruce bruce
bruceb444 at gmail.com
Mon Jun 14 13:57:03 CDT 2010
Carlos, Thanks a lot for getting me started. That helps a great deal.
Currently, the *$agi->request['agi_extension']; returns the SIP channel
info with IP and I want that to be the incoming DID number. *
*
*
*My dialplan output is this for line one:*
**exten => _x.,1,NoOp(${EXTEN})
*415444555*
But with the agi_extension it comes back as:
NoOp("SIP/64.111.222.111-00000ca7", "")
Where can I find the list of command requests that can be sent to Asterisk?
Specially that for DID.
Thanks
On Mon, Jun 14, 2010 at 2:15 PM, Carlos Chavez <cursor at telecomabmex.com>wrote:
> On Mon, 2010-06-14 at 13:41 -0400, bruce bruce wrote:
> > Hi Carlso,
> >
> >
> > Thanks for the input. I have done this in php and am not familiar with
> > phpagi.
> > So, there is absolutely no way to temporarily solve this problem by
> > getting the value back from php file?
> >
> >
> > Wondering if it would require a lot of work to change the php file to
> > phpagi?
> > Thanks,
> > Bruce
> >
> Here is an example:
>
> exten => _x.,1,AGI(sample.agi)
> exten => _x.,n,NoOp(${var})
>
> sample.agi:
>
> #!/usr/bin/php -q
> <?php
> set_time_limit(30);
> require('phpagi/phpagi.php');
> $agi = new AGI();
> $exten = $agi->request['agi_extension']; //Dialed extension
> // the result is stored in $exten
> // do something with your data
> $agi->set_variable("var", $result);
> $agi->verbose("The result was: $result", 3);
> ?>
>
> You can even send parameters to the AGI via the command line like:
>
> exten => _x.,1,AGI(sample.agi,param1,param2) //Use comma for 1.6 or |
> for 1.4 or below
>
> And access them via $argv[1], $argv[2] is there is some extra
> information that you cannot get via the AGI variables.
>
> --
> Telecomunicaciones Abiertas de México S.A. de C.V.
> Carlos Chávez Prats
> Director de Tecnología
> +52-55-91169161 ext 2001
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100614/f144f36b/attachment.htm
More information about the asterisk-users
mailing list