【发布时间】:2016-07-02 20:29:10
【问题描述】:
这是我的 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: 当我将 extensions.conf 设置为设置 1 时,我听不到对方的声音,但是当 extensions.conf 设置为设置 2 时,我听到双方的对话. 如何解决?这是我没听到时看到的日志
[Jul 1 22:50:38] WARNING[11299]: chan_sip.c:4175 retrans_pkt: seqno 21(关键响应)的传输 tvK9cRGNN- 时已达到重传超时 - 请参阅 https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions 数据包在 8383 毫秒后超时,没有响应 [Jul 1 22:50:38] WARNING[11299]: chan_sip.c:4204 retrans_pkt: 挂断电话 tvK9cRGNN- - 没有回复我们的关键数据包(请参阅 https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions)。
我知道有很多错误的配置,比如 insecure=very 等。但现在我想让这个原型成功运行
【问题讨论】:
-
您应该为入站和出站创建不同的上下文。您应该正确设置星号服务器 nat 遍历/防火墙。
-
NAT 穿越和防火墙已正确完成。因为如果错了,我不会在设置 1 中进行出站工作,在设置 2 中进行入站工作。我知道问题出在 extensions.conf。
标签: asterisk sip asteriskami sip-server nexmo