mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
if space
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15893 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -117,7 +117,7 @@ static switch_status_t config_callback_dsn(switch_xml_config_item_t *data, const
|
||||
|
||||
if ((callback_type == CONFIG_LOAD || callback_type == CONFIG_RELOAD) && changed) {
|
||||
|
||||
if(zstr(newvalue)) {
|
||||
if (zstr(newvalue)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No local database defined.\n");
|
||||
} else {
|
||||
switch_safe_free(globals.odbc_dsn);
|
||||
|
||||
@@ -1876,7 +1876,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
||||
|
||||
member->score_iir = (int)(((1.0 - SCORE_DECAY) * (float)member->score) + (SCORE_DECAY * (float)member->score_iir));
|
||||
|
||||
if(member->score_iir > SCORE_MAX_IIR) {
|
||||
if (member->score_iir > SCORE_MAX_IIR) {
|
||||
member->score_iir = SCORE_MAX_IIR;
|
||||
}
|
||||
|
||||
@@ -5197,11 +5197,11 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
switch_channel_set_variable(channel, "conference_name", conference->name);
|
||||
|
||||
/* Set MOH from variable if not set */
|
||||
if(zstr(conference->moh_sound)) {
|
||||
if (zstr(conference->moh_sound)) {
|
||||
conference->moh_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_moh_sound"));
|
||||
}
|
||||
/* Set perpetual-sound from variable if not set */
|
||||
if(zstr(conference->perpetual_sound)) {
|
||||
if (zstr(conference->perpetual_sound)) {
|
||||
conference->perpetual_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_perpetual_sound"));
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ static http_data_t *do_lookup_url(switch_memory_pool_t *pool, const char *url, c
|
||||
}
|
||||
if (!strcasecmp(method, "head")) {
|
||||
curl_easy_setopt(curl_handle, CURLOPT_NOBODY, SWITCH_TRUE);
|
||||
} else if(!strcasecmp(method, "post")) {
|
||||
} else if (!strcasecmp(method, "post")) {
|
||||
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, strlen(data));
|
||||
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, (void *) data);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Post data: %s\n", data);
|
||||
@@ -288,7 +288,7 @@ SWITCH_STANDARD_APP(curl_app_function)
|
||||
switch_channel_set_variable(channel, "curl_response_data", print_json(pool, http_data));
|
||||
} else {
|
||||
SWITCH_STANDARD_STREAM(stream);
|
||||
if(do_headers) {
|
||||
if (do_headers) {
|
||||
slist = http_data->headers;
|
||||
while(slist) {
|
||||
stream.write_function(&stream, "%s\n", slist->data);
|
||||
@@ -376,7 +376,7 @@ SWITCH_STANDARD_API(curl_function)
|
||||
if (do_json) {
|
||||
stream->write_function(stream, "%s", print_json(pool, http_data));
|
||||
} else {
|
||||
if(do_headers) {
|
||||
if (do_headers) {
|
||||
slist = http_data->headers;
|
||||
while(slist) {
|
||||
stream->write_function(stream, "%s\n", slist->data);
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
/* Defines for error checking */
|
||||
#include <errno.h>
|
||||
|
||||
#if(EXPR_ERROR_LEVEL >= EXPR_ERROR_LEVEL_CHECK)
|
||||
#if (EXPR_ERROR_LEVEL >= EXPR_ERROR_LEVEL_CHECK)
|
||||
#define EXPR_RESET_ERR() errno = 0
|
||||
#define EXPR_CHECK_ERR() if(errno) return EXPR_ERROR_OUTOFRANGE
|
||||
#define EXPR_CHECK_ERR() if (errno) return EXPR_ERROR_OUTOFRANGE
|
||||
#else
|
||||
#define EXPR_RESET_ERR()
|
||||
#define EXPR_CHECK_ERR()
|
||||
@@ -136,7 +136,7 @@ int exprEvalNode(exprObj * obj, exprNode * nodes, int curnode, EXPRTYPE * val)
|
||||
if (d2 != 0.0)
|
||||
*val = d1 / d2;
|
||||
else {
|
||||
#if(EXPR_ERROR_LEVEL >= EXPR_ERROR_LEVEL_CHECK)
|
||||
#if (EXPR_ERROR_LEVEL >= EXPR_ERROR_LEVEL_CHECK)
|
||||
return EXPR_ERROR_DIVBYZERO;
|
||||
#else
|
||||
*val = 0.0;
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
/* Macro for adding a function node type */
|
||||
#define EXPR_ADDFUNC_TYPE(name, type, argmin, argmax, refmin, refmax) \
|
||||
err = exprFuncListAddType(flist, name, type, argmin, argmax, refmin, refmax); \
|
||||
if(err != EXPR_ERROR_NOERROR) \
|
||||
if (err != EXPR_ERROR_NOERROR) \
|
||||
return err;
|
||||
|
||||
/* Macro for adding a constant */
|
||||
#define EXPR_ADDCONST(name, val) \
|
||||
err = exprValListAdd(vlist, name, val); \
|
||||
if(err != EXPR_ERROR_NOERROR) \
|
||||
if (err != EXPR_ERROR_NOERROR) \
|
||||
return err;
|
||||
|
||||
/* Call this function to initialize these functions into a function list */
|
||||
|
||||
@@ -878,7 +878,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
node_list[node_count++] = node;
|
||||
}
|
||||
|
||||
if(switch_true(switch_channel_get_variable(channel, "fifo_destroy_after_use"))) {
|
||||
if (switch_true(switch_channel_get_variable(channel, "fifo_destroy_after_use"))) {
|
||||
node->ready = FIFO_DELAY_DESTROY;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,18 +199,18 @@ static const char *do_cid(switch_memory_pool_t *pool, const char *cid, const cha
|
||||
}
|
||||
|
||||
/* if a session is provided, check if the source part of the regex has any channel variables, then expand them */
|
||||
if(session) {
|
||||
if (session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
switch_assert(channel);
|
||||
|
||||
if(switch_string_var_check_const(src) || switch_string_has_escaped_data(src)) {
|
||||
if (switch_string_var_check_const(src) || switch_string_has_escaped_data(src)) {
|
||||
tmp_regex = switch_channel_expand_variables(channel, src);
|
||||
src_regex = switch_core_strdup(pool, tmp_regex);
|
||||
switch_safe_free(tmp_regex);
|
||||
src = src_regex;
|
||||
}
|
||||
|
||||
if(switch_string_var_check_const(dst) || switch_string_has_escaped_data(dst)) {
|
||||
if (switch_string_var_check_const(dst) || switch_string_has_escaped_data(dst)) {
|
||||
tmp_regex = switch_channel_expand_variables(channel, dst);
|
||||
dst_regex = switch_core_strdup(pool, tmp_regex);
|
||||
switch_safe_free(tmp_regex);
|
||||
@@ -426,7 +426,7 @@ static switch_bool_t set_db_random()
|
||||
db_random = "rand()";
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
if(db_check("SELECT random();") == SWITCH_TRUE) {
|
||||
if (db_check("SELECT random();") == SWITCH_TRUE) {
|
||||
db_random = "random()";
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
@@ -1354,9 +1354,9 @@ SWITCH_STANDARD_API(dialplan_lcr_function)
|
||||
if (!strcasecmp(argv[i], "intrastate")) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on intrastate rates\n");
|
||||
cb_struct.intrastate = SWITCH_TRUE;
|
||||
} else if(!strcasecmp(argv[i], "as")) {
|
||||
} else if (!strcasecmp(argv[i], "as")) {
|
||||
i++;
|
||||
if(argv[i] && !strcasecmp(argv[i], "xml")) {
|
||||
if (argv[i] && !strcasecmp(argv[i], "xml")) {
|
||||
as_xml = SWITCH_TRUE;
|
||||
} else {
|
||||
goto usage;
|
||||
|
||||
@@ -183,11 +183,11 @@ SWITCH_STANDARD_API(memcache_function)
|
||||
key = argv[1];
|
||||
val = argv[2];
|
||||
|
||||
if(argc > 3) {
|
||||
if (argc > 3) {
|
||||
expires_str = argv[3];
|
||||
expires = (time_t)strtol(expires_str, NULL, 10);
|
||||
}
|
||||
if(argc > 4) {
|
||||
if (argc > 4) {
|
||||
flags_str = argv[4];
|
||||
flags = (uint32_t)strtol(flags_str, NULL, 16);
|
||||
}
|
||||
@@ -239,11 +239,11 @@ SWITCH_STANDARD_API(memcache_function)
|
||||
} else {
|
||||
svalue = "1";
|
||||
}
|
||||
if(argc > 3) {
|
||||
if (argc > 3) {
|
||||
expires_str = argv[3];
|
||||
expires = (time_t)strtol(expires_str, NULL, 10);
|
||||
}
|
||||
if(argc > 4) {
|
||||
if (argc > 4) {
|
||||
flags_str = argv[4];
|
||||
flags = (uint32_t)strtol(flags_str, NULL, 16);
|
||||
}
|
||||
@@ -280,7 +280,7 @@ SWITCH_STANDARD_API(memcache_function)
|
||||
}
|
||||
} else if (!strcasecmp(subcmd, "delete") && argc > 1) {
|
||||
key = argv[1];
|
||||
if(argc > 2) {
|
||||
if (argc > 2) {
|
||||
expires_str = argv[3];
|
||||
expires = (time_t)strtol(expires_str, NULL, 10);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ SWITCH_STANDARD_API(memcache_function)
|
||||
switch_goto_status(SWITCH_STATUS_SUCCESS, mcache_error);
|
||||
}
|
||||
} else if (!strcasecmp(subcmd, "flush")) {
|
||||
if(argc > 1) {
|
||||
if (argc > 1) {
|
||||
expires_str = argv[3];
|
||||
expires = (time_t)strtol(expires_str, NULL, 10);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ static switch_status_t tts_commandline_speech_read_tts(switch_speech_handle_t *s
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
*datalen = my_datalen * 2;
|
||||
if(datalen == 0) {
|
||||
if (datalen == 0) {
|
||||
return SWITCH_STATUS_BREAK;
|
||||
} else {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
@@ -607,7 +607,7 @@ static switch_status_t audio_queue_create(audio_queue_t **audio_queue, const cha
|
||||
|
||||
done:
|
||||
|
||||
if(status != SWITCH_STATUS_SUCCESS) {
|
||||
if (status != SWITCH_STATUS_SUCCESS) {
|
||||
audio_queue_destroy(laudio_queue);
|
||||
}
|
||||
return status;
|
||||
@@ -628,7 +628,7 @@ static switch_status_t audio_queue_write(audio_queue_t *queue, void *data, switc
|
||||
|
||||
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
|
||||
switch_size_t len = *data_len;
|
||||
if(queue->file_write) {
|
||||
if (queue->file_write) {
|
||||
switch_file_write(queue->file_write, data, &len);
|
||||
}
|
||||
#endif
|
||||
@@ -3275,7 +3275,7 @@ static switch_status_t mod_unimrcp_do_config()
|
||||
*/
|
||||
static char *ip_addr_get(const char *value, apr_pool_t *pool)
|
||||
{
|
||||
if(!value || strcasecmp(value,"auto") == 0) {
|
||||
if (!value || strcasecmp(value,"auto") == 0) {
|
||||
char *addr = DEFAULT_LOCAL_IP_ADDRESS;
|
||||
apt_ip_get(&addr,pool);
|
||||
return addr;
|
||||
@@ -3337,19 +3337,19 @@ static int process_rtp_config(mrcp_client_t *client, mpf_rtp_config_t *rtp_confi
|
||||
rtp_config->jb_config.max_playout_delay = atol(val);
|
||||
} else if (strcasecmp(param, "codecs") == 0) {
|
||||
const mpf_codec_manager_t *codec_manager = mrcp_client_codec_manager_get(client);
|
||||
if(codec_manager) {
|
||||
if (codec_manager) {
|
||||
mpf_codec_manager_codec_list_load(codec_manager, &rtp_config->codec_list, val, pool);
|
||||
}
|
||||
} else if (strcasecmp(param, "ptime") == 0) {
|
||||
rtp_config->ptime = (apr_uint16_t)atol(val);
|
||||
#if UNI_VERSION_AT_LEAST(0,8,0)
|
||||
} else if(strcasecmp(param, "rtcp") == 0) {
|
||||
} else if (strcasecmp(param, "rtcp") == 0) {
|
||||
rtp_config->rtcp = atoi(val);
|
||||
} else if(strcasecmp(param, "rtcp-bye") == 0) {
|
||||
} else if (strcasecmp(param, "rtcp-bye") == 0) {
|
||||
rtp_config->rtcp_bye_policy = atoi(val);
|
||||
} else if(strcasecmp(param, "rtcp-tx-interval") == 0) {
|
||||
} else if (strcasecmp(param, "rtcp-tx-interval") == 0) {
|
||||
rtp_config->rtcp_tx_interval = (apr_uint16_t)atoi(val);
|
||||
} else if(strcasecmp(param, "rtcp-rx-resolution") == 0) {
|
||||
} else if (strcasecmp(param, "rtcp-rx-resolution") == 0) {
|
||||
rtp_config->rtcp_rx_resolution = (apr_uint16_t)atol(val);
|
||||
#endif
|
||||
} else {
|
||||
@@ -3470,7 +3470,7 @@ static mrcp_client_t *mod_unimrcp_client_create(switch_memory_pool_t *mod_pool)
|
||||
#if UNI_VERSION_AT_LEAST(0,8,0)
|
||||
/* load the synthesizer and recognizer resources */
|
||||
resource_loader = mrcp_resource_loader_create(FALSE, pool);
|
||||
if(resource_loader) {
|
||||
if (resource_loader) {
|
||||
apt_str_t synth_resource;
|
||||
apt_str_t recog_resource;
|
||||
apt_string_set(&synth_resource, "speechsynth");
|
||||
|
||||
@@ -874,7 +874,7 @@ static int activate_rtp(struct private_object *tech_pvt)
|
||||
switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
|
||||
switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
|
||||
|
||||
if(globals.auto_nat && tech_pvt->profile->local_network &&
|
||||
if (globals.auto_nat && tech_pvt->profile->local_network &&
|
||||
!switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)) {
|
||||
switch_port_t external_port = 0;
|
||||
switch_nat_add_mapping((switch_port_t)tech_pvt->local_port, SWITCH_NAT_UDP, &external_port, SWITCH_FALSE);
|
||||
@@ -1232,7 +1232,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||
tech_pvt->rtp_session = NULL;
|
||||
}
|
||||
|
||||
if(globals.auto_nat && tech_pvt->profile->local_network &&
|
||||
if (globals.auto_nat && tech_pvt->profile->local_network &&
|
||||
!switch_check_network_list_ip(tech_pvt->remote_ip, tech_pvt->profile->local_network)) {
|
||||
switch_nat_del_mapping((switch_port_t)tech_pvt->local_port, SWITCH_NAT_UDP);
|
||||
}
|
||||
@@ -1247,9 +1247,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||
|
||||
switch_thread_rwlock_unlock(tech_pvt->profile->rwlock);
|
||||
|
||||
if(tech_pvt->profile->purge) {
|
||||
if (tech_pvt->profile->purge) {
|
||||
mdl_profile_t *profile = tech_pvt->profile;
|
||||
if(switch_core_hash_delete(globals.profile_hash, profile->name) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_delete(globals.profile_hash, profile->name) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Profile %s deleted successfully\n", profile->name);
|
||||
}
|
||||
}
|
||||
@@ -1685,13 +1685,13 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
}
|
||||
}
|
||||
|
||||
if(mdl_profile->purge) {
|
||||
if (mdl_profile->purge) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile '%s' is marked for deletion, disallowing outgoing call\n", mdl_profile->name);
|
||||
terminate_session(new_session, __LINE__, SWITCH_CAUSE_NORMAL_UNSPECIFIED);
|
||||
return SWITCH_CAUSE_NORMAL_UNSPECIFIED;
|
||||
}
|
||||
|
||||
if(switch_thread_rwlock_tryrdlock(mdl_profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_thread_rwlock_tryrdlock(mdl_profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't do read lock on profile '%s'\n", mdl_profile->name);
|
||||
terminate_session(new_session, __LINE__, SWITCH_CAUSE_NORMAL_UNSPECIFIED);
|
||||
return SWITCH_CAUSE_NORMAL_UNSPECIFIED;
|
||||
@@ -2270,11 +2270,11 @@ SWITCH_STANDARD_API(dl_login)
|
||||
|
||||
static switch_bool_t match_profile(mdl_profile_t *profile, mdl_profile_t *new_profile)
|
||||
{
|
||||
if(profile == new_profile) {
|
||||
if (profile == new_profile) {
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
|
||||
if(
|
||||
if (
|
||||
((!new_profile->name && !profile->name) ||
|
||||
(new_profile->name && profile->name && !strcasecmp(new_profile->name, profile->name))) &&
|
||||
((!new_profile->login && !profile->login) ||
|
||||
@@ -2311,7 +2311,7 @@ static switch_bool_t match_profile(mdl_profile_t *profile, mdl_profile_t *new_pr
|
||||
) {
|
||||
int i;
|
||||
if (switch_odbc_available()) {
|
||||
if(!(
|
||||
if (!(
|
||||
((!new_profile->odbc_dsn && !profile->odbc_dsn) ||
|
||||
(new_profile->odbc_dsn && profile->odbc_dsn && !strcasecmp(new_profile->odbc_dsn, profile->odbc_dsn))) &&
|
||||
((!new_profile->odbc_user && !profile->odbc_user) ||
|
||||
@@ -2324,7 +2324,7 @@ static switch_bool_t match_profile(mdl_profile_t *profile, mdl_profile_t *new_pr
|
||||
}
|
||||
|
||||
for(i=0; i<new_profile->acl_count; i++) {
|
||||
if(strcasecmp(new_profile->acl[i], profile->acl[i]) != 0) {
|
||||
if (strcasecmp(new_profile->acl[i], profile->acl[i]) != 0) {
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2337,7 +2337,7 @@ static switch_status_t destroy_profile(char *name)
|
||||
{
|
||||
mdl_profile_t *profile = NULL;
|
||||
|
||||
if((profile = switch_core_hash_find(globals.profile_hash, name))) {
|
||||
if ((profile = switch_core_hash_find(globals.profile_hash, name))) {
|
||||
if (profile->user_flags & LDL_FLAG_COMPONENT) {
|
||||
if (switch_odbc_available() && profile->odbc_dsn && profile->master_odbc) {
|
||||
switch_odbc_handle_disconnect(profile->master_odbc);
|
||||
@@ -2347,21 +2347,21 @@ static switch_status_t destroy_profile(char *name)
|
||||
switch_mutex_destroy(profile->mutex);
|
||||
}
|
||||
|
||||
if(switch_thread_rwlock_trywrlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_thread_rwlock_trywrlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Profile %s is busy\n", profile->name);
|
||||
profile->purge = SWITCH_TRUE;
|
||||
if(profile->handle) {
|
||||
if (profile->handle) {
|
||||
ldl_handle_stop(profile->handle);
|
||||
}
|
||||
} else {
|
||||
switch_thread_rwlock_unlock(profile->rwlock);
|
||||
profile->purge = SWITCH_TRUE;
|
||||
|
||||
if(profile->handle) {
|
||||
if (profile->handle) {
|
||||
ldl_handle_stop(profile->handle);
|
||||
}
|
||||
|
||||
if(switch_core_hash_delete(globals.profile_hash, profile->name) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_core_hash_delete(globals.profile_hash, profile->name) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Profile %s deleted successfully\n", profile->name);
|
||||
}
|
||||
}
|
||||
@@ -2448,8 +2448,8 @@ static switch_status_t soft_reload(void)
|
||||
if (profile) {
|
||||
switch_core_hash_insert(name_hash, profile->name, profile->login);
|
||||
|
||||
if((old_profile = switch_core_hash_find(globals.profile_hash, profile->name))) {
|
||||
if(match_profile(old_profile, profile)) {
|
||||
if ((old_profile = switch_core_hash_find(globals.profile_hash, profile->name))) {
|
||||
if (match_profile(old_profile, profile)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Found pre-existing profile %s [%s]\n", profile->name, profile->login);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Overwriting pre-existing profile %s [%s]\n", profile->name, profile->login);
|
||||
@@ -2471,7 +2471,7 @@ static switch_status_t soft_reload(void)
|
||||
switch_hash_this(hi, NULL, NULL, &data);
|
||||
profile = (mdl_profile_t *) data;
|
||||
|
||||
if(switch_core_hash_find(name_hash, profile->name)) {
|
||||
if (switch_core_hash_find(name_hash, profile->name)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "New profile %s [%s] activated\n", profile->name, profile->login);
|
||||
} else {
|
||||
switch_core_hash_insert(name_hash, profile->name, profile->name);
|
||||
@@ -2481,7 +2481,7 @@ static switch_status_t soft_reload(void)
|
||||
for (hi = switch_hash_first(NULL, name_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, NULL, NULL, &data);
|
||||
|
||||
if((profile = switch_core_hash_find(globals.profile_hash, (char*)data))) {
|
||||
if ((profile = switch_core_hash_find(globals.profile_hash, (char*)data))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleting unused profile %s [%s]\n", profile->name, profile->login);
|
||||
destroy_profile(profile->name);
|
||||
}
|
||||
@@ -2928,13 +2928,13 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(profile->purge) {
|
||||
if (profile->purge) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile '%s' is marked for deletion, disallowing incoming call\n", profile->name);
|
||||
status = LDL_STATUS_FALSE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(switch_thread_rwlock_tryrdlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_thread_rwlock_tryrdlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't do read lock on profile '%s'\n", profile->name);
|
||||
status = LDL_STATUS_FALSE;
|
||||
goto done;
|
||||
|
||||
@@ -3098,7 +3098,7 @@ struct iax_event *iax_get_event(int blocking) {
|
||||
ret = jb_get(cur->jb, &frame, now, get_interp_len(cur->voiceformat));
|
||||
switch (ret) {
|
||||
case JB_OK:
|
||||
// if(frame.type == JB_TYPE_VOICE && next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
|
||||
// if (frame.type == JB_TYPE_VOICE && next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
|
||||
event = frame.data;
|
||||
event = handle_event(event);
|
||||
if (event) {
|
||||
@@ -3107,7 +3107,7 @@ struct iax_event *iax_get_event(int blocking) {
|
||||
}
|
||||
break;
|
||||
case JB_INTERP:
|
||||
// if(next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
|
||||
// if (next + 20 != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not %ld+20!\n", jb_next(cur->jb), next);
|
||||
/* create an interpolation frame */
|
||||
//fprintf(stderr, "Making Interpolation frame\n");
|
||||
event = (struct iax_event *) malloc(sizeof(struct iax_event));
|
||||
@@ -3125,7 +3125,7 @@ struct iax_event *iax_get_event(int blocking) {
|
||||
}
|
||||
break;
|
||||
case JB_DROP:
|
||||
// if(next != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not next %ld!\n", jb_next(cur->jb), next);
|
||||
// if (next != jb_next(cur->jb)) fprintf(stderr, "NEXT %ld is not next %ld!\n", jb_next(cur->jb), next);
|
||||
iax_event_free(frame.data);
|
||||
break;
|
||||
case JB_NOFRAME:
|
||||
|
||||
@@ -380,7 +380,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
||||
const char* val = NULL;
|
||||
|
||||
val = switch_channel_get_variable(tech_pvt->channel, "disable_q850_reason");
|
||||
if(!val || switch_true(val)) {
|
||||
if (!val || switch_true(val)) {
|
||||
if (cause > 0 && cause < 128) {
|
||||
switch_snprintf(reason, sizeof(reason), "Q.850;cause=%d;text=\"%s\"", cause, switch_channel_cause2str(cause));
|
||||
} else if (cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE) {
|
||||
|
||||
@@ -1090,7 +1090,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
||||
if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created TCP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
||||
}
|
||||
if(sofia_test_pflag(profile, PFLAG_TLS) && switch_nat_add_mapping(profile->tls_sip_port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_test_pflag(profile, PFLAG_TLS) && switch_nat_add_mapping(profile->tls_sip_port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created TCP/TLS nat mapping for %s port %d\n", profile->name, profile->tls_sip_port);
|
||||
}
|
||||
}
|
||||
@@ -1302,7 +1302,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
||||
if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_TCP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted TCP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
||||
}
|
||||
if(sofia_test_pflag(profile, PFLAG_TLS) && switch_nat_del_mapping(profile->tls_sip_port, SWITCH_NAT_TCP) == SWITCH_STATUS_SUCCESS) {
|
||||
if (sofia_test_pflag(profile, PFLAG_TLS) && switch_nat_del_mapping(profile->tls_sip_port, SWITCH_NAT_TCP) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted TCP/TLS nat mapping for %s port %d\n", profile->name, profile->tls_sip_port);
|
||||
}
|
||||
}
|
||||
@@ -4671,7 +4671,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
const char* val = NULL;
|
||||
sofia_set_flag_locked(b_tech_pvt, TFLAG_BYE);
|
||||
val = switch_channel_get_variable(tech_pvt->channel, "disable_q850_reason");
|
||||
if(!val || switch_true(val)) {
|
||||
if (!val || switch_true(val)) {
|
||||
q850 = switch_core_session_sprintf(a_session, "Q.850;cause=16;text=\"normal_clearing\"");
|
||||
}
|
||||
nua_bye(b_tech_pvt->nh,
|
||||
|
||||
@@ -2848,7 +2848,7 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha
|
||||
if ((zstr(map->rm_encoding) || (tech_pvt->profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {
|
||||
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
|
||||
} else {
|
||||
if(map->rm_encoding) {
|
||||
if (map->rm_encoding) {
|
||||
match = strcasecmp(map->rm_encoding, imp->iananame) ? 0 : 1;
|
||||
} else {
|
||||
match = 0;
|
||||
@@ -2856,7 +2856,7 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha
|
||||
}
|
||||
|
||||
if (match) {
|
||||
if(ptime > 0) {
|
||||
if (ptime > 0) {
|
||||
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (unsigned int) map->rm_rate, ptime);
|
||||
} else {
|
||||
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh", imp->iananame, (unsigned int) map->rm_rate);
|
||||
@@ -4385,10 +4385,10 @@ sofia_destination_t* sofia_glue_get_destination(char *data)
|
||||
goto mem_fail;
|
||||
}
|
||||
|
||||
if((eoc = strstr(contact, ";fs_path="))) {
|
||||
if ((eoc = strstr(contact, ";fs_path="))) {
|
||||
*eoc = '\0';
|
||||
|
||||
if(!(route = strdup(eoc + 9))) {
|
||||
if (!(route = strdup(eoc + 9))) {
|
||||
goto mem_fail;
|
||||
}
|
||||
|
||||
@@ -4415,7 +4415,7 @@ sofia_destination_t* sofia_glue_get_destination(char *data)
|
||||
goto mem_fail;
|
||||
}
|
||||
|
||||
if((eoc = strstr(to, ";fs_path="))) {
|
||||
if ((eoc = strstr(to, ";fs_path="))) {
|
||||
*eoc++ = '>';
|
||||
*eoc = '\0';
|
||||
}
|
||||
@@ -4495,7 +4495,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
|
||||
dst = sofia_glue_get_destination((char*) o_contact);
|
||||
switch_assert(dst);
|
||||
|
||||
if(dst->route_uri) {
|
||||
if (dst->route_uri) {
|
||||
route_uri = sofia_glue_strip_uri(dst->route_uri);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ void sofia_sla_handle_register(nua_t *nua, sofia_profile_t *profile, sip_t const
|
||||
|
||||
dst = sofia_glue_get_destination((char*) full_contact);
|
||||
|
||||
if(dst->route_uri) {
|
||||
if (dst->route_uri) {
|
||||
route_uri = sofia_glue_strip_uri(dst->route_uri);
|
||||
}
|
||||
|
||||
|
||||
@@ -835,7 +835,7 @@ static switch_status_t shout_file_read(switch_file_handle_t *handle, void *data,
|
||||
} else {
|
||||
/* no data, so insert 1 second of silence */
|
||||
newbytes = 2 * handle->samplerate;
|
||||
if(newbytes < bytes) {
|
||||
if (newbytes < bytes) {
|
||||
bytes = newbytes;
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Padding mp3 stream with 1s of empty audio. (%s)\n", context->stream_url);
|
||||
|
||||
@@ -192,7 +192,7 @@ static void *ll_load (lua_State *L, const char *path) {
|
||||
NSObjectFileImage img;
|
||||
NSObjectFileImageReturnCode ret;
|
||||
/* this would be a rare case, but prevents crashing if it happens */
|
||||
if(!_dyld_present()) {
|
||||
if (!_dyld_present()) {
|
||||
lua_pushliteral(L, "dyld not present");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -790,7 +790,7 @@ abyss_bool handler_hook(TSession * r)
|
||||
//SocketClose(&(r->conn->socket));
|
||||
|
||||
HTTPWriteEnd(r);
|
||||
//if(r->conn->channelP)
|
||||
//if (r->conn->channelP)
|
||||
//ConnKill(r->conn);
|
||||
//ChannelInterrupt(r->conn->channelP);
|
||||
//ConnClose(r->conn);
|
||||
|
||||
Reference in New Issue
Block a user