mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 04:27:06 +00:00
Lots of trivial tweaks to minimize compiler warnings, especially on 64-bit platform: Added missing type casts, changed types, added missing NULL checks.
This commit is contained in:
1 parent
643c88f49b
commit
084e245085
57 files changed
+226
-216
No files matched your search
@@ -695,7 +695,7 @@ static cc_queue_t *load_queue(const char *queue_name)
|
||||
queue_set_config(queue);
|
||||
|
||||
/* Add the params to the event structure */
|
||||
count = switch_event_import_xml(switch_xml_child(x_queue, "param"), "name", "value", &event);
|
||||
count = (int)switch_event_import_xml(switch_xml_child(x_queue, "param"), "name", "value", &event);
|
||||
|
||||
if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, queue->config) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to process configuration\n");
|
||||
@@ -1938,11 +1938,11 @@ static int agents_callback(void *pArg, int argc, char **argv, char **columnNames
|
||||
if (cbt->tier_rule_no_agent_no_wait == SWITCH_TRUE && cbt->tier_agent_available == 0) {
|
||||
cbt->tier = atoi(agent_tier_level);
|
||||
/* Multiple the tier level by the tier wait time */
|
||||
} else if (cbt->tier_rule_wait_multiply_level == SWITCH_TRUE && (long) local_epoch_time_now(NULL) - atol(cbt->member_joined_epoch) >= atoi(agent_tier_level) * cbt->tier_rule_wait_second) {
|
||||
} else if (cbt->tier_rule_wait_multiply_level == SWITCH_TRUE && (long) local_epoch_time_now(NULL) - atol(cbt->member_joined_epoch) >= atoi(agent_tier_level) * (int)cbt->tier_rule_wait_second) {
|
||||
cbt->tier = atoi(agent_tier_level);
|
||||
cbt->tier_agent_available = 0;
|
||||
/* Just check if joined is bigger than next tier wait time */
|
||||
} else if (cbt->tier_rule_wait_multiply_level == SWITCH_FALSE && (long) local_epoch_time_now(NULL) - atol(cbt->member_joined_epoch) >= cbt->tier_rule_wait_second) {
|
||||
} else if (cbt->tier_rule_wait_multiply_level == SWITCH_FALSE && (long) local_epoch_time_now(NULL) - atol(cbt->member_joined_epoch) >= (int)cbt->tier_rule_wait_second) {
|
||||
cbt->tier = atoi(agent_tier_level);
|
||||
cbt->tier_agent_available = 0;
|
||||
} else {
|
||||
@@ -2069,8 +2069,6 @@ static int agents_callback(void *pArg, int argc, char **argv, char **columnNames
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int members_callback(void *pArg, int argc, char **argv, char **columnNames)
|
||||
|
||||
@@ -1407,7 +1407,7 @@ SWITCH_STANDARD_API(expand_function)
|
||||
}
|
||||
}
|
||||
|
||||
if ((arg = strchr(mycmd, ' '))) {
|
||||
if (mycmd && (arg = strchr(mycmd, ' '))) {
|
||||
*arg++ = '\0';
|
||||
}
|
||||
|
||||
@@ -6305,7 +6305,7 @@ SWITCH_STANDARD_JSON_API(json_status_function)
|
||||
oo = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(o, "count", oo);
|
||||
|
||||
cJSON_AddItemToObject(oo, "total", cJSON_CreateNumber(switch_core_session_id() - 1));
|
||||
cJSON_AddItemToObject(oo, "total", cJSON_CreateNumber((double)(switch_core_session_id() - 1)));
|
||||
cJSON_AddItemToObject(oo, "active", cJSON_CreateNumber(switch_core_session_count()));
|
||||
cJSON_AddItemToObject(oo, "peak", cJSON_CreateNumber(sessions_peak));
|
||||
cJSON_AddItemToObject(oo, "peak5Min", cJSON_CreateNumber(sessions_peak_fivemin));
|
||||
@@ -6332,8 +6332,8 @@ SWITCH_STANDARD_JSON_API(json_status_function)
|
||||
o = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(reply, "stackSizeKB", o);
|
||||
|
||||
cJSON_AddItemToObject(o, "current", cJSON_CreateNumber(cur / 1024));
|
||||
cJSON_AddItemToObject(o, "max", cJSON_CreateNumber(max / 1024));
|
||||
cJSON_AddItemToObject(o, "current", cJSON_CreateNumber((double)(cur / 1024)));
|
||||
cJSON_AddItemToObject(o, "max", cJSON_CreateNumber((double)(max / 1024)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2365,7 +2365,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
||||
{
|
||||
conference_obj_t *conference = (conference_obj_t *) obj;
|
||||
conference_member_t *imember;
|
||||
switch_frame_t *vid_frame;
|
||||
switch_frame_t *vid_frame = NULL;
|
||||
switch_status_t status;
|
||||
int want_refresh = 0;
|
||||
int yield = 0;
|
||||
@@ -2706,7 +2706,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
||||
} else if (conference->fnode->type == NODE_TYPE_FILE) {
|
||||
switch_core_file_read(&conference->fnode->fh, file_frame, &file_sample_len);
|
||||
if (conference->fnode->fh.vol) {
|
||||
switch_change_sln_volume_granular((void *)file_frame, file_sample_len, conference->fnode->fh.vol);
|
||||
switch_change_sln_volume_granular((void *)file_frame, (uint32_t)file_sample_len, conference->fnode->fh.vol);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3583,10 +3583,10 @@ static int noise_gate_check(conference_member_t *member)
|
||||
|
||||
if (target_score < 0) target_score = 0;
|
||||
|
||||
r = member->score > target_score;
|
||||
r = (int)member->score > target_score;
|
||||
|
||||
} else {
|
||||
r = member->score > member->energy_level;
|
||||
r = (int32_t)member->score > member->energy_level;
|
||||
}
|
||||
|
||||
return r;
|
||||
@@ -3607,11 +3607,11 @@ static void check_agc_levels(conference_member_t *member)
|
||||
|
||||
if (!member->avg_score) return;
|
||||
|
||||
if (member->avg_score < member->conference->agc_level - 100) {
|
||||
if ((int)member->avg_score < member->conference->agc_level - 100) {
|
||||
member->agc_volume_in_level++;
|
||||
switch_normalize_volume_granular(member->agc_volume_in_level);
|
||||
x = 1;
|
||||
} else if (member->avg_score > member->conference->agc_level + 100) {
|
||||
} else if ((int)member->avg_score > member->conference->agc_level + 100) {
|
||||
member->agc_volume_in_level--;
|
||||
switch_normalize_volume_granular(member->agc_volume_in_level);
|
||||
x = -1;
|
||||
@@ -3743,7 +3743,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
||||
goto do_continue;
|
||||
}
|
||||
|
||||
if (member->nt_tally > (member->read_impl.actual_samples_per_second / member->read_impl.samples_per_packet) * 3) {
|
||||
if (member->nt_tally > (int32_t)(member->read_impl.actual_samples_per_second / member->read_impl.samples_per_packet) * 3) {
|
||||
member->agc_volume_in_level = 0;
|
||||
clear_avg(member);
|
||||
}
|
||||
@@ -4016,14 +4016,14 @@ static void member_add_file_data(conference_member_t *member, int16_t *data, swi
|
||||
|
||||
/* Check for output volume adjustments */
|
||||
if (member->volume_out_level) {
|
||||
switch_change_sln_volume(file_frame, file_sample_len, member->volume_out_level);
|
||||
switch_change_sln_volume(file_frame, (uint32_t)file_sample_len, member->volume_out_level);
|
||||
}
|
||||
|
||||
for (i = 0; i < file_sample_len; i++) {
|
||||
if (member->fnode->mux) {
|
||||
sample = data[i] + file_frame[i];
|
||||
switch_normalize_to_16bit(sample);
|
||||
data[i] = sample;
|
||||
data[i] = (int16_t)sample;
|
||||
} else {
|
||||
data[i] = file_frame[i];
|
||||
}
|
||||
@@ -8398,7 +8398,7 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
while (!pin_valid && pin_retries && status == SWITCH_STATUS_SUCCESS) {
|
||||
size_t dpin_length = dpin ? strlen(dpin) : 0;
|
||||
size_t mdpin_length = mdpin ? strlen(mdpin) : 0;
|
||||
int maxpin = dpin_length > mdpin_length ? dpin_length : mdpin_length;
|
||||
int maxpin = dpin_length > mdpin_length ? (int)dpin_length : (int)mdpin_length;
|
||||
switch_status_t pstatus = SWITCH_STATUS_FALSE;
|
||||
|
||||
/* be friendly */
|
||||
|
||||
@@ -177,7 +177,7 @@ char *string_to_keypad_digit(const char *in)
|
||||
|
||||
while (*s) {
|
||||
char c;
|
||||
if ((c = digit_matching_keypad(*s++)) > 0) {
|
||||
if ((c = (char)digit_matching_keypad(*s++)) > 0) {
|
||||
*d++ = c + 48;
|
||||
}
|
||||
}
|
||||
@@ -843,7 +843,7 @@ switch_status_t navigate_entrys(switch_core_session_t *session, dir_profile_t *p
|
||||
params->try_again = 1;
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
goto end;
|
||||
} else if (profile->max_result != 0 && result_count > profile->max_result) {
|
||||
} else if (profile->max_result != 0 && (uint32_t)result_count > profile->max_result) {
|
||||
switch_ivr_phrase_macro(session, DIR_RESULT_COUNT_TOO_LARGE, NULL, NULL, NULL);
|
||||
params->try_again = 1;
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
|
||||
@@ -4749,7 +4749,7 @@ SWITCH_STANDARD_APP(blind_transfer_ack_function)
|
||||
switch_bool_t val = 0;
|
||||
|
||||
if (data) {
|
||||
val = switch_true((char *) val);
|
||||
val = (switch_bool_t)switch_true((char *) data);
|
||||
}
|
||||
|
||||
switch_ivr_blind_transfer_ack(session, val);
|
||||
@@ -5233,7 +5233,7 @@ void *SWITCH_THREAD_FUNC call_monitor_thread(switch_thread_t *thread, void *obj)
|
||||
switch_mutex_t *mutex;
|
||||
uint32_t counter = 0;
|
||||
switch_memory_pool_t *pool = cm->pool;
|
||||
int size;
|
||||
unsigned int size;
|
||||
char *argv[512] = { 0 };
|
||||
int busy = 0;
|
||||
switch_event_t *var_event = NULL;
|
||||
|
||||
@@ -1720,15 +1720,15 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
||||
|
||||
expanded_originate_string = switch_event_expand_headers(ovars, h->originate_string);
|
||||
|
||||
if (switch_stristr("origination_caller", expanded_originate_string)) {
|
||||
if (node && switch_stristr("origination_caller", expanded_originate_string)) {
|
||||
originate_string = switch_mprintf("{execute_on_answer='unset fifo_hangup_check',fifo_name='%q',fifo_hangup_check='%q'}%s",
|
||||
node->name, node->name, expanded_originate_string);
|
||||
} else {
|
||||
if (!zstr(node->outbound_name)) {
|
||||
if (node && !zstr(node->outbound_name)) {
|
||||
originate_string = switch_mprintf("{execute_on_answer='unset fifo_hangup_check',fifo_name='%q',fifo_hangup_check='%q',"
|
||||
"origination_caller_id_name=Queue,origination_caller_id_number='Queue: %q'}%s",
|
||||
node->name, node->name, node->outbound_name, expanded_originate_string);
|
||||
} else {
|
||||
} else if (node) {
|
||||
originate_string = switch_mprintf("{execute_on_answer='unset fifo_hangup_check',fifo_name='%q',fifo_hangup_check='%q',"
|
||||
"origination_caller_id_name=Queue,origination_caller_id_number='Queue: %q'}%s",
|
||||
node->name, node->name, node->name, expanded_originate_string);
|
||||
@@ -1737,7 +1737,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
||||
}
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node ? node->name : "");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "pre-dial");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Outbound-UUID", h->uuid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "outbound-strategy", "enterprise");
|
||||
@@ -1759,7 +1759,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
||||
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node ? node->name : "");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "post-dial");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Outbound-UUID", h->uuid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "outbound-strategy", "enterprise");
|
||||
@@ -1776,7 +1776,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node ? node->name : "");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "post-dial");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Outbound-UUID", h->uuid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "outbound-strategy", "enterprise");
|
||||
|
||||
@@ -690,7 +690,7 @@ end:
|
||||
|
||||
static switch_status_t fsv_file_write(switch_file_handle_t *handle, void *data, size_t *len)
|
||||
{
|
||||
uint32_t datalen = *len * 2;
|
||||
size_t datalen = *len * 2;
|
||||
size_t size;
|
||||
switch_status_t status;
|
||||
|
||||
@@ -720,7 +720,7 @@ static switch_status_t fsv_file_write(switch_file_handle_t *handle, void *data,
|
||||
|
||||
static switch_status_t fsv_file_write_video(switch_file_handle_t *handle, void *data, size_t *len)
|
||||
{
|
||||
uint32_t datalen = *len;
|
||||
uint32_t datalen = (uint32_t)*len;
|
||||
uint32_t bytes = datalen | VID_BIT;
|
||||
size_t size;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
@@ -58,7 +58,7 @@ typedef struct {
|
||||
uint32_t rate_usage; /* < Current rate usage */
|
||||
time_t last_check; /* < Last rate check */
|
||||
uint32_t interval; /* < Interval used on last rate check */
|
||||
uint32_t last_update; /* < Last updated timestamp (rate or total) */
|
||||
switch_time_t last_update; /* < Last updated timestamp (rate or total) */
|
||||
} limit_hash_item_t;
|
||||
|
||||
struct callback {
|
||||
@@ -837,7 +837,7 @@ static void *SWITCH_THREAD_FUNC limit_remote_thread(switch_thread_t *thread, voi
|
||||
limit_remote_t *remote = (limit_remote_t*)obj;
|
||||
while (remote->state > REMOTE_OFF) {
|
||||
if (remote->state != REMOTE_UP) {
|
||||
if (esl_connect_timeout(&remote->handle, remote->host, remote->port, remote->username, remote->password, 5000) == ESL_SUCCESS) {
|
||||
if (esl_connect_timeout(&remote->handle, remote->host, (esl_port_t)remote->port, remote->username, remote->password, 5000) == ESL_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Connected to remote FreeSWITCH (%s) at %s:%d\n",
|
||||
remote->name, remote->host, remote->port);
|
||||
|
||||
|
||||
@@ -1892,15 +1892,15 @@ static switch_status_t do_config(void)
|
||||
char *val = (char *) switch_xml_attr_soft(param, "value");
|
||||
|
||||
if (!strcasecmp(var, "all")) {
|
||||
switch_byte_t all = switch_true(val);
|
||||
switch_byte_t all = switch_true_byte(val);
|
||||
memset(&profile->perms, all, sizeof(profile->perms));
|
||||
} else if (!strcasecmp(var, "none")) {
|
||||
switch_byte_t none = switch_true(val);
|
||||
switch_byte_t none = switch_true_byte(val);
|
||||
memset(&profile->perms, none, sizeof(profile->perms));
|
||||
} else if (!strcasecmp(var, "set-params")) {
|
||||
profile->perms.set_params = switch_true(val);
|
||||
profile->perms.set_params = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "set-vars")) {
|
||||
profile->perms.set_vars = switch_true(val);
|
||||
profile->perms.set_vars = switch_true_byte(val);
|
||||
|
||||
if (profile->perms.set_vars) {
|
||||
switch_xml_t x_list, x_var;
|
||||
@@ -1928,7 +1928,7 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
}
|
||||
} else if (!strcasecmp(var, "get-vars")) {
|
||||
profile->perms.get_vars = switch_true(val);
|
||||
profile->perms.get_vars = switch_true_byte(val);
|
||||
|
||||
if (profile->perms.get_vars) {
|
||||
switch_xml_t x_list, x_var;
|
||||
@@ -1956,9 +1956,9 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
}
|
||||
} else if (!strcasecmp(var, "extended-data")) {
|
||||
profile->perms.extended_data = switch_true(val);
|
||||
profile->perms.extended_data = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "execute-apps")) {
|
||||
profile->perms.execute_apps = switch_true(val);
|
||||
profile->perms.execute_apps = switch_true_byte(val);
|
||||
|
||||
if (profile->perms.execute_apps) {
|
||||
switch_xml_t x_list, x_app;
|
||||
@@ -1987,7 +1987,7 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
|
||||
} else if (!strcasecmp(var, "expand-vars")) {
|
||||
profile->perms.expand_vars = switch_true(val);
|
||||
profile->perms.expand_vars = switch_true_byte(val);
|
||||
|
||||
if (profile->perms.expand_vars) {
|
||||
switch_xml_t x_list, x_var, x_api;
|
||||
@@ -2039,27 +2039,27 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
|
||||
} else if (!strcasecmp(var, "dial")) {
|
||||
profile->perms.dial.enabled = switch_true(val);
|
||||
profile->perms.dial.enabled = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "dial-set-context")) {
|
||||
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
|
||||
profile->perms.dial.set_context = switch_true(val);
|
||||
profile->perms.dial.set_context = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "dial-set-dialplan")) {
|
||||
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
|
||||
profile->perms.dial.set_dp = switch_true(val);
|
||||
profile->perms.dial.set_dp = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "dial-set-cid-name")) {
|
||||
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
|
||||
profile->perms.dial.set_cid_name = switch_true(val);
|
||||
profile->perms.dial.set_cid_name = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "dial-set-cid-number")) {
|
||||
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
|
||||
profile->perms.dial.set_cid_number = switch_true(val);
|
||||
profile->perms.dial.set_cid_number = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "dial-full-originate")) {
|
||||
if (switch_true(val)) profile->perms.dial.enabled = SWITCH_TRUE;
|
||||
profile->perms.dial.full_originate = switch_true(val);
|
||||
profile->perms.dial.full_originate = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "conference")) {
|
||||
profile->perms.conference.enabled = switch_true(val);
|
||||
profile->perms.conference.enabled = switch_true_byte(val);
|
||||
} else if (!strcasecmp(var, "conference-set-profile")) {
|
||||
if (switch_true(val)) profile->perms.conference.enabled = SWITCH_TRUE;
|
||||
profile->perms.conference.set_profile = switch_true(val);
|
||||
profile->perms.conference.set_profile = switch_true_byte(val);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2577,7 +2577,7 @@ static switch_status_t write_meta_file(http_file_context_t *context, const char
|
||||
data);
|
||||
|
||||
|
||||
status = write(fd, write_data, strlen(write_data) + 1) > 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
status = write(fd, write_data, (int)strlen(write_data) + 1) > 0 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
@@ -2947,7 +2947,7 @@ static switch_status_t http_file_file_read(switch_file_handle_t *handle, void *d
|
||||
*len = context->samples;
|
||||
}
|
||||
|
||||
context->samples -= *len;
|
||||
context->samples -= (int)*len;
|
||||
memset(data, 255, *len *2);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
|
||||
@@ -666,7 +666,7 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa
|
||||
} else if (CF("lcr_limit_id")) {
|
||||
additional->limit_id = switch_core_strdup(pool, switch_str_nil(argv[i]));
|
||||
} else if (CF("lcr_limit_max")) {
|
||||
additional->limit_max = (float)atof(switch_str_nil(argv[i]));
|
||||
additional->limit_max = (int)(float)atof(switch_str_nil(argv[i]));
|
||||
}
|
||||
|
||||
/* add all fields to the fields event */
|
||||
@@ -944,7 +944,7 @@ static switch_status_t lcr_do_lookup(callback_t *cb_struct)
|
||||
if ((channel = switch_core_session_get_channel(cb_struct->session))) {
|
||||
const char *max_rate = switch_channel_get_variable(channel, "max_rate");
|
||||
if (!zstr(max_rate)) {
|
||||
cb_struct->max_rate = atof(max_rate);
|
||||
cb_struct->max_rate = (float)atof(max_rate);
|
||||
}
|
||||
switch_channel_set_variable_var_check(channel, "lcr_rate_field", rate_field, SWITCH_FALSE);
|
||||
switch_channel_set_variable_var_check(channel, "lcr_user_rate_field", user_rate_field, SWITCH_FALSE);
|
||||
@@ -1611,7 +1611,7 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
||||
}
|
||||
}
|
||||
|
||||
if (lcr_do_lookup(&routes) == SWITCH_STATUS_SUCCESS) {
|
||||
if (caller_profile && lcr_do_lookup(&routes) == SWITCH_STATUS_SUCCESS) {
|
||||
if ((extension = switch_caller_extension_new(session, caller_profile->destination_number, caller_profile->destination_number)) == 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "memory error!\n");
|
||||
goto end;
|
||||
@@ -1646,7 +1646,7 @@ SWITCH_STANDARD_DIALPLAN(lcr_dialplan_hunt)
|
||||
switch_caller_extension_add_application(session, extension, app, argc);
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "LCR lookup failed for %s using profile %s\n", caller_profile->destination_number, caller_profile->context);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "LCR lookup failed for %s using profile %s\n", caller_profile ? caller_profile->destination_number : "unknown", caller_profile ? caller_profile->context : "unknown");
|
||||
}
|
||||
|
||||
end:
|
||||
@@ -1953,31 +1953,31 @@ SWITCH_STANDARD_API(dialplan_lcr_function)
|
||||
stream->write_function(stream, " <row id=\"%d\">\n", rowcount);
|
||||
}
|
||||
|
||||
write_data(stream, as_xml, "prefix", current->digit_str, 2, maximum_lengths.digit_str);
|
||||
write_data(stream, as_xml, "carrier_name", current->carrier_name, 2, maximum_lengths.carrier_name);
|
||||
write_data(stream, as_xml, "rate", current->rate_str, 2, maximum_lengths.rate);
|
||||
write_data(stream, as_xml, "prefix", current->digit_str, 2, (int)maximum_lengths.digit_str);
|
||||
write_data(stream, as_xml, "carrier_name", current->carrier_name, 2, (int)maximum_lengths.carrier_name);
|
||||
write_data(stream, as_xml, "rate", current->rate_str, 2, (int)maximum_lengths.rate);
|
||||
if (current->codec) {
|
||||
write_data(stream, as_xml, "codec", current->codec, 2, maximum_lengths.codec);
|
||||
write_data(stream, as_xml, "codec", current->codec, 2, (int)maximum_lengths.codec);
|
||||
} else {
|
||||
write_data(stream, as_xml, "codec", "", 2, maximum_lengths.codec);
|
||||
write_data(stream, as_xml, "codec", "", 2, (int)maximum_lengths.codec);
|
||||
}
|
||||
|
||||
if (current->cid) {
|
||||
write_data(stream, as_xml, "cid", current->cid, 2, maximum_lengths.cid);
|
||||
write_data(stream, as_xml, "cid", current->cid, 2, (int)maximum_lengths.cid);
|
||||
} else {
|
||||
write_data(stream, as_xml, "cid", "", 2, maximum_lengths.cid);
|
||||
write_data(stream, as_xml, "cid", "", 2, (int)maximum_lengths.cid);
|
||||
}
|
||||
|
||||
if (current->limit_realm && current->limit_id) {
|
||||
char *str = NULL;
|
||||
str = switch_core_sprintf(pool, "%s %s %d", current->limit_realm, current->limit_id, current->limit_max);
|
||||
|
||||
write_data(stream, as_xml, "limit", str, 2, maximum_lengths.limit);
|
||||
write_data(stream, as_xml, "limit", str, 2, (int)maximum_lengths.limit);
|
||||
} else {
|
||||
write_data(stream, as_xml, "limit", "", 2, maximum_lengths.limit);
|
||||
write_data(stream, as_xml, "limit", "", 2, (int)maximum_lengths.limit);
|
||||
}
|
||||
|
||||
write_data(stream, as_xml, "dialstring", current->dialstring, 2, maximum_lengths.dialstring);
|
||||
write_data(stream, as_xml, "dialstring", current->dialstring, 2, (int)maximum_lengths.dialstring);
|
||||
if (as_xml) {
|
||||
event_xml = switch_event_xmlize(current->fields, SWITCH_VA_NONE);
|
||||
event_str = switch_xml_toxml(event_xml, SWITCH_FALSE);
|
||||
|
||||
@@ -341,8 +341,8 @@ static int cr_readln(REDIS rhnd, int start, char **line, int *idx)
|
||||
*line = buf->data + buf->idx;
|
||||
if (idx)
|
||||
*idx = buf->idx;
|
||||
len = nl - *line;
|
||||
buf->idx = (nl - buf->data) + 2; /* skip "\r\n" */
|
||||
len = (int)(nl - *line);
|
||||
buf->idx = (int)((nl - buf->data) + 2); /* skip "\r\n" */
|
||||
|
||||
DEBUG("size=%d, len=%d, idx=%d, start=%d, line=%s",
|
||||
buf->size, buf->len, buf->idx, start, *line);
|
||||
|
||||
@@ -260,7 +260,7 @@ SWITCH_LIMIT_RESET(limit_reset_redis)
|
||||
|
||||
if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
|
||||
int i = 0;
|
||||
int hostnamelen = strlen(switch_core_get_switchname())+1;
|
||||
int hostnamelen = (int)strlen(switch_core_get_switchname())+1;
|
||||
|
||||
for (i = 0; i < keyc && uuids[i]; i++){
|
||||
const char *key = uuids[i] + hostnamelen;
|
||||
|
||||
@@ -76,7 +76,7 @@ typedef enum {
|
||||
#define check_tz() \
|
||||
do { \
|
||||
tzoff = switch_event_get_header(event, "tod_tz_offset"); \
|
||||
tzname = switch_event_get_header(event, "timezone"); \
|
||||
tzname_ = switch_event_get_header(event, "timezone"); \
|
||||
if (!zstr(tzoff) && switch_is_number(tzoff)) { \
|
||||
offset = atoi(tzoff); \
|
||||
break; \
|
||||
@@ -93,7 +93,7 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
|
||||
char *expression_expanded = NULL, *field_expanded = NULL;
|
||||
switch_regex_t *re = NULL;
|
||||
const char *to = switch_event_get_header(event, "to");
|
||||
const char *tzoff = NULL, *tzname = NULL;
|
||||
const char *tzoff = NULL, *tzname_ = NULL;
|
||||
int offset = 0;
|
||||
|
||||
check_tz();
|
||||
@@ -117,7 +117,7 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
|
||||
int time_match;
|
||||
|
||||
check_tz();
|
||||
time_match = switch_xml_std_datetime_check(xcond, tzoff ? &offset : NULL, tzname);
|
||||
time_match = switch_xml_std_datetime_check(xcond, tzoff ? &offset : NULL, tzname_);
|
||||
|
||||
switch_safe_free(field_expanded);
|
||||
switch_safe_free(expression_expanded);
|
||||
|
||||
@@ -399,7 +399,7 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da
|
||||
if (pvt->verbose) {
|
||||
span_log_set_level(dtmf_rx_get_logging_state(pvt->dtmf_detect), SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
|
||||
}
|
||||
dtmf_rx_parms(pvt->dtmf_detect, pvt->filter_dialtone, pvt->twist, pvt->reverse_twist, pvt->threshold);
|
||||
dtmf_rx_parms(pvt->dtmf_detect, pvt->filter_dialtone, (float)pvt->twist, (float)pvt->reverse_twist, (float)pvt->threshold);
|
||||
dtmf_rx_set_realtime_callback(pvt->dtmf_detect, spandsp_dtmf_rx_realtime_callback, pvt);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
#include "udptl.h"
|
||||
|
||||
#define FALSE 0
|
||||
#ifndef TRUE
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
static int decode_length(const uint8_t *buf, int limit, int *len, int *pvalue)
|
||||
{
|
||||
|
||||
@@ -162,7 +162,8 @@ static int find_longest(valet_lot_t *lot, int min, int max)
|
||||
const void *i_var;
|
||||
void *i_val;
|
||||
valet_token_t *token;
|
||||
int longest = 0, cur = 0, longest_ext = 0;
|
||||
int longest_ext = 0;
|
||||
time_t longest = 0, cur = 0;
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
|
||||
switch_mutex_lock(lot->mutex);
|
||||
|
||||
@@ -710,7 +710,8 @@ static vm_profile_t *load_profile(const char *profile_name)
|
||||
|
||||
if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile_name))) {
|
||||
switch_memory_pool_t *pool;
|
||||
int x, count;
|
||||
int x;
|
||||
switch_size_t count;
|
||||
char *errmsg;
|
||||
|
||||
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -751,7 +752,7 @@ static vm_profile_t *load_profile(const char *profile_name)
|
||||
}
|
||||
|
||||
|
||||
if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, profile->config) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_xml_config_parse_event(event, (int)count, SWITCH_FALSE, profile->config) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to process configuration\n");
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
goto end;
|
||||
@@ -2845,7 +2846,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
||||
if (!message_len) {
|
||||
size_t len = 0;
|
||||
if (measure_file_len(file_path, &len) == SWITCH_STATUS_SUCCESS) {
|
||||
message_len = len;
|
||||
message_len = (uint32_t)len;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3658,7 +3659,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
||||
|
||||
if (x_user) {
|
||||
switch_channel_get_variables(channel, &vars);
|
||||
status = deliver_vm(profile, x_user, domain_name, file_path, message_len, read_flags, vars,
|
||||
status = deliver_vm(profile, x_user, domain_name, file_path, (uint32_t)message_len, read_flags, vars,
|
||||
switch_core_session_get_pool(session), caller_id_name, caller_id_number, NULL, SWITCH_FALSE,
|
||||
session ? switch_core_session_get_uuid(session) : NULL, session);
|
||||
switch_event_destroy(&vars);
|
||||
|
||||
Reference in new issue
Block a user