if space
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15893 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
376861fd8c
commit
21e3bb970a
|
@ -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);
|
||||
|
|
|
@ -136,7 +136,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_load_grammar(switch_asr_handle_t
|
|||
int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));
|
||||
for (i = 0; i < argc && param[i]; ++i) {
|
||||
char *param_pair[2] = { 0 };
|
||||
if(switch_separate_string(param[i], '=', param_pair, (sizeof(param_pair) / sizeof(param_pair[0]))) == 2) {
|
||||
if (switch_separate_string(param[i], '=', param_pair, (sizeof(param_pair) / sizeof(param_pair[0]))) == 2) {
|
||||
switch_core_asr_text_param(ah, param_pair[0], param_pair[1]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle
|
|||
int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));
|
||||
for (i = 0; i < argc && param[i]; ++i) {
|
||||
char *param_pair[2] = { 0 };
|
||||
if(switch_separate_string(param[i], '=', param_pair, (sizeof(param_pair) / sizeof(param_pair[0]))) == 2) {
|
||||
if (switch_separate_string(param[i], '=', param_pair, (sizeof(param_pair) / sizeof(param_pair[0]))) == 2) {
|
||||
switch_core_speech_text_param_tts(sh, param_pair[0], param_pair[1]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ static const et_info fmtinfo[] = {
|
|||
static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
|
||||
int digit;
|
||||
LONGDOUBLE_TYPE d;
|
||||
if( (*cnt)++ >= 16 ) return '0';
|
||||
if ( (*cnt)++ >= 16 ) return '0';
|
||||
digit = (int)*val;
|
||||
d = digit;
|
||||
digit += '0';
|
||||
|
@ -263,16 +263,16 @@ static int vxprintf(
|
|||
count = length = 0;
|
||||
bufpt = 0;
|
||||
for(; (c=(*fmt))!=0; ++fmt){
|
||||
if( c!='%' ){
|
||||
if ( c!='%' ){
|
||||
int amt;
|
||||
bufpt = (char *)fmt;
|
||||
amt = 1;
|
||||
while( (c=(*++fmt))!='%' && c!=0 ) amt++;
|
||||
(*func)(arg,bufpt,amt);
|
||||
count += amt;
|
||||
if( c==0 ) break;
|
||||
if ( c==0 ) break;
|
||||
}
|
||||
if( (c=(*++fmt))==0 ){
|
||||
if ( (c=(*++fmt))==0 ){
|
||||
errorflag = 1;
|
||||
(*func)(arg,"%",1);
|
||||
count++;
|
||||
|
@ -295,9 +295,9 @@ static int vxprintf(
|
|||
}while( !done && (c=(*++fmt))!=0 );
|
||||
/* Get the field width */
|
||||
width = 0;
|
||||
if( c=='*' ){
|
||||
if ( c=='*' ){
|
||||
width = va_arg(ap,int);
|
||||
if( width<0 ){
|
||||
if ( width<0 ){
|
||||
flag_leftjustify = 1;
|
||||
width = -width;
|
||||
}
|
||||
|
@ -308,16 +308,16 @@ static int vxprintf(
|
|||
c = *++fmt;
|
||||
}
|
||||
}
|
||||
if( width > etBUFSIZE-10 ){
|
||||
if ( width > etBUFSIZE-10 ){
|
||||
width = etBUFSIZE-10;
|
||||
}
|
||||
/* Get the precision */
|
||||
if( c=='.' ){
|
||||
if ( c=='.' ){
|
||||
precision = 0;
|
||||
c = *++fmt;
|
||||
if( c=='*' ){
|
||||
if ( c=='*' ){
|
||||
precision = va_arg(ap,int);
|
||||
if( precision<0 ) precision = -precision;
|
||||
if ( precision<0 ) precision = -precision;
|
||||
c = *++fmt;
|
||||
}else{
|
||||
while( c>='0' && c<='9' ){
|
||||
|
@ -329,10 +329,10 @@ static int vxprintf(
|
|||
precision = -1;
|
||||
}
|
||||
/* Get the conversion type modifier */
|
||||
if( c=='l' ){
|
||||
if ( c=='l' ){
|
||||
flag_long = 1;
|
||||
c = *++fmt;
|
||||
if( c=='l' ){
|
||||
if ( c=='l' ){
|
||||
flag_longlong = 1;
|
||||
c = *++fmt;
|
||||
}else{
|
||||
|
@ -344,9 +344,9 @@ static int vxprintf(
|
|||
/* Fetch the info entry for the field */
|
||||
infop = 0;
|
||||
for(idx=0; idx<etNINFO; idx++){
|
||||
if( c==fmtinfo[idx].fmttype ){
|
||||
if ( c==fmtinfo[idx].fmttype ){
|
||||
infop = &fmtinfo[idx];
|
||||
if( useExtended || (infop->flags & FLAG_INTERN)==0 ){
|
||||
if ( useExtended || (infop->flags & FLAG_INTERN)==0 ){
|
||||
xtype = infop->type;
|
||||
}else{
|
||||
return -1;
|
||||
|
@ -355,13 +355,13 @@ static int vxprintf(
|
|||
}
|
||||
}
|
||||
zExtra = 0;
|
||||
if( infop==0 ){
|
||||
if ( infop==0 ){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Limit the precision to prevent overflowing buf[] during conversion */
|
||||
if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
|
||||
if ( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
|
||||
precision = etBUFSIZE-40;
|
||||
}
|
||||
|
||||
|
@ -392,28 +392,28 @@ static int vxprintf(
|
|||
flag_long = sizeof(char*)==sizeof(long int);
|
||||
/* Fall through into the next case */
|
||||
case etRADIX:
|
||||
if( infop->flags & FLAG_SIGNED ){
|
||||
if ( infop->flags & FLAG_SIGNED ){
|
||||
int64_t v;
|
||||
if( flag_longlong ) v = va_arg(ap,int64_t);
|
||||
else if( flag_long ) v = va_arg(ap,long int);
|
||||
if ( flag_longlong ) v = va_arg(ap,int64_t);
|
||||
else if ( flag_long ) v = va_arg(ap,long int);
|
||||
else v = va_arg(ap,int);
|
||||
if( v<0 ){
|
||||
if ( v<0 ){
|
||||
longvalue = -v;
|
||||
prefix = '-';
|
||||
}else{
|
||||
longvalue = v;
|
||||
if( flag_plussign ) prefix = '+';
|
||||
else if( flag_blanksign ) prefix = ' ';
|
||||
if ( flag_plussign ) prefix = '+';
|
||||
else if ( flag_blanksign ) prefix = ' ';
|
||||
else prefix = 0;
|
||||
}
|
||||
}else{
|
||||
if( flag_longlong ) longvalue = va_arg(ap,uint64_t);
|
||||
else if( flag_long ) longvalue = va_arg(ap,unsigned long int);
|
||||
if ( flag_longlong ) longvalue = va_arg(ap,uint64_t);
|
||||
else if ( flag_long ) longvalue = va_arg(ap,unsigned long int);
|
||||
else longvalue = va_arg(ap,unsigned int);
|
||||
prefix = 0;
|
||||
}
|
||||
if( longvalue==0 ) flag_alternateform = 0;
|
||||
if( flag_zeropad && precision<width-(prefix!=0) ){
|
||||
if ( longvalue==0 ) flag_alternateform = 0;
|
||||
if ( flag_zeropad && precision<width-(prefix!=0) ){
|
||||
precision = width-(prefix!=0);
|
||||
}
|
||||
bufpt = &buf[etBUFSIZE-1];
|
||||
|
@ -431,12 +431,12 @@ static int vxprintf(
|
|||
for(idx=precision-length; idx>0; idx--){
|
||||
*(--bufpt) = '0'; /* Zero pad */
|
||||
}
|
||||
if( prefix ) *(--bufpt) = prefix; /* Add sign */
|
||||
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
|
||||
if ( prefix ) *(--bufpt) = prefix; /* Add sign */
|
||||
if ( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
|
||||
const char *pre;
|
||||
char x;
|
||||
pre = &aPrefix[infop->prefix];
|
||||
if( *bufpt!=pre[0] ){
|
||||
if ( *bufpt!=pre[0] ){
|
||||
for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
|
||||
}
|
||||
}
|
||||
|
@ -447,17 +447,17 @@ static int vxprintf(
|
|||
case etGENERIC:
|
||||
realvalue = va_arg(ap,double);
|
||||
#ifndef SWITCH_OMIT_FLOATING_POINT
|
||||
if( precision<0 ) precision = 6; /* Set default precision */
|
||||
if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
|
||||
if( realvalue<0.0 ){
|
||||
if ( precision<0 ) precision = 6; /* Set default precision */
|
||||
if ( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
|
||||
if ( realvalue<0.0 ){
|
||||
realvalue = -realvalue;
|
||||
prefix = '-';
|
||||
}else{
|
||||
if( flag_plussign ) prefix = '+';
|
||||
else if( flag_blanksign ) prefix = ' ';
|
||||
if ( flag_plussign ) prefix = '+';
|
||||
else if ( flag_blanksign ) prefix = ' ';
|
||||
else prefix = 0;
|
||||
}
|
||||
if( xtype==etGENERIC && precision>0 ) precision--;
|
||||
if ( xtype==etGENERIC && precision>0 ) precision--;
|
||||
#if 0
|
||||
/* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
|
||||
for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
|
||||
|
@ -465,16 +465,16 @@ static int vxprintf(
|
|||
/* It makes more sense to use 0.5 */
|
||||
for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}
|
||||
#endif
|
||||
if( xtype==etFLOAT ) realvalue += rounder;
|
||||
if ( xtype==etFLOAT ) realvalue += rounder;
|
||||
/* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
|
||||
exp = 0;
|
||||
if( realvalue>0.0 ){
|
||||
if ( realvalue>0.0 ){
|
||||
while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; }
|
||||
while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; }
|
||||
while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }
|
||||
while( realvalue<1e-8 && exp>=-350 ){ realvalue *= 1e8; exp-=8; }
|
||||
while( realvalue<1.0 && exp>=-350 ){ realvalue *= 10.0; exp--; }
|
||||
if( exp>350 || exp<-350 ){
|
||||
if ( exp>350 || exp<-350 ){
|
||||
bufpt = "NaN";
|
||||
length = 3;
|
||||
break;
|
||||
|
@ -486,13 +486,13 @@ static int vxprintf(
|
|||
** or etFLOAT, as appropriate.
|
||||
*/
|
||||
flag_exp = xtype==etEXP;
|
||||
if( xtype!=etFLOAT ){
|
||||
if ( xtype!=etFLOAT ){
|
||||
realvalue += rounder;
|
||||
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
|
||||
if ( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
|
||||
}
|
||||
if( xtype==etGENERIC ){
|
||||
if ( xtype==etGENERIC ){
|
||||
flag_rtz = !flag_alternateform;
|
||||
if( exp<-4 || exp>precision ){
|
||||
if ( exp<-4 || exp>precision ){
|
||||
xtype = etEXP;
|
||||
}else{
|
||||
precision = precision - exp;
|
||||
|
@ -501,7 +501,7 @@ static int vxprintf(
|
|||
}else{
|
||||
flag_rtz = 0;
|
||||
}
|
||||
if( xtype==etEXP ){
|
||||
if ( xtype==etEXP ){
|
||||
e2 = 0;
|
||||
}else{
|
||||
e2 = exp;
|
||||
|
@ -509,11 +509,11 @@ static int vxprintf(
|
|||
nsd = 0;
|
||||
flag_dp = (precision>0) | flag_alternateform | flag_altform2;
|
||||
/* The sign in front of the number */
|
||||
if( prefix ){
|
||||
if ( prefix ){
|
||||
*(bufpt++) = prefix;
|
||||
}
|
||||
/* Digits prior to the decimal point */
|
||||
if( e2<0 ){
|
||||
if ( e2<0 ){
|
||||
*(bufpt++) = '0';
|
||||
}else{
|
||||
for(; e2>=0; e2--){
|
||||
|
@ -521,7 +521,7 @@ static int vxprintf(
|
|||
}
|
||||
}
|
||||
/* The decimal point */
|
||||
if( flag_dp ){
|
||||
if ( flag_dp ){
|
||||
*(bufpt++) = '.';
|
||||
}
|
||||
/* "0" digits after the decimal point but before the first
|
||||
|
@ -534,11 +534,11 @@ static int vxprintf(
|
|||
*(bufpt++) = (char)et_getdigit(&realvalue,&nsd);
|
||||
}
|
||||
/* Remove trailing zeros and the "." if no digits follow the "." */
|
||||
if( flag_rtz && flag_dp ){
|
||||
if ( flag_rtz && flag_dp ){
|
||||
while( bufpt[-1]=='0' ) *(--bufpt) = 0;
|
||||
assert( bufpt>buf );
|
||||
if( bufpt[-1]=='.' ){
|
||||
if( flag_altform2 ){
|
||||
if ( bufpt[-1]=='.' ){
|
||||
if ( flag_altform2 ){
|
||||
*(bufpt++) = '0';
|
||||
}else{
|
||||
*(--bufpt) = 0;
|
||||
|
@ -546,14 +546,14 @@ static int vxprintf(
|
|||
}
|
||||
}
|
||||
/* Add the "eNNN" suffix */
|
||||
if( flag_exp || (xtype==etEXP && exp) ){
|
||||
if ( flag_exp || (xtype==etEXP && exp) ){
|
||||
*(bufpt++) = aDigits[infop->charset];
|
||||
if( exp<0 ){
|
||||
if ( exp<0 ){
|
||||
*(bufpt++) = '-'; exp = -exp;
|
||||
}else{
|
||||
*(bufpt++) = '+';
|
||||
}
|
||||
if( exp>=100 ){
|
||||
if ( exp>=100 ){
|
||||
*(bufpt++) = (char)(exp/100)+'0'; /* 100's digit */
|
||||
exp %= 100;
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ static int vxprintf(
|
|||
|
||||
/* Special case: Add leading zeros if the flag_zeropad flag is
|
||||
** set and we are not left justified */
|
||||
if( flag_zeropad && !flag_leftjustify && length < width){
|
||||
if ( flag_zeropad && !flag_leftjustify && length < width){
|
||||
int i;
|
||||
int nPad = width - length;
|
||||
for(i=width; i>=nPad; i--){
|
||||
|
@ -594,7 +594,7 @@ static int vxprintf(
|
|||
case etCHARLIT:
|
||||
case etCHARX:
|
||||
c = buf[0] = (char)(xtype==etCHARX ? va_arg(ap,int) : *++fmt);
|
||||
if( precision>=0 ){
|
||||
if ( precision>=0 ){
|
||||
for(idx=1; idx<precision; idx++) buf[idx] = (char)c;
|
||||
length = precision;
|
||||
}else{
|
||||
|
@ -605,13 +605,13 @@ static int vxprintf(
|
|||
case etSTRING:
|
||||
case etDYNSTRING:
|
||||
bufpt = va_arg(ap,char*);
|
||||
if( bufpt==0 ){
|
||||
if ( bufpt==0 ){
|
||||
bufpt = "";
|
||||
}else if( xtype==etDYNSTRING ){
|
||||
}else if ( xtype==etDYNSTRING ){
|
||||
zExtra = bufpt;
|
||||
}
|
||||
length = strlen(bufpt);
|
||||
if( precision>=0 && precision<length ) length = precision;
|
||||
if ( precision>=0 && precision<length ) length = precision;
|
||||
break;
|
||||
case etSQLESCAPE:
|
||||
case etSQLESCAPE2:
|
||||
|
@ -620,35 +620,35 @@ static int vxprintf(
|
|||
int needQuote;
|
||||
char *escarg = va_arg(ap,char*);
|
||||
isnull = escarg==0;
|
||||
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
|
||||
if ( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
|
||||
for(i=n=0; (ch=escarg[i])!=0; i++){
|
||||
if( ch=='\'' || (xtype==etSQLESCAPE3 && ch=='\\')) n++;
|
||||
if ( ch=='\'' || (xtype==etSQLESCAPE3 && ch=='\\')) n++;
|
||||
}
|
||||
needQuote = !isnull && xtype==etSQLESCAPE2;
|
||||
n += i + 1 + needQuote*2;
|
||||
if( n>etBUFSIZE ){
|
||||
if ( n>etBUFSIZE ){
|
||||
bufpt = zExtra = malloc( n );
|
||||
if( bufpt==0 ) return -1;
|
||||
if ( bufpt==0 ) return -1;
|
||||
}else{
|
||||
bufpt = buf;
|
||||
}
|
||||
j = 0;
|
||||
if( needQuote ) bufpt[j++] = '\'';
|
||||
if ( needQuote ) bufpt[j++] = '\'';
|
||||
for(i=0; (ch=escarg[i])!=0; i++){
|
||||
bufpt[j++] = (char)ch;
|
||||
if( ch=='\'' || ( xtype==etSQLESCAPE3 && ch=='\\')) bufpt[j++] = (char)ch;
|
||||
if ( ch=='\'' || ( xtype==etSQLESCAPE3 && ch=='\\')) bufpt[j++] = (char)ch;
|
||||
}
|
||||
if( needQuote ) bufpt[j++] = '\'';
|
||||
if ( needQuote ) bufpt[j++] = '\'';
|
||||
bufpt[j] = 0;
|
||||
length = j;
|
||||
/* The precision is ignored on %q and %Q */
|
||||
/* if( precision>=0 && precision<length ) length = precision; */
|
||||
/* if ( precision>=0 && precision<length ) length = precision; */
|
||||
break;
|
||||
}
|
||||
#ifdef __UNSUPPORTED__
|
||||
case etTOKEN: {
|
||||
Token *pToken = va_arg(ap, Token*);
|
||||
if( pToken && pToken->z ){
|
||||
if ( pToken && pToken->z ){
|
||||
(*func)(arg, (char*)pToken->z, pToken->n);
|
||||
}
|
||||
length = width = 0;
|
||||
|
@ -659,7 +659,7 @@ static int vxprintf(
|
|||
int k = va_arg(ap, int);
|
||||
struct SrcList_item *pItem = &pSrc->a[k];
|
||||
assert( k>=0 && k<pSrc->nSrc );
|
||||
if( pItem->zDatabase && pItem->zDatabase[0] ){
|
||||
if ( pItem->zDatabase && pItem->zDatabase[0] ){
|
||||
(*func)(arg, pItem->zDatabase, strlen(pItem->zDatabase));
|
||||
(*func)(arg, ".", 1);
|
||||
}
|
||||
|
@ -674,35 +674,35 @@ static int vxprintf(
|
|||
** "length" characters long. The field width is "width". Do
|
||||
** the output.
|
||||
*/
|
||||
if( !flag_leftjustify ){
|
||||
if ( !flag_leftjustify ){
|
||||
register int nspace;
|
||||
nspace = width-length;
|
||||
if( nspace>0 ){
|
||||
if ( nspace>0 ){
|
||||
count += nspace;
|
||||
while( nspace>=etSPACESIZE ){
|
||||
(*func)(arg,spaces,etSPACESIZE);
|
||||
nspace -= etSPACESIZE;
|
||||
}
|
||||
if( nspace>0 ) (*func)(arg,spaces,nspace);
|
||||
if ( nspace>0 ) (*func)(arg,spaces,nspace);
|
||||
}
|
||||
}
|
||||
if( length>0 ){
|
||||
if ( length>0 ){
|
||||
(*func)(arg,bufpt,length);
|
||||
count += length;
|
||||
}
|
||||
if( flag_leftjustify ){
|
||||
if ( flag_leftjustify ){
|
||||
register int nspace;
|
||||
nspace = width-length;
|
||||
if( nspace>0 ){
|
||||
if ( nspace>0 ){
|
||||
count += nspace;
|
||||
while( nspace>=etSPACESIZE ){
|
||||
(*func)(arg,spaces,etSPACESIZE);
|
||||
nspace -= etSPACESIZE;
|
||||
}
|
||||
if( nspace>0 ) (*func)(arg,spaces,nspace);
|
||||
if ( nspace>0 ) (*func)(arg,spaces,nspace);
|
||||
}
|
||||
}
|
||||
if( zExtra ){
|
||||
if ( zExtra ){
|
||||
free(zExtra);
|
||||
}
|
||||
}/* End for loop over the format string */
|
||||
|
@ -731,27 +731,27 @@ struct sgMprintf {
|
|||
static void mout(void *arg, const char *zNewText, int nNewChar){
|
||||
struct sgMprintf *pM = (struct sgMprintf*)arg;
|
||||
pM->nTotal += nNewChar;
|
||||
if( pM->nChar + nNewChar + 1 > pM->nAlloc ){
|
||||
if( pM->xRealloc==0 ){
|
||||
if ( pM->nChar + nNewChar + 1 > pM->nAlloc ){
|
||||
if ( pM->xRealloc==0 ){
|
||||
nNewChar = pM->nAlloc - pM->nChar - 1;
|
||||
}else{
|
||||
pM->nAlloc = pM->nChar + nNewChar*2 + 1;
|
||||
if( pM->zText==pM->zBase ){
|
||||
if ( pM->zText==pM->zBase ){
|
||||
pM->zText = pM->xRealloc(0, pM->nAlloc);
|
||||
if( pM->zText && pM->nChar ){
|
||||
if ( pM->zText && pM->nChar ){
|
||||
memcpy(pM->zText, pM->zBase, pM->nChar);
|
||||
}
|
||||
}else{
|
||||
char *zNew;
|
||||
zNew = pM->xRealloc(pM->zText, pM->nAlloc);
|
||||
if( zNew ){
|
||||
if ( zNew ){
|
||||
pM->zText = zNew;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if( pM->zText ){
|
||||
if( nNewChar>0 ){
|
||||
if ( pM->zText ){
|
||||
if ( nNewChar>0 ){
|
||||
memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
|
||||
pM->nChar += nNewChar;
|
||||
}
|
||||
|
@ -777,15 +777,15 @@ static char *base_vprintf(
|
|||
sM.nAlloc = nInitBuf;
|
||||
sM.xRealloc = xRealloc;
|
||||
vxprintf(mout, &sM, useInternal, zFormat, ap);
|
||||
if( xRealloc ){
|
||||
if( sM.zText==sM.zBase ){
|
||||
if ( xRealloc ){
|
||||
if ( sM.zText==sM.zBase ){
|
||||
sM.zText = xRealloc(0, sM.nChar+1);
|
||||
if( sM.zText ){
|
||||
if ( sM.zText ){
|
||||
memcpy(sM.zText, sM.zBase, sM.nChar+1);
|
||||
}
|
||||
}else if( sM.nAlloc>sM.nChar+10 ){
|
||||
}else if ( sM.nAlloc>sM.nChar+10 ){
|
||||
char *zNew = xRealloc(sM.zText, sM.nChar+1);
|
||||
if( zNew ){
|
||||
if ( zNew ){
|
||||
sM.zText = zNew;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -425,7 +425,7 @@ static switch_status_t switch_nat_add_mapping_pmp(switch_port_t port, switch_nat
|
|||
|
||||
if (proto == SWITCH_NAT_TCP) {
|
||||
sendnewportmappingrequest(&natpmp, NATPMP_PROTOCOL_TCP, port, port, 31104000);
|
||||
} else if(proto == SWITCH_NAT_UDP) {
|
||||
} else if (proto == SWITCH_NAT_UDP) {
|
||||
sendnewportmappingrequest(&natpmp, NATPMP_PROTOCOL_UDP, port, port, 31104000);
|
||||
}
|
||||
|
||||
|
@ -474,7 +474,7 @@ static switch_status_t switch_nat_add_mapping_upnp(switch_port_t port, switch_na
|
|||
if (proto == SWITCH_NAT_TCP) {
|
||||
r = UPNP_AddPortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, port_str,
|
||||
nat_globals.pvt_addr, "FreeSWITCH", "TCP", 0);
|
||||
} else if(proto == SWITCH_NAT_UDP) {
|
||||
} else if (proto == SWITCH_NAT_UDP) {
|
||||
r = UPNP_AddPortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, port_str,
|
||||
nat_globals.pvt_addr, "FreeSWITCH", "UDP", 0);
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ static switch_status_t switch_nat_del_mapping_pmp(switch_port_t port, switch_nat
|
|||
|
||||
if (proto == SWITCH_NAT_TCP) {
|
||||
sendnewportmappingrequest(&natpmp, NATPMP_PROTOCOL_TCP, port, port, 0);
|
||||
} else if(proto == SWITCH_NAT_UDP) {
|
||||
} else if (proto == SWITCH_NAT_UDP) {
|
||||
sendnewportmappingrequest(&natpmp, NATPMP_PROTOCOL_UDP, port, port, 0);
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
|
|||
|
||||
if (proto == SWITCH_NAT_TCP) {
|
||||
r = UPNP_DeletePortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, "TCP", 0);
|
||||
} else if(proto == SWITCH_NAT_UDP) {
|
||||
} else if (proto == SWITCH_NAT_UDP) {
|
||||
r = UPNP_DeletePortMapping(nat_globals.urls.controlURL, nat_globals.data.servicetype, port_str, "UDP", 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -2974,7 +2974,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
|
|||
if (zrtp_session_info.sas_is_ready) {
|
||||
if (rtp_session->zrtp_mitm_tries > ZRTP_MITM_TRIES) {
|
||||
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND);
|
||||
} else if(zrtp_status_ok == zrtp_resolve_mitm_call(frame->extra_data, rtp_session->zrtp_ctx)) {
|
||||
} else if (zrtp_status_ok == zrtp_resolve_mitm_call(frame->extra_data, rtp_session->zrtp_ctx)) {
|
||||
switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND);
|
||||
zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid,
|
||||
&rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified^1);
|
||||
|
|
Loading…
Reference in New Issue