diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-10-07 08:56:59 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-10-07 08:56:59 +0000 |
commit | 6466c2ebf903662b09ef916658da432da0b233ff (patch) | |
tree | 62239f23511b98b55b116e7d96a2bda338c16e0e | |
parent | eda9434455e0217c294b90985c1eba9fc47b5ed8 (diff) |
when possible, use ast_set2_flags instead of ast_set/ast_clr .
Also mark XXX some dubious places.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2c7007c63..f013d7406 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -15268,20 +15268,11 @@ static struct sip_user *build_user(const char *name, struct ast_variable *v, int if (user->maxcallbitrate < 0) user->maxcallbitrate = default_maxcallbitrate; } else if (!strcasecmp(v->name, "t38pt_udptl")) { - if (ast_true(v->value)) { - ast_set_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_UDPTL); - } else - ast_clear_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_UDPTL); + ast_set2_flag(&user->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_UDPTL); } else if (!strcasecmp(v->name, "t38pt_rtp")) { - if (ast_true(v->value)) { - ast_set_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_RTP); - } else - ast_clear_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_RTP); + ast_set2_flag(&user->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_RTP); } else if (!strcasecmp(v->name, "t38pt_tcp")) { - if (ast_true(v->value)) { - ast_set_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_TCP); - } else - ast_clear_flag(&user->flags[1], SIP_PAGE2_T38SUPPORT_TCP); + ast_set2_flag(&user->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_TCP); } } ast_copy_flags(&user->flags[0], &userflags[0], mask[0].flags); @@ -15582,20 +15573,11 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str if (peer->maxcallbitrate < 0) peer->maxcallbitrate = default_maxcallbitrate; } else if (!strcasecmp(v->name, "t38pt_udptl")) { - if (ast_true(v->value)) { - ast_set_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_UDPTL); - } else - ast_clear_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_UDPTL); + ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_UDPTL); } else if (!strcasecmp(v->name, "t38pt_rtp")) { - if (ast_true(v->value)) { - ast_set_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_RTP); - } else - ast_clear_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_RTP); + ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_RTP); } else if (!strcasecmp(v->name, "t38pt_tcp")) { - if (ast_true(v->value)) { - ast_set_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_TCP); - } else - ast_clear_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT_TCP); + ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_T38SUPPORT_TCP); } } if (!ast_test_flag(&global_flags[1], SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC) && realtime) { @@ -15863,7 +15845,7 @@ static int reload_config(enum channelreloadreason reason) default_expiry = atoi(v->value); if (default_expiry < 1) default_expiry = DEFAULT_DEFAULT_EXPIRY; - } else if (!strcasecmp(v->name, "sipdebug")) { + } else if (!strcasecmp(v->name, "sipdebug")) { /* XXX maybe ast_set2_flags ? */ if (ast_true(v->value)) ast_set_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONFIG); } else if (!strcasecmp(v->name, "dumphistory")) { @@ -15964,19 +15946,19 @@ static int reload_config(enum channelreloadreason reason) default_maxcallbitrate = atoi(v->value); if (default_maxcallbitrate < 0) default_maxcallbitrate = DEFAULT_MAX_CALL_BITRATE; - } else if (!strcasecmp(v->name, "t38pt_udptl")) { + } else if (!strcasecmp(v->name, "t38pt_udptl")) { /* XXX maybe ast_set2_flags ? */ if (ast_true(v->value)) { ast_set_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT_UDPTL); } - } else if (!strcasecmp(v->name, "t38pt_rtp")) { + } else if (!strcasecmp(v->name, "t38pt_rtp")) { /* XXX maybe ast_set2_flags ? */ if (ast_true(v->value)) { ast_set_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT_RTP); } - } else if (!strcasecmp(v->name, "t38pt_tcp")) { + } else if (!strcasecmp(v->name, "t38pt_tcp")) { /* XXX maybe ast_set2_flags ? */ if (ast_true(v->value)) { ast_set_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT_TCP); } - } else if (!strcasecmp(v->name, "rfc2833compensate")) { + } else if (!strcasecmp(v->name, "rfc2833compensate")) { /* XXX maybe ast_set2_flags ? */ if (ast_true(v->value)) { ast_set_flag(&global_flags[1], SIP_PAGE2_RFC2833_COMPENSATE); } |