Форвард звонка - Unauthorized
Добавлено: 26 ноя 2024, 11:47
Всем доброго дня!
Имеем Asterisk 18.10.0. На нем есть транк в сторону провайдера, и есть транк в сторону АТС AVAYA.
Схематично так:
AVAYA(192.168.30.2+192.168.30.3)<--sip-->ASTERISK(192.168.28.5)<--sip-->ПРОВАЙДЕР
| |
телефон1 телефон2
На телефоне1 настроен форвард на сотовый(т.е. в город через провайдера транзитом через Asterisk) после 2 гудков.
Если позвонить с телефона2 на телефон1, то на телефоне1 происходит форвард, который направляет звонок обратно на Asterisk, и далее на Asterisk происходит реджект, т.к. звонок возвращается с номера теоефона2, и для Asterisk он получается Unauthorized, т.к. этот же номер зарегистрирован на этом же Asterisk. Звонок к провайдеру не отправляется.
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 181 Call Is Being Forwarded
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Server: Avaya CM/R015x.02.1.016.4
Contact: "Ivanov Dmitriy" <sip:3308@192.168.30.2:5090;transport=tcp>
P-Asserted-Identity: "Ivanov Dmitriy" <sip:3308@hevel.company.ru:5090>
Accept-Language: en
Supported: timer, replaces, join, histinfo
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Content-Type: application/sdp
Content-Length: 163
v=0
o=- 1 2 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2080 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
<------------->
--- (15 headers 9 lines) ---
sip_route_dump: route/path hop: <sip:192.168.30.2:5090;lr;transport=tcp>
<--- Transmitting (no NAT) to 192.168.33.59:57125 --->
SIP/2.0 181 Call is being forwarded
Via: SIP/2.0/UDP 192.168.33.59:57125;branch=z9hG4bKPjc419d4595e4a4112b2dad938729da9cc;received=192.168.33.59;rport=57125
From: <sip:3605@192.168.28.5>;tag=bb076907d1cb4e22ac5ae1908c570168
To: <sip:3308@192.168.28.5>;tag=as745b3981
Call-ID: ddc81c6907a9474e8e75116695066fe3
CSeq: 17416 INVITE
Server: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:3308@192.168.28.5:5060>
Content-Length: 0
<------------>
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 183 Session Progress
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Server: Avaya CM/R015x.02.1.016.4
Contact: "Ivanov Dmitriy" <sip:3308@192.168.30.2:5090;transport=tcp>
P-Asserted-Identity: "MicroSIP" <sip:3605@hevel.company.ru:5090>
Accept-Language: en
Supported: timer, replaces, join, histinfo
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Content-Type: application/sdp
Content-Length: 163
v=0
o=- 1 2 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2080 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
<------------->
--- (15 headers 9 lines) ---
sip_route_dump: route/path hop: <sip:192.168.30.2:5090;lr;transport=tcp>
Comparing SDP version 2 -> 2 and unique parts [- 1 IN IP4 192.168.30.2] -> [- 1 IN IP4 192.168.30.2]
<--- SIP read from TCP:192.168.30.2:10248 --->
INVITE sip:89171234567@192.168.28.5 SIP/2.0
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5
Call-ID: 80b8abfd1fabef1ee17674591e400
CSeq: 1 INVITE
Max-Forwards: 69
Route: <sip:192.168.28.5;lr;phase=terminating;transport=tcp>
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Date: Tue, 26 Nov 2024 08:25:29 GMT
User-Agent: Avaya CM/R015x.02.1.016.4
Supported: timer, replaces, join, histinfo, 100rel
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Contact: "MicroSIP" <sip:3605@192.168.30.2:5090;transport=tcp>
Session-Expires: 1200;refresher=uac
Min-SE: 1200
P-Asserted-Identity: "MicroSIP" <sip:3605@192.168.28.5>
Content-Type: application/sdp
History-Info: <sip:3308@hevel.company.ru>;index=1
History-Info: "Ivanov Dmitriy" <sip:3308@hevel.company.ru?Reason=SIP%3Bcause%3D480%3Btext%3D%22Temporarily%20Unavailable%22&Reason=Redirection%3Bcause%3DNORMAL%3Bavaya-cm-reason%3D%22cover-no-reply%22>;index=1.1
History-Info: <sip:089171234567@hevel.company.ru>;index=2.1
Alert-Info: <cid:internal@invalid.unknown.domain>;avaya-cm-alert-type=internal
Content-Length: 234
v=0
o=- 1 1 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2054 RTP/AVP 8 0 18 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
<------------->
--- (24 headers 12 lines) ---
Sending to 192.168.30.2:5090 (no NAT)
Sending to 192.168.30.2:5090 (no NAT)
Using INVITE request as basis request - 80b8abfd1fabef1ee17674591e400
Found peer '3605' for '3605' from 192.168.30.2:10248
<--- Reliably Transmitting (no NAT) to 192.168.30.2:5090 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400;received=192.168.30.2
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5;tag=as43cbf155
Call-ID: 80b8abfd1fabef1ee17674591e400
CSeq: 1 INVITE
Server: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="743a7a33"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '80b8abfd1fabef1ee17674591e400' in 6400 ms (Method: INVITE)
<--- SIP read from TCP:192.168.30.2:10248 --->
ACK sip:89171234567@192.168.28.5 SIP/2.0
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5;tag=as43cbf155
Call-ID: 80b8abfd1fabef1ee17674591e400
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400;received=192.168.30.2
CSeq: 1 ACK
Max-Forwards: 70
Route: <sip:192.168.28.5;lr;phase=terminating;transport=tcp>
User-Agent: Avaya CM/R015x.02.1.016.4
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 486 Busy Here
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Server: Avaya CM/R015x.02.1.016.4
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
Transmitting (no NAT) to 192.168.30.2:5090:
ACK sip:3308@192.168.30.2:5090;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Max-Forwards: 70
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2:5090>;tag=80aa84f61fabef1eb17674591e400
Contact: <sip:3605@192.168.28.5:5060;transport=tcp>
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Content-Length: 0
Если заранее номер вызываемого изменить на Asterisk в момент отправления звонка на Avaya, то обратно после форварда он так же возвращается с несуществующего на Asterisk номера и спокойно уходит к провайдеру. Но данный подход неприменим, т.к. звонки с Asterisk на Avaya должны ходить без изменения номера.
Я был бы очень благодарен за помощь, как разрулить данную ситуацию.
Имеем Asterisk 18.10.0. На нем есть транк в сторону провайдера, и есть транк в сторону АТС AVAYA.
Схематично так:
AVAYA(192.168.30.2+192.168.30.3)<--sip-->ASTERISK(192.168.28.5)<--sip-->ПРОВАЙДЕР
| |
телефон1 телефон2
На телефоне1 настроен форвард на сотовый(т.е. в город через провайдера транзитом через Asterisk) после 2 гудков.
Если позвонить с телефона2 на телефон1, то на телефоне1 происходит форвард, который направляет звонок обратно на Asterisk, и далее на Asterisk происходит реджект, т.к. звонок возвращается с номера теоефона2, и для Asterisk он получается Unauthorized, т.к. этот же номер зарегистрирован на этом же Asterisk. Звонок к провайдеру не отправляется.
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 181 Call Is Being Forwarded
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Server: Avaya CM/R015x.02.1.016.4
Contact: "Ivanov Dmitriy" <sip:3308@192.168.30.2:5090;transport=tcp>
P-Asserted-Identity: "Ivanov Dmitriy" <sip:3308@hevel.company.ru:5090>
Accept-Language: en
Supported: timer, replaces, join, histinfo
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Content-Type: application/sdp
Content-Length: 163
v=0
o=- 1 2 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2080 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
<------------->
--- (15 headers 9 lines) ---
sip_route_dump: route/path hop: <sip:192.168.30.2:5090;lr;transport=tcp>
<--- Transmitting (no NAT) to 192.168.33.59:57125 --->
SIP/2.0 181 Call is being forwarded
Via: SIP/2.0/UDP 192.168.33.59:57125;branch=z9hG4bKPjc419d4595e4a4112b2dad938729da9cc;received=192.168.33.59;rport=57125
From: <sip:3605@192.168.28.5>;tag=bb076907d1cb4e22ac5ae1908c570168
To: <sip:3308@192.168.28.5>;tag=as745b3981
Call-ID: ddc81c6907a9474e8e75116695066fe3
CSeq: 17416 INVITE
Server: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:3308@192.168.28.5:5060>
Content-Length: 0
<------------>
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 183 Session Progress
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Server: Avaya CM/R015x.02.1.016.4
Contact: "Ivanov Dmitriy" <sip:3308@192.168.30.2:5090;transport=tcp>
P-Asserted-Identity: "MicroSIP" <sip:3605@hevel.company.ru:5090>
Accept-Language: en
Supported: timer, replaces, join, histinfo
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Content-Type: application/sdp
Content-Length: 163
v=0
o=- 1 2 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2080 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
<------------->
--- (15 headers 9 lines) ---
sip_route_dump: route/path hop: <sip:192.168.30.2:5090;lr;transport=tcp>
Comparing SDP version 2 -> 2 and unique parts [- 1 IN IP4 192.168.30.2] -> [- 1 IN IP4 192.168.30.2]
<--- SIP read from TCP:192.168.30.2:10248 --->
INVITE sip:89171234567@192.168.28.5 SIP/2.0
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5
Call-ID: 80b8abfd1fabef1ee17674591e400
CSeq: 1 INVITE
Max-Forwards: 69
Route: <sip:192.168.28.5;lr;phase=terminating;transport=tcp>
Record-Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Date: Tue, 26 Nov 2024 08:25:29 GMT
User-Agent: Avaya CM/R015x.02.1.016.4
Supported: timer, replaces, join, histinfo, 100rel
Allow: INVITE, CANCEL, BYE, ACK, PRACK, SUBSCRIBE, NOTIFY, REFER, OPTIONS, INFO, PUBLISH
Contact: "MicroSIP" <sip:3605@192.168.30.2:5090;transport=tcp>
Session-Expires: 1200;refresher=uac
Min-SE: 1200
P-Asserted-Identity: "MicroSIP" <sip:3605@192.168.28.5>
Content-Type: application/sdp
History-Info: <sip:3308@hevel.company.ru>;index=1
History-Info: "Ivanov Dmitriy" <sip:3308@hevel.company.ru?Reason=SIP%3Bcause%3D480%3Btext%3D%22Temporarily%20Unavailable%22&Reason=Redirection%3Bcause%3DNORMAL%3Bavaya-cm-reason%3D%22cover-no-reply%22>;index=1.1
History-Info: <sip:089171234567@hevel.company.ru>;index=2.1
Alert-Info: <cid:internal@invalid.unknown.domain>;avaya-cm-alert-type=internal
Content-Length: 234
v=0
o=- 1 1 IN IP4 192.168.30.2
s=-
c=IN IP4 192.168.30.3
b=AS:64
t=0 0
m=audio 2054 RTP/AVP 8 0 18 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
<------------->
--- (24 headers 12 lines) ---
Sending to 192.168.30.2:5090 (no NAT)
Sending to 192.168.30.2:5090 (no NAT)
Using INVITE request as basis request - 80b8abfd1fabef1ee17674591e400
Found peer '3605' for '3605' from 192.168.30.2:10248
<--- Reliably Transmitting (no NAT) to 192.168.30.2:5090 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400;received=192.168.30.2
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5;tag=as43cbf155
Call-ID: 80b8abfd1fabef1ee17674591e400
CSeq: 1 INVITE
Server: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="743a7a33"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '80b8abfd1fabef1ee17674591e400' in 6400 ms (Method: INVITE)
<--- SIP read from TCP:192.168.30.2:10248 --->
ACK sip:89171234567@192.168.28.5 SIP/2.0
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=80b8abfd1fabef1ed17674591e400
To: sip:89171234567@192.168.28.5;tag=as43cbf155
Call-ID: 80b8abfd1fabef1ee17674591e400
Via: SIP/2.0/TCP 192.168.30.2:5090;branch=z9hG4bK80b8abfd1fabef1ef17674591e400;received=192.168.30.2
CSeq: 1 ACK
Max-Forwards: 70
Route: <sip:192.168.28.5;lr;phase=terminating;transport=tcp>
User-Agent: Avaya CM/R015x.02.1.016.4
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
<--- SIP read from TCP:192.168.30.2:5090 --->
SIP/2.0 486 Busy Here
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2>;tag=80aa84f61fabef1eb17674591e400
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 INVITE
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Server: Avaya CM/R015x.02.1.016.4
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
Transmitting (no NAT) to 192.168.30.2:5090:
ACK sip:3308@192.168.30.2:5090;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.28.5:5060;branch=z9hG4bK2936b058
Route: <sip:192.168.30.2:5090;lr;transport=tcp>
Max-Forwards: 70
From: "MicroSIP" <sip:3605@192.168.28.5>;tag=as140ee313
To: <sip:3308@192.168.30.2:5090>;tag=80aa84f61fabef1eb17674591e400
Contact: <sip:3605@192.168.28.5:5060;transport=tcp>
Call-ID: 5bf67d55510df5da4538bb756a0f4249@192.168.28.5:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 18.10.0~dfsg+~cs6.10.40431411-2
Content-Length: 0
Если заранее номер вызываемого изменить на Asterisk в момент отправления звонка на Avaya, то обратно после форварда он так же возвращается с несуществующего на Asterisk номера и спокойно уходит к провайдеру. Но данный подход неприменим, т.к. звонки с Asterisk на Avaya должны ходить без изменения номера.
Я был бы очень благодарен за помощь, как разрулить данную ситуацию.