diff options
author | Matthew Nicholson <mnicholson@digium.com> | 2011-08-16 14:41:23 +0000 |
---|---|---|
committer | Matthew Nicholson <mnicholson@digium.com> | 2011-08-16 14:41:23 +0000 |
commit | 8f2e8d4b8a3a6cf96b41e2e0b20651d5ccc61478 (patch) | |
tree | 4f7413c902de4f49cb3baa6c4533b5d688f7177c /channels | |
parent | 3d42d45f25d81446573a0e5d7d9c77406a35a3ba (diff) |
Merged revisions 332022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10
................
r332022 | mnicholson | 2011-08-16 09:40:37 -0500 (Tue, 16 Aug 2011) | 16 lines
In 10 and trunk this option is disabled by default.
Merged revisions 332021 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r332021 | mnicholson | 2011-08-16 09:20:43 -0500 (Tue, 16 Aug 2011) | 7 lines
Added the 'storesipcause' option to sip.conf to allow the user to disable the
setting of HASH(SIP_CAUSE,<chan name>) on the channel.
Having chan_sip set HASH(SIP_CAUSE,<chan name>) on the channel carries a
significant performance penalty because of the usage of the MASTER_CHANNEL()
dialplan function.
AST-580
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5ac741934..b017a03ed 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -746,6 +746,8 @@ static enum st_refresher global_st_refresher; /*!< Session-Timer refresher static int global_min_se; /*!< Lowest threshold for session refresh interval */ static int global_max_se; /*!< Highest threshold for session refresh interval */ +static int global_store_sip_cause; /*!< Whether the MASTER_CHANNEL(HASH(SIP_CAUSE,[chan_name])) var should be set */ + static int global_dynamic_exclude_static = 0; /*!< Exclude static peers from contact registrations */ /*@}*/ @@ -17979,6 +17981,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, " SIP realtime: Enabled\n" ); ast_cli(a->fd, " Qualify Freq : %d ms\n", global_qualifyfreq); ast_cli(a->fd, " Q.850 Reason header: %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_Q850_REASON))); + ast_cli(a->fd, " Store SIP_CAUSE: %s\n", AST_CLI_YESNO(global_store_sip_cause)); ast_cli(a->fd, "\nNetwork QoS Settings:\n"); ast_cli(a->fd, "---------------------------\n"); ast_cli(a->fd, " IP ToS SIP: %s\n", ast_tos2str(global_tos_sip)); @@ -25072,7 +25075,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as handle_response(p, respid, e + len, req, seqno); - if (p->owner) { + if (global_store_sip_cause && p->owner) { struct ast_channel *owner = p->owner; snprintf(causevar, sizeof(causevar), "MASTER_CHANNEL(HASH(SIP_CAUSE,%s))", owner->name); @@ -28108,6 +28111,7 @@ static int reload_config(enum channelreloadreason reason) global_shrinkcallerid = 1; authlimit = DEFAULT_AUTHLIMIT; authtimeout = DEFAULT_AUTHTIMEOUT; + global_store_sip_cause = FALSE; sip_cfg.matchexternaddrlocally = DEFAULT_MATCHEXTERNADDRLOCALLY; @@ -28585,6 +28589,8 @@ static int reload_config(enum channelreloadreason reason) } else { global_st_refresher = i; } + } else if (!strcasecmp(v->name, "storesipcause")) { + global_store_sip_cause = ast_true(v->value); } else if (!strcasecmp(v->name, "qualifygap")) { if (sscanf(v->value, "%30d", &global_qualify_gap) != 1) { ast_log(LOG_WARNING, "Invalid qualifygap '%s' at line %d of %s\n", v->value, v->lineno, config); |