网页回拨源码
来源:互联网 发布:电子商务网络平台创业 编辑:程序博客网 时间:2024/04/29 19:12
ASTERISK+LINUX+PHP 的WebCall, 网页回拨源码
801 响起再拨打到 1000
$strChannel ="SIP/801";
$strExten =1000;
把下列代码保存为.php文件,放于www/html 下
修改下面$strUser ; $strSecret ; $strChannel ; $strExten ; 参数
$strUser = "admin"; $strSecret = "amp111";为 ami接口帐号密码
$strChannel 为内部分机号码,$strExten回拨号码
#------------------------------------------------------------------------------------------
#edit the below variable values to reflect your system/information
#------------------------------------------------------------------------------------------
#specify the name/ip address of your asterisk box
#if your are hosting this page on your asterisk box, then you can use
#127.0.0.1 as the host IP.? Otherwise, you will need to edit the following
#line in manager.conf, under the Admin user section:
#permit=127.0.0.1/255.255.255.0
#change to:
#permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on)
$strHost = "127.0.0.1";
#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)
#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.
$strUser = "admin";
#specify the password for the above user
$strSecret = "123456";
#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc
$strChannel = "SIP/{$_POST['sip']}";
#specify the context to make the outgoing call from.? By default, AAH uses from-internal
#Using from-internal will make you outgoing dialing rules apply
$strContext = "from-internal";
#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "30";
#specify the priority you wish to place on making this call
$strPriority = "1";
#specify the maximum amount of retries
$strMaxRetry = "2";
#--------------------------------------------------------------------------------------------
#Shouldn't need to edit anything below this point to make this script work
#--------------------------------------------------------------------------------------------
#get the phone number from the posted form
$strExten =$_POST['callid'];
#specify the caller id for the call
$strCallerId = "Web Call Test <$strExten>";
$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: 9$strExten\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: $strPriority\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
fclose($oSocket);
echo 'Call ...';
echo $strChannel
?>
另外写一个php页面 代码如下
用post方法将 callid和sip 2个参数传到callback页面
<form action="2.php" method="post">
Your number <input type="text" name="callid" />
SIP <input type="text" name="sip" />
We will call this number back <input type="submit" name="submit" value="Call back" />
</form>
- 网页回拨源码
- 网页回拨-Web CallBack
- 网页回拨(客服)的弊端
- freeswitch 回拨实例
- Freeswitch callback 回拨
- 回拨电话原理分析
- 双向回拨技术介绍
- 回拨电话该怎样分析和治理
- 手机回拨工具BY QQ1527276164
- freeswitch 用ESL originate实现回拨
- 回拨系统开发 APP定制开发
- kc回拨的一个python脚本
- 网页源码
- 网页源码
- 博软提供H323,SIP软交换,回拨系统
- IM互通新方案-GTalk to VoIP回拨服务
- 申购资金创新高 中国石油可能启动回拨机制
- 讨论:响一声就挂吸费电话频遭投诉 回拨话费被扣数百
- 解决android自定义标题栏充满的问题
- Eclipse中控制Android模拟器行为
- android监听文件和目录的创建删除移动等事件
- Android源码make常见错误
- 关于修改mysql字符集的问题
- 网页回拨源码
- 窗口最大化且不遮挡状态栏的简单办法!
- Spinner填充数据后设置默认值的问题
- 理解HTTP消息头
- Return a null reference
- sicily 1701
- HTTP协议返回状态码表
- 通过PhoneLookup读取所有电话号码
- linux 下安装phonon