RE: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Yuan LIU
From: "Mike D'Ambrogia" <[EMAIL PROTECTED]> You'll need to modify your current overall programming strategy in order to implement this. But do the READ that you are attempting from within the dial plan and not the AGI script, and either update my_var prior to calling the AGI, or pass my_var in t

Re: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Yuan LIU
From: "Ralph Liebessohn" <[EMAIL PROTECTED]> On 1/11/07, Mike D'Ambrogia <[EMAIL PROTECTED]> wrote: Ralph Kind of new to asterisk, and really new to AGI but it looks like you were trying to have the AGI script tell asterisk to read and lay the results into my_var and then regain control in

RE: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Mike D'Ambrogia
just as a followup and potential solution to the passing of values, I've been setting variables at the top of the dialplan using : exten => 100,n,Set(my_var=) Now I can modify my_var in the dialplan, and I can get/set my_var in the AGI script via GET VARIABLE and SET VARIABLE You'll need to m

RE: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Mike D'Ambrogia
Users Mailing List - Non-Commercial Discussion Subject: Re: FW: [asterisk-users] Get dialed numbers in AGI On 1/11/07, Mike D'Ambrogia <[EMAIL PROTECTED]> wrote: Ralph Kind of new to asterisk, and really new to AGI but it looks like you were trying to have the AGI script tell asterisk to

Re: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Time Bandit
All the variables here was my_var, it worked for GET VARIABLE but didn't for SAYDIGITS and odbc connection. How can I SAYDIGITS of my_var or insert my_var value into a db? - What I need more to use WAIT FOR DIGIT? Because it didn't stop to wait for digits. - STDIN shoudn't get the result of READ

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Ralph Liebessohn
On 1/11/07, Eric ManxPower Wieling <[EMAIL PROTECTED]> wrote: What version of Asterisk? Perhaps it changed since the last time I had to deal with the issue. Perhaps it was fixed for 1.0, or maybe it was specific to asterisk-perl. Mike D'Ambrogia wrote: > Not true for the php version, it will

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Ralph Liebessohn
On 1/11/07, Eric ManxPower Wieling <[EMAIL PROTECTED]> wrote: Steve Edwards wrote: > On Thu, 11 Jan 2007, Yuan LIU wrote: > >> AGI doesn't see the name "var"; all it sees is an array @ARGV (or >> whatever in the respective language). As the documentation says, >> values are passed like command

Re: FW: [asterisk-users] Get dialed numbers in AGI

2007-01-12 Thread Ralph Liebessohn
On 1/11/07, Mike D'Ambrogia <[EMAIL PROTECTED]> wrote: Ralph Kind of new to asterisk, and really new to AGI but it looks like you were trying to have the AGI script tell asterisk to read and lay the results into my_var and then regain control in the AGI script, is that correct? If so I don't

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Eric \"ManxPower\" Wieling
What version of Asterisk? Perhaps it changed since the last time I had to deal with the issue. Perhaps it was fixed for 1.0, or maybe it was specific to asterisk-perl. Mike D'Ambrogia wrote: Not true for the php version, it will take multiple params into argv[0], argv[1], argv[2], etc Eric

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Steve Edwards
On Thu, 11 Jan 2007, Eric "ManxPower" Wieling wrote: AGI() does not support more than 1 parameter to AGIs. fs> show application agi . . . [E|Dead]AGI(command|args): Executes an Asterisk Gateway Interface Note that while "arg" is not actually a word, "args" implies pl

RE: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Mike D'Ambrogia
Not true for the php version, it will take multiple params into argv[0], argv[1], argv[2], etc Eric "ManxPower" Wieling wrote: > AGI() does not support more than 1 parameter to AGIs. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-u

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Lee Jenkins
Eric "ManxPower" Wieling wrote: Steve Edwards wrote: On Thu, 11 Jan 2007, Yuan LIU wrote: AGI doesn't see the name "var"; all it sees is an array @ARGV (or whatever in the respective language). As the documentation says, values are passed like command line arguments. But, in the interest o

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Eric \"ManxPower\" Wieling
Steve Edwards wrote: On Thu, 11 Jan 2007, Yuan LIU wrote: AGI doesn't see the name "var"; all it sees is an array @ARGV (or whatever in the respective language). As the documentation says, values are passed like command line arguments. But, in the interest of "more maintainable code," you c

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Steve Edwards
On Thu, 11 Jan 2007, Yuan LIU wrote: AGI doesn't see the name "var"; all it sees is an array @ARGV (or whatever in the respective language). As the documentation says, values are passed like command line arguments. But, in the interest of "more maintainable code," you can pass the option na

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Yuan LIU
From: "Ralph Liebessohn" <[EMAIL PROTECTED]> On 1/10/07, Yuan LIU <[EMAIL PROTECTED]> wrote: >From: "Ralph Liebessohn" <[EMAIL PROTECTED]> However, a small adaption of dial plan could accomplish what you wanted, that is, to read the variable in dial plan, then pass its value to AGI. Hope this h

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Doug Crompton
I am not sure if this is what you meant in your query. Here is a Perl script that checks a dialed numbers areacode/exchange and determines if it is a local or long distance call. I then send it out either PSTN or SIP. The dialed number is sent to the script which returns true or false. There might

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Ralph Liebessohn
On 1/11/07, Ralph Liebessohn <[EMAIL PROTECTED]> wrote: Mike, it didn't help. I just SOLVED the problem! You're a genius. Now I can get information from dialplan. Do you know why the other ways didn't work? -- Ralph Liebessohn ICQ: 74835911 Skype: liebessohn Errata. " IT just SOLVED.." Not

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Ralph Liebessohn
On 1/11/07, Mike D'Ambrogia <[EMAIL PROTECTED]> wrote: on the php AGI side the ${var} parameter passed in from your dialplan will be exposed in PHP's $argv[1] array element fwrite(STDOUT,"exec saydigits $argv[1]\n"); as a side note $argv[0] contains the full path including filename to the scr

