如何让asterisk服务器自动响应SIP呼叫? [英] How to make asterisk server automatically response to SIP call?

查看:40
本文介绍了如何让asterisk服务器自动响应SIP呼叫?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目的:我想用软电话(3CX电话)注册asterisk服务器,并调用服务器和asterisk动作

My objective: I want to use softphone(3CX phone) register with asterisk server, and make call to the server and asterisk act

作为自动响应某些内容的服务器,例如播放歌曲.

as a server to automatically response something, like play a song.

我是怎么做的:我使用 virtualbox 安装了 asteriskNow,并通过为我的 SIP 设备设置扩展来注册软电话

How i did: I installed asteriskNow using virtualbox, and registered the softphone by setting exntension for my SIP device

(分机号 333).我在 etc/asterisk/extensions.conf 中写了一个拨号方案.拨号方案是:

(extension 333). And i write a dialplan in etc/asterisk/extensions.conf. The dialplan is :

[incoming]
exten =>s,1,Answer()
exten =>s,n,Playback(dir-intro-oper)
exten =>s,n,Hangup()

我想要任何来电到服务器,服务器会自动接听,并播放预定义的语音(dir-intro-oper.gsm)

I want any incoming call to server, the server will automatically answer, and play a pre-defined voice (dir-intro-oper.gsm )

然后举手.

但我遇到的问题是:

我使用软电话,但不知道应该拨哪个号码到星号服务器.我应该为

I use softphone, and i dont know which number i should dial to the asterisk server. Should i set up a extension number for

星号服务器本身?如果是这样,该怎么做?通过设置 SIP 卡车?在sip.conf中写拨号计划?或者其他什么?

asterisk server itself? If so, how to do that? By setting up SIP truck? Write the dialplan in sip.conf? or anything else?

另一个问题:我读了星号相关的书星号,未来的电话",它告诉我们在 extensions.conf 中编写拨号计划

Another questions: I read the asterisk related book"asterisk, the future telephony" which tells us to write dialplan in the extensions.conf

直接,但我发现服务器中的extensions.conf提醒我们不要直接修改文件,必须使用web-gui

directly, but i found the extensions.conf in the server which alerts us do not modified the file directly, must use web-gui

修改.那么我应该遵循哪种方式?

to modify.So which way i should follow?

在这种情况下,我不使用任何其他硬件电话.我是asterisk的新手,请给我一些提示和详细程序.

In this case, i do not use any other hardware phone. I am a novice on asterisk, please give me some hints and detail procedure.

推荐答案

您使用的s"扩展名是一个特殊的",当 Asterisk 不知道该做什么时,它会尝试使用它.

The "s" extension that you are using is a "special" that when Asterisk doesn't know what to do, it tries to use that.

如果您真的希望以相同的方式处理来自 VoIP 电话或 ITSP 的任何呼叫,请尝试以下操作:

If you really want any call to the box, either from a VoIP phone or an ITSP to get handled the same way, try this:

[incoming]
exten =>_X.,1,Answer()
same => n,Playback(dir-intro-oper)
same => n,Hangup()

...并确保在您设置的 SIP 电话和 SIP 中继定义中:

... and make sure that in your SIP phone and SIP trunk definitions that you set:

context=incoming

这实际上会强制所有呼叫进入您的上下文,然后无论您拨打什么电话,您始终会匹配分机号码.

That literally forces all calls into your context and then no matter what you dial, you always match the extension number.

更多阅读在 https://wiki.asterisk.org/wiki/display/AST/模式+匹配

这篇关于如何让asterisk服务器自动响应SIP呼叫?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