Module: sip-router Branch: master Commit: 2ac96ebcc173a2f1e601b38afa5c9bba5de8c0b5 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2ac96ebc...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Sat Mar 3 12:34:38 2012 +0100
uac(k): support for 407 challenge to registrations
- requested in FS#204, by Oded Resnik
---
modules_k/uac/uac_reg.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules_k/uac/uac_reg.c b/modules_k/uac/uac_reg.c index c25712f..d944a10 100644 --- a/modules_k/uac/uac_reg.c +++ b/modules_k/uac/uac_reg.c @@ -529,7 +529,7 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) } }
- if(ps->code == 401) + if(ps->code == 401 || ps->code == 407) { if(ri->flags & UAC_REG_AUTHSENT) { @@ -539,7 +539,7 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) ri->flags |= UAC_REG_DISABLED; goto done; } - hdr = get_autenticate_hdr(ps->rpl, 401); + hdr = get_autenticate_hdr(ps->rpl, ps->code); if (hdr==0) { LM_ERR("failed to extract authenticate hdr\n"); @@ -569,7 +569,7 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) s_ruri.s = b_ruri; s_ruri.len = strlen(s_ruri.s);
do_uac_auth(&method, &s_ruri, &cred, &auth, response); - new_auth_hdr=build_authorization_hdr(401, &s_ruri, &cred, + new_auth_hdr=build_authorization_hdr(ps->code, &s_ruri, &cred, &auth, response); if (new_auth_hdr==0) {