Приветствую!
FreePBX 2.11.0.16
Asterisk 1.8.13.0
Появилась задача сделать переадресацию входящий город -> мобильный.
Сделал. Голос не идет. Стал разбираться.
Порты проброшены.
Провайдер Зебра.
Связь работает, голос при входящих/исходящих есть
sip_nat.conf:
externhost = 98.223.12.46
nat = yes
bindaddr = 192.168.0.104
bindport = 5060
rtp_additional.conf:
[general]
rtpstart = 17000
rtpend = 30000
Если прописать в sip_nat.conf строку localnet = 192.168.0.0/255.255.255.0, то получим отлуп входящего трафика вообще:
[2014-01-28 05:41:26] NOTICE[9682]: chan_sip.c:22578 handle_request_invite: Sending fake auth rejection for device <sip:4951234567@213.145.43.44:5061;user=phone>;tag=3737545293-3809590663-67162548-83276323
Дебаг при этом такой:
Reliably Transmitting (no NAT) to 213.145.43.128:5060: // 213.145.43.128 IP Зебры.
OPTIONS sip:213.145.43.128;user=phone SIP/2.0
Via: SIP/2.0/UDP 98.223.12.46:5060;branch=z9hG4bK5571a093 // 98.223.12.46 наш внешний IP
Max-Forwards: 70
From: "Unknown" <sip:00012345@91.221.232.34>;tag=as09674afa //00012345 наш логин в Зебре
To: <sip:213.145.43.128;user=phone>
Contact: <sip:00012345@98.223.12.46:5060>
Call-ID: 76d78fee481f541e7fc80331570e6055@98.223.12.46:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(1.8.13.0)
Date: Tue, 28 Jan 2014 01:44:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:213.145.43.128:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 98.223.12.46:5060;branch=z9hG4bK5571a093
From: "Unknown" <sip:00012345@98.223.12.46>;tag=as09674afa
To: <sip:213.145.43.128;user=phone>;tag=283547583-3809590663-620821410-575105168
Call-ID: 76d78fee481f541e7fc80331570e6055@98.223.12.46:5060
CSeq: 102 OPTIONS
Allow: ACK, BYE, CANCEL, INFO, INVITE, OPTIONS, PRACK, REFER, REGISTER, UPDATE
Accept: application/dtmf-relay
Accept: application/ISUP
Accept: application/sdp
Supported: 100rel
Server: MERA MVTS3G v.4.4.0-20
Content-Length: 0
<------------->
--- (13 headers 0 lines) ---
Really destroying SIP dialog '76d78fee481f541e7fc80331570e6055@98.223.12.46:5060' Method: OPTIONS
<--- SIP read from UDP:213.145.43.128:5061 --->
INVITE sip:00012345@98.223.12.46:5060 SIP/2.0
Via: SIP/2.0/UDP 213.145.43.128:5061;rport;branch=z9hG4bK-3189824448-3809590663-620821410-575105168
From: <sip:4951234567@213.145.43.128:5061;user=phone>;tag=3605387968-3809590663-620821410-575105168
To: <sip:74959559279@98.223.12.46;user=phone>
Call-ID: c0dae76687bd11e3a2fb002590684722@213.145.43.128
CSeq: 1 INVITE
Contact: <sip:4951234567@213.145.43.128:5061;user=phone>
Content-Type: application/sdp
Allow: ACK, BYE, CANCEL, INFO, INVITE, OPTIONS, REFER, REGISTER, UPDATE
Max-Forwards: 70
User-Agent: MERA MVTS3G v.4.4.0-20
Cisco-Guid: 2521412007-2264142307-2647064577-1119051430
Remote-Party-ID: <sip:4951234567@213.145.43.128:5061;user=phone>;party=calling;privacy=off;screen=yes
Content-Length: 348
v=0
o=- 1390873480 1390873480 IN IP4 213.145.43.128
s=-
c=IN IP4 213.145.43.128
t=0 0
m=audio 27322 RTP/AVP 18 97 8 0 96
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:97 G729/8000
a=fmtp:97 annexb=no
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=sendrecv
a=silenceSupp:off - - - -
<------------->
--- (14 headers 16 lines) ---
Sending to 213.145.43.128:5061 (NAT)
Using INVITE request as basis request - c0dae76687bd11e3a2fb002590684722@213.145.43.128
No matching peer for '4951234567' from '213.145.43.128:5061'
[2014-01-28 05:44:40] NOTICE[9682]: chan_sip.c:22578 handle_request_invite: Sending fake auth rejection for device <sip:49512345671@213.145.43.128:5061;user=phone>;tag=3605387968-3809590663-620821410-575105168
[2014-01-28 05:44:40] NOTICE[9682]: chan_sip.c:22578 handle_request_invite: Sending fake auth rejection for device <sip:4951234567@213.145.43.128:5061;user=phone>;tag=3605387968-3809590663-620821410-575105168
<--- Reliably Transmitting (NAT) to 213.145.43.128:5061 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 213.145.43.128:5061;branch=z9hG4bK-3189824448-3809590663-620821410-575105168;received=213.145.43.128;rport=5061
From: <sip:4951234567@213.145.43.128:5061;user=phone>;tag=3605387968-3809590663-620821410-575105168
To: <sip:74959559279@98.223.12.46;user=phone>;tag=as50e7d750
Call-ID: c0dae76687bd11e3a2fb002590684722@213.145.43.128
CSeq: 1 INVITE
Server: FPBX-2.11.0(1.8.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="555da67b"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog 'c0dae76687bd11e3a2fb002590684722@213.145.43.128' in 32000 ms (Method: INVITE)
Scheduling destruction of SIP dialog 'c0dae76687bd11e3a2fb002590684722@213.145.43.128' in 32000 ms (Method: INVITE)
Соответственно INVITE не проходит и канал рушится. Если убрать строку - все работает нормально.
Переадресация - Астериск не хочет передавать свой внешний IP. Думаю это связано с вышесказанным.
Весь мозг сломал куда копать.
Спасибо.