RE: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Mike D'Ambrogia
riginal Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ralph Liebessohn Sent: Thursday, January 11, 2007 6:00 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Get dialed numbers in AGI On 1/10/07, Yuan LIU <[EMAIL PROTECTED

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-11 Thread Ralph Liebessohn
On 1/10/07, Yuan LIU <[EMAIL PROTECTED]> wrote: >From: "Ralph Liebessohn" <[EMAIL PROTECTED]> I did a quick test and it seems that everything passed to AGI is by value, and there is no apparent relationship between variable named used in two different AGI commands. However, a small adaption of

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Lee Jenkins
Ralph Liebessohn wrote: Using: fwrite(STDOUT,"exec read my_var|//usr/share/asterisk/sounds/please-wait-connect-oncall-eng|5|||15 \n"); fwrite(STDOUT,"get variable my_var \n"); fflush(STDOUT); $my_var=STDIN; fwrite(STDOUT,"exec saydigits $my_var \n"); I got it: Also you might try concatenat

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Lee Jenkins
Ralph Liebessohn wrote: Hi Lee, thanks for the tip. I tried other methods trying to get the variable value, but no success. Doing a GET VARIABLE my_var after READ the "get variable" returns the value I dialed, but doesn't give the exact value to it. I got Resource ID #1 instead. Using: fwrit

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Yuan LIU
From: "Ralph Liebessohn" <[EMAIL PROTECTED]> Hi Yuan and Anton, Let's put here all AGI for test: #!/usr/bin/php -q ... $my_var="123"; fflush(STDERR); fwrite(STDERR,"Just testing\"\"\n"); fflush(STDERR); fwrite(STDOUT,"exec read my_var|//usr/share/asterisk/sounds/please-wait-connect-oncall-eng

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Ralph Liebessohn
On 1/10/07, Lee Jenkins <[EMAIL PROTECTED]> wrote: Ralph Liebessohn wrote: > Hi, > > I'm trying to write a AGI in PHP to get the numbers dialed (with > read()), save it into a variable to insert it into a SQL server > database. But I cannot see results into the variable, it always return > NULL.

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Anton Frolov
hi I never really programmed in PHP, I use Perl for my purposes. I found a good AGI library for Perl and is happy with it. It allows me to call functions instead of parsing the input. While looking for my library, I saw at least one for PHP. So why not to use it? In Perl it looks like: my %agi

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Ralph Liebessohn
On 1/10/07, Yuan LIU <[EMAIL PROTECTED]> wrote: Then there must be an error somewhere. The variable READ() in Asterisk should be usable. Should be able to use SayDigits() to play it back - or no value is read. Yuan Liu Hi Yuan and Anton, Let's put here all AGI for test: #!/usr/bin/php -q

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Lee Jenkins
Ralph Liebessohn wrote: Hi, I'm trying to write a AGI in PHP to get the numbers dialed (with read()), save it into a variable to insert it into a SQL server database. But I cannot see results into the variable, it always return NULL. Here is a piece of the AGI. fwrite(STDOUT,"exec Read my_v

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Yuan LIU
From: Anton Frolov <[EMAIL PROTECTED]> you could use one of the AGI libraries... then you can just call a function to get the number. AF. Ralph Liebessohn wrote: > Hi, > > I'm trying to write a AGI in PHP to get the numbers dialed (with > read()), save it into a variable to insert it into a SQL

Re: [asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Anton Frolov
you could use one of the AGI libraries... then you can just call a function to get the number. AF. Ralph Liebessohn wrote: > Hi, > > I'm trying to write a AGI in PHP to get the numbers dialed (with > read()), save it into a variable to insert it into a SQL server > database. But I cannot see r

[asterisk-users] Get dialed numbers in AGI

2007-01-10 Thread Ralph Liebessohn
Hi, I'm trying to write a AGI in PHP to get the numbers dialed (with read()), save it into a variable to insert it into a SQL server database. But I cannot see results into the variable, it always return NULL. Here is a piece of the AGI. fwrite(STDOUT,"exec Read my_var|/sound_to_play|5|||15 \n")