Страница 1 из 2

SIP trunk

Добавлено: 06 ноя 2013, 13:24
dimaolin2
Добрый день, уважаемое сообщество. При настройке SIP trunk без авторизации не проходят входящие звонки, с исходящими всё ОК.
В консоли при звонке 404 Not found
Дебаг звонка и конф.файлы приведены ниже

Смущает следующая запись
Looking for 25420;phone-context=myCDPdomain.myUDPdomain.ru in internal (domain smolensk.sml)
Наш IP 192.168.111.163
IP прова 192.168.1.250


<--- SIP read from UDP:192.168.1.250:5060 --->
INVITE sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml:5060;maddr=192.168.111.163;transport=udp;user=phone;x-nt-redirect=redirect-server SIP/2.0
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=76b3ee8-fa01a8c0-13c4-55013-130e0cb-2e3433b3-130e0cb
To: <sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>
Call-ID: 99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb
CSeq: 1 INVITE
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130e0cb-a6ee1963-4532f3c0
Max-Forwards: 70
Supported: 100rel,x-nortel-sipvc,replaces
User-Agent: Nortel CS1000 SIP GW release_7.0 version_ssLinux-7.00.20
P-Asserted-Identity: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>
Privacy: none
x-nt-e164-clid: +74813135666@smolensk.sml;user=phone
History-Info: <sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;index=1
Contact: <sip:4813135666;phone-context=+4812@smolensk.sml:5060;maddr=192.168.1.250;transport=udp;user=phone>
Allow: INVITE,ACK,BYE,REGISTER,REFER,NOTIFY,CANCEL,PRACK,OPTIONS,INFO,SUBSCRIBE,UPDATE
Content-Type: multipart/mixed;boundary=unique-boundary-1
Content-Length: 888

--unique-boundary-1
Content-Type: application/sdp

v=0
o=- 1628155 1 IN IP4 192.168.1.250
s=-
c=IN IP4 192.168.1.237
t=0 0
m=audio 5248 RTP/AVP 8 0 101 111
c=IN IP4 192.168.1.237
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:111 X-nt-inforeq/8000
a=ptime:20
a=maxptime:20
a=sendrecv

--unique-boundary-1
Content-Type: application/x-nt-mcdn-frag-hex;version=ssLinux-7.00.20;base=x2611
Content-Disposition: signal;handling=optional

0500fe01
0107130085900000a200
09090f00e9a0830001007e00
131e070011fd1800a1160201010201a1300e8005300380010181020007850104
1315070011fa0f00a10d02010102020100cc040000420700
1e0403008183
460e01000a0001006400010000000000
--unique-boundary-1
Content-Type: application/x-nt-epid-frag-hex;version=ssLinux-7.00.20;base=x2611
Content-Disposition: signal;handling=optional

011201
b4:b0:17:7e:51:be
--unique-boundary-1--
<------------->
--- (17 headers 35 lines) ---
Sending to 192.168.1.250:5060 (NAT)
Using INVITE request as basis request - 99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb
Found peer 'trunk' for '4813135666;phone-context=+4812' from 192.168.1.250:5060
== Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found RTP audio format 111
Found audio description format telephone-event for ID 101
Found unknown media description format X-nt-inforeq for ID 111
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.237:5248
Looking for 25420;phone-context=myCDPdomain.myUDPdomain.ru in internal (domain smolensk.sml)

