Продолжение этого http://asterisk-support.ru/question/67502/sip20-401-unauthorized/
sip.conf
[general]
subscribemwi=no
language=ru
nat=no
format=wav
videosupport=yes
dtmfmode=auto
relaxdtmf=yes
limitonpeers=yes
bindaddr=0.0.0.0
rtpkeepalive=5
limitonpeer=yes
bindport=5060
allowguest=no
alwaysauthreject=yes
accept_outofcall_message=yes
outofcall_message_context=messages
auth_message_requests=no
textsupport=yes
register => 74952780526$abc.ru:Passwd:74952780526@sip.abc.ru
[74952780526]
type=friend
secret=Passwd
host=sip.abc.ru
nat=no
context=incoming
insecure=invite,port
canreinvite=yes
qualify=yes
externrefresh=60
allow=all
extensions.conf
[outgoing]
exten => _8XXXXXXXXXX,1,Macro(recording,${CALLERID(num)},${EXTEN})
same => n,Set(_DYNAMIC_FEATURES=fax_rec#fax_send)
same => n,Set(CALLERID(num)=696#74997265726)
same => n,Dial(SIP/${OPERATOR}/${EXTEN},,wWtT)
same => n,Hangup()
tcpdump с работающего клиента
10:48:05.826889 IP (tos 0x0, ttl 252, id 27130, offset 0, flags [none], proto UDP (17), length 882)
109.167.231.110.5060 > 109.167.231.150.5060: SIP, length: 854
INVITE sip:84991123007@sip.abc.ru SIP/2.0
Via: SIP/2.0/UDP 109.167.231.110:5060;branch=z9hG4bK9e5d0081a42201
From: <sip:696#74997285726@sip.abc.ru>;tag=9e5d0081a4
To: <sip:84991123007@sip.abc.ru>
Call-ID: 9e43c95d-45ed-00ae-9581-0002a4040bb4@192.168.123.222
CSeq: 2201 INVITE
Supported: timer, replaces
Min-SE: 1800
Date: Mon, 11 Nov 2019 11:18:54 GMT
User-Agent: AddPac SIP Gateway
Contact: <sip:696#74997285726@109.167.231.110:5060>
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, REFER, NOTIFY, INFO
Content-Type: application/sdp
Content-Length: 244
Max-Forwards: 70
v=0
o=696#74997285726 1573471134 1573471134 IN IP4 109.167.231.110
s=AddPac Gateway SDP
c=IN IP4 109.167.231.110
t=1573471134 0
m=audio 23606 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
10:48:05.830410 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 375)
109.167.231.150.5060 > 109.167.231.110.5060: SIP, length: 347
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 109.167.231.110:5060;branch=z9hG4bK9e5d0081a42201
From: <sip:696#74997285726@sip.abc.ru>;tag=9e5d0081a4
To: <sip:84991123007@sip.abc.ru>
Call-ID: 9e43c95d-45ed-00ae-9581-0002a4040bb4@192.168.123.222
CSeq: 2201 INVITE
Contact: <sip:84991123007@109.167.231.150:5060>
Server: TS-v4.5.1-20g
Content-Length: 0
10:48:12.455960 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 697)
109.167.231.150.5060 > 109.167.231.110.5060: SIP, length: 669
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 109.167.231.110:5060;branch=z9hG4bK9e5d0081a42201
From: <sip:696#74997285726@sip.abc.ru>;tag=9e5d0081a4
To: <sip:84991123007@sip.abc.ru>;tag=540278073-3927005188-67109285-3977954595
Call-ID: 9e43c95d-45ed-00ae-9581-0002a4040bb4@192.168.123.222
CSeq: 2201 INVITE
Contact: <sip:84991123007@109.167.231.150:5060>
Content-Type: application/sdp
Server: TS-v4.5.1-20g
Content-Length: 241
v=0
o=- 1573458492 1573458492 IN IP4 109.167.231.150
s=-
c=IN IP4 109.167.231.150
t=0 0
m=audio 13194 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -
10:48:12.723723 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 280)
109.167.231.150.13194 > 109.167.231.110.23606: UDP, length 252
Дамп с астера:
16:24:50.832724 IP (tos 0x0, ttl 64, id 14361, offset 0, flags [+], proto UDP (17), length 1500)
109.167.231.118.5060 > 109.167.231.150.5060: SIP, length: 1472
INVITE sip:84991123007@sip.abc.ru SIP/2.0
Via: SIP/2.0/UDP 109.167.231.118:5060;branch=z9hG4bK1b8a212c
Max-Forwards: 70
From: <sip:696%2374952780526@109.167.231.118>;tag=as7b07d695
To: <sip:84991123007@sip.abc.ru>
Contact: <sip:696%2374952780526@109.167.231.118:5060>
Call-ID: 6685e29b013942cc68b31e6b041e5f98@109.167.231.118:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.25.1
Date: Mon, 11 Nov 2019 13:24:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 1454
v=0
o=root 234791304 234791304 IN IP4 109.167.231.118
s=Asterisk PBX 11.25.1
c=IN IP4 109.167.231.118
t=0 0
m=audio 15290 RTP/AVP 3 4 0 0 8 8 112 5 7 18 110 97 111 9 102 115 116 117 96 100 107 108 10 118 119 101
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:0 PCMU/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:110 speex/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=fmtp:116 bitrate=64000
a=rtpmap:117 speex/16000
a=rtpmap:96 SILK/8000
a=fmtp:96 maxaveragebitrate=10000
a=fmtp:96 usedtx=0
a=fmtp:96 useinbandfec=1
a=rtpmap:100[!sip]
16:24:50.832775 IP (tos 0x0, ttl 64, id 14361, offset 1480, flags [none], proto UDP (17), length 596)
109.167.231.118 > 109.167.231.150: ip-proto-17
16:24:50.840311 IP (tos 0x0, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 370)
109.167.231.150.5060 > 109.167.231.118.5060: SIP, length: 342
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 109.167.231.118:5060;branch=z9hG4bK1b8a212c
From: <sip:696#74952780526@109.167.231.118>;tag=as7b07d695
To: <sip:84991123007@sip.abc.ru>
Call-ID: 6685e29b013942cc68b31e6b041e5f98@109.167.231.118:5060
CSeq: 102 INVITE
Contact: <sip:84991123007@109.167.231.150:5060>
Server: TS-v4.5.1-20g
Content-Length: 0
16:24:50.841122 IP (tos 0x0, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 490)
109.167.231.150.5060 > 109.167.231.118.5060: SIP, length: 462
SIP/2.0 400 Bad Request
Via: SIP/2.0/UDP 109.167.231.118:5060;branch=z9hG4bK1b8a212c
From: <sip:696#74952780526@109.167.231.118>;tag=as7b07d695
To: <sip:84991123007@sip.abc.ru>;tag=2121997381-3927017220-67109285-3977954595
Call-ID: 6685e29b013942cc68b31e6b041e5f98@109.167.231.118:5060
CSeq: 102 INVITE
Contact: <sip:84991123007@109.167.231.150:5060>
Server: TS-v4.5.1-20g
Reason: MVTSLocal;cause=84;text="SIP - Invalid SDP from originator"
Content-Length: 0
16:24:51.339445 IP (tos 0x0, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 490)
109.167.231.150.5060 > 109.167.231.118.5060: SIP, length: 462
SIP/2.0 400 Bad Request
Via: SIP/2.0/UDP 109.167.231.118:5060;branch=z9hG4bK1b8a212c
From: <sip:696#74952780526@109.167.231.118>;tag=as7b07d695
To: <sip:84991123007@sip.abc.ru>;tag=2121997381-3927017220-67109285-3977954595
Call-ID: 6685e29b013942cc68b31e6b041e5f98@109.167.231.118:5060
CSeq: 102 INVITE
Contact: <sip:84991123007@109.167.231.150:5060>
Server: TS-v4.5.1-20g
Reason: MVTSLocal;cause=84;text="SIP - Invalid SDP from originator"
Content-Length: 0
16:24:51.340003 IP (tos 0x0, ttl 64, id 14455, offset 0, flags [none], proto UDP (17), length 471)
109.167.231.118.5060 > 109.167.231.150.5060: SIP, length: 443
ACK sip:84991123007@sip.abc.ru SIP/2.0
Via: SIP/2.0/UDP 109.167.231.118:5060;branch=z9hG4bK1b8a212c
Max-Forwards: 70
From: <sip:696%2374952780526@109.167.231.118>;tag=as7b07d695
To: <sip:84991123007@sip.abc.ru>;tag=2121997381-3927017220-67109285-3977954595
Contact: <sip:696%2374952780526@109.167.231.118:5060>
Call-ID: 6685e29b013942cc68b31e6b041e5f98@109.167.231.118:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.25.1
Content-Length: 0
Вижу, что данные передаются криво (From: <sip:696%2374952780526@109.167.231.118>;tag=as7b07d695), но не пойму как поправить.