Jump to content
Калькуляторы

[РЕШЕНО] CommuniGatePro - NAT - Asterisk нет голоса CommuniGatePro -- Internet -- Router -- Asterisk

Здравствуйте, asterisk за NAT подключается к ISP, при входящем звонке (от провайдера на АТС) нет голоса (исходящей пока не занимался). В пакетах от прова в SDP поле медиаданных (m=) прилетают разныые IP (из пула, видимо балансируют). АТС клиента шлет трафик на указанные IP и порт, но в трубке тишина. Странная ситуация в консоли asterisk, после вопроизведения ролика со стороны клиента, поступает еще один звонок на exten "h":

 

Пир, контекст ISP:

 

register=AUTHNAME:SECRET@AAA.BBB.CCC.249/AUTHNAME

[AUTHNAME]
type=peer
secret=SECRET
qualify=yes
insecure=invite,port
host=AAA.BBB.CCC.249
fromdomain=ISP.DOMAIN.HERE
dtmfmode=rfc2833
defaultuser=AUTHNAME
context=from-trunk-sip-ISP

 

# asterisk -rx "sip show peers"
Name/username             Host                                    Dyn Forcerport ACL Port     Status
AUTHNAME/AUTHNAME               AAA.BBB.CCC.249                                             5060     OK (61 ms)
# asterisk -rx "sip show registry"
Host                                    dnsmgr Username       Refresh State                Reg.Time
AAA.BBB.CCC.249:5060             N      AUTHNAME             3585 Registered           Tue, 29 Jul 2014 20:20:47
1 SIP registrations.

 

[from-trunk-sip-ISP]
exten => _.,1,NoOp(***** Call from ${CALLERID(all)} to ${EXTEN} from ISP *****)
exten => _.,n,Answer
exten => _.,n,Playback(en/hello-world)
exten => _.,n,Hangup

 

Звонок в CLI Asterisk:

 

 

 

localhost*CLI>

== Using SIP RTP TOS bits 184

== Using SIP RTP CoS mark 5

-- Executing [AUTHNAME@from-trunk-sip-ISP:1] NoOp("SIP/AUTHNAME-000000d2", "***** Call from "+7<CALLER-ID-NUM>" <+7CALLER-ID-NUM> to AUTHNAME from ISP *****") in new stack

-- Executing [AUTHNAME@from-trunk-sip-ISP:2] Answer("SIP/AUTHNAME-000000d2", "") in new stack

-- Executing [AUTHNAME@from-trunk-sip-ISP:3] Playback("SIP/AUTHNAME-000000d2", "en/hello-world") in new stack

Sent RTP packet to AAA.BBB.CCC.130:48410 (type 00, seq 057591, ts 000160, len 000160)

-- <SIP/AUTHNAME-000000d2> Playing 'en/hello-world.ulaw' (language 'en')

Sent RTP packet to AAA.BBB.CCC.130:48410 (type 00, seq 057592, ts 000320, len 000160)

...

...

...

Sent RTP packet to AAA.BBB.CCC.130:48410 (type 00, seq 057665, ts 012000, len 000160)

-- Executing [AUTHNAME@from-trunk-sip-ISP:4] Hangup("SIP/AUTHNAME-000000d2", "") in new stack

== Spawn extension (from-trunk-sip-ISP, AUTHNAME, 4) exited non-zero on 'SIP/AUTHNAME-000000d2'

-- Executing [h@from-trunk-sip-ISP:1] NoOp("SIP/AUTHNAME-000000d2", "***** Call from "+7<CALLER-ID-NUM>" <+7CALLER-ID-NUM> to h from ISP *****") in new stack

-- Executing [h@from-trunk-sip-ISP:2] Answer("SIP/AUTHNAME-000000d2", "") in new stack

== Spawn extension (from-trunk-sip-ISP, h, 2) exited non-zero on 'SIP/AUTHNAME-000000d2'

localhost*CLI>

 

 

 

TCPDump соединения:

 

 

 

[root@localhost user]# tcpdump -vpni eth0 net AAA.BBB.CCC.0/16

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

 

20:29:09.449538 IP (tos 0xa0, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 1252)

AAA.BBB.CCC.249.sip > 192.168.1.233.sip: SIP, length: 1224

INVITE sip:AUTHNAME@192.168.1.233:5060 SIP/2.0

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229666-aoncfje;cgp=example.com;rport

Record-Route: <sip:AAA.BBB.CCC.249:5060;lr>

Record-Route: <sip:10.69.96.2:5060;lr>

Record-Route: <sip:rev.16636103-10.69.96.2.dialog.cgatepro;lr>

Max-Forwards: 67

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

Contact: <sip:signode-306020-DAD2A83E_aoncfje-C9F2@AAA.BBB.CCC.249:5060>

CSeq: 1 INVITE

Supported: 100rel,timer,replaces,histinfo,precondition

Session-Expires: 7200

Min-SE: 900

User-Agent: CommuniGatePro-callLeg/5.4.11

Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,REFER

Content-Type: application/sdp

Content-Length: 337

 

