mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
Add 'ignoreoodreplies' option which will not create a pvt structure on a SIP response but instead basically drop it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@45260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -373,6 +373,8 @@ static int global_rtpkeepalive = 0;
|
|||||||
static int global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
|
static int global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
|
||||||
static int global_regattempts_max = 0;
|
static int global_regattempts_max = 0;
|
||||||
|
|
||||||
|
static int global_ignoreoodreplies = 1;
|
||||||
|
|
||||||
/* Object counters */
|
/* Object counters */
|
||||||
static int suserobjs = 0;
|
static int suserobjs = 0;
|
||||||
static int ruserobjs = 0;
|
static int ruserobjs = 0;
|
||||||
@@ -3238,6 +3240,11 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&iflock);
|
ast_mutex_unlock(&iflock);
|
||||||
|
|
||||||
|
/* If this is a response and we have ignoring of out of dialog replies turned, then drop it */
|
||||||
|
if (req->method == SIP_RESPONSE && global_ignoreoodreplies)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
p = sip_alloc(callid, sin, 1, intended_method);
|
p = sip_alloc(callid, sin, 1, intended_method);
|
||||||
if (p)
|
if (p)
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
@@ -8304,6 +8311,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
|
|||||||
ast_cli(fd, " Videosupport: %s\n", videosupport ? "Yes" : "No");
|
ast_cli(fd, " Videosupport: %s\n", videosupport ? "Yes" : "No");
|
||||||
ast_cli(fd, " AutoCreatePeer: %s\n", autocreatepeer ? "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, " Allow unknown access: %s\n", global_allowguest ? "Yes" : "No");
|
||||||
|
ast_cli(fd, " Drop misc replies: %s\n", global_ignoreoodreplies ? "Yes" : "No");
|
||||||
ast_cli(fd, " Promsic. redir: %s\n", ast_test_flag(&global_flags, SIP_PROMISCREDIR) ? "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, " 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");
|
ast_cli(fd, " Call to non-local dom.: %s\n", allow_external_domains ? "Yes" : "No");
|
||||||
@@ -11947,6 +11955,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
|
|||||||
ast_set_flag(mask, SIP_PROMISCREDIR);
|
ast_set_flag(mask, SIP_PROMISCREDIR);
|
||||||
ast_set2_flag(flags, ast_true(v->value), SIP_PROMISCREDIR);
|
ast_set2_flag(flags, ast_true(v->value), SIP_PROMISCREDIR);
|
||||||
res = 1;
|
res = 1;
|
||||||
|
} else if (!strcasecmp(v->name, "ignoreoodreplies")) {
|
||||||
|
if (ast_true(v->value))
|
||||||
|
global_ignoreoodreplies = 1;
|
||||||
|
else
|
||||||
|
global_ignoreoodreplies = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@@ -12599,6 +12612,7 @@ static int reload_config(void)
|
|||||||
tos = 0;
|
tos = 0;
|
||||||
expiry = DEFAULT_EXPIRY;
|
expiry = DEFAULT_EXPIRY;
|
||||||
global_allowguest = 1;
|
global_allowguest = 1;
|
||||||
|
global_ignoreoodreplies = 1;
|
||||||
|
|
||||||
/* Read the [general] config section of sip.conf (or from realtime config) */
|
/* Read the [general] config section of sip.conf (or from realtime config) */
|
||||||
v = ast_variable_browse(cfg, "general");
|
v = ast_variable_browse(cfg, "general");
|
||||||
|
@@ -111,7 +111,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
|||||||
; for any reason, always reject with '401 Unauthorized'
|
; for any reason, always reject with '401 Unauthorized'
|
||||||
; instead of letting the requester know whether there was
|
; instead of letting the requester know whether there was
|
||||||
; a matching user or peer for their request
|
; a matching user or peer for their request
|
||||||
|
;ignoreoodreplies = no ; If no then out of dialog replies will not be ignored
|
||||||
;
|
;
|
||||||
; If regcontext is specified, Asterisk will dynamically create and destroy a
|
; If regcontext is specified, Asterisk will dynamically create and destroy a
|
||||||
; NoOp priority 1 extension for a given peer who registers or unregisters with
|
; NoOp priority 1 extension for a given peer who registers or unregisters with
|
||||||
|
Reference in New Issue
Block a user