<--- Reliably Transmitting (NAT) to 192.168.1.250:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130e0cb-a6ee1963-4532f3c0;received=192.168.1.250;rport=5060
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=76b3ee8-fa01a8c0-13c4-55013-130e0cb-2e3433b3-130e0cb
To: <sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;tag=as7da9d0c2
Call-ID: 99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb
CSeq: 1 INVITE
Server: Asterisk PBX SVN-branch-1.8-r397377
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
[Nov 6 13:10:07] NOTICE[11452]: chan_sip.c:23437 handle_request_invite: Call from 'trunk' (192.168.1.250:5060) to extension '25420' rejected because extension not found in context 'internal'.
Scheduling destruction of SIP dialog '99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.250:5060 --->
ACK sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml:5060;maddr=192.168.111.163;transport=udp;user=phone;x-nt-redirect=redirect-server SIP/2.0
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=76b3ee8-fa01a8c0-13c4-55013-130e0cb-2e3433b3-130e0cb
To: <sip:25420;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;tag=as7da9d0c2
Call-ID: 99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb
CSeq: 1 ACK
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130e0cb-a6ee1963-4532f3c0
Max-Forwards: 70
User-Agent: Nortel CS1000 SIP GW release_7.0 version_ssLinux-7.00.20
Contact: <sip:4813135666;phone-context=+4812@smolensk.sml:5060;maddr=192.168.1.250;transport=udp;user=phone>
Allow: INVITE,ACK,BYE,REGISTER,REFER,NOTIFY,CANCEL,PRACK,OPTIONS,INFO,SUBSCRIBE,UPDATE
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Really destroying SIP dialog '99d37a8-fa01a8c0-13c4-55013-130e0cb-2317e7bd-130e0cb' Method: ACK

Файлы конфигурации sip.conf и extension.conf

---sip.conf---

[general]
allowoverlap=no
srvlookup=no
bindport=5060
language=ru
udpbindaddr=0.0.0.0
tcpenable=no
canreinvite=no
context=internal
allowguest=yes

[trunk]

type=friend
context=internal
host=192.168.1.250
allowquest=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm

---extension.conf---

[globals]

[general]

language=ru

[default]

include=internal


[internal]

exten => _2540X,1,Answer()
exten => _2540X,n,Dial(DAHDI/${EXTEN:3},50,tT)
exten => _2540X,n,Hangup()

exten => _2541X,1,Answer()
exten => _2541X,n,Dial(DAHDI/${EXTEN:3},50,tT)
exten => _2541X,n,Hangup()

exten => _2542X,1,Answer()
exten => _2542X,n,Dial(DAHDI/${EXTEN:3},50,tT)
exten => _2542X,n,Hangup()

exten => 25430,1,Macro(monitor)
exten => 25430,n,Dial(DAHDI/30,50)
exten => 25430,n,Hangup()

exten => _22XXX,1,Dial(SIP/192.168.1.250/${EXTEN},50,tTxX)
exten => _21XXX,1,Dial(SIP/192.168.1.250/${EXTEN},50,tTxX)
exten => _23XXX,1,Dial(SIP/192.168.1.250/${EXTEN},50,tTxX)
exten => _24XXX,1,Dial(SIP/192.168.1.250/${EXTEN},50,tTxX)

exten => _9XXXXXX,1,Dial(SIP/192.168.1.250/${EXTEN},60,tTxX)
exten => _08XXXXXXXXXX,1,Dial(SIP/192.168.1.250/${EXTEN},60,tTxX)

include => parkedcalls


[macro-monitor]

exten => s,1,Set(MONITOR_FILE=/var/spool/asterisk/monitor/wav/${UNIQUEID})
exten => s,n,MixMonitor(${MONITOR_FILE}.wav,b)

Перепробовал все. Бьюсь вторые сутки. Прошу помощи. Спасибо

Re: SIP trunk

Добавлено: 06 ноя 2013, 13:34
zzuz
CLI>dialplan show 25420@internal

Re: SIP trunk

Добавлено: 06 ноя 2013, 13:37
ded
Добавьте
[trunk]

type=friend
context=internal
host=192.168.1.250
insecure=invite
; allowquest=yes -- а это не надо
disallow=all
allow=ulaw
allow=alaw
allow=gsm

Re: SIP trunk

Добавлено: 06 ноя 2013, 13:54
dimaolin2
insecure=invite добавляли, добавляли порт. По прежнему 404

dialplan show 25420@internal
[ Context 'internal' created by 'pbx_config' ]
'_2542X' => 1. Answer() [pbx_config]
2. Dial(DAHDI/${EXTEN:3},50,tT) [pbx_config]
3. Hangup() [pbx_config]

