环境
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
图片
问题
来电不会路由到我的软电话 1001。我得到的唯一结果是 10 秒静音,然后挂断。外部通话运行完美
感谢您的帮助或链接或称我为笨蛋并告诉我这很明显
我使用这个环境只是为了学习,它也不是 24/7 全天候运行。如果您遗漏了什么,请告诉我
编辑
这是调试日志
[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