[asterisk-commits] mmichelson: trunk r398300 - in /trunk: ./ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 4 17:49:26 CDT 2013


Author: mmichelson
Date: Wed Sep  4 17:49:25 2013
New Revision: 398300

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398300
Log:
Give more detail regarding failures to create request with auth credentials.

(issue ASTERISK-22386)
........

Merged revisions 398299 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_outbound_authenticator_digest.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Sep  4 17:49:25 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398198,398206,398215,398226,398237,398283,398286
+/branches/12:1-398198,398206,398215,398226,398237,398283,398286,398299

Modified: trunk/res/res_pjsip_outbound_authenticator_digest.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_outbound_authenticator_digest.c?view=diff&rev=398300&r1=398299&r2=398300
==============================================================================
--- trunk/res/res_pjsip_outbound_authenticator_digest.c (original)
+++ trunk/res/res_pjsip_outbound_authenticator_digest.c Wed Sep  4 17:49:25 2013
@@ -85,13 +85,27 @@
 		return -1;
 	}
 
-	if (pjsip_auth_clt_reinit_req(&auth_sess, challenge,
-				tsx->last_tx, new_request) != PJ_SUCCESS) {
-		ast_log(LOG_WARNING, "Failed to create new request with authentication credentials\n");
-		return -1;
+	switch (pjsip_auth_clt_reinit_req(&auth_sess, challenge,
+				tsx->last_tx, new_request)) {
+	case PJ_SUCCESS:
+		return 0;
+	case PJSIP_ENOCREDENTIAL:
+		ast_log(LOG_WARNING, "Unable to create request with auth."
+				"No auth credentials for any realms in challenge.\n");
+		break;
+	case PJSIP_EAUTHSTALECOUNT:
+		ast_log(LOG_WARNING, "Unable to create request with auth."
+				"Number of stale retries exceeded\n");
+		break;
+	case PJSIP_EFAILEDCREDENTIAL:
+		ast_log(LOG_WARNING, "Authentication credentials not accepted by server\n");
+		break;
+	default:
+		ast_log(LOG_WARNING, "Unable to create request with auth. Unknown failure\n");
+		break;
 	}
 
-	return 0;
+	return -1;
 }
 
 static struct ast_sip_outbound_authenticator digest_authenticator = {




More information about the asterisk-commits mailing list