Carlos Chavez
2017-Dec-02 22:33 UTC
[asterisk-users] PJSIP Trunk 401 Unauthorized (Alestra Mexico)
??? 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
Joshua Colp
2017-Dec-02 22:40 UTC
[asterisk-users] PJSIP Trunk 401 Unauthorized (Alestra Mexico)
On Sat, Dec 2, 2017, at 06:33 PM, Carlos Chavez wrote:> ??? 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?<snip>> > 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?If you turn up the core debug to level 4 and send it to the console it will tell you what it is doing. I'd also suggest providing the endpoint definition, and confirming it was loaded as expected. If it's not then you can look at the Asterisk console at load time and it will tell you what it did not like. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org
Carlos Chavez
2017-Dec-04 17:39 UTC
[asterisk-users] PJSIP Trunk 401 Unauthorized (Alestra Mexico)
On 12/2/17 4:40 PM, Joshua Colp wrote:> On Sat, Dec 2, 2017, at 06:33 PM, Carlos Chavez wrote: >> 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? > <snip> > >> 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? > If you turn up the core debug to level 4 and send it to the console it > will tell you what it is doing. I'd also suggest providing the endpoint > definition, and confirming it was loaded as expected. If it's not then > you can look at the Asterisk console at load time and it will tell you > what it did not like. >Thank you for your help. It turns out that I did not notice that the register for the trunk had the endpoint defined there and therefore the identify section is ignored. I never got a message that the IP matched because of this. I need to keep this in mind for future reference. -- Telecomunicaciones Abiertas de M?xico S.A. de C.V. Carlos Ch?vez +52 (55)8116-9161