aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-16 20:04:13 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-16 20:04:13 +0000
commit1eb87f1820904656719dd8e314510d9d42660e17 (patch)
treecba6bee79f9486ce2a6345d03a6edae6d8b378a9 /channels
parent83d85670c2e7f3da34dbe7752e10e5cd7b9bf743 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@45279 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4e6b105b4..66f70fa0e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -377,6 +377,8 @@ static int global_rtpkeepalive = 0;
static int global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
static int global_regattempts_max = 0;
+static int global_ignoreoodresponses = 1;
+
/* Object counters */
static int suserobjs = 0;
static int ruserobjs = 0;
@@ -3276,6 +3278,11 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
p = p->next;
}
ast_mutex_unlock(&iflock);
+
+ /* If this is a response and we have ignoring of out of dialog responses turned on, then drop it */
+ if (req->method == SIP_RESPONSE && global_ignoreoodresponses)
+ return NULL;
+
p = sip_alloc(callid, sin, 1, intended_method);
if (p)
ast_mutex_lock(&p->lock);
@@ -8391,6 +8398,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
ast_cli(fd, " Videosupport: %s\n", videosupport ? "Yes" : "No");
ast_cli(fd, " AutoCreatePeer: %s\n", autocreatepeer ? "Yes" : "No");
ast_cli(fd, " Allow unknown access: %s\n", global_allowguest ? "Yes" : "No");
+ ast_cli(fd, " Drop misc responses: %s\n", global_ignoreoodresponses ? "Yes" : "No");
ast_cli(fd, " Promsic. redir: %s\n", ast_test_flag(&global_flags, SIP_PROMISCREDIR) ? "Yes" : "No");
ast_cli(fd, " SIP domain support: %s\n", AST_LIST_EMPTY(&domain_list) ? "No" : "Yes");
ast_cli(fd, " Call to non-local dom.: %s\n", allow_external_domains ? "Yes" : "No");
@@ -12057,6 +12065,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
ast_set_flag(mask, SIP_PROMISCREDIR);
ast_set2_flag(flags, ast_true(v->value), SIP_PROMISCREDIR);
res = 1;
+ } else if (!strcasecmp(v->name, "ignoreoodresponses")) {
+ if (ast_true(v->value))
+ global_ignoreoodresponses = 1;
+ else
+ global_ignoreoodresponses = 0;
}
return res;
@@ -12709,6 +12722,7 @@ static int reload_config(void)
tos = 0;
expiry = DEFAULT_EXPIRY;
global_allowguest = 1;
+ global_ignoreoodresponses = 1;
/* Read the [general] config section of sip.conf (or from realtime config) */
v = ast_variable_browse(cfg, "general");