瀏覽代碼

uac(k): support for 407 challenge to registrations

- requested in FS#204, by Oded Resnik
(cherry picked from commit 2ac96ebcc173a2f1e601b38afa5c9bba5de8c0b5)
Daniel-Constantin Mierla 13 年之前
父節點
當前提交
13b5952b65
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      modules_k/uac/uac_reg.c

+ 3 - 3
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)
 		{