diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-04 16:37:04 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-04 16:37:04 +0000 |
commit | 2a2914cb6440f9e34970b4924e232ae178038eb4 (patch) | |
tree | a81813f76cbe2188b5ed87b29bb60aea80c52c88 | |
parent | 5adacb5ab5bc7f27868c60d97d6601bec74e158f (diff) |
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)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@60083 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1418c4e48..9e11e0275 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11986,20 +11986,17 @@ static struct ast_channel *sip_request_call(const char *type, int format, void * /*! \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 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask } 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; } |