1

我在 CentOS 6.4 x64 上配置了 Asterisk 11.7.0,配置如下sip.conf

[general]
register =>mynumber:mypass@xxx.xxx.xxx.xxx
registertimeout=20
context=incoming
allowoverlap=no
bindport=5060
bindaddr=192.168.0.3
srvlookup=no
subscribecontext=from-sip

; The SIP provider
[VoIPProvider]
canreinvite=no
username=mynumber
fromuser=mynumber
secret=mypass
context=incoming
type=friend
fromdomain=xxx.xxx.xxx.xxx
;host=xxx.xxx.xxx.xxx
dtmfmode=rfc2833
disallow=all
allow=alaw
allow=ulaw
nat=yes
insecure=very

; ext 100
[100]
type=friend
host=dynamic
secret=MyPass123
context=internal
mailbox=100@default
callgroup=1
pickupgroup=1
dtmfmode=rfc2833
canreinvite=no

; ext 200
[200]
type=friend
host=dynamic
secret=MyPass123
context=internal
callgroup=1
pickupgroup=1
dtmfmode=rfc2833
canreinvite=no

和以下extensions.conf:

[incoming]
; Ring on extension 100, 200 and the mobile phone.
exten => s,1,Answer()
exten => s,n,Dial(SIP/100&SIP/200&SIP/VoIPProvider/*320423456789,150,r,t,)

; Pass unanswered call to a mobile phone
exten => s,n,Dial(SIP/VoIPProvider/*320423456789,150,r)

; Still not answered? Pass unanswered calls to voicemail
exten => s,n,Voicemail(100,u)
exten => s,n,Hangup

[outgoing]
exten => _XXXXXXXXXXXXXXX,1,Dial(SIP/VoIPProvider/${EXTEN})
exten => _XXXXXXXXXX,1,Dial(SIP/VoIPProvider/${EXTEN})
exten => _XXXXXX,1,Dial(SIP/VoIPProvider/${EXTEN})

[internal]
exten => _XXX,1,Dial(SIP/${EXTEN})

; Calls to ext 100
exten => 100,1,Dial(SIP/100,20)
exten => 100,n,VoiceMail(100,u)
exten => 100,n,Hangup

; Calls to ext 200
exten => 200,1,Dial(SIP/100,20)
exten => 200,n,Hangup

当我尝试从 IP 电话拨打我的手机号码时,我在 Asterisk CLI 中看到以下输出:

-- Executing [XXXXXXXXX@outgoing:1] Dial("SIP/XXX-00000002", "SIP/VoIPProvider/XXXXXXXXX") in new stack

WARNING[19884][C-00000003]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)

== Everyone is busy/congested at this time (1:0/0/1)
-- Auto fallthrough, channel 'SIP/XXX-00000002' status is 'CHANUNAVAIL'

现在,我知道这cause 20 - Subscriber absent意味着什么,但我确定我的手机号码存在并且可以访问,因为当我从我的手机(来电)拨打 IP 电话的号码时,它可以工作。

有什么建议么?

4

2 回答 2

1

我看不到 VoIPProvider 条目如何用于拨出呼叫,因为它没有“主机”字段,因此 Asterisk 不知道应该将 SIP 呼叫发送到哪里。

尝试在您的 sip.conf 中创建一个名为“VoIPProvider_Outgoing”或类似名称的新条目,并取消注释主机字段。然后在您的 extensions.conf 中将“VoIPProvider”替换为“VoIPProvider_Outgoing”。

于 2014-01-07T00:22:44.670 回答
-1

请在您的拨号用户上下文中添加您的传出上下文。

就像在内部:

包括=传出或包括=传出

这在 Asterisk 中的含义相同

于 2014-05-27T09:14:49.127 回答