[asterisk-users] PJSIP Trunk 401 Unauthorized (Alestra Mexico)

Carlos Chavez cursor at telecomab.mx
Sat Dec 2 16:33:41 CST 2017


     I am having a really bad day trying to get incoming calls to work 
on Asterisk 13 with PJSIP.  We just migrated from Asterisk 1.8 where 
everything was working but there seems that something got lost in 
translation.  No matter what I try I always get a 401 Unauthorized 
message when receiving a call from the PSTN provider.  I can make calls 
and the registration is working.  I have tried to set the identify to an 
endpoint that does not have an auth defined.  Anyone using Alestra SIP 
trunks in Mexico?

Here is what I get on the cli:

<--- Received SIP request (1092 bytes) from UDP:200.94.59.150:5060 --->
INVITE sip:5547371276 at XXX.XXX.XXX.XXX:5060;line=qooanvj SIP/2.0
Via: SIP/2.0/UDP 200.94.59.150:5060;branch=z9hG4bKnvnkof007gngrp80d2g1.1
From: 
<sip:5567307529 at alestramex.com;user=phone>;tag=866455524-1512253376938-
To: "MEXICO USERNAME"<sip:5547371276 at asbw.alestravoip.com;line=qooanvj>
Call-ID: BW1622569380212171700499694 at 10.6.30.9
CSeq: 212444374 INVITE
Contact: <sip:5567307529 at 200.94.59.150:5060;transport=udp>
Supported: 100rel,timer
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Recv-Info: x-broadworks-client-session-info
Accept: application/media_control+xml,application/sdp,multipart/mixed
Min-SE: 90
Session-Expires: 900;refresher=uac
Max-Forwards: 9
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 287

v=0
o=BroadWorks 26026640 1 IN IP4 200.94.59.152
s=-
c=IN IP4 200.94.59.152
t=0 0
m=audio 5470 RTP/AVP 18 0 8 100
a=rtpmap:18 G729/8000
a=fmtp:18 annexb:no
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-15
a=sendrecv
a=maxptime:40

<--- Transmitting SIP response (588 bytes) to UDP:200.94.59.150:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 
200.94.59.150:5060;received=200.94.59.150;branch=z9hG4bKnvnkof007gngrp80d2g1.1
Call-ID: BW1622569380212171700499694 at 10.6.30.9
From: 
<sip:5567307529 at alestramex.com;user=phone>;tag=866455524-1512253376938-
To: "MEXICO USERNAME" 
<sip:5547371276 at asbw.alestravoip.com;line=qooanvj>;tag=z9hG4bKnvnkof007gngrp80d2g1.1
CSeq: 212444374 INVITE
WWW-Authenticate: Digest 
realm="asterisk",nonce="1512253376/546618e0645f233990bd70d97691ddba",opaque="3b5f610b33037ba2",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.18.3
Content-Length:  0


<--- Received SIP request (434 bytes) from UDP:200.94.59.150:5060 --->
ACK sip:5547371276 at XXX.XXX.XXX.XXX:5060;line=qooanvj SIP/2.0
Via: SIP/2.0/UDP 200.94.59.150:5060;branch=z9hG4bKnvnkof007gngrp80d2g1.1
CSeq: 212444374 ACK
From: 
<sip:5567307529 at alestramex.com;user=phone>;tag=866455524-1512253376938-
To: "MEXICO 
USERNAME"<sip:5547371276 at asbw.alestravoip.com;line=qooanvj>;tag=z9hG4bKnvnkof007gngrp80d2g1.1
Call-ID: BW1622569380212171700499694 at 10.6.30.9
Max-Forwards: 9
Content-Length: 0


My identify is:

=============================================
  endpoint      : Alestra
  match         : 200.94.59.150/255.255.255.255
  match_header  :
  srv_lookups   : true


It does not matter if I use the original endpoint or an endpoint with no 
auth.  Asterisk will still reject the call.  Any tips? How can I make 
sure that the identify is being used?

-- 
Telecomunicaciones Abiertas de México S.A. de C.V.
Carlos Chávez
dCAP #1349
+52-(55)8116-9161




More information about the asterisk-users mailing list