在 Asterisk 服务器中路由呼叫
Route Call in Asterisk Server
我有一个场景,我想路由呼叫从 Asterisk sip 服务器,但我想做这样的事情
sip 服务器 运行 位于:192.168.1.10 和
Asterisk 服务器 运行 位于:192.168.1.4
client Diales---->sip:111@192.168.1.4---->To Asterisk and then Asterisk route the
calls------->sip:111@192.168.1.10 --------> sip server
谁能告诉我如何在 Asterisk 配置路由文件中做到这一点。
您需要在您的 Asterisk 服务器上设置 sip 中继。
查看此页面了解更多信息:
https://www.beardy.se/how-to-set-up-a-sip-trunk-in-the-asterisk-pbx
正如 os11k 所说,您需要 SIP 中继才能执行此操作。我将添加一些有关我们在两个城市之间设置 SIP 中继时遇到的问题的详细信息。
在 sip.conf
中添加 SIP 中继
- 确保在 SIP 中继配置中设置
sendrpid=yes
,否则 192.168.1.10 将无法获取来电显示。
- 可选地,您可能希望将 SIP 中继的上下文设置为不同的上下文而不是
default
,比如 context=sip-server-192-168-1-10
。
- 如果 192.168.1.10 仅适用于特定编解码器,您可以选择禁止或允许某些编解码器。
SIP 中继示例
[general]
register => SIP_ACCOUNT:SIP_PASSWORD@TheOtherSipServer
[TheOtherSipServer]
type=peer
context=sip-server-192-168-1-10
host=192.168.1.10
defaultuser=THE_ACCOUNT_HERE
fromuser=THE_ACCOUNT_HERE
remotesecret=THE_PASSWORD_OF_ACCOUNT_HERE
; if you want to send the remote caller id to 192.168.1.10, then set sendrpid=yes .
; you also need to trust the remote caller id in 192.168.1.10 .
sendrpid=yes
; if 192.168.1.10 can dial out from here, you need to set trustrpid=yes so you can get the caller id
;trustrpid=yes
; if 192.168.1.10 is picky on codecs
;disallow=all
;allow=THE_CODEC_NAME_ALLOWED_BY_THE_OTHER_SIP_SERVER
在extensions.conf
中设置拨号方案
Dial
是你所需要的,除非你有特殊要求。
拨号方案示例
[globals]
SIPTrunk=SIP/TheOtherSipServer
[sip-server-192-168-1-10]
;exten=>111,1,Dial(SIP/TheOtherSipServer/111)
exten=>111,1,Dial(${SIPTrunk}/${EXTEN})
我有一个场景,我想路由呼叫从 Asterisk sip 服务器,但我想做这样的事情
sip 服务器 运行 位于:192.168.1.10 和 Asterisk 服务器 运行 位于:192.168.1.4
client Diales---->sip:111@192.168.1.4---->To Asterisk and then Asterisk route the
calls------->sip:111@192.168.1.10 --------> sip server
谁能告诉我如何在 Asterisk 配置路由文件中做到这一点。
您需要在您的 Asterisk 服务器上设置 sip 中继。
查看此页面了解更多信息:
https://www.beardy.se/how-to-set-up-a-sip-trunk-in-the-asterisk-pbx
正如 os11k 所说,您需要 SIP 中继才能执行此操作。我将添加一些有关我们在两个城市之间设置 SIP 中继时遇到的问题的详细信息。
在 sip.conf
中添加 SIP 中继- 确保在 SIP 中继配置中设置
sendrpid=yes
,否则 192.168.1.10 将无法获取来电显示。 - 可选地,您可能希望将 SIP 中继的上下文设置为不同的上下文而不是
default
,比如context=sip-server-192-168-1-10
。 - 如果 192.168.1.10 仅适用于特定编解码器,您可以选择禁止或允许某些编解码器。
SIP 中继示例
[general] register => SIP_ACCOUNT:SIP_PASSWORD@TheOtherSipServer [TheOtherSipServer] type=peer context=sip-server-192-168-1-10 host=192.168.1.10 defaultuser=THE_ACCOUNT_HERE fromuser=THE_ACCOUNT_HERE remotesecret=THE_PASSWORD_OF_ACCOUNT_HERE ; if you want to send the remote caller id to 192.168.1.10, then set sendrpid=yes . ; you also need to trust the remote caller id in 192.168.1.10 . sendrpid=yes ; if 192.168.1.10 can dial out from here, you need to set trustrpid=yes so you can get the caller id ;trustrpid=yes ; if 192.168.1.10 is picky on codecs ;disallow=all ;allow=THE_CODEC_NAME_ALLOWED_BY_THE_OTHER_SIP_SERVER
在extensions.conf
中设置拨号方案Dial
是你所需要的,除非你有特殊要求。
拨号方案示例
[globals] SIPTrunk=SIP/TheOtherSipServer [sip-server-192-168-1-10] ;exten=>111,1,Dial(SIP/TheOtherSipServer/111) exten=>111,1,Dial(${SIPTrunk}/${EXTEN})