出站或入站呼叫仅在星号设置中起作用,而不是两者都起作用。为什么?

时间:2016-07-02 20:29:11

标签: asterisk sip asteriskami sip-server nexmo

这是我的sip.conf

; inbound configuration

[nexmo-sip]
fromdomain=sip.nexmo.com
type=friend
context=nexmo
insecure=port,invite
nat=no
;Add your codec list here.
; Note: Use "ulaw" for US only, "alaw" for the rest of the world.
allow=ulaw
allow=alaw
allow=G729
dtmfmode=rfc2833

[nexmo-sip-01](nexmo-sip)
host=173.193.199.24

[nexmo-sip-02](nexmo-sip)
host=174.37.245.34

[nexmo-sip-03](nexmo-sip)
host=5.10.112.121

[nexmo-sip-04](nexmo-sip)
host=5.10.112.122

[nexmo-sip-05](nexmo-sip)
host=119.81.44.6

[nexmo-sip-06](nexmo-sip)
host=119.81.44.7

;outbound configuration

[general]
register => <api-key>:<api-secret>@sip.nexmo.com
registerattempts=0
srvlookup=yes  
context=nexmo-sip1

[nexmo]
username=<api-key>
host=sip.nexmo.com
defaultuser=<api-key>
fromuser=<myNumber123>  
fromdomain=sip.nexmo.com
secret=<api-secret>
type=friend
context=nexmo-sip1
insecure=very
qualify=yes
nat=no
;Add your codec list here.
; Note: Use "ulaw" for US only, "alaw" for the rest of the world.
allow=ulaw
allow=alaw
allow=G729
dtmfmode=rfc2833

[<myNumber123>]   ; this number is at soft phone client
type=friend
context=nexmo-sip1
host=dynamic
secret=<myNumber123>
qualify=yes

[<mynumber123456>]  ; this is my mobile number
type=friend
context=nexmo-sip1
host=dynamic
secret=<secretkey>
qualify=yes

这是extensions.conf

[general]
live_dangerously=yes
[globals]

[nexmo-sip1]

exten => _X.,1,Dial(SIP/${EXTEN}@nexmo)

[default]
exten => s,1,gosub(nexmo-sip1,${EXTEN},1)

设置1:如果上面是extensions.conf的设置,我可以从我的软客户端进行出站呼叫,但无法获得对该软客户端的入站呼叫

设置2:如果我按如下方式更改extensions.conf的设置,我可以通过softclient接听来电,但无法拨打电话。

[general]
live_dangerously=yes
[globals]

[nexmo-sip1]

exten => _X.,1,Dial(SIP/${EXTEN},30)

[default]
exten => s,1,gosub(nexmo-sip1,${EXTEN},1)

问题1)我应该更改哪些内容以进行出站和入站呼叫?

问题2:当我在设置1中设置extensions.conf时,我没有听到对方的声音,但是当extensions.conf设置为设置2.如何解决?这是我在没有听到

时看到的日志

[Jul 1 22:50:38]警告[11299]:chan_sip.c:4175 retrans_pkt:传输时传输的重传超时tvK9cRGNN-对于seqno 21(严重响应) - 请参阅https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions 数据包在8383ms后超时,没有响应 [Jul 1 22:50:38]警告[11299]:chan_sip.c:4204 retrans_pkt:挂断电话tvK9cRGNN- - 没有回复我们的关键信息包(见https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions)。

我知道有很多错误的配置,比如不安全=非常等等。但是现在我想让这个原型成功运作

1 个答案:

答案 0 :(得分:0)

要使入站和出站呼叫有效,您需要有2个单独的入站入站和出站。

尝试按以下方式更改配置:extensions.conf:

[general]

[globals]

[nexmo-sip2]
exten => _X.,1,Dial(SIP/${EXTEN}@nexmo)

[nexmo-sip1]
exten => _X.,1,Dial(SIP/${EXTEN},30)

在sip.conf中,请保留所有内容,只需更新我粘贴的内容:

[<myNumber123>]   ; this number is at soft phone client
type=friend
context=nexmo-sip2
host=dynamic
secret=<myNumber123>
qualify=yes

[<mynumber123456>]  ; this is my mobile number
type=friend
context=nexmo-sip2
host=dynamic
secret=<secretkey>
qualify=yes

正如您所看到的,我们需要为您的SIP扩展(nexmo-sip2)和来自您的SIP提供商(nexmo-sip1)的呼叫提供2个单独的上下文。