<div dir="ltr"><div>Hi George,</div><div><br></div>Well, as it turns out the removal of "realm" in sonnyGW1_auth above does not remove the issue. I still see the issue. I did not see the issue earlier likely due to the CLI logging command mixup which I have now solved using a wireshark trace (CLI was just too verbose). I see the 407 authentication required still, and the following pattern just repeats at the Asterisk server (which is connected to the SIP trunk at 65.254.44.194) because the SIP trunk needs it to complete the outbound call, but the Asterisk server doesn't ever send it even after the 407 from the SIP trunk:<div><br></div><div>Wireshark trace of failed outbound call:<br><div><br></div><div><div> 217274 5915.986472000 sonnysMachine 65.254.44.194 SIP/SDP 1227 Request: INVITE <a href="http://sip:16175551212@65.254.44.194:5060">sip:16175551212@65.254.44.194:5060</a> |</div><div> 217280 5916.059148000 65.254.44.194 sonnysMachine SIP 385 Status: 100 Trying | </div><div> 217282 5916.059909000 65.254.44.194 sonnysMachine SIP 582 Status: 407 Proxy Authentication Required | </div><div> 217285 5916.060227000 sonnysMachine 65.254.44.194 SIP 425 Request: ACK <a href="http://sip:16175551212@65.254.44.194:5060">sip:16175551212@65.254.44.194:5060</a> |</div></div><div>...</div><div>(repeats ad infinitum)</div><div><br></div><div>When I look at the challenge in 407 Proxy Authentication Required from the server, I see that the realm is 65.254.44.194 (<a href="http://gw1.sip.us">gw1.sip.us</a>), but the appropriate Authorization (sent in the trunk registration, for example) is never sent back from the Asterisk server. Here's what the SIP trunk actually says (407 Auth required message; the nonce was changed by me):</div><div><br></div><div>Wireshark detail of 407 Proxy Authentication Required packet from SIP trunk:<br></div><div><br></div><div><div>Proxy-Authenticate: Digest realm="65.254.44.194", nonce="BLUBBERbbb/e495019b-83b4-491c-8f33-3e238a3c6af2", qop="auth"</div><div> Authentication Scheme: Digest</div><div> Realm: "65.254.44.194"</div><div> Nonce Value: "BLUBBERbbb/e495019b-83b4-491c-8f33-3e238a3c6af2"</div><div> QOP: "auth"</div></div><div><br></div><div>And here's how the SIP trunk registration works (correctly); note the bigger REGISTER message in the 3rd line pertaining to the registration at 65.254.44.194, it pertains to the additional 274 bytes of authentication information:</div><div><div><br></div><div>Wireshark detail of successful SIP trunk registration:</div><div><br></div><div> 12634 230.390420000 sonnysMachine 65.254.44.194 SIP 543 Request: REGISTER sip:<a href="http://gw1.sip.us">gw1.sip.us</a> (fetch bindings) |<br></div><div><div> 12635 230.461572000 65.254.44.194 sonnysMachine SIP 560 Status: 401 Unauthorized (0 bindings) | </div><div> 12637 230.462041000 sonnysMachine 65.254.44.194 SIP 815 Request: REGISTER sip:<a href="http://gw1.sip.us">gw1.sip.us</a> (fetch bindings) | </div><div> 12639 230.535100000 65.254.44.194 sonnysMachine SIP 486 Status: 200 OK (0 bindings) |</div></div></div><div><br></div></div><div>Any help is deeply appreciated.</div><div><br></div><div>Has anyone successfully done SIP trunk registration with PJSIP in Asterisk 13.1.0?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 15, 2015 at 12:34 PM, Sonny Rajagopalan <span dir="ltr"><<a href="mailto:sonny.rajagopalan@gmail.com" target="_blank">sonny.rajagopalan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That was the issue, thanks. I now am able to get the caller ringing on an outbound call, but an external phone number (E164) I am dialing does not ring.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 15, 2015 at 12:19 PM, George Joseph <span dir="ltr"><<a href="mailto:george.joseph@fairview5.com" target="_blank">george.joseph@fairview5.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 15, 2015 at 8:32 AM, Sonny Rajagopalan <span dir="ltr"><<a href="mailto:sonny.rajagopalan@gmail.com" target="_blank">sonny.rajagopalan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have setup my Asterisk 13.1.0 server with PJSIP on AWS/EC2. My basic configuration works, and I am connected to a SIP trunk using <a href="http://SIP.US" target="_blank">SIP.US</a>, and have set up my inbound calling which works correctly (when I call my PBX DID, the call does come into my PBX network).<div><br></div><div>The issue is that I am not able to make outbound calls, because the call fails with the error: </div><div><br></div><div><div>res_pjsip_outbound_authenticator_digest.c:125 digest_create_request_with_auth: Unable to create request with auth.No auth credentials for any realms in challenge.<br></div></div><div><br></div><div>CLI> pjsip show endpoint sonnyGW1<br></div><div><div><br></div><div>... =========================================================================================<br></div><div><br></div><div> Endpoint: sonnyGW1 Not in use 0 of inf</div><div> OutAuth: sonnyGW1_auth/sonny </div><div> Aor: sonnyGW1 0</div><div> Contact: sonnyGW1/sip:<a href="http://65.254.44.194:5060" target="_blank">65.254.44.194:5060</a> Unknown nan</div><div> Transport: transport-udp udp 0 0 <a href="http://0.0.0.0:5060" target="_blank">0.0.0.0:5060</a></div><div> Identify: sonnyGW1/sonnyGW1</div><div> Match: <a href="http://65.254.44.194/32" target="_blank">65.254.44.194/32</a></div></div><div><br></div><div>My pjsip.conf is as below<br></div><div><br></div><div><div>[sonnyGW1]</div><div>type=registration</div><div>transport=transport-udp</div><div>outbound_auth=sonnyGW1_auth</div><div>server_uri=sip:<a href="http://gw1.sip.us" target="_blank">gw1.sip.us</a></div><div>client_uri=<a href="mailto:sip%3Asonny@gw1.sip.us" target="_blank">sip:sonny@gw1.sip.us</a></div><div>contact_user=sonny</div><div>retry_interval=60</div><div>forbidden_retry_interval=600</div><div>expiration=3600</div><div><br></div><div>[sonnyGW1_auth]</div><div>type=auth</div><div>auth_type=userpass</div><div>password=somepassword</div><div>username=sonny</div><div>realm=<a href="http://gw1.sip.us" target="_blank">gw1.sip.us</a></div></div></div></blockquote><div><br></div><div>You probably need to remove the 'realm' line so that it will match any realm in the challenge.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br></div><div>[sonnyGW1]</div><div>type=aor</div><div>contact=sip:<a href="http://65.254.44.194:5060" target="_blank">65.254.44.194:5060</a></div><div><br></div><div>[sonnyGW1]</div><div>type=endpoint</div><div>transport=transport-udp</div><div>context=gateway1</div><div>allow=!all,ulaw</div><div>outbound_auth=sonnyGW1_auth</div><div>aors=sonnyGW1</div><div><br></div><div>[sonnyGW1]</div><div>type=identify</div><div>endpoint=sonnyGW1</div><div>match=65.254.44.194</div></div><div><br></div><div>My extensions.conf stub for the appropriate section looks like this (from <a href="https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels</a>) :</div><div><br></div><div><div>exten => _9XXXX.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:1} through gateway1)</div><div>exten => _9XXXX.,n,Dial(PJSIP/${EXTEN:1}@sonnyGW1)</div><div>; Have also tried</div><div>; exten => _9XXXX.,n,Dial(PJSIP/sip:${<a>EXTEN:1}@65.254.44.194:5060</a>)</div><div>exten => _9XXXX.,n,Playtones(congestion)</div><div>exten => _9XXXX.,n,Hangup()</div></div><div><br></div><div>I do know that this code is being executed as I see the log in the first line above.</div><div><br></div><div>Have I correctly set up authentication for outbound calling?</div><div><br></div><div>Any help appreciated. Thanks!</div></div><span class="HOEnZb"><font color="#888888"><span><font color="#888888">
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></font></span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br></font></span></div></div><span class="HOEnZb"><font color="#888888">
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></font></span></blockquote></div><br></div>
</blockquote></div><br></div>