来电不起作用

时间:2017-03-08 16:29:28

标签: asterisk pjsip incoming-call

环境

2个虚拟机

一个使用Debian 8,Asterisk 13.13.1,PJSIP 2.5.5

和另一个机智Debian 8 Gnome-GUI和SFLphone 1.4.1

虚拟机位于同一网络中的NAT路由器

NAT的方式是通过Asterisk-VM静态IP上的Exposed-Host功能完成的

启用Asterisk-VM防火墙,为此我已在CLI中以root身份完成:

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

文件

== pjsip.conf

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
local_net = 192.168.2.0/24
external_media_address =  ---Router WAN IP---
external_signaling_address = ---Router WAN IP---

[reg_sipgate]
type = registration
retry_interval = 20
max_retries = 10
contact_user = ---SIPgate-ID---
expiration = 120
transport = transport-udp
outbound_auth = auth_reg_sipgate
client_uri = sip:---SIPgate-ID---@sipgate.de:5060
server_uri = sip:sipgate.de:5060

[auth_reg_sipgate]
type = auth
username = ---SIPgate-ID---
password = ---SIPgate-passwd---

[sipgate_aor]
type = aor
contact = sip:---SIPgate-ID---@sipgate.de

[sipgate_identity]
type=identity
endpoint = sipgate
match = sipgate.de

[sipgate_auth]
type = auth
username = ---SIPgate-ID---
password = ---SIPgate-passwd---

[sipgate]
type = endpoint
context = sipgate-in
dtmf_mode =rfc4733
disallow = all
allow = alaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
timers = yes
from_user = ---SIPgate-ID---
from_domain = sipgate.de
language = en
outbound_auth = sipgate_auth
aors = sipgate_aor

== extensions.conf文件

[sipgate-in]
exten => _X.,1,NoOp(Processing an incoming call)
;same problem if this line is used and not the above line
;exten => ---SIPgate-number-in-plain---,1,NoOp(Processing an incoming call)
same => n,Dial(PJSIP/1001,20)
same => n,Hangup()

[sipgate-out]
exten => _X.,1,NoOp(Processing an outgoing call)
same => n,Dial(PJSIP/${EXTEN}@sipgate)
same => n,Hangup()

== pjsip_wizard.conf

[support](!)
type = wizard
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
endpoint/context = support
endpoint/allow_subscribe = yes
endpoint/allow = gsm
endpoint/direct_media = no
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
endpoint/ice_support = yes
endpoint/moh_suggest = default
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/send_pai = yes
endpoint/allow_transfer = yes
endpoint/trust_id_inbound = yes
endpoint/device_state_busy_at = 1
endpoint/trust_id_outbound = yes
endpoint/send_diversion = yes
aor/qualify_frequency = 30
aor/max_contacts = 1
aor/remove_existing = yes
aor/minimum_expiration = 30
aor/support_path = yes
phoneprov/PROFILE = profile1

[1001](support)
inbound_auth/username = 1001
inbound_auth/password = XXXXXXXXX

图片

CLI notice with verbose = 5

问题

来电不会被路由到我的软电话1001.我得到的只有10秒静音,然后是HangUp。外部呼叫运行完美

感谢您的帮助或链接或称我为dumbf * uck并告诉我它很明显

我使用这个环境只是为了学习,它不会产生24/7的运行效率。如果您遗失了某些内容,请告诉我

修改

这是debug.log

[Mar 20 06:46:59] DEBUG[25617] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg INVITE/cseq=103 (rdata0x7f9094001b98)
[Mar 20 06:46:59] DEBUG[25617] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000026 to use for Request msg INVITE/cseq=103 (rdata0x7f9094001b98)
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '04058962865' domain 'sipgate.de'
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Endpoint not found for From username '04058962865' domain 'sipgate.de'
[Mar 20 06:46:59] NOTICE[25618] res_pjsip/pjsip_distributor.c: Request 'INVITE' from '"04058962865" <sip:04058962865@sipgate.de>' failed for '217.10.79.9:5060' (callid: 0eb324896fae520c2707e7933f2b33fe@sipgate.de) - No matching endpoint found

