[asterisk-commits] russell: branch 1.2 r60083 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 4 09:37:04 MST 2007


Author: russell
Date: Wed Apr  4 11:37:04 2007
New Revision: 60083

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60083
Log:
Fix the return value of handle_common_options() so that it always properly
indicates whether it handled the option or not.  
(issue #9455, reported by Netview, fixed by me)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=60083&r1=60082&r2=60083
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed Apr  4 11:37:04 2007
@@ -11986,20 +11986,17 @@
 /*! \brief  handle_common_options: Handle flag-type options common to users and peers ---*/
 static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask, struct ast_variable *v)
 {
-	int res = 0;
+	int res = 1;
 
 	if (!strcasecmp(v->name, "trustrpid")) {
 		ast_set_flag(mask, SIP_TRUSTRPID);
 		ast_set2_flag(flags, ast_true(v->value), SIP_TRUSTRPID);
-		res = 1;
 	} else if (!strcasecmp(v->name, "sendrpid")) {
 		ast_set_flag(mask, SIP_SENDRPID);
 		ast_set2_flag(flags, ast_true(v->value), SIP_SENDRPID);
-		res = 1;
 	} else if (!strcasecmp(v->name, "useclientcode")) {
 		ast_set_flag(mask, SIP_USECLIENTCODE);
 		ast_set2_flag(flags, ast_true(v->value), SIP_USECLIENTCODE);
-		res = 1;
 	} else if (!strcasecmp(v->name, "dtmfmode")) {
 		ast_set_flag(mask, SIP_DTMF);
 		ast_clear_flag(flags, SIP_DTMF);
@@ -12086,8 +12083,8 @@
 	} else if (!strcasecmp(v->name, "promiscredir")) {
 		ast_set_flag(mask, SIP_PROMISCREDIR);
 		ast_set2_flag(flags, ast_true(v->value), SIP_PROMISCREDIR);
-		res = 1;
-	}
+	} else
+		res = 0;
 
 	return res;
 }



More information about the asterisk-commits mailing list