diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-24 13:57:45 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-24 13:57:45 +0000 |
commit | 93df440b0adf0b32f954e6a807701e78a7639566 (patch) | |
tree | ff62fa6cffc8f63497bcb98372907cf74ad8fe73 /channels/chan_sip.c | |
parent | ef27fcf50c024bbba92e976bf5bc0b38768b15df (diff) |
Allow global "qualify" option (bug #3649)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5071 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-x | channels/chan_sip.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 48db9a05a..a1f401424 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -136,8 +136,11 @@ static char default_fromdomain[AST_MAX_EXTENSION] = ""; #define DEFAULT_NOTIFYMIME "application/simple-message-summary" static char default_notifymime[AST_MAX_EXTENSION] = DEFAULT_NOTIFYMIME; + +static int default_qualify = 0; /* Default Qualify= setting */ + static struct ast_flags global_flags = {0}; /* global SIP_ flags */ -static struct ast_flags global_flags_page2 = {0}; /* more global SIP_ flags */ +static struct ast_flags global_flags_page2 = {0}; /* more global SIP_ flags */ static int srvlookup = 0; /* SRV Lookup on or off. Default is off, RFC behavior is on */ @@ -9205,7 +9208,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int peer->callgroup = 0; peer->pickupgroup = 0; peer->rtpkeepalive = global_rtpkeepalive; - peer->maxms = 0; + peer->maxms = default_qualify; peer->prefs = prefs; oldha = peer->ha; peer->ha = NULL; @@ -9431,6 +9434,7 @@ static int reload_config(void) strncpy(default_context, DEFAULT_CONTEXT, sizeof(default_context) - 1); default_language[0] = '\0'; default_fromdomain[0] = '\0'; + default_qualify = 0; externhost[0] = '\0'; externexpire = 0; externrefresh = 10; @@ -9621,6 +9625,15 @@ static int reload_config(void) } else { ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config); } + } else if (!strcasecmp(v->name, "qualify")) { + if (!strcasecmp(v->value, "no")) { + default_qualify = 0; + } else if (!strcasecmp(v->value, "yes")) { + default_qualify = DEFAULT_MAXMS; + } else if (sscanf(v->value, "%d", &default_qualify) != 1) { + ast_log(LOG_WARNING, "Qualification default should be 'yes', 'no', or a number of milliseconds at line %d of sip.conf\n", v->lineno); + default_qualify = 0; + } } else if (!strcasecmp(v->name, "callevents")) { callevents = ast_true(v->value); } |