[asterisk-users] Get dialed numbers in AGI

Yuan LIU yliu11 at hotmail.com
Wed Jan 10 10:37:26 MST 2007


>From: Anton Frolov <afng072 at frols.com>
>
>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 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");
> > fflush(STDOUT);
> > $conn=odbc_connect('MSSQL', 'USER', 'PASS');
> > $query = odbc_exec($conn, "INSERT INTO dialed(number) 
>VALUES('$my_var')");
> >
> > Even if I only show my_var value or try to use it inside asterisk, the
> > value is NULL.

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

> > There is another way to do it? Am I doing a mistake here?
> > I'm using Asterisk 1.2.13.
> >
> > Thank you all.
> >
> > --
> > Ralph Liebessohn
> > ICQ: 74835911
> > Skype: liebessohn




More information about the asterisk-users mailing list