您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

搞了个简单群呼系统(asterisk+PHP)

2025/3/28 0:44:16发布31次查看
弄了个简单群呼系统(asterisk+php)
先说下从 excel 中导入号码到数据库中去,然后从数据库中读取这些号码生成呼叫文件,进行呼叫即可
?
? ? ? ? ? ? ? ? ? ? ? ? ?
?
源码如下:(注:操作excel的读取文件就没写上来)
setoutputencoding('utf-8'); $conn= mysql_connect('localhost','root','888888') or die(数据库连接失败); mysql_query(set names 'utf-8');//设置编码输出 mysql_select_db('asterisk'); //选择数据库 $data->read('xls/tel.xls'); for ($i = 2; $i sheets[0]['numrows']; $i++) { $sql = insert into tel values(null,'.$data->sheets[0]['cells'][$i][1].',0); $query=mysql_query($sql); if($query) { } } }else { echo ; } } //.................................................................................................................end //........从数据库中读取号码生成一个一个的.call呼叫文件............................................................................ if(isset($_post['liji_tel'])) //立即呼叫。。这里还得完成流程呼叫完毕后。删除呼叫的号码 { $con= mysql_connect('localhost','root','888888') or die(数据库连接失败); mysql_query(set names 'utf-8');//设置编码输出 mysql_select_db('asterisk'); //选择数据 $result=mysql_query(select * from tel where s_id=0); while($rows=mysql_fetch_row($result)) { $filename=$rows[1].call; fopen($filename,w+); $somecontent_8001=channel: sip/$rows[1]./n.callerid: ./n.maxretries: 2./n.context: default./n.retrytime: 10./n.waittime: 10./n.extension: _x../n.setvar: id=$rows[0]./n; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { exit;} if (fwrite($handle, $somecontent_8001)=== false) {exit;}fclose($handle); $kk=mv .$filename. /var/spool/asterisk/outgoing/; system($kk,$restult);}} echo ; } //..............end ............................................................................................................?> 电话群呼(text): 选择要上传的号码文件: 上传文件:
立即呼叫

?
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product