diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-09-04 22:49:25 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-09-04 22:49:25 +0000 |
commit | 517389b1e7a57e583ed528ba1b20af7e1c84b50d (patch) | |
tree | 095060b83a0d0bbf88b6313a1be1a3aded5a82eb /res | |
parent | 3e6923c3f66d102fc3b95fe588619fb9626da7a9 (diff) |
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
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip_outbound_authenticator_digest.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c index 0a262f354..3072db18a 100644 --- a/res/res_pjsip_outbound_authenticator_digest.c +++ b/res/res_pjsip_outbound_authenticator_digest.c @@ -85,13 +85,27 @@ static int digest_create_request_with_auth(const struct ast_sip_auth_array *auth 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 = { |