From: "Ralph Liebessohn" <[EMAIL PROTECTED]>

Hi Yuan and Anton,

Let's put here all AGI for test:

#!/usr/bin/php -q
<?php
...
$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|5|||15
\n");
fwrite(STDOUT,"exec saydigits ${my_var} \n");
fflush(STDOUT);

$conn=odbc_connect('MSSQL', 'asterisk', '123456');
$query = odbc_exec($conn, "INSERT INTO usuario(nome) VALUES('$my_var')");
?>

If I not startup $my_var="123"; Saydigits receives a NULL as options. And so
nothing was inserted into db.

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 dial plan could accomplish what you wanted, that is, to read the variable in dial plan, then pass its value to AGI. Hope this helps.

Yuan Liu

I tried to use WAIT FOR DIGIT but it makes no sense, asterisk passed through
it directly like Joel Lansden <Joel AT digitalparadise DOT net> reported on
9/14/06.
Is there another function or way to test it or I must try in another
asterisk box?

--
Ralph Liebessohn
ICQ: 74835911
Skype: liebessohn


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to