exten=>23456,1,Answer() | |
same=>n,agi(/root/variables.php) | |
same=>n,read(pin,confbridge-pin) | |
same=>n,GotoIf($["${pin}"="${adminpin}"]?leader) | |
same=>n,GotoIf($["${pin}"="${userpin}"]?user) | |
same=>n,Playback(im-sorry) | |
same=>n,hangup() | |
same=>n(leader),Set(CONFBRIDGE(user,admin)=yes) | |
same=>n,Set(CONFBRIDGE(user,marked)=yes) | |
same=>n,ConfBridge(${confid}) | |
same=>n,hangup() | |
same=>n(user),ConfBridge(${confid}) | |
same=>n,hangup() | |
#!/usr/bin/php -q | |
<?php | |
set_time_limit(30); | |
require('/var/lib/asterisk/agi-bin/phpagi/phpagi.php'); | |
error_reporting(E_ALL); | |
$agi = new AGI(); | |
$agi->answer(); | |
$link = mysqli_connect("localhost", "root", "124VC57", "asterisk"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); | |
} | |
$query = " select * from tbl_voicemax_call_conference where conference_id=5 order by created_date desc limit 1"; | |
if ($result = mysqli_query($link, $query)) { | |
/* fetch associative array */ | |
while ($row = mysqli_fetch_assoc($result)) { | |
$agi->verbose(" conference id $row[user_id]"); | |
$agi->verbose( " coference pin $row[conference_pin]"); | |
$agi->verbose( " coference leader pin $row[conference_leader_pin]"); | |
$agi->verbose(" schedule date : $row[scheduled_date]"); | |
$agi->verbose(" conference time $row[conference_time]"); | |
$agi->verbose( " conference status $row[conference_status]"); | |
$cid = $agi->parse_callerid(); | |
$agi->verbose($cid[username]); | |
$agi->set_variable("confid",$row[user_id]); | |
$agi->set_variable("userpin",$row[conference_pin]); | |
$agi->set_variable("adminpin",$row[conference_leader_pin]); | |
//$agi->set_variable("CONFBRIDGE(user,pin)",$row[conference_pin]); | |
//$agi->set_variable("CONFBRIDGE(bridge,max_members)",2); | |
//$agi->exec("ConfBridge","$row[user_id]"); | |
//$agi->exec_goto('from-internal',$value,1); | |
} | |
/* free result set */ | |
mysqli_free_result($result); | |
} | |
else { | |
printf("Error: %s\n", mysqli_error($link)); | |
} | |
/* close connection */ | |
mysqli_close($link); | |
?> | |
No hay comentarios:
Publicar un comentario