summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-02-24 13:57:45 +0000
committerMark Spencer <markster@digium.com>2005-02-24 13:57:45 +0000
commit6eea9479e7c33d3bb4cadec615eb4c1e1b334428 (patch)
treeff62fa6cffc8f63497bcb98372907cf74ad8fe73 /channels/chan_sip.c
parent927828d4d4ded99fc34930b1b3b55349f7ce7346 (diff)
Allow global "qualify" option (bug #3649)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-xchannels/chan_sip.c17
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);
}