Hi, I have a problem with a sip trunk or my provider configured on asterisk 13.22 over chan_sip. I have configured sip trunk over ip with tls , the outgoing calls work fine, but asterisk refuse the call with a SIP/2.0 401 Unauthorized. The configuration of sip trunk:
[SBC]
disallow=all
type=peer
transport=tls
insecure=port,invite
qualify=yes
host=ip_oftrunk
encryption=yes
context=from-trunk
allow=alaw
nat=force_rport,comedia
port=5061
dtmfmode=auto
here art a sip trace of invite, obiosly i changed the private data of ips domains etc:
<— SIP read from TLS:XXXXX:35780 —>
INVITE sip:91XXXXXX@pbx-corpXXX.com:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS X.X.X.X:5061;branch=z9hG4bKo6899u2068notcra7130.1
To: sip:9XXXX@pbx-corp.XXX.com
From: sip:91XXXXX@smtXXXXX;user=phone;tag=lm4q4zyj-23dhxr;correlation-id=55751636
Call-ID: 192.168.126.41_55959020_6526775462368711112
CSeq: 1 INVITE
Max-Forwards: 62
Content-Length: 382
Contact: sip:smtcXXXXs:5061;fid=fid_1;transport=tls
Content-Type: application/sdp
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, PRACK
Accept: application/sdp
Supported: histinfo, timer
P-Asserted-Identity: sip:9XXXXXX@smtcXXXX;user=phone
Min-SE: 180
Session-Expires: 1800; refresher=uac
P-Acme-Vsa: 200:c020.s20.icx.XXX.net
P-Early-Media: supported
X-CND: 5283349168674273844250
v=0
o=- 11849918 11849918 IN IP4 X.X.X.X
s=-
c=IN IP4 X.X.X.X
t=0 0
a=sendrecv
m=audio 22146 RTP/SAVP 8 18 96
c=IN IP4 X.X.X.X
b=RR:3000
b=RS:1000
b=AS:128
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=maxptime:40
a=ptime:20
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZDQ6OYPfcARbHk8+Pv01SBlFQjSgXUeNoHcX3xxJ
<------------->
— (19 headers 18 lines) —
Sending to X.X.X.X:35780 (NAT)
Sending to X.X.X.X:35780 (NAT)
Using INVITE request as basis request - 192.168.126.41_55959020_6526775462368711112
No matching peer for ‘916XXXXXX’ from ‘X.X:X.X:35780’
I think that problem are that the calls arrive with the origing port 35780, because if i changed port=5061 by port=35780 asterisk accept the call…
by the way, when I changed the sip trunk name SBC BY number that calling 91XXXXXX, asterisk accept the call. Im confused because asterisk should accept the call of any port with insecure=port,invite, and accept the call by ip defined host=X.X.X.X. Any ideas?
SBC X.X.X.X Yes Yes A 5061 OK (24 ms)
Thanks