-= 1 extension (3 priorities) in 1 context. =-

Re: SIP trunk

Добавлено: 06 ноя 2013, 14:03
ded
У вас есть там Dial(DAHDI/${EXTEN:3},50,tT) ?
Может просто для теста зарегистрируете SIP телефон и примете звонок на него?
2 дня бьюсь - это мало.

Re: SIP trunk

Добавлено: 06 ноя 2013, 14:37
dimaolin2
Да, стоит банк каналов asteroid.
Завел аккаунт на софт фоне zoiper, по прежнему 404. Логи дебага при входящем звонке на 25400:

<--- SIP read from UDP:192.168.6.12:5060 --->


<------------->

<--- SIP read from UDP:192.168.6.12:5060 --->


<------------->

<--- SIP read from UDP:192.168.1.250:5060 --->
INVITE sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml:5060;maddr=192.168.111.163;transport=udp;user=phone;x-nt-redirect=redirect-server SIP/2.0
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=7789368-fa01a8c0-13c4-55013-130f358-25eb5720-130f358
To: <sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>
Call-ID: 95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358
CSeq: 1 INVITE
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130f358-a73691f5-7d6317f2
Max-Forwards: 70
Supported: 100rel,x-nortel-sipvc,replaces
User-Agent: Nortel CS1000 SIP GW release_7.0 version_ssLinux-7.00.20
P-Asserted-Identity: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>
Privacy: none
x-nt-e164-clid: +74813135666@smolensk.sml;user=phone
History-Info: <sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;index=1
Contact: <sip:4813135666;phone-context=+4812@smolensk.sml:5060;maddr=192.168.1.250;transport=udp;user=phone>
Allow: INVITE,ACK,BYE,REGISTER,REFER,NOTIFY,CANCEL,PRACK,OPTIONS,INFO,SUBSCRIBE,UPDATE
Content-Type: multipart/mixed;boundary=unique-boundary-1
Content-Length: 888

--unique-boundary-1
Content-Type: application/sdp

v=0
o=- 1629279 1 IN IP4 192.168.1.250
s=-
c=IN IP4 192.168.1.231
t=0 0
m=audio 5242 RTP/AVP 8 0 101 111
c=IN IP4 192.168.1.231
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:111 X-nt-inforeq/8000
a=ptime:20
a=maxptime:20
a=sendrecv

--unique-boundary-1
Content-Type: application/x-nt-mcdn-frag-hex;version=ssLinux-7.00.20;base=x2611
Content-Disposition: signal;handling=optional

0500ff01
0107130085900000a200
09090f00e9a0830001007f00
131e070011fd1800a1160201010201a1300e8005300380010181020007850104
1315070011fa0f00a10d02010102020100cc0400007a4c00
1e0403008183
460e01000a0001006400010000000000
--unique-boundary-1
Content-Type: application/x-nt-epid-frag-hex;version=ssLinux-7.00.20;base=x2611
Content-Disposition: signal;handling=optional

011201
b4:b0:17:7e:51:be
--unique-boundary-1--
<------------->
--- (17 headers 35 lines) ---
Sending to 192.168.1.250:5060 (NAT)
Using INVITE request as basis request - 95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358
Found peer 'trunk' for '4813135666;phone-context=+4812' from 192.168.1.250:5060
== Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found RTP audio format 111
Found audio description format telephone-event for ID 101
Found unknown media description format X-nt-inforeq for ID 111
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.231:5242
Looking for 25400;phone-context=myCDPdomain.myUDPdomain.ru in internal (domain smolensk.sml)

