mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Fix allow/disallow nomenclature (bug #2945, part deux)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -8292,9 +8292,9 @@ static struct sip_user *build_user(const char *name, struct ast_variable *v)
|
||||
user->amaflags = format;
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "allow")) {
|
||||
ast_parse_allow_deny(&user->prefs, &user->capability, v->value, 1);
|
||||
ast_parse_allow_disallow(&user->prefs, &user->capability, v->value, 1);
|
||||
} else if (!strcasecmp(v->name, "disallow")) {
|
||||
ast_parse_allow_deny(&user->prefs, &user->capability, v->value, 0);
|
||||
ast_parse_allow_disallow(&user->prefs, &user->capability, v->value, 0);
|
||||
} else if (!strcasecmp(v->name, "insecure")) {
|
||||
user->insecure = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "callingpres")) {
|
||||
@@ -8550,9 +8550,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
|
||||
} else if (!strcasecmp(v->name, "pickupgroup")) {
|
||||
peer->pickupgroup = ast_get_group(v->value);
|
||||
} else if (!strcasecmp(v->name, "allow")) {
|
||||
ast_parse_allow_deny(&peer->prefs, &peer->capability, v->value, 1);
|
||||
ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 1);
|
||||
} else if (!strcasecmp(v->name, "disallow")) {
|
||||
ast_parse_allow_deny(&peer->prefs, &peer->capability, v->value, 0);
|
||||
ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 0);
|
||||
} else if (!strcasecmp(v->name, "insecure")) {
|
||||
if (!strcasecmp(v->value, "very")) {
|
||||
peer->insecure = 2;
|
||||
@@ -8826,9 +8826,9 @@ static int reload_config(void)
|
||||
else
|
||||
memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr));
|
||||
} else if (!strcasecmp(v->name, "allow")) {
|
||||
ast_parse_allow_deny(&prefs, &global_capability, v->value, 1);
|
||||
ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1);
|
||||
} else if (!strcasecmp(v->name, "disallow")) {
|
||||
ast_parse_allow_deny(&prefs, &global_capability, v->value, 0);
|
||||
ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0);
|
||||
} else if (!strcasecmp(v->name, "register")) {
|
||||
sip_register(v->value, v->lineno);
|
||||
} else if (!strcasecmp(v->name, "recordhistory")) {
|
||||
|
6
frame.c
6
frame.c
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* Frame manipulation routines
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
@@ -958,7 +958,7 @@ int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
|
||||
return find_best ? ast_best_codec(formats) : 0;
|
||||
}
|
||||
|
||||
void ast_parse_allow_deny(struct ast_codec_pref *pref, int *mask, char *list, int allowing)
|
||||
void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, char *list, int allowing)
|
||||
{
|
||||
int format_i = 0;
|
||||
char *next_format = NULL, *last_format = NULL;
|
||||
|
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* Asterisk internal frame definitions.
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU Lesser General Public License. Other components of
|
||||
@@ -398,7 +398,7 @@ extern int ast_codec_pref_append(struct ast_codec_pref *pref, int format);
|
||||
extern int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best);
|
||||
|
||||
/* Parse an "allow" or "deny" line and update the mask and pref if provided */
|
||||
extern void ast_parse_allow_deny(struct ast_codec_pref *pref, int *mask, char *list, int allowing);
|
||||
extern void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, char *list, int allowing);
|
||||
|
||||
/* Dump codec preference list into a string */
|
||||
extern int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size);
|
||||
|
Reference in New Issue
Block a user