mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-31 07:34:19 +00:00
Merge branch 'master' into smgmaster
This commit is contained in:
commit
2d4b16516a
278 files changed
+61707
-5167
No files matched your search
+31
-9
@@ -904,16 +904,25 @@ static switch_ip_list_t IP_LIST = { 0 };
|
||||
SWITCH_DECLARE(switch_bool_t) switch_check_network_list_ip_token(const char *ip_str, const char *list_name, const char **token)
|
||||
{
|
||||
switch_network_list_t *list;
|
||||
uint32_t ip, net, mask, bits;
|
||||
ip_t ip, mask, net;
|
||||
uint32_t bits;
|
||||
char *ipv6 = strchr(ip_str,':');
|
||||
switch_bool_t ok = SWITCH_FALSE;
|
||||
|
||||
switch_mutex_lock(runtime.global_mutex);
|
||||
switch_inet_pton(AF_INET, ip_str, &ip);
|
||||
|
||||
ip = htonl(ip);
|
||||
if (ipv6) {
|
||||
switch_inet_pton(AF_INET6, ip_str, &ip);
|
||||
} else {
|
||||
switch_inet_pton(AF_INET, ip_str, &ip);
|
||||
ip.v4 = htonl(ip.v4);
|
||||
}
|
||||
|
||||
if ((list = switch_core_hash_find(IP_LIST.hash, list_name))) {
|
||||
ok = switch_network_list_validate_ip_token(list, ip, token);
|
||||
if (ipv6) {
|
||||
ok = switch_network_list_validate_ip6_token(list, ip, token);
|
||||
} else {
|
||||
ok = switch_network_list_validate_ip_token(list, ip.v4, token);
|
||||
}
|
||||
} else if (strchr(list_name, '/')) {
|
||||
if (strchr(list_name, ',')) {
|
||||
char *list_name_dup = strdup(list_name);
|
||||
@@ -926,15 +935,21 @@ SWITCH_DECLARE(switch_bool_t) switch_check_network_list_ip_token(const char *ip_
|
||||
int i;
|
||||
for (i = 0; i < argc; i++) {
|
||||
switch_parse_cidr(argv[i], &net, &mask, &bits);
|
||||
if ((ok = switch_test_subnet(ip, net, mask))) {
|
||||
break;
|
||||
if (ipv6) {
|
||||
if ((ok = switch_testv6_subnet(ip, net, mask))){
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((ok = switch_test_subnet(ip.v4, net.v4, mask.v4))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(list_name_dup);
|
||||
} else {
|
||||
switch_parse_cidr(list_name, &net, &mask, &bits);
|
||||
ok = switch_test_subnet(ip, net, mask);
|
||||
ok = switch_test_subnet(ip.v4, net.v4, mask.v4);
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_mutex);
|
||||
@@ -1240,6 +1255,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||
runtime.max_dtmf_duration = SWITCH_MAX_DTMF_DURATION;
|
||||
runtime.default_dtmf_duration = SWITCH_DEFAULT_DTMF_DURATION;
|
||||
runtime.min_dtmf_duration = SWITCH_MIN_DTMF_DURATION;
|
||||
runtime.odbc_dbtype = DBTYPE_DEFAULT;
|
||||
|
||||
/* INIT APR and Create the pool context */
|
||||
if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -1429,7 +1445,7 @@ static void switch_load_core_config(const char *file)
|
||||
{
|
||||
switch_xml_t xml = NULL, cfg = NULL;
|
||||
|
||||
switch_core_hash_insert(runtime.ptimes, "ilbc", &d_30);
|
||||
//switch_core_hash_insert(runtime.ptimes, "ilbc", &d_30);
|
||||
switch_core_hash_insert(runtime.ptimes, "G723", &d_30);
|
||||
|
||||
if ((xml = switch_xml_open_cfg(file, &cfg, NULL))) {
|
||||
@@ -1596,6 +1612,12 @@ static void switch_load_core_config(const char *file)
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
|
||||
}
|
||||
} else if (!strcasecmp(var, "core-dbtype") && !zstr(val)) {
|
||||
if (!strcasecmp(val, "MSSQL")) {
|
||||
runtime.odbc_dbtype = DBTYPE_MSSQL;
|
||||
} else {
|
||||
runtime.odbc_dbtype = DBTYPE_DEFAULT;
|
||||
}
|
||||
#ifdef ENABLE_ZRTP
|
||||
} else if (!strcasecmp(var, "rtp-enable-zrtp")) {
|
||||
switch_core_set_variable("zrtp_enabled", val);
|
||||
|
||||
Reference in new issue
Block a user