v=0

o=CGPLeg306020 3585286394 1792643198 IN IP4 AAA.BBB.CCC.130

s=-

c=IN IP4 AAA.BBB.CCC.130

t=0 0

m=audio 48408 RTP/AVP 0 8 18 101

c=IN IP4 AAA.BBB.CCC.130

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:18 G729/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16,32-49,64-89

a=sendrecv

a=rtcpping:M:3004196:1094723409

 

20:29:09.450765 IP (tos 0x60, ttl 64, id 33897, offset 0, flags [none], proto UDP (17), length 810)

192.168.1.233.sip > AAA.BBB.CCC.249.sip: SIP, length: 782

SIP/2.0 100 Trying

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229666-aoncfje;cgp=example.com;received=AAA.BBB.CCC.249;rport=5060

Record-Route: <sip:AAA.BBB.CCC.249:5060;lr>

Record-Route: <sip:10.69.96.2:5060;lr>

Record-Route: <sip:rev.16636103-10.69.96.2.dialog.cgatepro;lr>

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 1 INVITE

Server: FPBX-2.11.0(1.8.28.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Session-Expires: 1800;refresher=uas

Contact: <sip:AUTHNAME@CLIENT.HOST:5060>

Content-Length: 0

 

 

20:29:09.459129 IP (tos 0x60, ttl 64, id 33898, offset 0, flags [none], proto UDP (17), length 1133)

192.168.1.233.sip > AAA.BBB.CCC.249.sip: SIP, length: 1105

SIP/2.0 200 OK

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229666-aoncfje;cgp=example.com;received=AAA.BBB.CCC.249;rport=5060

Record-Route: <sip:AAA.BBB.CCC.249:5060;lr>

Record-Route: <sip:10.69.96.2:5060;lr>

Record-Route: <sip:rev.16636103-10.69.96.2.dialog.cgatepro;lr>

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 1 INVITE

Server: FPBX-2.11.0(1.8.28.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Session-Expires: 1800;refresher=uas

Contact: <sip:AUTHNAME@CLIENT.HOST:5060>

Content-Type: application/sdp

Require: timer

Content-Length: 263

 

v=0

o=root 660998376 660998376 IN IP4 CLIENT.HOST

s=Asterisk PBX 1.8.28.2

c=IN IP4 CLIENT.HOST

t=0 0

m=audio 11760 RTP/AVP 0 8 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=sendrecv

 

20:29:09.514295 IP (tos 0xa0, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 571)

AAA.BBB.CCC.249.sip > 192.168.1.233.sip: SIP, length: 543

ACK sip:AUTHNAME@192.168.1.233:5060 SIP/2.0

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229668-aoncfje;cgp=example.com;rport

Max-Forwards: 20

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

Contact: <sip:signode-306020-DAD2A83E_aoncfje-C9F2@AAA.BBB.CCC.249:5060>

CSeq: 1 ACK

User-Agent: CommuniGatePro-callLeg/5.4.11

Content-Length: 0

 

 

20:29:09.520304 IP (tos 0xa0, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 1129)

AAA.BBB.CCC.249.sip > 192.168.1.233.sip: SIP, length: 1101

INVITE sip:AUTHNAME@192.168.1.233:5060;maddr=CLIENT.HOST SIP/2.0

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229670-aoncfje;cgp=example.com;rport

Max-Forwards: 20

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

Contact: <sip:signode-306020-DAD2A83E_aoncfje-C9F2@AAA.BBB.CCC.249:5060>

CSeq: 2 INVITE

Supported: 100rel,timer,replaces,histinfo,precondition

Session-Expires: 1800;refresher=uas

Min-SE: 900

User-Agent: CommuniGatePro-callLeg/5.4.11

Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,REFER

Content-Type: application/sdp

Content-Length: 312

 

v=0

o=CGPLeg306020 3585286394 1792643199 IN IP4 AAA.BBB.CCC.130

s=-

c=IN IP4 AAA.BBB.CCC.130

t=0 0

m=audio 48410 RTP/AVP 0 8 101

c=IN IP4 AAA.BBB.CCC.130

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16,32-49,64-89

a=sendrecv

a=rtcpping:M1:3004197:1868662530

 

20:29:09.520613 IP (tos 0x60, ttl 64, id 33899, offset 0, flags [none], proto UDP (17), length 677)

192.168.1.233.sip > AAA.BBB.CCC.249.sip: SIP, length: 649

SIP/2.0 100 Trying

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229670-aoncfje;cgp=example.com;received=AAA.BBB.CCC.249;rport=5060

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 2 INVITE

Server: FPBX-2.11.0(1.8.28.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Session-Expires: 1800;refresher=uas

Contact: <sip:AUTHNAME@CLIENT.HOST:5060>

Content-Length: 0

 

 

20:29:09.520698 IP (tos 0x60, ttl 64, id 33900, offset 0, flags [none], proto UDP (17), length 985)

192.168.1.233.sip > AAA.BBB.CCC.249.sip: SIP, length: 957

SIP/2.0 200 OK

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229670-aoncfje;cgp=example.com;received=AAA.BBB.CCC.249;rport=5060

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 2 INVITE

Server: FPBX-2.11.0(1.8.28.2)

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

Session-Expires: 1800;refresher=uas

Contact: <sip:AUTHNAME@CLIENT.HOST:5060>

Content-Type: application/sdp

Require: timer

Content-Length: 263

 

v=0

o=root 660998376 660998377 IN IP4 CLIENT.HOST

s=Asterisk PBX 1.8.28.2

c=IN IP4 CLIENT.HOST

t=0 0

m=audio 11760 RTP/AVP 0 8 101

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=sendrecv

 

20:29:09.568275 IP (tos 0xa0, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 571)

AAA.BBB.CCC.249.sip > 192.168.1.233.sip: SIP, length: 543

ACK sip:AUTHNAME@192.168.1.233:5060 SIP/2.0

Via: SIP/2.0/UDP AAA.BBB.CCC.249:5060;branch=z9hG4bK229672-aoncfje;cgp=example.com;rport

Max-Forwards: 20

From: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

To: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

Contact: <sip:signode-306020-DAD2A83E_aoncfje-C9F2@AAA.BBB.CCC.249:5060>

CSeq: 2 ACK

User-Agent: CommuniGatePro-callLeg/5.4.11

Content-Length: 0

 

 

20:29:09.961288 IP (tos 0xb8, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 200)

192.168.1.233.11760 > AAA.BBB.CCC.130.48410: UDP, length 172

...

...

...

...

20:29:11.441359 IP (tos 0xb8, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 200)

192.168.1.233.11760 > AAA.BBB.CCC.130.48410: UDP, length 172

20:29:11.482455 IP (tos 0x60, ttl 64, id 33901, offset 0, flags [none], proto UDP (17), length 685)

192.168.1.233.sip > AAA.BBB.CCC.249.sip: SIP, length: 657

BYE sip:signode-306020-DAD2A83E_aoncfje-C9F2@AAA.BBB.CCC.249:5060 SIP/2.0

Via: SIP/2.0/UDP CLIENT.HOST:5060;branch=z9hG4bK7b5ad5e2;rport

Route: <sip:AAA.BBB.CCC.249:5060;lr>,<sip:10.69.96.2:5060;lr>,<sip:rev.16636103-10.69.96.2.dialog.cgatepro;lr>

Max-Forwards: 70

From: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

To: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 102 BYE

User-Agent: FPBX-2.11.0(1.8.28.2)

X-Asterisk-HangupCause: Normal Clearing

X-Asterisk-HangupCauseCode: 16

Content-Length: 0

 

 

20:29:11.533050 IP (tos 0xa0, ttl 51, id 0, offset 0, flags [DF], proto UDP (17), length 425)

AAA.BBB.CCC.249.sip > 192.168.1.233.sip: SIP, length: 397

SIP/2.0 200 OK

Via: SIP/2.0/UDP 192.168.1.233:5060;branch=z9hG4bK7b5ad5e2;rport=5060

From: <sip:+7<EXTEN>@AAA.BBB.CCC.249>;tag=as7e0ae9ca

To: "+7<CALLER-ID-NUM>" <sip:+7<CALLER-ID-NUM>@AAA.BBB.CCC.249>;tag=F14B7BD2-306020-DAD2A83E_aoncfje-C9F2

Call-ID: 4173575e68bf805020c03c916fa8ec71-mdpg4nu@172.24.23.6:5060.egress

CSeq: 102 BYE

Server: CommuniGatePro/5.4.11

Content-Length: 0

 

 

^C

85 packets captured

85 packets received by filter

0 packets dropped by kernel

 

 

 

Легенда:


  •  
  • AAA.BBB.CCC. - полсеть прова
  • CLIENT.HOST - внешний IP клиента
  • AUTHNAME - логин
  • SECRET - пароль
  • EXTEN - номер клиента
  • CALLER-ID-NUM - с этого номера тестовые звонки

 

SIP.CONF:

 

# cat sip_general_additional.conf | grep 'nat\|rtp\|media\|sdp\|extern\|invite'
rtpkeepalive=0
canreinvite=no
rtptimeout=30
rtpholdtimeout=300
nat=no
externip=CLIENT.HOST
directmedia=no

 

Второй день долблюсь, не пойму с чьей стороны проблема, от саппорта ответа не поступает на письма.

 

PS1: Для теста цеплял на Asterisk в другой AS, схема такая-же с регистрацией - все ОК.

PS2: В качестве GW ASUS-RT-N12, никаких port-forward нет. Техник на стороне клиента утверждает, что при настройке аккаунта на VoIP телефоне от D-Link (в тойже 192.168.1/24 висит) голос есть, что больше всего смущает.

PS3: Ситуция точно как описано здесь http://voxlink.ru/kb/asterisk-configuration/asterisk-sdp-in-reinvite-ignoresdpversion/, только с нормальной работой со стороны АТС клиента (направляет RTP трафик на заявленный IP,Port)

Edited by a-zazell

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.