ftdm_size_t len;
unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
ftdm_wait_flag_t wflags = FTDM_WRITE;
- ftdm_status_t status;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
wflags = FTDM_WRITE;
- status = ftdm_channel_wait(tech_pvt->ftdmchan, &wflags, ftdm_channel_get_io_interval(tech_pvt->ftdmchan) * 10);
+ ftdm_channel_wait(tech_pvt->ftdmchan, &wflags, ftdm_channel_get_io_interval(tech_pvt->ftdmchan) * 10);
if (!(wflags & FTDM_WRITE)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Dropping frame! (write not ready)\n");
double success = 0.0;
double amp = 0.0;
double s_rate;
- double e_rate;
+// double e_rate;
double avg_a;
double sine_len;
uint32_t sine_len_i;
/*! Every once in a while we evaluate the desa2 and amplitude results */
if(((pos + 1) % sine_len_i) == 0){
s_rate = success / (error + success);
- e_rate = error / (error + success);
+// e_rate = error / (error + success);
avg_a = amp / sine_len;
/*! Results out of these ranges are considered invalid */
if (!session && pool) {
switch_core_destroy_memory_pool(&pool);
}
+ /* This is so compile doesn't failed because status is never used */
+ if (status) {
+ }
}
SWITCH_STANDARD_API(cidlookup_function)
static void ladspa_parse(switch_core_session_t *session, const char *data)
{
char *argv[5] = { 0 };
- int argc;
char *lbuf;
if (data) {
lbuf = strdup(data);
- argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])));
+ switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])));
ladspa_session(session, argv[0], argv[1], argv[2], argv[3]);
free(lbuf);
}
size_t tstrip;
char *data = NULL;
char *destination_number = NULL;
- char *orig_destination_number = NULL;
char *codec = NULL;
char *cid = NULL;
char *header = NULL;
char *user_rate = NULL;
char *export_fields = NULL;
- orig_destination_number = destination_number = switch_core_strdup(pool, dialed_number);
+ destination_number = switch_core_strdup(pool, dialed_number);
tstrip = ((cur_route->digit_len - cur_route->tstrip) + 1);
lstrip = cur_route->lstrip;
const char *intralata = NULL;
switch_core_session_t *mysession = NULL;
switch_channel_t *channel = NULL;
- switch_caller_profile_t *caller_profile = NULL;
dest = strdup(outbound_profile->destination_number);
timelimit = atoi(var);
}
routes.session = session;
- caller_profile = switch_channel_get_caller_profile(channel);
intrastate = switch_channel_get_variable(channel, "intrastate");
intralata = switch_channel_get_variable(channel, "intralata");
cid_name_override = switch_channel_get_variable(channel, "origination_caller_id_name");
char *argv[4] = { 0 };
int argc;
char *mydata = NULL;
- char *dialstring = NULL;
+ //char *dialstring = NULL;
char *lcr_profile = NULL;
lcr_route current = NULL;
max_obj_t maximum_lengths = { 0 };
current = cb_struct.head;
while (current) {
- dialstring = get_bridge_data(pool, cb_struct.lookup_number, cb_struct.cid, current, cb_struct.profile, cb_struct.session);
+ //dialstring =
+ get_bridge_data(pool, cb_struct.lookup_number, cb_struct.cid, current, cb_struct.profile, cb_struct.session);
rowcount++;
if (as_xml) {
const char *billrate;
const char *billaccount;
float nobal_amt = globals.nobal_amt;
- float lowbal_amt = globals.lowbal_amt;
+ //float lowbal_amt = globals.lowbal_amt;
float balance;
if (!session) {
if (!zstr(switch_channel_get_variable(channel, "nobal_amt"))) {
nobal_amt = (float)atof(switch_channel_get_variable(channel, "nobal_amt"));
}
+ /*
if (!zstr(switch_channel_get_variable(channel, "lowbal_amt"))) {
lowbal_amt = (float)atof(switch_channel_get_variable(channel, "lowbal_amt"));
}
-
+ */
/* Return if there's no billing information on this session */
if (!billrate || !billaccount) {
return SWITCH_STATUS_SUCCESS;
if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
char *uuid = argv[0];
if ((psession = switch_core_session_locate(uuid))) {
- switch_channel_t *channel;
- channel = switch_core_session_get_channel(psession);
-
if (!strcasecmp(argv[1], "adjust") && argc == 3) {
nibblebill_adjust(psession, (float) atof(argv[2]));
} else if (!strcasecmp(argv[1], "flush")) {
char *filename = NULL;
char *argv[3], *feed_list[TTS_MAX_ENTRIES] = { 0 }, *feed_names[TTS_MAX_ENTRIES] = {
0};
- int argc, feed_index = 0;
+ int feed_index = 0;
const char *cf = "rss.conf";
switch_xml_t cfg, cxml, feeds, feed;
char buf[1024] = "";
if (!zstr(data)) {
if ((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]));
if (argv[0]) {
engine = argv[0];
double pts[P];
int16_t *data;
int16_t max;
- switch_ssize_t len;
- len = frame->samples * sizeof(int16_t);
+ //len = frame->samples * sizeof(int16_t);
data = (int16_t *) frame->data;
for (max = (int16_t) abs(data[0]), i = 1; i < frame->samples; i++) {
{
int32_t res;
short *dbuf_linear;
- unsigned char *ebuf_g729;
unsigned char ebuf_ulaw[decoded_data_len / 2];
uint32_t i;
struct dahdi_context *context = NULL;
}
dbuf_linear = decoded_data;
- ebuf_g729 = encoded_data;
for (i = 0; i < decoded_data_len / sizeof(short); i++) {
ebuf_ulaw[i] = linear_to_ulaw(dbuf_linear[i]);
}
PABLIO_Stream *aStream;
long numFrames;
//long numBytes;
- int channels = 1;
+ //int channels = 1;
if (!(inputParameters || outputParameters)) {
return -1;
switch_assert(aStream);
memset(aStream, 0, sizeof(PABLIO_Stream));
+ /*
if (inputParameters) {
channels = inputParameters->channelCount;
} else if (outputParameters) {
channels = outputParameters->channelCount;
}
+ */
numFrames = RoundUpToNextPowerOf2(samples_per_packet * 5);
aStream->bytesPerFrame = bytesPerSample;
switch_status_t skinny_tech_set_codec(private_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;
+ //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_channel_t *channel = switch_core_session_get_channel(session);
private_t *tech_pvt = switch_core_session_get_private(session);
- int payload = 0;
while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session))) {
if (switch_channel_ready(channel)) {
return SWITCH_STATUS_FALSE;
}
- payload = tech_pvt->read_frame.payload;
+ //payload = tech_pvt->read_frame.payload;
if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) {
switch_dtmf_t dtmf = { 0 };
switch_status_t skinny_session_ring_out(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
{
- switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
switch_assert(session);
switch_assert(listener);
switch_assert(listener->profile);
- channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
send_start_tone(listener, SKINNY_TONE_ALERT, 0, line_instance, tech_pvt->call_id);
switch_status_t skinny_session_hold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
{
- switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
switch_assert(session);
switch_assert(listener);
switch_assert(listener->profile);
- channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
skinny_session_stop_media(session, listener, line_instance);
switch_status_t skinny_session_unhold_line(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
{
- switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
switch_assert(session);
switch_assert(listener);
switch_assert(listener->profile);
- channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
- skinny_hold_active_calls(listener);
+ skinny_hold_active_calls(listener);
send_set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, tech_pvt->call_id);
send_set_speaker_mode(listener, SKINNY_SPEAKER_ON);
send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_RING_OUT, 0xffff);
switch_status_t skinny_session_stop_media(switch_core_session_t *session, listener_t *listener, uint32_t line_instance)
{
- switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
switch_assert(session);
switch_assert(listener);
switch_assert(listener->profile);
- channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
switch_clear_flag_locked(tech_pvt, TFLAG_IO);
uint32_t call_id = 0;
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
- private_t *tech_pvt = NULL;
skinny_check_data_length(request, sizeof(request->data.soft_key_event.event));
break;
case SOFTKEY_NEWCALL:
status = skinny_create_incoming_session(listener, &line_instance, &session);
- tech_pvt = switch_core_session_get_private(session);
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
break;
switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, skinny_message_t *request)
{
skinny_message_t *message;
- skinny_profile_t *profile;
switch_assert(listener->profile);
switch_assert(listener->device_name);
- profile = listener->profile;
-
message = switch_core_alloc(listener->pool, 12+sizeof(message->data.soft_key_template));
message->type = SOFT_KEY_TEMPLATE_RES_MESSAGE;
message->length = 4 + sizeof(message->data.soft_key_template);
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);