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);
}
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;
cur = data;
while (*cur) {
- var = 0;
if (*cur == ' ' || *cur == '\r' || *cur == '\n') {
cur++;
continue;
}
if (*(cur + 1) == '=') {
- var = 1;
switch(*cur) {
case 'c':
ts->channels = atoi(cur + 2);
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)
{
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;
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);
}
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;
printf("%s", SWITCH_SEQ_CLEARSCR);
- if (i > 0) {
- sleep_len = i;
- }
+ //if (i > 0) {
+ //sleep_len = i;
+ //}
initscr();
signal(SIGINT, SIG_IGN);
{
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])));
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");
}
{
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])));
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");
}
char *mydata = NULL, *argv[2] = { 0 };
int argc = 0;
- switch_status_t status = SWITCH_STATUS_FALSE;
-
if (zstr(cmd)) {
goto error;
}
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;
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;
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];
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);
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;
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;
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;
}
goto do_continue;
}
- req_iframe = 0;
+ //req_iframe = 0;
}
last_member = conference->floor_holder->id;
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;
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;
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;
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);
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;
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++);
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);
member.pool = switch_core_session_get_pool(session);
if (setup_media(&member, conference)) {
- flags = 0;
+ //flags = 0;
goto done;
}
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;
/* 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;
}
/* 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;
}
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;
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;
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");
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;
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);
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;
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) {
switch_status_t status = SWITCH_STATUS_FALSE;
switch_event_t *event = NULL;
char *sql = NULL;
- int connected = 0;
if (!globals.running) return NULL;
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) {
#define HASH_REMOTE_SYNTAX "list|kill [name]|rescan"
SWITCH_STANDARD_API(hash_remote_function)
{
- int argc;
+ //int argc;
char *argv[10];
char *dup = NULL;
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");
{
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;
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;
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) {
*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;
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;
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))) {
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];
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;
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")) {
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 {
(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);
SWITCH_STANDARD_APP(voicemail_function)
{
- int argc = 0;
char *argv[6] = { 0 };
char *mydata = NULL;
vm_profile_t *profile = NULL;
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 (;;) {
#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;
void *val = NULL;
switch_xml_t xml_root;
const char *err;
-
+ int argc = 0;
if (session) {
return SWITCH_STATUS_FALSE;
char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
const char *id = NULL, *domain = NULL, *profile_name = NULL;
vm_profile_t *profile = NULL;
- int argc = 0;
char *argv[6] = { 0 };
char *mycmd = NULL;
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])
int argc;
char *argv[3] = { 0 };
char *pattern = NULL;
- char *pri = NULL;
char *app = NULL;
char *argument = NULL;
char *expression = NULL, expression_buf[1024] = "";
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, '('))) {
{
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);
return status;
}
- payload = tech_pvt->video_read_frame.payload;
-
if (tech_pvt->video_read_frame.datalen > 0) {
break;
}
{
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;
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);
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];
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)) {
}
dup = strdup(line);
- argc = switch_split(dup, ' ', argv);
+ switch_split(dup, ' ', argv);
if (zstr(argv[2]) || !strcmp(argv[2], " ")) {
goto end;
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;
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_;
if (!family)
dig->ip4 = 1, dig->ip6 = 2;
- if (argv[1] && argv[1][0] == '@')
- dnsserver = argv++[1] + 1;
-
-
if (!argv[1])
{usage(2);}
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;
}
if (!host_is_domain(host)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s: invalid host\n", string);
- exitcode = 1;
continue;
}
continue /* resolved a/aaaa */;
stream->write_function(stream, "-ERR: %s: not found\n", string);
- exitcode = 1;
}
if (xml) {
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);
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);
{
/* 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;
}
from = sip->sip_from;
- to = sip->sip_to;
+ //to = sip->sip_to;
home = su_home_new(sizeof(*home));
switch_assert(home != NULL);
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];
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);
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;
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;
}
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");
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;
goto bad;
}
- index = atoi(key_str);
-
p = strchr(key_str, ' ');
if (p && *p && *(p + 1)) {
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;
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) &&
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;
if (!strcasecmp(attr->a_name, "ptime")) {
dptime = atoi(attr->a_value);
- } else if (!strcasecmp(attr->a_name, "maxptime")) {
- dmaxptime = atoi(attr->a_value);
}
}
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;
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);
}
}
} 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");
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);
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);
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;
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\"";
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;
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;
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;
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) {
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());
}
}
- 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;
}
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) {
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;
}
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);
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;
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;
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.
reg_desc = "Registered(AUTO-NAT)";
exptime = 30;
}
- nat_hack = 1;
} else {
char *p;
switch_copy_string(contact_str, v_contact_str, sizeof(contact_str));
char date[80] = "";
switch_size_t retsize;
char *p;
- size_t len;
close(fd->fd);
fd->fd = -1;
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);
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);
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";
}
}
- 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]) {
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) {
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;
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);
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);
{
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;
}
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 };
}
}
- 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;
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) {
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;
cb_state.session_state = jss_a;
dtmf_func = js_collect_input_callback;
bp = &cb_state;
- len = sizeof(cb_state);
}
}
#endif
int wrote;
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
+ wrote++;
close(fd);
fd = -1;
} else {
#endif
int wrote;
wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
+ wrote++;
close(fd);
fd = -1;
} else {
#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] = "";
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);
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;
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] = "";
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);
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;
}
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);
}
- got = *len;
-
if (!switch_test_flag(fh, SWITCH_FILE_NATIVE) && fh->native_rate != fh->samplerate) {
if (!fh->resampler) {
if (switch_resample_create(&fh->resampler,
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);
}
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;
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;
}
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) {
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"))) {
{
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) {
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)
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);
}
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);
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);
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) {
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) {
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__;
}
for (;;) {
- int done = 0;
switch_status_t status;
if (!switch_channel_ready(channel)) {
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);
}
if (status != SWITCH_STATUS_SUCCESS) {
- done = 1;
break;
}
}
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;
}
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) {
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;
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;
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) {
{
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) ||
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;
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;
uint64_t exp;
int r;
r = read(tfd, &exp, sizeof(exp));
+ r++;
} else {
do_sleep(1000);
}
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;
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"))) {