FS-3166 --resolve
This commit is contained in:
parent
c22aac0eac
commit
73279f01bf
|
@ -323,7 +323,7 @@ static void default_logger(const char *file, const char *func, int line, int lev
|
|||
ret = esl_vasprintf(&data, fmt, ap);
|
||||
|
||||
if (ret != -1) {
|
||||
fprintf(stderr, "[%s] %s:%d %s() %s", LEVEL_NAMES[level], file, line, func, data);
|
||||
fprintf(stderr, "[%s] %s:%d %s() %s", LEVEL_NAMES[level], fp, line, func, data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ static char *my_strdup (const char *s)
|
|||
TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd)
|
||||
{
|
||||
char *data = NULL, *cur = NULL, *end = NULL;
|
||||
int var = 0, LOOPING = 0;
|
||||
int LOOPING = 0;
|
||||
|
||||
if (!cmd) {
|
||||
return -1;
|
||||
|
@ -335,7 +335,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
cur = data;
|
||||
|
||||
while (*cur) {
|
||||
var = 0;
|
||||
if (*cur == ' ' || *cur == '\r' || *cur == '\n') {
|
||||
cur++;
|
||||
continue;
|
||||
|
@ -346,7 +345,6 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm
|
|||
}
|
||||
|
||||
if (*(cur + 1) == '=') {
|
||||
var = 1;
|
||||
switch(*cur) {
|
||||
case 'c':
|
||||
ts->channels = atoi(cur + 2);
|
||||
|
|
|
@ -165,10 +165,10 @@ SPAN_DECLARE(int) plc_fillin(plc_state_t *s, int16_t amp[], int len)
|
|||
float old_weight;
|
||||
float new_weight;
|
||||
float gain;
|
||||
int16_t *orig_amp;
|
||||
//int16_t *orig_amp;
|
||||
int orig_len;
|
||||
|
||||
orig_amp = amp;
|
||||
//orig_amp = amp;
|
||||
orig_len = len;
|
||||
if (s->missing_samples == 0)
|
||||
{
|
||||
|
|
|
@ -506,9 +506,9 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint32_t pt, void
|
|||
i->diff_total += i->diff;
|
||||
|
||||
if ((i->period_packet_in_count > i->period_time)) {
|
||||
uint32_t avg;
|
||||
//uint32_t avg;
|
||||
|
||||
avg = i->diff_total / least1(i->period_packet_in_count);
|
||||
//avg = i->diff_total / least1(i->period_packet_in_count);
|
||||
|
||||
i->period_packet_in_count = 0;
|
||||
|
||||
|
@ -904,7 +904,7 @@ static void default_logger(const char *file, const char *func, int line, int lev
|
|||
ret = stfu_vasprintf(&data, fmt, ap);
|
||||
|
||||
if (ret != -1) {
|
||||
fprintf(stderr, "[%s] %s:%d %s() %s", LEVEL_NAMES[level], file, line, func, data);
|
||||
fprintf(stderr, "[%s] %s:%d %s() %s", LEVEL_NAMES[level], fp, line, func, data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ int go(int i)
|
|||
int vgo(int i, switch_core_session_t *session)
|
||||
{
|
||||
int x;
|
||||
int sleep_len = 40000;
|
||||
//int sleep_len = 40000;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_frame_t *read_frame;
|
||||
switch_status_t status;
|
||||
|
@ -233,9 +233,9 @@ int vgo(int i, switch_core_session_t *session)
|
|||
|
||||
printf("%s", SWITCH_SEQ_CLEARSCR);
|
||||
|
||||
if (i > 0) {
|
||||
sleep_len = i;
|
||||
}
|
||||
//if (i > 0) {
|
||||
//sleep_len = i;
|
||||
//}
|
||||
|
||||
initscr();
|
||||
signal(SIGINT, SIG_IGN);
|
||||
|
|
|
@ -2601,7 +2601,6 @@ SWITCH_STANDARD_API(uuid_broadcast_function)
|
|||
{
|
||||
char *mycmd = NULL, *argv[4] = { 0 };
|
||||
int argc = 0;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
|
@ -2635,7 +2634,7 @@ SWITCH_STANDARD_API(uuid_broadcast_function)
|
|||
flags = SMF_ECHO_ALEG | SMF_HOLD_BLEG;
|
||||
}
|
||||
|
||||
status = switch_ivr_broadcast(argv[0], argv[1], flags);
|
||||
switch_ivr_broadcast(argv[0], argv[1], flags);
|
||||
stream->write_function(stream, "+OK Message Sent\n");
|
||||
}
|
||||
|
||||
|
@ -2648,7 +2647,6 @@ SWITCH_STANDARD_API(sched_broadcast_function)
|
|||
{
|
||||
char *mycmd = NULL, *argv[4] = { 0 };
|
||||
int argc = 0;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
|
@ -2678,7 +2676,7 @@ SWITCH_STANDARD_API(sched_broadcast_function)
|
|||
flags |= SMF_ECHO_ALEG;
|
||||
}
|
||||
|
||||
status = switch_ivr_schedule_broadcast(when, argv[1], argv[2], flags);
|
||||
switch_ivr_schedule_broadcast(when, argv[1], argv[2], flags);
|
||||
stream->write_function(stream, "+OK Message Scheduled\n");
|
||||
}
|
||||
|
||||
|
@ -2763,8 +2761,6 @@ SWITCH_STANDARD_API(uuid_buglist_function)
|
|||
char *mydata = NULL, *argv[2] = { 0 };
|
||||
int argc = 0;
|
||||
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (zstr(cmd)) {
|
||||
goto error;
|
||||
}
|
||||
|
@ -2781,7 +2777,7 @@ SWITCH_STANDARD_API(uuid_buglist_function)
|
|||
switch_core_session_t *lsession = NULL;
|
||||
|
||||
if ((lsession = switch_core_session_locate(argv[0]))) {
|
||||
status = switch_core_media_bug_enumerate(lsession, stream);
|
||||
switch_core_media_bug_enumerate(lsession, stream);
|
||||
switch_core_session_rwunlock(lsession);
|
||||
}
|
||||
goto ok;
|
||||
|
@ -3863,7 +3859,6 @@ SWITCH_STANDARD_API(show_function)
|
|||
struct holder holder = { 0 };
|
||||
int help = 0;
|
||||
char *mydata = NULL, *argv[6] = { 0 };
|
||||
int argc;
|
||||
char *command = NULL, *as = NULL;
|
||||
switch_core_flag_t cflags = switch_core_flags();
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
@ -3884,7 +3879,7 @@ SWITCH_STANDARD_API(show_function)
|
|||
holder.justcount = 0;
|
||||
|
||||
if (cmd && (mydata = strdup(cmd))) {
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
command = argv[0];
|
||||
if (argv[2] && !strcasecmp(argv[1], "as")) {
|
||||
as = argv[2];
|
||||
|
@ -4378,10 +4373,10 @@ SWITCH_STANDARD_API(uuid_fileman_function)
|
|||
char *cmd = argv[1];
|
||||
|
||||
if ((psession = switch_core_session_locate(uuid))) {
|
||||
switch_channel_t *channel;
|
||||
//switch_channel_t *channel;
|
||||
switch_file_handle_t *fh = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(psession);
|
||||
//channel = switch_core_session_get_channel(psession);
|
||||
|
||||
if (switch_ivr_get_file_handle(psession, &fh) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_ivr_process_fh(psession, cmd, fh);
|
||||
|
@ -4689,13 +4684,12 @@ SWITCH_STANDARD_API(strftime_tz_api_function)
|
|||
SWITCH_STANDARD_API(hupall_api_function)
|
||||
{
|
||||
char *mycmd = NULL, *argv[3] = { 0 };
|
||||
int argc = 0;
|
||||
char *var = NULL;
|
||||
char *val = NULL;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_MANAGER_REQUEST;
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_assert(argv[0]);
|
||||
if ((cause = switch_channel_str2cause(argv[0])) == SWITCH_CAUSE_NONE) {
|
||||
cause = SWITCH_CAUSE_MANAGER_REQUEST;
|
||||
|
|
|
@ -948,7 +948,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
|||
conference_member_t *imember;
|
||||
switch_frame_t *vid_frame;
|
||||
switch_status_t status;
|
||||
int has_vid = 1, req_iframe = 0;
|
||||
int has_vid = 1;// req_iframe = 0;
|
||||
int yield = 0;
|
||||
uint32_t last_member = 0;
|
||||
switch_core_session_t *session;
|
||||
|
@ -983,7 +983,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
|||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status) || !conference->floor_holder || switch_test_flag(vid_frame, SFF_CNG)) {
|
||||
conference->floor_holder = NULL;
|
||||
req_iframe = 0;
|
||||
//req_iframe = 0;
|
||||
goto do_continue;
|
||||
}
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
|||
goto do_continue;
|
||||
}
|
||||
|
||||
req_iframe = 0;
|
||||
//req_iframe = 0;
|
||||
}
|
||||
|
||||
last_member = conference->floor_holder->id;
|
||||
|
@ -2512,7 +2512,7 @@ static void conference_loop_output(conference_member_t *member)
|
|||
switch_timer_t timer = { 0 };
|
||||
uint32_t interval;
|
||||
uint32_t samples;
|
||||
uint32_t csamples;
|
||||
//uint32_t csamples;
|
||||
uint32_t tsamples;
|
||||
uint32_t flush_len;
|
||||
uint32_t low_count, bytes;
|
||||
|
@ -2535,7 +2535,7 @@ static void conference_loop_output(conference_member_t *member)
|
|||
channel = switch_core_session_get_channel(member->session);
|
||||
interval = read_impl.microseconds_per_packet / 1000;
|
||||
samples = switch_samples_per_packet(member->conference->rate, interval);
|
||||
csamples = samples;
|
||||
//csamples = samples;
|
||||
tsamples = member->orig_read_impl.samples_per_packet;
|
||||
flush_len = 0;
|
||||
low_count = 0;
|
||||
|
@ -2835,7 +2835,7 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
|
|||
conference_record_t *rec = (conference_record_t *) obj;
|
||||
conference_obj_t *conference = rec->conference;
|
||||
uint32_t samples = switch_samples_per_packet(conference->rate, conference->interval);
|
||||
uint32_t low_count = 0, mux_used;
|
||||
uint32_t mux_used;
|
||||
char *vval;
|
||||
switch_timer_t timer = { 0 };
|
||||
uint32_t rlen;
|
||||
|
@ -2962,7 +2962,7 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
|
|||
if (mux_used >= data_buf_len) {
|
||||
/* Flush the output buffer and write all the data (presumably muxed) to the file */
|
||||
switch_mutex_lock(member->audio_out_mutex);
|
||||
low_count = 0;
|
||||
//low_count = 0;
|
||||
|
||||
if ((rlen = (uint32_t) switch_buffer_read(member->mux_buffer, data_buf, data_buf_len))) {
|
||||
len = (switch_size_t) rlen / sizeof(int16_t);
|
||||
|
@ -4091,7 +4091,7 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
|
|||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *profile;
|
||||
char *uuid;
|
||||
char *name;
|
||||
//char *name;
|
||||
uint32_t count = 0;
|
||||
switch_xml_t x_tag;
|
||||
int toff = 0;
|
||||
|
@ -4104,7 +4104,7 @@ static void conference_xlist(conference_obj_t *conference, switch_xml_t x_confer
|
|||
uuid = switch_core_session_get_uuid(member->session);
|
||||
channel = switch_core_session_get_channel(member->session);
|
||||
profile = switch_channel_get_caller_profile(channel);
|
||||
name = switch_channel_get_name(channel);
|
||||
//name = switch_channel_get_name(channel);
|
||||
|
||||
|
||||
x_member = switch_xml_add_child_d(x_members, "member", moff++);
|
||||
|
@ -5661,7 +5661,7 @@ static int setup_media(conference_member_t *member, conference_obj_t *conference
|
|||
SWITCH_STANDARD_APP(conference_function)
|
||||
{
|
||||
switch_codec_t *read_codec = NULL;
|
||||
uint32_t flags = 0;
|
||||
//uint32_t flags = 0;
|
||||
conference_member_t member = { 0 };
|
||||
conference_obj_t *conference = NULL;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
@ -6049,7 +6049,7 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
member.pool = switch_core_session_get_pool(session);
|
||||
|
||||
if (setup_media(&member, conference)) {
|
||||
flags = 0;
|
||||
//flags = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -6338,7 +6338,6 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
|||
uint32_t announce_count = 0;
|
||||
char *maxmember_sound = NULL;
|
||||
uint32_t rate = 8000, interval = 20;
|
||||
switch_status_t status;
|
||||
int comfort_noise_level = 0;
|
||||
char *suppress_events = NULL;
|
||||
char *verbose_events = NULL;
|
||||
|
@ -6552,7 +6551,6 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
|||
/* Setup a memory pool to use. */
|
||||
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Pool Failure\n");
|
||||
status = SWITCH_STATUS_TERM;
|
||||
conference = NULL;
|
||||
goto end;
|
||||
}
|
||||
|
@ -6561,7 +6559,6 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
|||
/* Create the conference object. */
|
||||
if (!(conference = switch_core_alloc(pool, sizeof(*conference)))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
|
||||
status = SWITCH_STATUS_TERM;
|
||||
conference = NULL;
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -2298,14 +2298,14 @@ SWITCH_STANDARD_APP(record_function)
|
|||
char *path;
|
||||
switch_input_args_t args = { 0 };
|
||||
switch_file_handle_t fh = { 0 };
|
||||
int argc;
|
||||
//int argc;
|
||||
char *mydata, *argv[4] = { 0 };
|
||||
char *l = NULL;
|
||||
const char *tmp;
|
||||
int rate;
|
||||
|
||||
if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No file specified.\n");
|
||||
return;
|
||||
|
@ -2490,7 +2490,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
|
|||
const char *transfer_on_fail = NULL;
|
||||
char *tof_data = NULL;
|
||||
char *tof_array[4] = { 0 };
|
||||
int tof_arrayc = 0;
|
||||
//int tof_arrayc = 0;
|
||||
const char *continue_on_fail = NULL, *failure_causes = NULL,
|
||||
*v_campon = NULL, *v_campon_retries, *v_campon_sleep, *v_campon_timeout, *v_campon_fallback_exten = NULL;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||
|
@ -2510,7 +2510,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
|
|||
|
||||
transfer_on_fail = switch_channel_get_variable(caller_channel, "transfer_on_fail");
|
||||
tof_data = switch_core_session_strdup(session, transfer_on_fail);
|
||||
tof_arrayc = switch_split(tof_data, ' ', tof_array);
|
||||
switch_split(tof_data, ' ', tof_array);
|
||||
transfer_on_fail = tof_array[0];
|
||||
|
||||
failure_causes = switch_channel_get_variable(caller_channel, "failure_causes");
|
||||
|
|
|
@ -71,7 +71,7 @@ SWITCH_STANDARD_APP(bcast_function)
|
|||
switch_port_t rtp_port;
|
||||
char guess_ip[25];
|
||||
ls_how_t ready = SEND_TYPE_UNKNOWN;
|
||||
int argc;
|
||||
//int argc;
|
||||
char *mydata, *argv[5];
|
||||
char *mcast_ip = "224.168.168.168";
|
||||
switch_port_t mcast_port = 34567;
|
||||
|
@ -87,7 +87,7 @@ SWITCH_STANDARD_APP(bcast_function)
|
|||
mydata = switch_core_session_strdup(session, data);
|
||||
assert(mydata != NULL);
|
||||
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "esf_multicast_ip"))) {
|
||||
mcast_ip = switch_core_session_strdup(session, var);
|
||||
|
|
|
@ -1167,7 +1167,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
|
|||
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||
switch_call_cause_t cancel_cause = 0;
|
||||
char *uuid_list = NULL;
|
||||
int connected = 0, total = 0;
|
||||
int total = 0;
|
||||
const char *codec;
|
||||
struct call_helper *rows[MAX_ROWS] = { 0 };
|
||||
int rowcount = 0;
|
||||
|
@ -1417,8 +1417,6 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
|
|||
goto end;
|
||||
}
|
||||
|
||||
connected = 1;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -1513,7 +1511,6 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
|||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_event_t *event = NULL;
|
||||
char *sql = NULL;
|
||||
int connected = 0;
|
||||
|
||||
if (!globals.running) return NULL;
|
||||
|
||||
|
@ -1592,8 +1589,6 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
|||
goto end;
|
||||
}
|
||||
|
||||
connected = 1;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
|
|
|
@ -611,7 +611,7 @@ SWITCH_STANDARD_API(hash_dump_function)
|
|||
#define HASH_REMOTE_SYNTAX "list|kill [name]|rescan"
|
||||
SWITCH_STANDARD_API(hash_remote_function)
|
||||
{
|
||||
int argc;
|
||||
//int argc;
|
||||
char *argv[10];
|
||||
char *dup = NULL;
|
||||
|
||||
|
@ -622,7 +622,7 @@ SWITCH_STANDARD_API(hash_remote_function)
|
|||
|
||||
dup = strdup(cmd);
|
||||
|
||||
argc = switch_split(dup, ' ', argv);
|
||||
switch_split(dup, ' ', argv);
|
||||
if (argv[0] && !strcmp(argv[0], "list")) {
|
||||
switch_hash_index_t *hi;
|
||||
stream->write_function(stream, "Remote connections:\nName\t\t\tState\n");
|
||||
|
|
|
@ -433,7 +433,6 @@ static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uin
|
|||
{
|
||||
switch_frame_t out_frame = { 0 };
|
||||
switch_core_session_t *session;
|
||||
switch_channel_t *channel;
|
||||
pvt_t *pvt;
|
||||
uint8_t pkt[LOCAL_FAX_MAX_DATAGRAM];
|
||||
int x;
|
||||
|
@ -441,7 +440,6 @@ static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uin
|
|||
|
||||
pvt = (pvt_t *) user_data;
|
||||
session = pvt->session;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
/* we need to build a real packet here and make write_frame.packet and write_frame.packetlen point to it */
|
||||
out_frame.flags = SFF_UDPTL_PACKET | SFF_PROXY_PACKET;
|
||||
|
|
|
@ -61,7 +61,6 @@ static int decode_open_type(const uint8_t *buf, int limit, int *len, const uint8
|
|||
int octet_cnt;
|
||||
int octet_idx;
|
||||
int stat;
|
||||
int i;
|
||||
const uint8_t **pbuf;
|
||||
|
||||
for (octet_idx = 0, *p_num_octets = 0;; octet_idx += octet_cnt) {
|
||||
|
@ -71,7 +70,6 @@ static int decode_open_type(const uint8_t *buf, int limit, int *len, const uint8
|
|||
*p_num_octets += octet_cnt;
|
||||
|
||||
pbuf = &p_object[octet_idx];
|
||||
i = 0;
|
||||
/* Make sure the buffer contains at least the number of bits requested */
|
||||
if ((*len + octet_cnt) > limit)
|
||||
return -1;
|
||||
|
|
|
@ -2414,7 +2414,6 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
|||
char *vm_email = NULL;
|
||||
char *vm_email_from = NULL;
|
||||
char *vm_notify_email = NULL;
|
||||
char *email_addr = NULL;
|
||||
char *vm_timezone = NULL;
|
||||
int send_mail = 0;
|
||||
int send_main = 0;
|
||||
|
@ -2479,8 +2478,6 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
|||
vm_notify_email = switch_core_strdup(pool, val);
|
||||
} else if (!strcasecmp(var, "vm-mailfrom")) {
|
||||
vm_email_from = switch_core_strdup(pool, val);
|
||||
} else if (!strcasecmp(var, "email-addr")) {
|
||||
email_addr = switch_core_strdup(pool, val);
|
||||
} else if (!strcasecmp(var, "vm-email-all-messages") && (send_main = switch_true(val))) {
|
||||
send_mail++;
|
||||
} else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) {
|
||||
|
@ -2987,8 +2984,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
int send_mail = 0;
|
||||
cc_t cc = { 0 };
|
||||
char *read_flags = NORMAL_FLAG_STRING;
|
||||
int priority = 3;
|
||||
int email_attach = 1;
|
||||
char *operator_ext = NULL;
|
||||
char buf[2];
|
||||
char key_buf[80];
|
||||
|
@ -3003,7 +2998,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
char *record_macro = VM_RECORD_MESSAGE_MACRO;
|
||||
int send_main = 0;
|
||||
int send_notify = 0;
|
||||
int insert_db = 1;
|
||||
const char *read_id = NULL;
|
||||
const char *caller_id_name = NULL;
|
||||
const char *caller_id_number = NULL;
|
||||
|
@ -3060,10 +3054,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
vm_storage_dir = switch_core_session_strdup(session, val);
|
||||
} else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) {
|
||||
send_mail++;
|
||||
} else if (!strcasecmp(var, "vm-keep-local-after-email")) {
|
||||
insert_db = switch_true(val);
|
||||
} else if (!strcasecmp(var, "vm-attach-file")) {
|
||||
email_attach = switch_true(val);
|
||||
} else if (!strcasecmp(var, "vm-disk-quota")) {
|
||||
disk_quota = atoi(val);
|
||||
} else if (!strcasecmp(var, "vm-alternate-greet-id")) {
|
||||
|
@ -3103,11 +3093,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"Falling back to leaving message locally due to too many misconfiguration.\n");
|
||||
send_mail = 0;
|
||||
insert_db = 1;
|
||||
}
|
||||
|
||||
if (send_notify && !send_main) {
|
||||
insert_db = 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -3289,7 +3274,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
(void) vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
|
||||
if (*profile->urgent_key == *input) {
|
||||
read_flags = URGENT_FLAG_STRING;
|
||||
priority = 1;
|
||||
(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL);
|
||||
} else {
|
||||
(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL);
|
||||
|
@ -3331,7 +3315,6 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||
|
||||
SWITCH_STANDARD_APP(voicemail_function)
|
||||
{
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mydata = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
@ -3345,7 +3328,7 @@ SWITCH_STANDARD_APP(voicemail_function)
|
|||
|
||||
if (!zstr(data)) {
|
||||
mydata = switch_core_session_strdup(session, data);
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
@ -4359,7 +4342,6 @@ SWITCH_STANDARD_API(voicemail_list_api_function)
|
|||
#define VOICEMAIL_SYNTAX "rss [<host> <port> <uri> <user> <domain>] | [load|unload|reload] <profile> [reloadxml]"
|
||||
SWITCH_STANDARD_API(voicemail_api_function)
|
||||
{
|
||||
int argc = 0;
|
||||
char *mydata = NULL, *argv[6];
|
||||
char *host = NULL, *port = NULL, *uri = NULL;
|
||||
char *user = NULL, *domain = NULL;
|
||||
|
@ -4371,7 +4353,7 @@ SWITCH_STANDARD_API(voicemail_api_function)
|
|||
void *val = NULL;
|
||||
switch_xml_t xml_root;
|
||||
const char *err;
|
||||
|
||||
int argc = 0;
|
||||
|
||||
if (session) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -4588,7 +4570,6 @@ SWITCH_STANDARD_API(vm_fsdb_pref_greeting_set_function)
|
|||
char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4598,7 +4579,7 @@ SWITCH_STANDARD_API(vm_fsdb_pref_greeting_set_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -4673,7 +4654,6 @@ SWITCH_STANDARD_API(vm_fsdb_pref_recname_set_function)
|
|||
char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4683,7 +4663,7 @@ SWITCH_STANDARD_API(vm_fsdb_pref_recname_set_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -4756,7 +4736,6 @@ SWITCH_STANDARD_API(vm_fsdb_pref_password_set_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4766,7 +4745,7 @@ SWITCH_STANDARD_API(vm_fsdb_pref_password_set_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -4821,7 +4800,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_list_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4831,7 +4809,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_list_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[1])
|
||||
|
@ -4879,7 +4857,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_purge_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4889,7 +4866,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_purge_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -4929,7 +4906,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_delete_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4939,7 +4915,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_delete_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -4981,7 +4957,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_save_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -4991,7 +4966,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_save_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -5032,7 +5007,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_undelete_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -5042,7 +5016,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_undelete_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -5083,7 +5057,6 @@ SWITCH_STANDARD_API(vm_fsdb_auth_login_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -5100,7 +5073,7 @@ SWITCH_STANDARD_API(vm_fsdb_auth_login_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[0])
|
||||
|
@ -5188,7 +5161,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_get_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -5198,7 +5170,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_get_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[1])
|
||||
|
@ -5252,7 +5224,6 @@ SWITCH_STANDARD_API(vm_fsdb_msg_count_function)
|
|||
const char *id = NULL, *domain = NULL, *profile_name = NULL;
|
||||
vm_profile_t *profile = NULL;
|
||||
|
||||
int argc = 0;
|
||||
char *argv[6] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
|
||||
|
@ -5262,7 +5233,7 @@ SWITCH_STANDARD_API(vm_fsdb_msg_count_function)
|
|||
|
||||
if (!zstr(cmd)) {
|
||||
mycmd = switch_core_strdup(pool, cmd);
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (argv[1])
|
||||
|
|
|
@ -164,7 +164,6 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
int argc;
|
||||
char *argv[3] = { 0 };
|
||||
char *pattern = NULL;
|
||||
char *pri = NULL;
|
||||
char *app = NULL;
|
||||
char *argument = NULL;
|
||||
char *expression = NULL, expression_buf[1024] = "";
|
||||
|
@ -242,7 +241,7 @@ SWITCH_STANDARD_DIALPLAN(asterisk_dialplan_hunt)
|
|||
switch_channel_set_variable(channel, "CHANNEL", switch_channel_get_name(channel));
|
||||
switch_channel_set_variable(channel, "UNIQUEID", switch_core_session_get_uuid(session));
|
||||
|
||||
pri = argv[1];
|
||||
//pri = argv[1];
|
||||
app = argv[2];
|
||||
|
||||
if ((argument = strchr(app, '('))) {
|
||||
|
|
|
@ -766,7 +766,6 @@ static switch_status_t sofia_read_video_frame(switch_core_session_t *session, sw
|
|||
{
|
||||
private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
int payload = 0;
|
||||
|
||||
switch_assert(tech_pvt != NULL);
|
||||
|
||||
|
@ -810,8 +809,6 @@ static switch_status_t sofia_read_video_frame(switch_core_session_t *session, sw
|
|||
return status;
|
||||
}
|
||||
|
||||
payload = tech_pvt->video_read_frame.payload;
|
||||
|
||||
if (tech_pvt->video_read_frame.datalen > 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -867,7 +864,6 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
|
|||
{
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
int payload = 0;
|
||||
uint32_t sanity = 1000;
|
||||
switch_rtcp_frame_t rtcp_frame;
|
||||
|
||||
|
@ -979,8 +975,6 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
|
|||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
payload = tech_pvt->read_frame.payload;
|
||||
|
||||
if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) {
|
||||
switch_dtmf_t dtmf = { 0 };
|
||||
switch_rtp_dequeue_dtmf(tech_pvt->rtp_session, &dtmf);
|
||||
|
@ -1859,13 +1853,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
const char *name = msg->string_array_arg[0], *number = msg->string_array_arg[1];
|
||||
char *arg = NULL;
|
||||
char *argv[2] = { 0 };
|
||||
int argc;
|
||||
//int argc;
|
||||
|
||||
if (zstr(name) && !zstr(msg->string_arg)) {
|
||||
arg = strdup(msg->string_arg);
|
||||
switch_assert(arg);
|
||||
|
||||
argc = switch_separate_string(arg, '|', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
switch_separate_string(arg, '|', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
name = argv[0];
|
||||
number = argv[1];
|
||||
|
||||
|
@ -4910,7 +4904,7 @@ static switch_status_t list_profile_gateway(const char *line, const char *cursor
|
|||
switch_console_callback_match_t *my_matches = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *dup = NULL;
|
||||
int argc;
|
||||
//int argc;
|
||||
char *argv[4] = { 0 };
|
||||
|
||||
if (zstr(line)) {
|
||||
|
@ -4918,7 +4912,7 @@ static switch_status_t list_profile_gateway(const char *line, const char *cursor
|
|||
}
|
||||
|
||||
dup = strdup(line);
|
||||
argc = switch_split(dup, ' ', argv);
|
||||
switch_split(dup, ' ', argv);
|
||||
|
||||
if (zstr(argv[2]) || !strcmp(argv[2], " ")) {
|
||||
goto end;
|
||||
|
|
|
@ -210,17 +210,14 @@ void _usage(int exitcode, switch_stream_handle_t *stream)
|
|||
switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
|
||||
|
||||
{
|
||||
int exitcode = 0;
|
||||
int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
|
||||
int family = 0, multiple = 0;
|
||||
char const *dnsserver = NULL;
|
||||
char const *string;
|
||||
url_t *uri = NULL;
|
||||
|
||||
char const *host;
|
||||
char const *port;
|
||||
char *transport = NULL, tport[32];
|
||||
int argc;
|
||||
char *argv_[25] = { 0 };
|
||||
char *mycmd = NULL;
|
||||
char **argv;
|
||||
|
@ -239,7 +236,7 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
|
|||
|
||||
mycmd = strdup(cmd);
|
||||
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv_) / sizeof(argv_[0])) - 1);
|
||||
switch_separate_string(mycmd, ' ', argv, (sizeof(argv_) / sizeof(argv_[0])) - 1);
|
||||
argv = argv_;
|
||||
|
||||
|
||||
|
@ -321,10 +318,6 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
|
|||
if (!family)
|
||||
dig->ip4 = 1, dig->ip6 = 2;
|
||||
|
||||
if (argv[1] && argv[1][0] == '@')
|
||||
dnsserver = argv++[1] + 1;
|
||||
|
||||
|
||||
|
||||
if (!argv[1])
|
||||
{usage(2);}
|
||||
|
@ -360,7 +353,6 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
|
|||
|
||||
if (!uri || (uri->url_type != url_sip && uri->url_type != url_sips)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s: invalid uri\n", string);
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -387,7 +379,6 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
|
|||
|
||||
if (!host_is_domain(host)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s: invalid host\n", string);
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -402,7 +393,6 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
|
|||
continue /* resolved a/aaaa */;
|
||||
|
||||
stream->write_function(stream, "-ERR: %s: not found\n", string);
|
||||
exitcode = 1;
|
||||
}
|
||||
|
||||
if (xml) {
|
||||
|
|
|
@ -1457,7 +1457,7 @@ switch_thread_t *launch_sofia_worker_thread(sofia_profile_t *profile)
|
|||
void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
sofia_profile_t *profile = (sofia_profile_t *) obj;
|
||||
switch_memory_pool_t *pool;
|
||||
//switch_memory_pool_t *pool;
|
||||
sip_alias_node_t *node;
|
||||
switch_event_t *s_event;
|
||||
int use_100rel = !sofia_test_pflag(profile, PFLAG_DISABLE_100REL);
|
||||
|
@ -1717,7 +1717,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||
|
||||
su_home_unref(profile->home);
|
||||
su_root_destroy(profile->s_root);
|
||||
pool = profile->pool;
|
||||
//pool = profile->pool;
|
||||
|
||||
sofia_glue_del_profile(profile);
|
||||
switch_core_hash_destroy(&profile->chat_hash);
|
||||
|
@ -5581,7 +5581,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||
{
|
||||
/* Incoming refer */
|
||||
sip_from_t const *from;
|
||||
sip_to_t const *to;
|
||||
//sip_to_t const *to;
|
||||
sip_refer_to_t const *refer_to;
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
char *etmp = NULL, *exten = NULL;
|
||||
|
@ -5604,7 +5604,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||
}
|
||||
|
||||
from = sip->sip_from;
|
||||
to = sip->sip_to;
|
||||
//to = sip->sip_to;
|
||||
|
||||
home = su_home_new(sizeof(*home));
|
||||
switch_assert(home != NULL);
|
||||
|
@ -6374,7 +6374,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
|||
const char *displayname = NULL;
|
||||
const char *destination_number = NULL;
|
||||
const char *from_user = NULL, *from_host = NULL;
|
||||
const char *referred_by_user = NULL, *referred_by_host = NULL;
|
||||
const char *referred_by_user = NULL;//, *referred_by_host = NULL;
|
||||
const char *context = NULL;
|
||||
const char *dialplan = NULL;
|
||||
char network_ip[80];
|
||||
|
@ -6905,7 +6905,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
|||
|
||||
if (sip->sip_referred_by) {
|
||||
referred_by_user = sip->sip_referred_by->b_url->url_user;
|
||||
referred_by_host = sip->sip_referred_by->b_url->url_host;
|
||||
//referred_by_host = sip->sip_referred_by->b_url->url_host;
|
||||
channel_name = url_set_chanvars(session, sip->sip_referred_by->b_url, sip_referred_by);
|
||||
|
||||
check_decode(referred_by_user, session);
|
||||
|
|
|
@ -2662,9 +2662,7 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int
|
|||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec?\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
} else {
|
||||
int ms;
|
||||
tech_pvt->video_read_frame.rate = tech_pvt->video_rm_rate;
|
||||
ms = tech_pvt->video_write_codec.implementation->microseconds_per_packet / 1000;
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Set VIDEO Codec %s %s/%ld %d ms\n",
|
||||
switch_channel_get_name(tech_pvt->channel), tech_pvt->video_rm_encoding, tech_pvt->video_rm_rate, tech_pvt->video_codec_ms);
|
||||
tech_pvt->video_read_frame.codec = &tech_pvt->video_read_codec;
|
||||
|
@ -2689,7 +2687,6 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int
|
|||
|
||||
switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
|
||||
{
|
||||
int ms;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
int resetting = 0;
|
||||
|
||||
|
@ -2782,7 +2779,6 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
|
|||
}
|
||||
|
||||
tech_pvt->read_frame.rate = tech_pvt->rm_rate;
|
||||
ms = tech_pvt->write_codec.implementation->microseconds_per_packet / 1000;
|
||||
|
||||
if (!switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec?\n");
|
||||
|
@ -2865,7 +2861,6 @@ switch_status_t sofia_glue_build_crypto(private_object_t *tech_pvt, int index, s
|
|||
switch_status_t sofia_glue_add_crypto(private_object_t *tech_pvt, const char *key_str, switch_rtp_crypto_direction_t direction)
|
||||
{
|
||||
unsigned char key[SWITCH_RTP_MAX_CRYPTO_LEN];
|
||||
int index;
|
||||
switch_rtp_crypto_key_type_t type;
|
||||
char *p;
|
||||
|
||||
|
@ -2874,8 +2869,6 @@ switch_status_t sofia_glue_add_crypto(private_object_t *tech_pvt, const char *ke
|
|||
goto bad;
|
||||
}
|
||||
|
||||
index = atoi(key_str);
|
||||
|
||||
p = strchr(key_str, ' ');
|
||||
|
||||
if (p && *p && *(p + 1)) {
|
||||
|
@ -2922,7 +2915,6 @@ switch_status_t sofia_glue_add_crypto(private_object_t *tech_pvt, const char *ke
|
|||
|
||||
switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_flag_t myflags)
|
||||
{
|
||||
int bw, ms;
|
||||
const char *err = NULL;
|
||||
const char *val = NULL;
|
||||
switch_rtp_flag_t flags;
|
||||
|
@ -2963,9 +2955,6 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
|||
goto end;
|
||||
}
|
||||
|
||||
bw = tech_pvt->read_impl.bits_per_second;
|
||||
ms = tech_pvt->read_impl.microseconds_per_packet;
|
||||
|
||||
if (myflags) {
|
||||
flags = myflags;
|
||||
} else if (!sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_RTP_AUTOADJ) &&
|
||||
|
@ -4095,7 +4084,7 @@ void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp)
|
|||
sdp_session_t *sdp;
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
sdp_attribute_t *attr;
|
||||
int ptime = 0, dptime = 0, dmaxptime = 0, maxptime = 0;
|
||||
int ptime = 0, dptime = 0;
|
||||
|
||||
if (!(parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) {
|
||||
return;
|
||||
|
@ -4116,8 +4105,6 @@ void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp)
|
|||
|
||||
if (!strcasecmp(attr->a_name, "ptime")) {
|
||||
dptime = atoi(attr->a_value);
|
||||
} else if (!strcasecmp(attr->a_name, "maxptime")) {
|
||||
dmaxptime = atoi(attr->a_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4125,7 +4112,7 @@ void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp)
|
|||
for (m = sdp->sdp_media; m; m = m->m_next) {
|
||||
|
||||
ptime = dptime;
|
||||
maxptime = dmaxptime;
|
||||
//maxptime = dmaxptime;
|
||||
|
||||
if (m->m_proto == sdp_proto_rtp) {
|
||||
sdp_rtpmap_t *map;
|
||||
|
@ -4133,7 +4120,7 @@ void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp)
|
|||
if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) {
|
||||
ptime = atoi(attr->a_value);
|
||||
} else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) {
|
||||
maxptime = atoi(attr->a_value);
|
||||
//maxptime = atoi(attr->a_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4803,7 +4790,6 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
|
|||
} else if (m->m_type == sdp_media_video && m->m_port) {
|
||||
sdp_rtpmap_t *map;
|
||||
const char *rm_encoding;
|
||||
int framerate = 0;
|
||||
const switch_codec_implementation_t *mimp = NULL;
|
||||
int vmatch = 0, i;
|
||||
switch_channel_set_variable(tech_pvt->channel, "video_possible", "true");
|
||||
|
@ -4823,7 +4809,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
|
|||
|
||||
for (attr = m->m_attributes; attr; attr = attr->a_next) {
|
||||
if (!strcasecmp(attr->a_name, "framerate") && attr->a_value) {
|
||||
framerate = atoi(attr->a_value);
|
||||
//framerate = atoi(attr->a_value);
|
||||
}
|
||||
if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value) {
|
||||
switch_channel_set_variable(tech_pvt->channel, "sip_remote_video_rtcp_port", attr->a_value);
|
||||
|
@ -6253,7 +6239,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
|
|||
contact = sofia_glue_get_url_from_contact((char *) o_contact, 1);
|
||||
if (!zstr(network_ip) && sofia_glue_check_nat(profile, network_ip)) {
|
||||
char *ptr = NULL;
|
||||
const char *transport_str = NULL;
|
||||
//const char *transport_str = NULL;
|
||||
|
||||
|
||||
id = switch_mprintf("sip:%s@%s", user, profile->extsipip);
|
||||
|
@ -6261,7 +6247,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
|
|||
|
||||
if ((ptr = sofia_glue_find_parameter(o_contact, "transport="))) {
|
||||
sofia_transport_t transport = sofia_glue_str2transport(ptr);
|
||||
transport_str = sofia_glue_transport2str(transport);
|
||||
//transport_str = sofia_glue_transport2str(transport);
|
||||
switch (transport) {
|
||||
case SOFIA_TRANSPORT_TCP:
|
||||
contact_str = profile->tcp_public_contact;
|
||||
|
@ -6469,7 +6455,7 @@ void sofia_glue_parse_rtp_bugs(uint32_t *flag_pole, const char *str)
|
|||
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_nat_parse_t *np)
|
||||
{
|
||||
char *contact_str = NULL;
|
||||
const char *contact_host, *contact_user;
|
||||
const char *contact_host;//, *contact_user;
|
||||
sip_contact_t const *contact;
|
||||
char *port;
|
||||
const char *display = "\"user\"";
|
||||
|
@ -6497,7 +6483,7 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sof
|
|||
|
||||
port = (char *) contact->m_url->url_port;
|
||||
contact_host = sip->sip_contact->m_url->url_host;
|
||||
contact_user = sip->sip_contact->m_url->url_user;
|
||||
//contact_user = sip->sip_contact->m_url->url_user;
|
||||
|
||||
display = contact->m_display;
|
||||
|
||||
|
|
|
@ -208,10 +208,10 @@ switch_status_t sofia_presence_chat_send(const char *proto, const char *from, co
|
|||
|
||||
if (!zstr(remote_ip) && sofia_glue_check_nat(profile, remote_ip)) {
|
||||
char *ptr = NULL;
|
||||
const char *transport_str = NULL;
|
||||
//const char *transport_str = NULL;
|
||||
if ((ptr = sofia_glue_find_parameter(dst->contact, "transport="))) {
|
||||
sofia_transport_t transport = sofia_glue_str2transport(ptr);
|
||||
transport_str = sofia_glue_transport2str(transport);
|
||||
//transport_str = sofia_glue_transport2str(transport);
|
||||
switch (transport) {
|
||||
case SOFIA_TRANSPORT_TCP:
|
||||
contact_str = profile->tcp_public_contact;
|
||||
|
@ -2059,7 +2059,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
tagi_t tags[])
|
||||
{
|
||||
|
||||
long exp_abs, exp_delta;
|
||||
long exp_delta;
|
||||
char exp_delta_str[30] = "";
|
||||
sip_to_t const *to;
|
||||
const char *from_user = NULL, *from_host = NULL;
|
||||
|
@ -2080,7 +2080,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
int sent_reply = 0;
|
||||
sip_contact_t const *contact;
|
||||
const char *ipv6;
|
||||
const char *contact_host, *contact_user;
|
||||
const char *contact_user;
|
||||
sofia_nat_parse_t np = { { 0 } };
|
||||
|
||||
if (!sip) {
|
||||
|
@ -2095,7 +2095,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
return;
|
||||
}
|
||||
|
||||
contact_host = sip->sip_contact->m_url->url_host;
|
||||
//contact_host = sip->sip_contact->m_url->url_host;
|
||||
contact_user = sip->sip_contact->m_url->url_user;
|
||||
|
||||
tl_gets(tags, NUTAG_SUBSTATE_REF(sub_state), TAG_END());
|
||||
|
@ -2142,10 +2142,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
}
|
||||
}
|
||||
|
||||
if (exp_delta) {
|
||||
exp_abs = (long) switch_epoch_time_now(NULL) + exp_delta;
|
||||
} else {
|
||||
exp_abs = 0;
|
||||
if (!exp_delta) {
|
||||
sub_state = nua_substate_terminated;
|
||||
}
|
||||
|
||||
|
@ -2773,9 +2770,7 @@ void sofia_presence_handle_sip_i_message(int status,
|
|||
sip_to_t const *to = sip->sip_to;
|
||||
const char *to_user = NULL;
|
||||
const char *to_host = NULL;
|
||||
sip_subject_t const *sip_subject = sip->sip_subject;
|
||||
sip_payload_t *payload = sip->sip_payload;
|
||||
const char *subject = "n/a";
|
||||
char *msg = NULL;
|
||||
|
||||
if (sip->sip_content_type && sip->sip_content_type->c_subtype) {
|
||||
|
@ -2802,14 +2797,9 @@ void sofia_presence_handle_sip_i_message(int status,
|
|||
msg = payload->pl_data;
|
||||
}
|
||||
|
||||
if (sip_subject) {
|
||||
subject = sip_subject->g_value;
|
||||
}
|
||||
|
||||
if (nh) {
|
||||
char hash_key[512];
|
||||
private_object_t *tech_pvt;
|
||||
switch_channel_t *channel;
|
||||
switch_event_t *event;
|
||||
char *to_addr;
|
||||
char *from_addr;
|
||||
|
@ -2840,7 +2830,6 @@ void sofia_presence_handle_sip_i_message(int status,
|
|||
}
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_IN_DIALOG_CHAT) && (tech_pvt = (private_object_t *) switch_core_hash_find(profile->chat_hash, hash_key))) {
|
||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
|
|
|
@ -852,7 +852,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
const char *reg_host = profile->reg_db_domain;
|
||||
const char *sub_host = profile->sub_domain;
|
||||
char contact_str[1024] = "";
|
||||
int nat_hack = 0;
|
||||
uint8_t multi_reg = 0, multi_reg_contact = 0, avoid_multi_reg = 0;
|
||||
uint8_t stale = 0, forbidden = 0;
|
||||
auth_res_t auth_res;
|
||||
|
@ -863,7 +862,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
char network_ip[80];
|
||||
char network_port_c[6];
|
||||
char url_ip[80];
|
||||
char *register_gateway = NULL;
|
||||
int network_port;
|
||||
const char *reg_desc = "Registered";
|
||||
const char *call_id = NULL;
|
||||
|
@ -1094,8 +1092,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
avoid_multi_reg = 1;
|
||||
}
|
||||
|
||||
register_gateway = switch_event_get_header(*v_event, "sip-register-gateway");
|
||||
|
||||
/* Allow us to force the SIP user to be something specific - needed if
|
||||
* we - for example - want to be able to ensure that the username a UA can
|
||||
* be contacted at is the same one that they used for authentication.
|
||||
|
@ -1166,7 +1162,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
reg_desc = "Registered(AUTO-NAT)";
|
||||
exptime = 30;
|
||||
}
|
||||
nat_hack = 1;
|
||||
} else {
|
||||
char *p;
|
||||
switch_copy_string(contact_str, v_contact_str, sizeof(contact_str));
|
||||
|
|
|
@ -94,7 +94,6 @@ static void do_rotate(cdr_fd_t *fd)
|
|||
char date[80] = "";
|
||||
switch_size_t retsize;
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
close(fd->fd);
|
||||
fd->fd = -1;
|
||||
|
@ -103,7 +102,7 @@ static void do_rotate(cdr_fd_t *fd)
|
|||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d-%H-%M-%S", &tm);
|
||||
|
||||
len = strlen(fd->path) + strlen(date) + 2;
|
||||
|
||||
p = switch_mprintf("%s.%s", fd->path, date);
|
||||
assert(p);
|
||||
switch_file_rename(fd->path, p, globals.pool);
|
||||
|
|
|
@ -990,19 +990,19 @@ SWITCH_STANDARD_API(event_sink_function)
|
|||
stream->write_function(stream, "<events>\n");
|
||||
|
||||
while (switch_queue_trypop(listener->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
|
||||
char *etype;
|
||||
//char *etype;
|
||||
pevent = (switch_event_t *) pop;
|
||||
|
||||
if (listener->format == EVENT_FORMAT_PLAIN) {
|
||||
etype = "plain";
|
||||
//etype = "plain";
|
||||
switch_event_serialize(pevent, &listener->ebuf, SWITCH_TRUE);
|
||||
stream->write_function(stream, "<event type=\"plain\">\n%s</event>", listener->ebuf);
|
||||
} else if (listener->format == EVENT_FORMAT_JSON) {
|
||||
etype = "json";
|
||||
//etype = "json";
|
||||
switch_event_serialize_json(pevent, &listener->ebuf);
|
||||
} else {
|
||||
switch_xml_t xml;
|
||||
etype = "xml";
|
||||
//etype = "xml";
|
||||
|
||||
if ((xml = switch_event_xmlize(pevent, SWITCH_VA_NONE))) {
|
||||
listener->ebuf = switch_xml_toxml(xml, SWITCH_FALSE);
|
||||
|
|
|
@ -758,7 +758,7 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
|||
char *mycmd = NULL, *argv[8] = { 0 };
|
||||
char *local_stream_name = NULL, *path = NULL, *timer_name = NULL;
|
||||
uint32_t prebuf = 1;
|
||||
int rate = 8000, shuffle = 1, interval = 20;
|
||||
int rate = 8000, interval = 20;
|
||||
uint8_t channels = 1;
|
||||
int argc = 0;
|
||||
char *cf = "local_stream.conf";
|
||||
|
@ -790,7 +790,7 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
|||
}
|
||||
}
|
||||
|
||||
shuffle = argv[3] ? switch_true(argv[3]) : 1;
|
||||
//shuffle = argv[3] ? switch_true(argv[3]) : 1;
|
||||
prebuf = argv[4] ? atoi(argv[4]) : DEFAULT_PREBUFFER_SIZE;
|
||||
|
||||
if (argv[5]) {
|
||||
|
@ -833,8 +833,8 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
|||
if (tmp == 8000 || tmp == 16000 || tmp == 32000) {
|
||||
rate = tmp;
|
||||
}
|
||||
} else if (!strcasecmp(var, "shuffle")) {
|
||||
shuffle = switch_true(val);
|
||||
//} else if (!strcasecmp(var, "shuffle")) {
|
||||
//shuffle = switch_true(val);
|
||||
} else if (!strcasecmp(var, "prebuf")) {
|
||||
tmp = atoi(val);
|
||||
if (tmp > 0) {
|
||||
|
|
|
@ -339,7 +339,6 @@ static char **supported_formats;
|
|||
static switch_status_t setup_formats(void)
|
||||
{
|
||||
SF_FORMAT_INFO info;
|
||||
SF_INFO sfinfo;
|
||||
char buffer[128];
|
||||
int format, major_count, subtype_count, m, s;
|
||||
int len, x, skip;
|
||||
|
@ -358,7 +357,7 @@ static switch_status_t setup_formats(void)
|
|||
sf_command(NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof(int));
|
||||
sf_command(NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof(int));
|
||||
|
||||
sfinfo.channels = 1;
|
||||
//sfinfo.channels = 1;
|
||||
len = ((major_count + (exlen + 2)) * sizeof(char *));
|
||||
supported_formats = switch_core_permanent_alloc(len);
|
||||
|
||||
|
@ -402,7 +401,7 @@ static switch_status_t setup_formats(void)
|
|||
info.format = s;
|
||||
sf_command(NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof(info));
|
||||
format = (format & SF_FORMAT_TYPEMASK) | info.format;
|
||||
sfinfo.format = format;
|
||||
//sfinfo.format = format;
|
||||
/*
|
||||
if (sf_format_check(&sfinfo)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, " %s\n", info.name);
|
||||
|
|
|
@ -766,11 +766,8 @@ static JSBool dtmf_construct(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
|||
{
|
||||
switch_dtmf_t *dtmf;
|
||||
int32 duration = switch_core_default_dtmf_duration(0);
|
||||
char *ename;
|
||||
|
||||
if (argc > 0) {
|
||||
ename = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
} else {
|
||||
if (argc <= 0) {
|
||||
eval_some_js("~throw new Error(\"Invalid Args\");", cx, obj, rval);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
@ -1911,7 +1908,6 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
|||
char *tts_name = NULL;
|
||||
char *voice_name = NULL;
|
||||
char *text = NULL;
|
||||
switch_codec_t *codec;
|
||||
void *bp = NULL;
|
||||
int len = 0;
|
||||
struct input_callback_state cb_state = { 0 };
|
||||
|
@ -1979,7 +1975,6 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
|||
}
|
||||
}
|
||||
|
||||
codec = switch_core_session_get_read_codec(jss->session);
|
||||
cb_state.ret = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
cb_state.saveDepth = JS_SuspendRequest(cx);
|
||||
args.input_callback = dtmf_func;
|
||||
|
@ -2281,13 +2276,12 @@ static JSBool session_detach(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
|||
static JSBool session_execute(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
||||
{
|
||||
JSBool retval = JS_FALSE;
|
||||
switch_channel_t *channel;
|
||||
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
jsval ret = JS_TRUE;
|
||||
|
||||
METHOD_SANITY_CHECK();
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
/* you can execute some apps before you answer CHANNEL_SANITY_CHECK(); */
|
||||
|
||||
if (argc > 0) {
|
||||
|
@ -3498,7 +3492,6 @@ static JSBool js_bridge(JSContext * cx, JSObject * obj, uintN argc, jsval * argv
|
|||
struct js_session *jss_a = NULL, *jss_b = NULL;
|
||||
JSObject *session_obj_a = NULL, *session_obj_b = NULL;
|
||||
void *bp = NULL;
|
||||
int len = 0;
|
||||
switch_input_callback_function_t dtmf_func = NULL;
|
||||
struct input_callback_state cb_state = { 0 };
|
||||
JSFunction *function;
|
||||
|
@ -3548,7 +3541,6 @@ static JSBool js_bridge(JSContext * cx, JSObject * obj, uintN argc, jsval * argv
|
|||
cb_state.session_state = jss_a;
|
||||
dtmf_func = js_collect_input_callback;
|
||||
bp = &cb_state;
|
||||
len = sizeof(cb_state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
|||
#endif
|
||||
int wrote;
|
||||
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
|
||||
wrote++;
|
||||
close(fd);
|
||||
fd = -1;
|
||||
} else {
|
||||
|
@ -393,6 +394,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
|||
#endif
|
||||
int wrote;
|
||||
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
|
||||
wrote++;
|
||||
close(fd);
|
||||
fd = -1;
|
||||
} else {
|
||||
|
|
|
@ -776,10 +776,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
#if defined(HAVE_SETRLIMIT) && !defined(__sun)
|
||||
if (!waste && !(flags & SCF_VG)) {
|
||||
int x;
|
||||
//int x;
|
||||
|
||||
memset(&rlp, 0, sizeof(rlp));
|
||||
x = getrlimit(RLIMIT_STACK, &rlp);
|
||||
getrlimit(RLIMIT_STACK, &rlp);
|
||||
|
||||
if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) {
|
||||
char buf[1024] = "";
|
||||
|
|
|
@ -1193,16 +1193,10 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t
|
|||
|
||||
SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state)
|
||||
{
|
||||
switch_channel_state_t state, mystate;
|
||||
|
||||
for (;;) {
|
||||
if (other_channel) {
|
||||
state = switch_channel_get_running_state(other_channel);
|
||||
}
|
||||
mystate = switch_channel_get_running_state(channel);
|
||||
|
||||
if ((channel->state == channel->running_state && channel->running_state == want_state) ||
|
||||
(other_channel && other_channel->state >= CS_HANGUP) || channel->state >= CS_HANGUP) {
|
||||
switch_channel_down(other_channel) || switch_channel_down(channel)) {
|
||||
break;
|
||||
}
|
||||
switch_yield(20000);
|
||||
|
@ -1212,11 +1206,10 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, sw
|
|||
|
||||
SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *channel, switch_channel_state_t want_state, uint32_t timeout)
|
||||
{
|
||||
switch_channel_state_t state;
|
||||
|
||||
uint32_t count = 0;
|
||||
|
||||
for (;;) {
|
||||
state = switch_channel_get_running_state(channel);
|
||||
|
||||
if ((channel->state == channel->running_state && channel->running_state == want_state) || channel->state >= CS_HANGUP) {
|
||||
break;
|
||||
|
@ -3360,7 +3353,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
|
|||
switch_time_t answerusec = 0;
|
||||
switch_time_t uduration = 0, legbillusec = 0, billusec = 0, progresssec = 0, progressusec = 0, progress_mediasec = 0, progress_mediausec = 0;
|
||||
time_t tt_created = 0, tt_answered = 0, tt_resurrected = 0,
|
||||
tt_progress = 0, tt_progress_media = 0, tt_hungup = 0, mtt_created = 0, mtt_answered = 0, mtt_resurrected = 0,
|
||||
tt_progress = 0, tt_progress_media = 0, tt_hungup = 0, mtt_created = 0, mtt_answered = 0,
|
||||
mtt_hungup = 0, tt_prof_created, mtt_prof_created, mtt_progress = 0, mtt_progress_media = 0;
|
||||
void *pop;
|
||||
char dtstr[SWITCH_DTMF_LOG_LEN + 1] = "";
|
||||
|
@ -3476,7 +3469,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
|
|||
switch_channel_set_variable(channel, "answer_uepoch", tmp);
|
||||
|
||||
tt_resurrected = (time_t) (caller_profile->times->resurrected / 1000000);
|
||||
mtt_resurrected = (time_t) (caller_profile->times->resurrected / 1000);
|
||||
switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_resurrected);
|
||||
switch_channel_set_variable(channel, "resurrect_epoch", tmp);
|
||||
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->resurrected);
|
||||
|
|
|
@ -1280,6 +1280,7 @@ static void switch_core_set_serial(void)
|
|||
|
||||
if ((write_fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) >= 0) {
|
||||
bytes = write(write_fd, buf, sizeof(buf));
|
||||
bytes++;
|
||||
close(write_fd);
|
||||
write_fd = -1;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
|
|||
SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, void *data, switch_size_t *len)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_size_t want, got, orig_len = *len;
|
||||
switch_size_t want, orig_len = *len;
|
||||
|
||||
switch_assert(fh != NULL);
|
||||
switch_assert(fh->file_interface != NULL);
|
||||
|
@ -276,8 +276,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
|
|||
}
|
||||
|
||||
|
||||
got = *len;
|
||||
|
||||
if (!switch_test_flag(fh, SWITCH_FILE_NATIVE) && fh->native_rate != fh->samplerate) {
|
||||
if (!fh->resampler) {
|
||||
if (switch_resample_create(&fh->resampler,
|
||||
|
@ -567,14 +565,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
|||
|
||||
if (fh->spool_path) {
|
||||
char *command;
|
||||
int result;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
command = switch_mprintf("move %s %s", fh->spool_path, fh->file_path);
|
||||
#else
|
||||
command = switch_mprintf("/bin/mv %s %s", fh->spool_path, fh->file_path);
|
||||
#endif
|
||||
result = system(command);
|
||||
system(command);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Copy spooled file [%s] to [%s]\n", fh->spool_path, fh->file_path);
|
||||
free(command);
|
||||
}
|
||||
|
|
|
@ -511,7 +511,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session
|
|||
SWITCH_DECLARE(uint32_t) switch_core_media_bug_prune(switch_core_session_t *session)
|
||||
{
|
||||
switch_media_bug_t *bp = NULL, *last = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
int ttl = 0;
|
||||
|
||||
|
||||
|
@ -540,7 +539,7 @@ SWITCH_DECLARE(uint32_t) switch_core_media_bug_prune(switch_core_session_t *sess
|
|||
switch_thread_rwlock_unlock(session->bug_rwlock);
|
||||
|
||||
if (bp) {
|
||||
status = switch_core_media_bug_close(&bp);
|
||||
switch_core_media_bug_close(&bp);
|
||||
ttl++;
|
||||
goto top;
|
||||
}
|
||||
|
|
|
@ -481,15 +481,13 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
|||
UNPROTECT_INTERFACE(endpoint_interface);
|
||||
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
} else {
|
||||
switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
|
||||
switch_caller_profile_t *profile = NULL, *cloned_profile = NULL;
|
||||
switch_event_t *event;
|
||||
switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
|
||||
const char *use_uuid;
|
||||
|
||||
switch_assert(peer_channel);
|
||||
|
||||
peer_profile = switch_channel_get_caller_profile(peer_channel);
|
||||
|
||||
if ((use_uuid = switch_event_get_header(var_event, "origination_uuid"))) {
|
||||
use_uuid = switch_core_session_strdup(*new_session, use_uuid);
|
||||
if (switch_core_session_set_uuid(*new_session, use_uuid) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -1454,13 +1452,12 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_e
|
|||
switch_channel_t *channel;
|
||||
switch_xml_t tag, tag2, tag3, vars, callflow;
|
||||
switch_call_direction_t direction = SWITCH_CALL_DIRECTION_OUTBOUND;
|
||||
char *bridgeto, *flag_str = NULL, *cap_str = NULL, *direction_s = NULL, *uuid = NULL;
|
||||
char *flag_str = NULL, *cap_str = NULL, *direction_s = NULL, *uuid = NULL;
|
||||
uint32_t flags[CF_FLAG_MAX] = { 0 };
|
||||
uint32_t caps[CC_FLAG_MAX] = { 0 };
|
||||
int i;
|
||||
|
||||
vars = switch_xml_child(xml, "variables");
|
||||
bridgeto = xml_find_var(vars, SWITCH_SIGNAL_BOND_VARIABLE);
|
||||
uuid = xml_find_var(vars, "uuid");
|
||||
|
||||
if ((tag = switch_xml_child(xml, "channel_data"))) {
|
||||
|
|
|
@ -299,14 +299,11 @@ static void *SWITCH_THREAD_FUNC unicast_thread_run(switch_thread_t *thread, void
|
|||
{
|
||||
switch_unicast_conninfo_t *conninfo = (switch_unicast_conninfo_t *) obj;
|
||||
switch_size_t len;
|
||||
switch_channel_t *channel;
|
||||
|
||||
if (!conninfo) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
channel = switch_core_session_get_channel(conninfo->session);
|
||||
|
||||
while (switch_test_flag(conninfo, SUF_READY) && switch_test_flag(conninfo, SUF_THREAD_RUNNING)) {
|
||||
len = conninfo->write_frame.buflen;
|
||||
if (switch_socket_recv(conninfo->socket, conninfo->write_frame.data, &len) != SWITCH_STATUS_SUCCESS || len == 0) {
|
||||
|
@ -1363,11 +1360,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_
|
|||
switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 250, NULL);
|
||||
switch_yield(250000);
|
||||
} else {
|
||||
switch_status_t st;
|
||||
switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL);
|
||||
switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL);
|
||||
switch_channel_wait_for_flag(channel, CF_MEDIA_SET, SWITCH_TRUE, 10000, NULL);
|
||||
st = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
}
|
||||
|
||||
if ((flags & SMF_REBRIDGE)
|
||||
|
@ -2274,7 +2270,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
|
|||
switch_frame_t *read_frame, write_frame = { 0 };
|
||||
switch_status_t status;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
uint32_t interval, samples;
|
||||
uint32_t interval;
|
||||
uint32_t ts = 0;
|
||||
switch_codec_implementation_t read_impl = { 0 };
|
||||
switch_core_session_get_read_impl(session, &read_impl);
|
||||
|
@ -2286,7 +2282,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
|
|||
}
|
||||
|
||||
interval = read_impl.microseconds_per_packet / 1000;
|
||||
samples = switch_samples_per_packet(read_impl.samples_per_second, interval);
|
||||
//samples = switch_samples_per_packet(read_impl.samples_per_second, interval);
|
||||
|
||||
qlen = delay_ms / (interval);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting delay to %dms (%d frames)\n", delay_ms, qlen);
|
||||
|
|
|
@ -1637,7 +1637,6 @@ static switch_bool_t preprocess_callback(switch_media_bug_t *bug, void *user_dat
|
|||
pp_cb_t *cb = (pp_cb_t *) user_data;
|
||||
switch_codec_implementation_t read_impl = { 0 };
|
||||
switch_frame_t *frame = NULL;
|
||||
int y;
|
||||
|
||||
switch_core_session_get_read_impl(session, &read_impl);
|
||||
|
||||
|
@ -1682,7 +1681,7 @@ static switch_bool_t preprocess_callback(switch_media_bug_t *bug, void *user_dat
|
|||
memcpy(frame->data, cb->read_out, frame->datalen);
|
||||
}
|
||||
|
||||
y = speex_preprocess_run(cb->read_st, frame->data);
|
||||
speex_preprocess_run(cb->read_st, frame->data);
|
||||
}
|
||||
|
||||
if (cb->write_ec) {
|
||||
|
@ -1703,7 +1702,7 @@ static switch_bool_t preprocess_callback(switch_media_bug_t *bug, void *user_dat
|
|||
memcpy(frame->data, cb->write_out, frame->datalen);
|
||||
}
|
||||
|
||||
y = speex_preprocess_run(cb->write_st, frame->data);
|
||||
speex_preprocess_run(cb->write_st, frame->data);
|
||||
}
|
||||
|
||||
if (cb->read_ec) {
|
||||
|
|
|
@ -862,10 +862,9 @@ static switch_status_t hanguphook(switch_core_session_t *session)
|
|||
switch_core_session_message_t msg = { 0 };
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_event_t *event;
|
||||
switch_channel_state_t state;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
state = switch_channel_get_state(channel);
|
||||
|
||||
|
||||
msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
|
||||
msg.from = __FILE__;
|
||||
|
|
|
@ -832,7 +832,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
|
|||
}
|
||||
|
||||
for (;;) {
|
||||
int done = 0;
|
||||
switch_status_t status;
|
||||
|
||||
if (!switch_channel_ready(channel)) {
|
||||
|
@ -874,7 +873,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
|
|||
if (switch_channel_has_dtmf(channel)) {
|
||||
if (!args->input_callback && !args->buf && !args->dmachine) {
|
||||
status = SWITCH_STATUS_BREAK;
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
switch_channel_dequeue_dtmf(channel, &dtmf);
|
||||
|
@ -902,7 +900,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
|
|||
}
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS) {
|
||||
done = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1003,7 +1000,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
switch_file_handle_t lfh;
|
||||
const char *p;
|
||||
char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = "";
|
||||
//char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = "";
|
||||
char *ext;
|
||||
const char *prefix;
|
||||
const char *timer_name;
|
||||
|
@ -1235,35 +1232,35 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_TITLE, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
title = switch_core_session_strdup(session, p);
|
||||
//title = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_TITLE", p);
|
||||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_COPYRIGHT, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
copyright = switch_core_session_strdup(session, p);
|
||||
//copyright = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_COPYRIGHT", p);
|
||||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_SOFTWARE, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
software = switch_core_session_strdup(session, p);
|
||||
//software = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_SOFTWARE", p);
|
||||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_ARTIST, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
artist = switch_core_session_strdup(session, p);
|
||||
//artist = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_ARTIST", p);
|
||||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_COMMENT, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
comment = switch_core_session_strdup(session, p);
|
||||
//comment = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_COMMENT", p);
|
||||
}
|
||||
|
||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_DATE, &p) == SWITCH_STATUS_SUCCESS) {
|
||||
date = switch_core_session_strdup(session, p);
|
||||
//date = switch_core_session_strdup(session, p);
|
||||
switch_channel_set_variable(channel, "RECORD_DATE", p);
|
||||
}
|
||||
|
||||
|
||||
interval = read_impl.microseconds_per_packet / 1000;
|
||||
|
||||
if (!fh->audio_buffer) {
|
||||
|
@ -2314,7 +2311,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
|
|||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
switch_speech_handle_t lsh, *sh;
|
||||
switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
|
||||
switch_codec_t *read_codec;
|
||||
const char *timer_name, *var;
|
||||
cached_speech_handle_t *cache_obj = NULL;
|
||||
int need_create = 1, need_alloc = 1;
|
||||
|
@ -2355,7 +2351,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
|
|||
timer_name = switch_channel_get_variable(channel, "timer_name");
|
||||
|
||||
switch_core_session_reset(session, SWITCH_FALSE, SWITCH_FALSE);
|
||||
read_codec = switch_core_session_get_read_codec(session);
|
||||
|
||||
rate = read_impl.actual_samples_per_second;
|
||||
interval = read_impl.microseconds_per_packet / 1000;
|
||||
|
|
|
@ -1681,11 +1681,11 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
|||
switch_mutex_lock(loadable_modules.mutex);
|
||||
|
||||
for (x = 0; x < preflen; x++) {
|
||||
char *cur, *last = NULL, *next = NULL, *name, *p, buf[256];
|
||||
char *cur, *next = NULL, *name, *p, buf[256];
|
||||
uint32_t interval = 0, rate = 0, bit = 0;
|
||||
|
||||
switch_copy_string(buf, prefs[x], sizeof(buf));
|
||||
last = name = next = cur = buf;
|
||||
name = next = cur = buf;
|
||||
|
||||
for (;;) {
|
||||
if (!next) {
|
||||
|
|
|
@ -2342,7 +2342,6 @@ static void do_flush(switch_rtp_t *rtp_session)
|
|||
{
|
||||
int was_blocking = 0;
|
||||
switch_size_t bytes;
|
||||
switch_status_t status;
|
||||
|
||||
if (!switch_rtp_ready(rtp_session) ||
|
||||
switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) ||
|
||||
|
@ -2377,7 +2376,7 @@ static void do_flush(switch_rtp_t *rtp_session)
|
|||
do {
|
||||
if (switch_rtp_ready(rtp_session)) {
|
||||
bytes = sizeof(rtp_msg_t);
|
||||
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes);
|
||||
switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes);
|
||||
if (bytes) {
|
||||
int do_cng = 0;
|
||||
|
||||
|
@ -3981,14 +3980,14 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
|
|||
|
||||
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL)) {
|
||||
switch_size_t bytes;
|
||||
char bufa[30];
|
||||
const char *tx_host;
|
||||
//char bufa[30];
|
||||
|
||||
/* Fast PASS! */
|
||||
if (!switch_test_flag(frame, SFF_PROXY_PACKET) && !switch_test_flag(frame, SFF_UDPTL_PACKET)) {
|
||||
return 0;
|
||||
}
|
||||
bytes = frame->packetlen;
|
||||
tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->remote_addr);
|
||||
//tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->remote_addr);
|
||||
|
||||
|
||||
send_msg = frame->packet;
|
||||
|
|
|
@ -794,6 +794,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
|
|||
uint64_t exp;
|
||||
int r;
|
||||
r = read(tfd, &exp, sizeof(exp));
|
||||
r++;
|
||||
} else {
|
||||
do_sleep(1000);
|
||||
}
|
||||
|
|
|
@ -1851,7 +1851,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
|
|||
switch_xml_t *domain, switch_xml_t *user, switch_xml_t *ingroup, switch_event_t *params)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
switch_event_t *my_params = NULL, *search_params = NULL;
|
||||
switch_event_t *my_params = NULL;
|
||||
switch_xml_t group = NULL, groups = NULL, users = NULL;
|
||||
|
||||
*root = NULL;
|
||||
|
@ -1888,10 +1888,6 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
|
|||
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (params != my_params) {
|
||||
search_params = params;
|
||||
}
|
||||
|
||||
if ((groups = switch_xml_child(*domain, "groups"))) {
|
||||
for (group = switch_xml_child(groups, "group"); group; group = group->next) {
|
||||
if ((users = switch_xml_child(group, "users"))) {
|
||||
|
|
Loading…
Reference in New Issue