[Asterisk-Users] phpagi
Vladimir Montealegre
v_estailes at tutopia.com
Thu Jan 19 09:13:16 MST 2006
hello wath is wrong with this code???
$dbconn = mysql_connect("127.0.0.1","vladimir","vladimir");
mysql_select_db("cuentas");
$inDB = false;
//$link = mysql_connect("127.0.0.1", "vladimir", "vladimir") or die("Could
not connect");
//$db = mysql_select_db("cuentas", $link) or die("Could not select
database");
$rc = execute_agi( "ANSWER ");
sleep(1); // Wait for the channel to get created and RTP packets to be sent
// On my system the welcome you would only hear 'elcome' So I paused for 1
second
$rc = execute_agi( "STREAM FILE user \"\" ");
$rc = execute_agi( "STREAM FILE please-enter-the \"0123456789\" ");
// obtenga datos diga number.gsm espere x tiempo y espere 6 digitos.
if ( !$rc[result] )
$rc = execute_agi( "GET DATA number 15000 6");
$usuario = $rc[result];
$rc = execute_agi( "SAY DIGITS $usuario \"\" ");
if ( !$rc[result] )
$rc = execute_agi( "GET DATA access-code 15000 4 \"\" ");
$codigo = $rc[result];
$rc = execute_agi( "SAY DIGITS $codigo \"\" ");
$query = "SELECT codigo, password from usuarios where codigo
='$usuario'";
$tmp = mysql_query($query);
if(mysql_num_rows($tmp) > 0) {
list($usuario2, $codigo2) = mysql_fetch_array($tmp);
}
$rc = execute_agi( "SAY DIGITS $codigo2 \"\" ");
______________________________
Visita http://www.tutopia.com y comienza a navegar más rápido en Internet. Tutopia es Internet para todos.
More information about the asterisk-users
mailing list