验证电话号码 php asterisk
我想做到这一点,以便当客户在我的网站上注册时,电话号码字段旁边有一个“验证”按钮,一旦单击,就会创建一串随机数字,例如 5 位数字长,其中一个是单击“验证”按钮后,会向该号码拨打电话,然后会听到一个声音,例如“这是公司,您的电话验证号码是 4 2 5 2 5”,然后重复几分钟,或者直到在该号码中输入正确的号码字符串。电话。一旦电话号码得到验证,客户就可以提交申请。
我希望用 asterisk 和 php 来完成这个任务。 FastAGI 是实现这一目标的最佳方法吗?所以我的研究表明 FastAGI 是最好的方法,我是否必须使用 http:// /code.google.com/p/fastagi-php-drclue/?或者我应该只使用常规的星号 agi?
将 DTMF 音调传回 PHP 脚本的最佳方法是什么?
I want to make it so when a customer is signing up on my website that next to the phone number field, there is a "verify" button, where once clicked a random string of digits is created, say 5 digits long, and one the verify button is clicked a phone call is placed to the number and a voice says something like "this is company and your phone verification number is 4 2 5 2 5" and repeats for a few minutes or until the correct number string is typed into the phone. Once the phone number is verified the customer is allowed to submit the application.
I am looking to accomplishing this with asterisk and php. Is FastAGI the best way to accomplish this. So frat my research says that FastAGI is the best way, would I have to use http://code.google.com/p/fastagi-php-drclue/? Or should I just be using the regular asterisk agi?
How is the best way to pass the DTMF tones back the the PHP script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 phpAGI 来完成此任务。然后,您可以使用 AMI 的 originate 命令。将数字传回 PHP 将会出现问题,因为由于 PHP 的性质,您无法引发用户事件。最好的办法是使用 dialplan 将结果写入数据库,然后使用 ajax 定期查询数据库以查看用户是否输入了正确的验证码。
您可以将任意变量传递到原始调用中的拨号方案中,因此应该很容易识别用户。
老实说,这并不是说这很复杂,而是很复杂,而且我的帖子中遗漏了很多细节。在一篇文章中解释整个解决方案有点困难。
编辑:如果您使用同步拨号,您将知道呼叫何时完成。您还需要在拨号方案中设置一个扩展来处理交互部分。 originate 命令拨打出站号码,当呼叫接通后,它会拨打 originate 命令中指定的分机。请记住,Asterisk 不会对 SIP 线路进行呼叫进度分析,因此这对您来说可能是也可能不是大问题。
You can use phpAGI to accomplish this task. You then use the originate command of the AMI. Passing the digits back to PHP is going to be problematic, as you can't raise user events because of the nature of PHP. Your best bet is to write the results to a database using the dialplan, and then periodically query the DB using ajax to see if the user has entered the proper verification code.
You can pass arbitrary variables into the dialplan within the originate call, so it should be easy to identify the user.
Honestly, it not that this is complicated, but it is convoluted, and quite a bit of detail is missing from my post. It's kind of difficult to explain this entire solution within a single post.
EDIT: If you use synchronous dialing, you will know when the call has completed. You will also need to set up an extension in your dialplan to handle the interactive portion. The originate command dials an outbound number, and when the call is connected, it then dials the extension specified in the originate command. Bear in mind though that Asterisk does not do call progress analysis over SIP lines, so that may or may not be a big problem for you.
这听起来对“AsterClick”来说是一项非常简单的工作 [ http://www.asterclick.drclue.net ]
AsterClick 是世界上唯一的事件驱动的 Asterisk AMI/(XML)/HTML5 JavaScript
在 AsterClick 上下文中,您的网页实际上可以实时发出呼叫,并且
完全用 JavaScript 验证结果。
如果您正在寻找更通用的东西,只需创建一个例程
接受电话号码并根据号码本身发出个人识别码
这样 Asterisk 拨号方案和您的网页根本不需要通信。
我将使用 Asterisk 的 dialplan 脚本构建例程,并且简单地
在 JavaScript 中重现结果例程。
通过这种方式,您可以消除很多编程麻烦。
AsterClick 项目有一个名为 FastAGI 的祖先项目(此类包的通用名称)
http://code.google.com/p/fastagi-php-drclue/
该软件包将您的服务器端 PHP 脚本视为可动态加载的插件
可以从您的拨号计划中调用它,并可以访问常规 PHP 脚本可以访问的任何内容,以及当前调用的所有详细信息。
FastAGI 工具还有可用于数据库交互的配套类。
因此,请访问论坛并咕哝几句话,我或用户可以为您提供帮助。
请记住,论坛是面向 HTML5 的,但我们也有遗留工具!
当然全部免费
--Doc
This sounds like a pretty easy job for "AsterClick" [ http://www.asterclick.drclue.net ]
AsterClick is the worlds only event driven Asterisk AMI/(XML)/HTML5 JavaScript
In the AsterClick context , your web page can actually place the call in real time and
validate the results entirely in JavaScript.
If your looking for something a little more generic, simply create a routine
that takes a phone number and emits a pin code based upon the number itself
so that the Asterisk dialplan and your web page need not communicate at all.
I would build the routine using Asterisk's dialplan scripting and simply
reproduce the resulting routine in JavaScript.
In this fashion you do away with a lot of programming hassles.
The AsterClick project has an ancestor project called FastAGI (A common name for such packages)
http://code.google.com/p/fastagi-php-drclue/
This package treats your server side PHP scripts as dynamically loadable plugins
that can be called from your dialplan with access to anything a regular PHP script has access to , plus all the particulars of the current call.
The FastAGI tool also has companion classes available for database interactions.
So drop by the forums and mumble a few words and I or the users can set you on your way.
Keep in mind the Forum is HTML5 orientated, but we also have legacy tools too!
All free of course
--Doc