Hello I have a situation with PJSIP.
- I created a TRUNK with provider for make and receive calls
If I put “auth=auth_XXXX” in section of endpoint the trunk dont receive call, the asterisk send 401.
[Log of 401]
<— Received SIP request (943 bytes) from UDP:IP_NOT_REAL:5060 —>
INVITE sip:0001@IP_NO_REAL_2:5060;line=xisfcoj SIP/2.0
Via: SIP/2.0/UDP IP_NOT_REAL:5060;rport;branch=z9hG4bKPj61616e24-affa-4599-9bd1-8348eb4cc471
From: sip:0001@10.158.0.2;tag=514eef8c-305b-495a-b579-da27c0c2d3db
To: sip:0001@IP_NO_REAL_2;line=xisfcoj
Contact: sip:0001@IP_NOT_REAL:5060
Call-ID: a7605642-57b6-4eda-86d1-0bea1afc4cca
CSeq: 6101 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER
Supported: timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Alert-Info: interno
Max-Forwards: 70
User-Agent: asterisk
Content-Type: application/sdp
Content-Length: 272
v=0
o=- 1447647912 1447647912 IN IP4 IP_NOT_REAL
s=asterisk
c=IN IP4 IP_NOT_REAL
t=0 0
m=audio 11098 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
<— Transmitting SIP response (569 bytes) to UDP:IP_NOT_REAL:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP IP_NOT_REAL:5060;rport=5060;received=IP_NOT_REAL;branch=z9hG4bKPj61616e24-affa-4599-9bd1-8348eb4cc471
Call-ID: a7605642-57b6-4eda-86d1-0bea1afc4cca
From: sip:0001@10.158.0.2;tag=514eef8c-305b-495a-b579-da27c0c2d3db
To: sip:0001@IP_NO_REAL_2;line=xisfcoj;tag=z9hG4bKPj61616e24-affa-4599-9bd1-8348eb4cc471
CSeq: 6101 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1587298335/73188e1f114143da7b020ee0721df6fe”,opaque=“5a4affa4671c8648”,algorithm=md5,qop=“auth”
Server: asterisk
Content-Length: 0
<— Received SIP request (440 bytes) from UDP:IP_NOT_REAL:5060 —>
ACK sip:0001@IP_NOT_REAL:5060;line=xisfcoj SIP/2.0
Via: SIP/2.0/UDP IP_NOT_REAL:5060;rport;branch=z9hG4bKPj61616e24-affa-4599-9bd1-8348eb4cc471
From: sip:0001@10.158.0.2;tag=514eef8c-305b-495a-b579-da27c0c2d3db
To: sip:0001@IP_NO_REAL_2;line=xisfcoj;tag=z9hG4bKPj61616e24-affa-4599-9bd1-8348eb4cc471
Call-ID: a7605642-57b6-4eda-86d1-0bea1afc4cca
CSeq: 6101 ACK
Max-Forwards: 70
User-Agent: asterisk
Content-Length: 0
END LOG.
but if dont put this the trunk work perfectly but we can send register from other ip phone with username of trunk but with any password and asterisk accept, is very insecure
Block of endpoint TRUNK provider
[0001]
type=endpoint
context=geral
disallow=all
allow=ulaw
outbound_auth=auth_0001
aors=0001
from_user=0001
;;;;;auth=auth_0001
I read all documentaion about trunk with registration, and only found rules with ACL for turn security, but we have a dynamic ips.