[Mar 20 06:46:59] DEBUG[25617] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg ACK/cseq=103 (rdata0x7f9094001b98)
[Mar 20 06:46:59] DEBUG[25617] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000026 to use for Request msg ACK/cseq=103 (rdata0x7f9094001b98)
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '04058962865' domain 'sipgate.de'
[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Endpoint not found for From username '04058962865' domain 'sipgate.de'
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [3] in [0, 4294967295] gives [3](0)
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [2] in [0, 4294967295] gives [2](0)
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: Wrapper created
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: Set timer to 3000 msec
[Mar 20 06:47:02] DEBUG[25618] res_pjsip/pjsip_message_ip_updater.c: Re-wrote Contact URI host/port to 192.168.2.100:5060

[Mar 20 06:47:02] DEBUG[25617] res_pjsip/pjsip_distributor.c: No dialog serializer for response Response msg 200/OPTIONS/cseq=64036 (rdata0x7f9094001b98). Using request transaction as basis
[Mar 20 06:47:02] DEBUG[25617] res_pjsip/pjsip_distributor.c: Found serializer pjsip/default-0000000c on transaction tsx0x7f90b0008e48
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: PJSIP tsx response received
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: Cancelling timer
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: Timer cancelled
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [3] in [0, 4294967295] gives [3](0)
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [0] in [0, 4294967295] gives [0](0)
[Mar 20 06:47:02] DEBUG[25618] config.c: extract uint from [2] in [0, 4294967295] gives [2](0)
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: Callbacks executed
[Mar 20 06:47:02] DEBUG[25618] res_pjsip.c: 0x7f90b0006510: wrapper destroyed
[Mar 20 06:47:02] DEBUG[25623] res_pjsip/pjsip_configuration.c: Contact 1001/sip:1001@192.168.2.200:5060 status didn't change: Reachable, RTT: 2.107 msec
[Mar 20 06:47:15] DEBUG[25622] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:15] DEBUG[25620] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:15] DEBUG[25615] threadpool.c: Destroying worker thread 9
[Mar 20 06:47:15] DEBUG[25615] threadpool.c: Destroying worker thread 7
[Mar 20 06:47:15] DEBUG[25621] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:15] DEBUG[25615] threadpool.c: Destroying worker thread 8
[Mar 20 06:47:16] DEBUG[25627] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:16] DEBUG[25625] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:16] DEBUG[25595] threadpool.c: Destroying worker thread 13
[Mar 20 06:47:16] DEBUG[25595] threadpool.c: Destroying worker thread 12
[Mar 20 06:47:17] DEBUG[25657] res_pjsip_registrar_expire.c: Woke up at 1489988837  Interval: 30
[Mar 20 06:47:17] DEBUG[25657] res_pjsip_registrar_expire.c: Expiring 0 contacts
[Mar 20 06:47:23] DEBUG[25619] threadpool.c: Worker thread idle timeout reached. Dying.
[Mar 20 06:47:23] DEBUG[25615] threadpool.c: Destroying worker thread 6

[Mar 20 06:47:26] DEBUG[25617] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg REGISTER/cseq=53083 (rdata0x7f9094001b98)
[Mar 20 06:47:26] DEBUG[25617] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000033 to use for Request msg REGISTER/cseq=53083 (rdata0x7f9094001b98)
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '1001' domain '192.168.2.100'
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Identified by From username '1001' domain '192.168.2.100'

[Mar 20 06:47:26] DEBUG[25617] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg REGISTER/cseq=53084 (rdata0x7f9094001b98)
[Mar 20 06:47:26] DEBUG[25617] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-00000033 to use for Request msg REGISTER/cseq=53084 (rdata0x7f9094001b98)
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username '1001' domain '192.168.2.100'
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_endpoint_identifier_user.c: Identified by From username '1001' domain '192.168.2.100'
[Mar 20 06:47:26] DEBUG[25618] res_pjsip_authenticator_digest.c: Calculated nonce 1489988846/53973002a197b8acbac0fc7c46b92b1b. Actual nonce is 1489988846/53973002a197b8acbac0fc7c46b92b1b

1 个答案:

答案 0 :(得分:0)

解决方案

debug.log中的这一行把我带到了它

[Mar 20 06:46:59] DEBUG[25618] res_pjsip_endpoint_identifier_ip.c: No identify sections to match against

pjsip.conf中要改变的两件事

我自己犯了一个非常愚蠢的错误。

你必须改变这一行

[sipgate_identity]
type=identity

[sipgate_identity]
type=identify

和第二:

sipgate给了我一些其他的错误,所以看起来它不适用于alaw,

所以我把它改成了gsm

[sipgate]
type = endpoint
...
disallow = all
allow = alaw
...

更改为

[sipgate]
type = endpoint
...
disallow = all
allow = gsm
...