소스 검색

modules/registrar: fixes to checking of Require: and Supported: headers for outbound

Peter Dunkley 12 년 전
부모
커밋
c9f8bfdf7a
2개의 변경된 파일13개의 추가작업 그리고 11개의 파일을 삭제
  1. 2 1
      modules/registrar/reply.c
  2. 11 10
      modules/registrar/save.c

+ 2 - 1
modules/registrar/reply.c

@@ -673,7 +673,8 @@ int reg_send_reply(struct sip_msg* _m)
 			if (add_supported(_m, &outbound_str) < 0)
 				return -1;
 
-			if (get_require(_m) & F_OPTION_TAG_OUTBOUND) {
+			if ((get_require(_m) & F_OPTION_TAG_OUTBOUND)
+			    || (get_supported(_m) & F_OPTION_TAG_OUTBOUND)) {
 				if (add_require(_m, &outbound_str) < 0)
 					return -1;
 

+ 11 - 10
modules/registrar/save.c

@@ -865,7 +865,7 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 	}
 
 	if (parse_require(_m) == 0) {
-		if (!(get_require(_m) & F_OPTION_TAG_OUTBOUND)
+		if ((get_require(_m) & F_OPTION_TAG_OUTBOUND)
 				&& reg_outbound_mode == REG_OUTBOUND_NONE) {
 			LM_WARN("Outbound required by UAC and not supported by server\n");
 			rerrno = R_OB_REQD;
@@ -908,17 +908,18 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 			goto error;
 		}
 
-		if (use_ob == 0 && (get_supported(_m) & F_OPTION_TAG_OUTBOUND)
-			&& contact->reg_id) {
-			LM_WARN("Outbound used by UAC but not supported by edge proxy\n");
-			rerrno = R_OB_UNSUP_EDGE;
-			goto error;
-		} else {
-			/* ignore ;reg-id parameter */
-			use_regid = 0;
+		if (use_ob == 0) {
+			if ((get_supported(_m) & F_OPTION_TAG_OUTBOUND)
+			    && contact->reg_id) {
+				LM_WARN("Outbound used by UAC but not supported by edge proxy\n");
+				rerrno = R_OB_UNSUP_EDGE;
+				goto error;
+			} else {
+				/* ignore ;reg-id parameter */
+				use_regid = 0;
+			}
 		}
 	}
-
 	
 	get_act_time();
 	c = get_first_contact(_m);