本文介绍了使用 Asterisk 通过网络服务器使电话响铃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最简单的方法是什么?以及如何实施?

What is the easiest way? And how can it be implemented?

我想过类似的事情:

  1. 我向网络服务器请求一个页面
  2. Php 向 asterisk 发送一个要拨打的号码(php 和 asterisk 在同一台机器上运行)
  3. Asterisk 拨打电话

  1. php sip 客户端注册到远程星号服务器
  2. Php sip 客户端将要拨打的号码发送给 asterik
  3. 电话铃

我不在乎我能不能听到什么,它响了就足够了

i don't care if i can hear something, it's enough that it rings

推荐答案

调用文件

最简单的方法是生成调用文件.Asterisk 具有通过 spool 目录发起呼叫的功能.

The easiest way is to generate a Call File.Asterisk has the feature to initiate Calls through a spool directory.

https://wiki.asterisk.org/wiki/display/AST/星号+调用+文件

提示和注意事项:

  • 您必须在单独的目录中创建调用文件并将其移动(不要使用复制,因为星号会立即解析文件,但移动是安全的)到假脱机目录中.

  • you have to create the call file in a seperate directoryand move it (do not use copy, because asterisk parses the file immediately, but move is safe) into the spool directory.

调用文件必须由用户拥有,星号运行为

The call file must be owned by the user asterisk runs as

星号(文件上的 utime() )检查修改时间戳,如果修改的时间戳在未来,则安排调用它

asterisk (utime() on the file ) checks the modification timestamp, and schedules the call on it, if the modified timestamp is in the future

AMI - Asterisk 管理器界面

也可以通过脚本发起呼叫(AMI).您必须在 manager.conf 中设置登录名(即用户名、密码).使用 Telnet 在 asterisk 服务器 ip 端口 5038 上测试 AMI:

It is also possible to initiate a Call over a Script (AMI).You have to set up a login (ie. username, password) in manager.conf.Test the AMI with Telnet at the asterisk server ip at port 5038:

Action: Login
Username: username
Secret: password

Action: Originate
Channel: SIP/123
Context: default
Exten: 012345678
Priority: 1
Callerid: AMICall

Action: Logoff

您也可以使用 PHP-AMI(带有 PHP-AGI )拨出.

You could also use PHP-AMI (comes with PHP-AGI ) to dial out.

manager.conf 的安全说明:

 ---------------------------- SECURITY NOTE -------------------------------
; Note that you should not enable the AMI on a public IP address. If needed,
; block this TCP port with iptables (or another FW software) and reach it
; with IPsec, SSH, or SSL vpn tunnel.  You can also make the manager
; interface available over http/https if Asterisk's http server is enabled in
; http.conf and if both "enabled" and "webenabled" are set to yes in
; this file.  Both default to no.  httptimeout provides the maximum
; timeout in seconds before a web based session is discarded.  The
; default is 60 seconds.
;

AJAM - 异步 Javascript 星号管理器

AJAM 是一个 Web 服务器,您可以启用并使用它通过 http 与 Asterisk Manager Interface (AMI) 进行通信.

AJAM is a Webserver which you could enable and use to communicate to the Asterisk Manager Interface (AMI) over http.

这篇关于使用 Asterisk 通过网络服务器使电话响铃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 22:23