<--- Reliably Transmitting (NAT) to 192.168.1.250:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130f358-a73691f5-7d6317f2;received=192.168.1.250;rport=5060
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=7789368-fa01a8c0-13c4-55013-130f358-25eb5720-130f358
To: <sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;tag=as43970025
Call-ID: 95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358
CSeq: 1 INVITE
Server: Asterisk PBX SVN-branch-1.8-r397377
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
[Nov 6 14:29:16] NOTICE[11452]: chan_sip.c:23437 handle_request_invite: Call from 'trunk' (192.168.1.250:5060) to extension '25400' rejected because extension not found in context 'internal'.
Scheduling destruction of SIP dialog '95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.250:5060 --->
ACK sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml:5060;maddr=192.168.111.163;transport=udp;user=phone;x-nt-redirect=redirect-server SIP/2.0
From: <sip:4813135666;phone-context=+4812@smolensk.sml;user=phone>;tag=7789368-fa01a8c0-13c4-55013-130f358-25eb5720-130f358
To: <sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml;user=phone>;tag=as43970025
Call-ID: 95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358
CSeq: 1 ACK
Via: SIP/2.0/UDP 192.168.1.250:5060;branch=z9hG4bK-130f358-a73691f5-7d6317f2
Max-Forwards: 70
User-Agent: Nortel CS1000 SIP GW release_7.0 version_ssLinux-7.00.20
Contact: <sip:4813135666;phone-context=+4812@smolensk.sml:5060;maddr=192.168.1.250;transport=udp;user=phone>
Allow: INVITE,ACK,BYE,REGISTER,REFER,NOTIFY,CANCEL,PRACK,OPTIONS,INFO,SUBSCRIBE,UPDATE
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Really destroying SIP dialog '95e01c8-fa01a8c0-13c4-55013-130f358-51049562-130f358' Method: ACK

---sip.conf---

[Jack]
type=friend
host=dynamic
secret=12345
allow=alaw
allow=ulaw
allow=gsm

---extensions.conf---

exten => 25400,1,Answer()
exten => 25400,n,DumpChan(3)
exten => 25400,n,Dial(SIP/Jack,30)
exten => 25400,n,Hangup()

Re: SIP trunk

Добавлено: 06 ноя 2013, 14:59
ded
Это у вас в заголовках пакетов @smolensk.sml реально такое прибегает? Или дописываете/переписываете? И ИП адреса меняли перед тем как сюда паблишить или так и есть по внутренним - 192.168.1.250 ??
Если так и есть, то проблема резольвинга самосочинённых доменов типа smolensk.sml в конкретные внутренние ИП адреса. Смоленск должен указать свой внутрненний ДНС сервер который держит эту зону - smolensk.sml
Ну и в префиксе там
To: <sip:25400;phone-context=myCDPdomain.myUDPdomain.ru@smolensk.sml
тоже чёрти что. Ни в какой контекст не обработается.
Я бы тоже на месте Астериска сказал 404.

Re: SIP trunk

Добавлено: 06 ноя 2013, 15:11
dimaolin2
Да, именно такой invite приходит от провайдера. Изменить invite их техподдержка не может. IP не меняли, это реальный IP во внутренней сети. И про то что адрес не резолвится тех поддержки было сказано.
Вот их ответ:
--------
Добрый день!
Доменное имя smolensk.sml не ссылается в нашей АТС ни на какой IP, можете в своей АТС поставить такое же доменное имя, по определению указывается доменное имя или ip адрес
--------

Re: SIP trunk

Добавлено: 06 ноя 2013, 15:24
Vlad1983
домен тут ни при чем
[Nov 6 14:29:16] NOTICE[11452]: chan_sip.c:23437 handle_request_invite: Call from 'trunk' (192.168.1.250:5060) to extension '25400' rejected because extension not found in context 'internal'.

Re: SIP trunk

Добавлено: 06 ноя 2013, 15:26
ded
Можно попытаться
1) принять входящие на дефолтный экстен
exten => _X.,1,Dial(SIP/Jack,30)
2) если получится - то
exten => _254X.,1,Dial(DAHDI/${EXTEN:0:5})

у него

Код: Выделить всё

dialplan show 25420@internal
[ Context 'internal' created by 'pbx_config' ]
'_2542X' => 1. Answer() [pbx_config]
2. Dial(DAHDI/${EXTEN:3},50,tT) [pbx_config]
3. Hangup() [pbx_config]