Merge branch 'master' into smgmaster

This commit is contained in:
Moises Silva committed 2010-10-04 22:08:19 -04:00
commit 5f7ab903bb
307 files changed
+16815 -2494

No files matched your search

@@ -402,6 +402,7 @@ static struct {
char *odbc_dsn;
char *odbc_user;
char *odbc_pass;
char *dbname;
int32_t threads;
int32_t running;
switch_mutex_t *mutex;
@@ -506,7 +507,7 @@ switch_cache_db_handle_t *cc_get_db_handle(void)
dbh = NULL;
return dbh;
} else {
options.core_db_options.db_path = CC_SQLITE_DB_NAME;
options.core_db_options.db_path = globals.dbname;
if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_CORE_DB, &options) != SWITCH_STATUS_SUCCESS)
dbh = NULL;
return dbh;
@@ -1258,6 +1259,8 @@ static switch_status_t load_config(void)
if (!strcasecmp(var, "debug")) {
globals.debug = atoi(val);
} else if (!strcasecmp(var, "dbname")) {
globals.dbname = strdup(val);
} else if (!strcasecmp(var, "odbc-dsn")) {
globals.odbc_dsn = strdup(val);
@@ -1272,6 +1275,9 @@ static switch_status_t load_config(void)
}
}
}
if (!globals.dbname) {
globals.dbname = strdup(CC_SQLITE_DB_NAME);
}
/* Loading queue into memory struct */
if ((x_queues = switch_xml_child(cfg, "queues"))) {
@@ -1498,7 +1504,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
/* Update Agents Items */
/* Do not remove uuid of the agent if we are a standby agent */
sql = switch_mprintf("UPDATE agents SET %q last_bridge_end = %ld, talk_time = talk_time + (%ld-last_bridge_start) WHERE name = '%q' AND system = '%q';"
sql = switch_mprintf("UPDATE agents SET %s last_bridge_end = %ld, talk_time = talk_time + (%ld-last_bridge_start) WHERE name = '%q' AND system = '%q';"
, (strcasecmp(h->agent_type, CC_AGENT_TYPE_UUID_STANDBY)?"uuid = '',":""), (long) switch_epoch_time_now(NULL), (long) switch_epoch_time_now(NULL), h->agent_name, h->agent_system);
cc_execute_sql(NULL, sql, NULL);
switch_safe_free(sql);
@@ -2675,9 +2681,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load)
{
switch_application_interface_t *app_interface;
switch_api_interface_t *api_interface;
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
switch_status_t status;
memset(&globals, 0, sizeof(globals));
globals.pool = pool;
@@ -2685,11 +2689,16 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load)
switch_core_hash_init(&globals.queue_hash, globals.pool);
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
return status;
}
switch_mutex_lock(globals.mutex);
globals.running = 1;
switch_mutex_unlock(globals.mutex);
load_config();
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
if (!AGENT_DISPATCH_THREAD_STARTED) {
cc_agent_dispatch_thread_start();
@@ -2770,6 +2779,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown)
}
switch_safe_free(globals.odbc_dsn);
switch_safe_free(globals.dbname);
switch_mutex_unlock(globals.mutex);
return SWITCH_STATUS_SUCCESS;
@@ -135,7 +135,7 @@ SWITCH_STANDARD_API(nat_map_function)
switch_bool_t sticky = SWITCH_FALSE;
if (!cmd) {
goto error;
goto usage;
}
if (!switch_nat_is_initialized()) {
@@ -147,9 +147,8 @@ SWITCH_STANDARD_API(nat_map_function)
switch_assert(mydata);
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc < 1) {
goto error;
goto usage;
}
if (argv[0] && switch_stristr("status", argv[0])) {
tmp = switch_nat_status();
@@ -197,6 +196,10 @@ SWITCH_STANDARD_API(nat_map_function)
error:
stream->write_function(stream, "false");
goto ok;
usage:
stream->write_function(stream, "USAGE: nat_map [status|reinit|republish] | [add|del] <port> [tcp|udp] [sticky]");
ok:
@@ -1062,7 +1065,7 @@ SWITCH_STANDARD_API(url_encode_function)
int len = 0;
if (!zstr(cmd)) {
len = (strlen(cmd) * 3) + 1;
len = (int)(strlen(cmd) * 3) + 1;
switch_zmalloc(data, len);
switch_url_encode(cmd, data, len);
reply = data;
@@ -3045,7 +3048,7 @@ SWITCH_STANDARD_API(xml_wrap_api_function)
if (mystream.data) {
if (encoded) {
elen = (int) strlen(mystream.data) * 3;
elen = (int) strlen(mystream.data) * 3 + 1;
edata = malloc(elen);
switch_assert(edata != NULL);
memset(edata, 0, elen);
@@ -4215,7 +4218,7 @@ SWITCH_STANDARD_API(escape_function)
return SWITCH_STATUS_SUCCESS;
}
len = strlen(cmd) * 2;
len = (int)strlen(cmd) * 2;
mycmd = malloc(len);
stream->write_function(stream, "%s", switch_escape_string(cmd, mycmd, len));
@@ -1012,7 +1012,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
uint8_t *file_frame;
uint8_t *async_file_frame;
int16_t *bptr;
int x = 0;
uint32_t x = 0;
int32_t z = 0;
int member_score_sum = 0;
int divisor = 0;
@@ -1330,6 +1330,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
switch_mutex_unlock(omember->audio_out_mutex);
if (!ok) {
switch_mutex_unlock(conference->mutex);
goto end;
}
}
@@ -1913,6 +1914,8 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
uint32_t hangover = 40, hangunder = 15, hangover_hits = 0, hangunder_hits = 0, energy_level = 0, diff_level = 400;
switch_codec_implementation_t read_impl = { 0 };
switch_core_session_t *session = member->session;
int check_floor_change;
switch_assert(member != NULL);
switch_clear_flag_locked(member, MFLAG_TALKING);
@@ -1925,6 +1928,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
and mux it with any audio from other channels. */
while (switch_test_flag(member, MFLAG_RUNNING) && switch_channel_ready(channel)) {
check_floor_change = 0;
if (switch_channel_ready(channel) && switch_channel_test_app_flag(channel, CF_APP_TAGGED)) {
switch_yield(100000);
@@ -2082,25 +2086,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
}
if (diff >= diff_level || ++hangunder_hits >= hangunder) {
switch_mutex_lock(member->conference->member_mutex);
if ((!member->conference->floor_holder ||
!switch_test_flag(member->conference->floor_holder, MFLAG_TALKING) ||
((member->score_iir > SCORE_IIR_SPEAKING_MAX) && (member->conference->floor_holder->score_iir < SCORE_IIR_SPEAKING_MIN))) &&
(!switch_test_flag(member->conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) {
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_add_event_member_data(member, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d",
member->conference->floor_holder ? member->conference->floor_holder->id : 0);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", member->conference->floor_holder ? member->id : 0);
switch_event_fire(&event);
}
member->conference->floor_holder = member;
}
switch_mutex_unlock(member->conference->member_mutex);
check_floor_change = 1;
hangover_hits = hangunder_hits = 0;
member->last_talking = switch_epoch_time_now(NULL);
@@ -2190,6 +2176,28 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
do_continue:
switch_mutex_unlock(member->read_mutex);
if (check_floor_change) {
switch_mutex_lock(member->conference->member_mutex);
if ((!member->conference->floor_holder ||
!switch_test_flag(member->conference->floor_holder, MFLAG_TALKING) ||
((member->score_iir > SCORE_IIR_SPEAKING_MAX) && (member->conference->floor_holder->score_iir < SCORE_IIR_SPEAKING_MIN))) &&
(!switch_test_flag(member->conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) {
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_add_event_member_data(member, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d",
member->conference->floor_holder ? member->conference->floor_holder->id : 0);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", member->conference->floor_holder ? member->id : 0);
switch_event_fire(&event);
}
member->conference->floor_holder = member;
}
switch_mutex_unlock(member->conference->member_mutex);
}
}
@@ -3733,7 +3741,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t *conference, switch_st
static switch_xml_t add_x_tag(switch_xml_t x_member, const char *name, const char *value, int off)
{
switch_size_t dlen = strlen(value) * 3;
switch_size_t dlen = strlen(value) * 3 + 1;
char *data;
switch_xml_t x_tag;
@@ -393,7 +393,7 @@ static dir_profile_t *load_profile(const char *profile_name)
profile_set_config(profile);
/* Add the params to the event structure */
count = switch_event_import_xml(switch_xml_child(x_profile, "param"), "name", "value", &event);
count = (int)switch_event_import_xml(switch_xml_child(x_profile, "param"), "name", "value", &event);
if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, profile->config) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to process configuration\n");
@@ -611,7 +611,7 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
}
if (strlen(cbr->digits) < sizeof(cbr->digits) - 2) {
int at = strlen(cbr->digits);
int at = (int)strlen(cbr->digits);
cbr->digits[at++] = dtmf->digit;
cbr->digits[at] = '\0';
} else {
@@ -649,25 +649,25 @@ static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_
if (zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%d", DIR_RESULT_ITEM, cbt->want + 1);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
}
if (!zstr_buf(recorded_name) && zstr_buf(buf)) {
switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key);
switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
}
if (zstr_buf(recorded_name) && zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_SAY_NAME, cbt->fullname);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
}
if (cbt->exten_visible && zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_AT, cbt->extension);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
}
if (zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%c,%c,%c,%c", DIR_RESULT_MENU, *profile->select_name_key, *profile->next_key, *profile->prev_key,
*profile->new_search_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key, 0);
}
if (!zstr_buf(buf)) {
+49 -33
View File
@@ -909,48 +909,42 @@ SWITCH_STANDARD_APP(set_profile_var_function)
SWITCH_STANDARD_APP(export_function)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
const char *exports;
char *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
int local = 1;
char *var, *val = NULL;
if (zstr(data)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
} else {
exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE);
var = switch_core_session_strdup(session, data);
if (var) {
val = strchr(var, '=');
if (!strncasecmp(var, "nolocal:", 8)) {
var_name = var + 8;
local = 0;
} else {
var_name = var;
}
}
if (val) {
if ((val = strchr(var, '='))) {
*val++ = '\0';
if (zstr(val)) {
val = NULL;
}
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "EXPORT %s[%s]=[%s]\n", local ? "" : "(REMOTE ONLY) ",
var_name ? var_name : "", val ? val : "UNDEF");
switch_channel_set_variable(channel, var, val);
switch_channel_export_variable(channel, var, val, SWITCH_EXPORT_VARS_VARIABLE);
}
}
if (var && val) {
if (exports) {
new_exports_d = switch_mprintf("%s,%s", exports, var);
new_exports = new_exports_d;
} else {
new_exports = var;
SWITCH_STANDARD_APP(bridge_export_function)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
char *var, *val = NULL;
if (zstr(data)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
} else {
var = switch_core_session_strdup(session, data);
if ((val = strchr(var, '='))) {
*val++ = '\0';
if (zstr(val)) {
val = NULL;
}
switch_channel_set_variable(channel, SWITCH_EXPORT_VARS_VARIABLE, new_exports);
switch_safe_free(new_exports_d);
}
switch_channel_export_variable(channel, var, val, SWITCH_BRIDGE_EXPORT_VARS_VARIABLE);
}
}
@@ -1712,10 +1706,11 @@ SWITCH_STANDARD_APP(att_xfer_function)
SWITCH_STANDARD_APP(read_function)
{
char *mydata;
char *argv[6] = { 0 };
char *argv[7] = { 0 };
int argc;
int32_t min_digits = 0;
int32_t max_digits = 0;
uint32_t digit_timeout = 0;
int timeout = 1000;
char digit_buffer[128] = "";
const char *prompt_audio_file = NULL;
@@ -1751,6 +1746,13 @@ SWITCH_STANDARD_APP(read_function)
valid_terminators = argv[5];
}
if (argc > 6) {
digit_timeout = atoi(argv[6]);
if (digit_timeout < 0) {
digit_timeout = 0;
}
}
if (min_digits <= 1) {
min_digits = 1;
}
@@ -1767,17 +1769,19 @@ SWITCH_STANDARD_APP(read_function)
valid_terminators = "#";
}
switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, sizeof(digit_buffer), timeout, valid_terminators);
switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, sizeof(digit_buffer), timeout, valid_terminators,
digit_timeout);
}
SWITCH_STANDARD_APP(play_and_get_digits_function)
{
char *mydata;
char *argv[9] = { 0 };
char *argv[10] = { 0 };
int argc;
int32_t min_digits = 0;
int32_t max_digits = 0;
int32_t max_tries = 0;
uint32_t digit_timeout = 0;
int timeout = 1000;
char digit_buffer[128] = "";
const char *prompt_audio_file = NULL;
@@ -1827,6 +1831,14 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
digits_regex = argv[8];
}
if (argc > 9) {
digit_timeout = atoi(argv[9]);
if (digit_timeout < 0) {
digit_timeout = 0;
}
}
if (min_digits <= 1) {
min_digits = 1;
}
@@ -1844,7 +1856,7 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
}
switch_play_and_get_digits(session, min_digits, max_digits, max_tries, timeout, valid_terminators,
prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex);
prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex, digit_timeout);
}
#define SAY_SYNTAX "<module_name> <say_type> <say_method> [<say_gender>] <text>"
@@ -3299,6 +3311,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "sound_test", "Analyze Audio", "Analyze Audio", sound_test_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "export", "Export a channel variable across a bridge", EXPORT_LONG_DESC, export_function, "<varname>=<value>",
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
SWITCH_ADD_APP(app_interface, "bridge_export", "Export a channel variable across a bridge", EXPORT_LONG_DESC, bridge_export_function, "<varname>=<value>",
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
SWITCH_ADD_APP(app_interface, "set", "Set a channel variable", SET_LONG_DESC, set_function, "<varname>=<value>",
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
SWITCH_ADD_APP(app_interface, "set_global", "Set a global variable", SET_GLOBAL_LONG_DESC, set_global_function, "<varname>=<value>",
@@ -3367,9 +3381,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "endless_playback", "Playback File Endlessly", "Endlessly Playback a file to the channel",
endless_playback_function, "<path>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "att_xfer", "Attended Transfer", "Attended Transfer", att_xfer_function, "<channel_url>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "read", "Read Digits", "Read Digits", read_function, "<min> <max> <file> <var_name> <timeout> <terminators>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "read", "Read Digits", "Read Digits", read_function,
"<min> <max> <file> <var_name> <timeout> <terminators> <digit_timeout>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "play_and_get_digits", "Play and get Digits", "Play and get Digits",
play_and_get_digits_function, "<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp>", SAF_NONE);
play_and_get_digits_function,
"<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp> [<digit_timeout>]", SAF_NONE);
SWITCH_ADD_APP(app_interface, "stop_record_session", "Stop Record Session", STOP_SESS_REC_DESC, stop_record_session_function, "<path>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_MEDIA_TAP);
SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function,
+39 -42
View File
@@ -439,7 +439,7 @@ static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input,
#define check_string(s) if (!zstr(s) && !strcasecmp(s, "undef")) { s = NULL; }
static int node_consumer_wait_count(fifo_node_t *node)
static int node_caller_count(fifo_node_t *node)
{
int i, len = 0;
@@ -458,7 +458,7 @@ static void node_remove_uuid(fifo_node_t *node, const char *uuid)
fifo_queue_popfly(node->fifo_list[i], uuid);
}
if (!node_consumer_wait_count(node)) {
if (!node_caller_count(node)) {
node->start_waiting = 0;
}
@@ -507,20 +507,19 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session
args.buflen = sizeof(buf);
if (switch_ivr_play_file(session, NULL, cd->list[cd->index], &args) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_FALSE;
return SWITCH_STATUS_BREAK;
}
if (match_key(caller_exit_key, *buf)) {
cd->abort = 1;
return SWITCH_STATUS_FALSE;
switch_channel_set_variable(channel, "fifo_caller_exit_key", (char *)buf);
return SWITCH_STATUS_BREAK;
}
cd->next = switch_epoch_time_now(NULL) + cd->freq;
cd->index++;
}
} else if (cd->orbit_timeout && switch_epoch_time_now(NULL) >= cd->orbit_timeout) {
cd->do_orbit = 1;
return SWITCH_STATUS_FALSE;
return SWITCH_STATUS_BREAK;
}
return SWITCH_STATUS_SUCCESS;
@@ -541,7 +540,7 @@ static switch_status_t consumer_read_frame_callback(switch_core_session_t *sessi
}
if (total) {
return SWITCH_STATUS_FALSE;
return SWITCH_STATUS_BREAK;
}
return SWITCH_STATUS_SUCCESS;
@@ -875,7 +874,7 @@ static void do_unbridge(switch_core_session_t *consumer_session, switch_core_ses
char *sql;
switch_event_t *event;
switch_channel_clear_app_flag(consumer_channel, FIFO_APP_BRIDGE_TAG);
switch_channel_clear_app_flag_key(__FILE__, consumer_channel, FIFO_APP_BRIDGE_TAG);
switch_channel_set_variable(consumer_channel, "fifo_bridged", NULL);
ts = switch_micro_time_now();
@@ -989,7 +988,7 @@ static switch_status_t messagehook (switch_core_session_t *session, switch_core_
goto end;
}
switch_channel_set_app_flag(consumer_channel, FIFO_APP_BRIDGE_TAG);
switch_channel_set_app_flag_key(__FILE__, consumer_channel, FIFO_APP_BRIDGE_TAG);
switch_channel_set_variable(consumer_channel, "fifo_bridged", "true");
switch_channel_set_variable(consumer_channel, "fifo_manual_bridge", "true");
@@ -1683,7 +1682,7 @@ static void find_consumers(fifo_node_t *node)
switch(node->outbound_strategy) {
case NODE_STRATEGY_ENTERPRISE:
{
int need = node_consumer_wait_count(node);
int need = node_caller_count(node);
if (node->outbound_per_cycle && node->outbound_per_cycle < need) {
need = node->outbound_per_cycle;
@@ -1753,7 +1752,7 @@ static void *SWITCH_THREAD_FUNC node_thread_run(switch_thread_t *thread, void *o
if ((node = (fifo_node_t *) val)) {
if (node->outbound_priority == 0) node->outbound_priority = 5;
if (node->has_outbound && node->ready && !node->busy && node->outbound_priority == cur_priority) {
ppl_waiting = node_consumer_wait_count(node);
ppl_waiting = node_caller_count(node);
consumer_total = node->consumer_count;
idle_consumers = node_idle_consumers(node);
@@ -1831,7 +1830,7 @@ static void check_cancel(fifo_node_t *node)
return;
}
ppl_waiting = node_consumer_wait_count(node);
ppl_waiting = node_caller_count(node);
if (node->ring_consumer_count > 0 && ppl_waiting < 1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Outbound call count (%d) exceeds required value for queue %s (%d), "
@@ -1855,7 +1854,7 @@ static void send_presence(fifo_node_t *node)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "park");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", node->name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", node->name);
if ((wait_count = node_consumer_wait_count(node)) > 0) {
if ((wait_count = node_caller_count(node)) > 0) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Active (%d waiting)", wait_count);
} else {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Idle");
@@ -1990,6 +1989,11 @@ static void dec_use_count(switch_core_session_t *session, switch_bool_t send_eve
if ((outbound_id = switch_channel_get_variable(channel, "fifo_outbound_uuid"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s untracking call on uuid %s!\n", switch_channel_get_name(channel), outbound_id);
sql = switch_mprintf("delete from fifo_bridge where consumer_uuid='%q'", switch_core_session_get_uuid(session));
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
del_bridge_call(outbound_id);
sql = switch_mprintf("update fifo_outbound set use_count=use_count-1, stop_time=%ld, next_avail=%ld + lag + 1 where use_count > 0 and uuid='%q'",
now, now, outbound_id);
@@ -2043,7 +2047,7 @@ SWITCH_STANDARD_APP(fifo_track_call_function)
add_bridge_call(data);
switch_channel_set_app_flag(channel, FIFO_APP_TRACKING);
switch_channel_set_app_flag_key(__FILE__, channel, FIFO_APP_TRACKING);
switch_channel_set_variable(channel, "fifo_outbound_uuid", data);
switch_channel_set_variable(channel, "fifo_track_call", "true");
@@ -2296,7 +2300,6 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_answer(channel);
switch_thread_rwlock_wrlock(node->rwlock);
node->caller_count++;
if ((pri = switch_channel_get_variable(channel, "fifo_priority"))) {
p = atoi(pri);
@@ -2306,7 +2309,7 @@ SWITCH_STANDARD_APP(fifo_function)
p = MAX_PRI - 1;
}
if (!node_consumer_wait_count(node)) {
if (!node_caller_count(node)) {
node->start_waiting = switch_micro_time_now();
}
@@ -2343,7 +2346,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_set_variable(channel, "fifo_timestamp", date);
switch_channel_set_variable(channel, "fifo_serviced_uuid", NULL);
switch_channel_set_app_flag(channel, FIFO_APP_BRIDGE_TAG);
switch_channel_set_app_flag_key(__FILE__, channel, FIFO_APP_BRIDGE_TAG);
if (chime_list) {
char *list_dup = switch_core_session_strdup(session, chime_list);
@@ -2416,10 +2419,10 @@ SWITCH_STANDARD_APP(fifo_function)
}
}
switch_channel_clear_app_flag(channel, FIFO_APP_BRIDGE_TAG);
abort:
switch_channel_clear_app_flag_key(__FILE__, channel, FIFO_APP_BRIDGE_TAG);
abort:
fifo_caller_del(switch_core_session_get_uuid(session));
if (!aborted && switch_channel_ready(channel)) {
@@ -2442,7 +2445,6 @@ SWITCH_STANDARD_APP(fifo_function)
switch_mutex_lock(globals.mutex);
switch_thread_rwlock_wrlock(node->rwlock);
node_remove_uuid(node, uuid);
node->caller_count--;
switch_thread_rwlock_unlock(node->rwlock);
send_presence(node);
check_cancel(node);
@@ -2583,7 +2585,7 @@ SWITCH_STANDARD_APP(fifo_function)
continue;
}
if ((waiting = node_consumer_wait_count(node))) {
if ((waiting = node_caller_count(node))) {
if (!importance || node->importance > importance) {
if (strat == STRAT_WAITING_LONGER) {
@@ -2671,7 +2673,7 @@ SWITCH_STANDARD_APP(fifo_function)
}
}
if (pop && !node_consumer_wait_count(node)) {
if (pop && !node_caller_count(node)) {
switch_thread_rwlock_wrlock(node->rwlock);
node->start_waiting = 0;
switch_thread_rwlock_unlock(node->rwlock);
@@ -2775,7 +2777,8 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_set_flag(other_channel, CF_BREAK);
while (switch_channel_ready(channel) && switch_channel_ready(other_channel) && switch_channel_test_app_flag(other_channel, FIFO_APP_BRIDGE_TAG)) {
while (switch_channel_ready(channel) && switch_channel_ready(other_channel) &&
switch_channel_test_app_flag(other_channel, FIFO_APP_BRIDGE_TAG)) {
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
if (!SWITCH_READ_ACCEPTABLE(status)) {
break;
@@ -2787,9 +2790,6 @@ SWITCH_STANDARD_APP(fifo_function)
const char *arg = switch_channel_get_variable(other_channel, "current_application_data");
switch_caller_extension_t *extension = NULL;
switch_thread_rwlock_wrlock(node->rwlock);
node->caller_count--;
switch_thread_rwlock_unlock(node->rwlock);
send_presence(node);
check_cancel(node);
@@ -2955,9 +2955,6 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_set_variable(other_channel, "fifo_status", "DONE");
switch_channel_set_variable(other_channel, "fifo_timestamp", date);
switch_thread_rwlock_wrlock(node->rwlock);
node->caller_count--;
switch_thread_rwlock_unlock(node->rwlock);
send_presence(node);
check_cancel(node);
switch_core_session_rwunlock(other_session);
@@ -3070,7 +3067,7 @@ SWITCH_STANDARD_APP(fifo_function)
done:
switch_mutex_lock(globals.mutex);
if (node && node->ready == FIFO_DELAY_DESTROY && node->consumer_count == 0 && node->caller_count == 0) {
if (node && node->ready == FIFO_DELAY_DESTROY && node->consumer_count == 0 && node_caller_count(node) == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "%s removed.\n", node->name);
switch_core_hash_delete(globals.fifo_hash, node->name);
switch_thread_rwlock_wrlock(node->rwlock);
@@ -3085,7 +3082,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_mutex_unlock(globals.mutex);
switch_channel_clear_app_flag(channel, FIFO_APP_BRIDGE_TAG);
switch_channel_clear_app_flag_key(__FILE__, channel, FIFO_APP_BRIDGE_TAG);
switch_core_media_bug_resume(session);
@@ -3505,9 +3502,9 @@ static void list_node(fifo_node_t *node, switch_xml_t x_report, int *off, int ve
switch_xml_set_attr_d(x_fifo, "name", node->name);
switch_snprintf(tmp, sizeof(buffer), "%d", node->consumer_count);
switch_xml_set_attr_d(x_fifo, "consumer_count", tmp);
switch_snprintf(tmp, sizeof(buffer), "%d", node->caller_count);
switch_snprintf(tmp, sizeof(buffer), "%d", node_caller_count(node));
switch_xml_set_attr_d(x_fifo, "caller_count", tmp);
switch_snprintf(tmp, sizeof(buffer), "%d", node_consumer_wait_count(node));
switch_snprintf(tmp, sizeof(buffer), "%d", node_caller_count(node));
switch_xml_set_attr_d(x_fifo, "waiting_count", tmp);
switch_snprintf(tmp, sizeof(buffer), "%u", node->importance);
switch_xml_set_attr_d(x_fifo, "importance", tmp);
@@ -3569,7 +3566,7 @@ void node_dump(switch_stream_handle_t *stream)
node->outbound_priority,
node->busy,
node->ready,
node_consumer_wait_count(node)
node_caller_count(node)
);
}
@@ -3687,9 +3684,9 @@ SWITCH_STANDARD_API(fifo_api_function)
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
node = (fifo_node_t *) val;
len = node_consumer_wait_count(node);
len = node_caller_count(node);
switch_thread_rwlock_wrlock(node->rwlock);
stream->write_function(stream, "%s:%d:%d:%d\n", (char *) var, node->consumer_count, node->caller_count, len);
stream->write_function(stream, "%s:%d:%d:%d\n", (char *) var, node->consumer_count, node_caller_count(node), len);
switch_thread_rwlock_unlock(node->rwlock);
x++;
}
@@ -3698,9 +3695,9 @@ SWITCH_STANDARD_API(fifo_api_function)
stream->write_function(stream, "none\n");
}
} else if ((node = switch_core_hash_find(globals.fifo_hash, argv[1]))) {
len = node_consumer_wait_count(node);
len = node_caller_count(node);
switch_thread_rwlock_wrlock(node->rwlock);
stream->write_function(stream, "%s:%d:%d:%d\n", argv[1], node->consumer_count, node->caller_count, len);
stream->write_function(stream, "%s:%d:%d:%d\n", argv[1], node->consumer_count, node_caller_count(node), len);
switch_thread_rwlock_unlock(node->rwlock);
} else {
stream->write_function(stream, "none\n");
@@ -3710,7 +3707,7 @@ SWITCH_STANDARD_API(fifo_api_function)
for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
node = (fifo_node_t *) val;
len = node_consumer_wait_count(node);
len = node_caller_count(node);
switch_thread_rwlock_wrlock(node->rwlock);
stream->write_function(stream, "%s:%d\n", (char *) var, node->has_outbound);
switch_thread_rwlock_unlock(node->rwlock);
@@ -3721,7 +3718,7 @@ SWITCH_STANDARD_API(fifo_api_function)
stream->write_function(stream, "none\n");
}
} else if ((node = switch_core_hash_find(globals.fifo_hash, argv[1]))) {
len = node_consumer_wait_count(node);
len = node_caller_count(node);
switch_thread_rwlock_wrlock(node->rwlock);
stream->write_function(stream, "%s:%d\n", argv[1], node->has_outbound);
switch_thread_rwlock_unlock(node->rwlock);
@@ -4072,7 +4069,7 @@ static switch_status_t load_config(int reload, int del_all)
continue;
}
if (node_consumer_wait_count(node) || node->consumer_count || node_idle_consumers(node)) {
if (node_caller_count(node) || node->consumer_count || node_idle_consumers(node)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s removal delayed, still in use.\n", node->name);
node->ready = FIFO_DELAY_DESTROY;
} else {
+4 -3
View File
@@ -852,7 +852,8 @@ static void do_config(switch_bool_t reload)
const char *username = switch_xml_attr(x_list, "username");
const char *password = switch_xml_attr(x_list, "password");
const char *szinterval = switch_xml_attr(x_list, "interval");
int port = 0, interval = 0;
uint16_t port = 0;
int interval = 0;
limit_remote_t *remote;
switch_threadattr_t *thd_attr = NULL;
@@ -866,7 +867,7 @@ static void do_config(switch_bool_t reload)
}
if (!zstr(szport)) {
port = atoi(szport);
port = (uint16_t)atoi(szport);
}
if (!zstr(szinterval)) {
@@ -949,7 +950,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown)
/* Kill remote connections, destroy needs a wrlock so we unlock after finding a pointer */
while(remote_clean) {
void *val;
const void *key;
const void *key = NULL;
switch_ssize_t keylen;
limit_remote_t *item = NULL;
+2 -2
View File
@@ -167,7 +167,7 @@ static const char *do_cid(switch_memory_pool_t *pool, const char *cid, const cha
switch_channel_t *channel = NULL;
if (!zstr(cid)) {
len = strlen(cid);
len = (uint32_t)strlen(cid);
} else {
goto done;
}
@@ -506,7 +506,7 @@ static char *expand_digits(switch_memory_pool_t *pool, char *digits, switch_bool
int digit_len;
SWITCH_STANDARD_STREAM(dig_stream);
digit_len = strlen(digits);
digit_len = (int)strlen(digits);
digits_copy = switch_core_strdup(pool, digits);
for (n = digit_len; n > 0; n--) {
@@ -419,10 +419,10 @@ static switch_status_t do_billing(switch_core_session_t *session)
billaccount = switch_channel_get_variable(channel, "nibble_account");
if (!zstr(switch_channel_get_variable(channel, "nobal_amt"))) {
nobal_amt = atof(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 = atof(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 */
@@ -549,8 +549,8 @@ static switch_status_t do_config(void)
if (id == -1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to add tone_descriptor: %s, tone: %s. (too many tones)\n", name, tone_name);
return SWITCH_STATUS_FALSE;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Adding tone_descriptor: %s, tone: %s(%d)\n", name, tone_name, id);}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Adding tone_descriptor: %s, tone: %s(%d)\n", name, tone_name, id);
/* add elements to tone */
for (element = switch_xml_child(tone, "element"); element; element = switch_xml_next(element)) {
const char *freq1_attr = switch_xml_attr(element, "freq1");
@@ -203,9 +203,9 @@ static void *SWITCH_THREAD_FUNC timer_thread_run(switch_thread_t *thread, void *
goto end;
}
while(t38_state_list.thread_running) {
switch_mutex_lock(globals.cond_mutex);
switch_mutex_lock(globals.cond_mutex);
while(t38_state_list.thread_running) {
switch_mutex_lock(t38_state_list.mutex);
@@ -226,6 +226,8 @@ static void *SWITCH_THREAD_FUNC timer_thread_run(switch_thread_t *thread, void *
switch_core_timer_next(&timer);
}
switch_mutex_unlock(globals.cond_mutex);
end:
@@ -789,9 +791,9 @@ static t38_mode_t negotiate_t38(pvt_t *pvt)
t38_options->T38FaxRateManagement = "transferredTCF";
t38_options->T38FaxMaxBuffer = 2000;
t38_options->T38FaxMaxDatagram = LOCAL_FAX_MAX_DATAGRAM;
if (strcasecmp(t38_options->T38FaxUdpEC, "t38UDPRedundancy") == 0
||
strcasecmp(t38_options->T38FaxUdpEC, "t38UDPFEC") == 0) {
if (!zstr(t38_options->T38FaxUdpEC) &&
(strcasecmp(t38_options->T38FaxUdpEC, "t38UDPRedundancy") == 0 ||
strcasecmp(t38_options->T38FaxUdpEC, "t38UDPFEC") == 0)) {
t38_options->T38FaxUdpEC = "t38UDPRedundancy";
} else {
t38_options->T38FaxUdpEC = NULL;
@@ -850,6 +852,12 @@ static t38_mode_t request_t38(pvt_t *pvt)
insist = globals.enable_t38_insist;
}
if ((t38_options = switch_channel_get_private(channel, "t38_options"))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"%s already has T.38 data\n", switch_channel_get_name(channel));
enabled = 0;
}
if (enabled) {
t38_options = switch_core_session_alloc(session, sizeof(*t38_options));
@@ -992,6 +1000,7 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
switch_frame_t write_frame = { 0 };
switch_codec_implementation_t read_impl = { 0 };
int16_t *buf = NULL;
uint32_t req_counter = 0;
switch_core_session_get_read_impl(session, &read_impl);
@@ -1107,10 +1116,11 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL);
/* If you have the means, I highly recommend picking one up. ...*/
request_t38(pvt);
if (pvt->app_mode == FUNCTION_TX) {
req_counter = 100;
} else {
req_counter = 50;
}
while (switch_channel_ready(channel)) {
int tx = 0;
@@ -1154,6 +1164,13 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
break;
case T38_MODE_UNKNOWN:
{
if (req_counter) {
if (!--req_counter) {
/* If you have the means, I highly recommend picking one up. ...*/
request_t38(pvt);
}
}
if (switch_channel_test_app_flag_key("T38", channel, CF_APP_T38)) {
if (negotiate_t38(pvt) == T38_MODE_NEGOTIATED) {
/* is is safe to call this again, it was already called above in AUDIO_MODE */
+4 -4
View File
@@ -93,7 +93,7 @@ static int encode_length(uint8_t *buf, int *len, int value)
if (value < 0x80) {
/* 1 octet */
buf[(*len)++] = value;
buf[(*len)++] = (uint8_t)value;
return value;
}
if (value < 0x4000) {
@@ -106,7 +106,7 @@ static int encode_length(uint8_t *buf, int *len, int value)
/* Fragmentation */
multiplier = (value < 0x10000) ? (value >> 14) : 4;
/* Set the first 2 bits of the octet */
buf[(*len)++] = 0xC0 | multiplier;
buf[(*len)++] = (uint8_t) (0xC0 | multiplier);
return multiplier << 14;
}
@@ -419,10 +419,10 @@ int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int
/* Span is defined as an inconstrained integer, which it dumb. It will only
ever be a small value. Treat it as such. */
buf[len++] = 1;
buf[len++] = span;
buf[len++] = (uint8_t)span;
/* The number of entries is defined as a length, but will only ever be a small
value. Treat it as such. */
buf[len++] = entries;
buf[len++] = (uint8_t)entries;
for (m = 0; m < entries; m++) {
/* Make an XOR'ed entry the maximum length */
limit = (entry + m) & UDPTL_BUF_MASK;
@@ -203,7 +203,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
}
do {
status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, "#");
status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, "#", 0);
} while (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_FALSE);
if (status == SWITCH_STATUS_SUCCESS) {
@@ -233,7 +233,17 @@ SWITCH_STANDARD_APP(valet_parking_function)
}
}
dest = switch_core_session_sprintf(session, "sleep:1000,valet_park:%s %s", lot_name, ext);
if (!(tmp = switch_channel_get_variable(channel, "valet_hold_music"))) {
tmp = switch_channel_get_variable(channel, "hold_music");
}
if (tmp)
music = tmp;
if (!strcasecmp(music, "silence")) {
music = "silence_stream://-1";
}
dest = switch_core_session_sprintf(session, "set:valet_hold_music=%s,sleep:1000,valet_park:%s %s", music, lot_name, ext);
switch_channel_set_variable(channel, "inline_destination", dest);
if (is_auto) {
@@ -266,12 +276,6 @@ SWITCH_STANDARD_APP(valet_parking_function)
}
if (!(tmp = switch_channel_get_variable(channel, "valet_hold_music"))) {
tmp = switch_channel_get_variable(channel, "hold_music");
}
if (tmp)
music = tmp;
switch_core_hash_insert(lot->hash, ext, switch_core_session_get_uuid(session));
args.input_callback = valet_on_dtmf;
@@ -280,9 +284,6 @@ SWITCH_STANDARD_APP(valet_parking_function)
switch_mutex_unlock(lot->mutex);
if (!strcasecmp(music, "silence")) {
music = "silence_stream://-1";
}
while(switch_channel_ready(channel)) {
switch_status_t pstatus = switch_ivr_play_file(session, NULL, music, &args);
@@ -1422,6 +1422,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
char cid_buf[1024] = "";
if (switch_channel_ready(channel)) {
const char *vm_announce_cid = NULL;
switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_number, cbt->cid_name);
@@ -1429,7 +1430,13 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
msg.string_arg = cid_buf;
msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
switch_core_session_receive_message(session, &msg);
if (!zstr(cbt->cid_number) && (vm_announce_cid = switch_channel_get_variable(channel, "vm_announce_cid"))) {
switch_ivr_play_file(session, NULL, vm_announce_cid, NULL);
switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL);
switch_ivr_say(session, cbt->cid_number, NULL, "name_spelled", "pronounced", NULL, NULL);
}
args.input_callback = cancel_on_dtmf;
switch_snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s:%s:%s%s%s", profile->listen_file_key, profile->save_file_key,
@@ -1524,7 +1531,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
vm_cc[0] = '\0';
TRY_CODE(switch_ivr_read
(session, 0, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key));
(session, 0, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key, 0));
cmd = switch_core_session_sprintf(session, "%s@%s %s %s '%s'", vm_cc, cbt->domain, new_file_path, cbt->cid_number, cbt->cid_name);
@@ -1988,7 +1995,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p
switch_xml_t xx_user, xx_domain, xx_domain_root;
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", VM_ENTER_PASS_MACRO, profile->terminator_key);
TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key));
TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key, 0));
sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex);
switch_safe_free(file_path);
@@ -3678,7 +3685,7 @@ static int web_callback(void *pArg, int argc, char **argv, char **columnNames)
const char *fmt = "%a, %e %b %Y %T %z";
char heard[80];
char title_b4[128] = "";
char title_aft[128 * 3] = "";
char title_aft[128 * 3 + 1] = "";
if (argc > 0) {
l_created = switch_time_make(atol(argv[0]), 0);
+1 -1
View File
@@ -2724,7 +2724,7 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
name++;
name = switch_core_sprintf(ah->memory_pool, "%s ASR-%d", name, speech_channel_number);
} else {
name = switch_core_sprintf(ah->memory_pool, "ASR-%d", name, speech_channel_number);
name = switch_core_sprintf(ah->memory_pool, "ASR-%d", speech_channel_number);
}
/* Allocate the channel */
+111 -57
View File
@@ -98,11 +98,8 @@ typedef enum {
AMR_DTX_ENABLED
} amr_dtx_t;
struct amr_context {
void *encoder_state;
void *decoder_state;
switch_byte_t enc_modes;
switch_byte_t enc_mode;
/*! \brief Various codec settings */
struct amr_codec_settings {
int dtx_mode;
uint32_t change_period;
switch_byte_t max_ptime;
@@ -110,6 +107,24 @@ struct amr_context {
switch_byte_t channels;
switch_byte_t flags;
};
typedef struct amr_codec_settings amr_codec_settings_t;
static amr_codec_settings_t default_codec_settings = {
/*.dtx_mode */ AMR_DTX_ENABLED,
/*.change_period */ 0,
/*.max_ptime */ 0,
/*.ptime */ 0,
/*.channels */ 0,
/*.flags */ 0,
};
struct amr_context {
void *encoder_state;
void *decoder_state;
switch_byte_t enc_modes;
switch_byte_t enc_mode;
};
#define AMR_DEFAULT_BITRATE AMR_BITRATE_1220
@@ -117,6 +132,88 @@ static struct {
switch_byte_t default_bitrate;
} globals;
static switch_status_t switch_amr_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
{
if (codec_fmtp) {
amr_codec_settings_t *codec_settings = NULL;
if (codec_fmtp->private_info) {
codec_settings = codec_fmtp->private_info;
memcpy(codec_settings, &default_codec_settings, sizeof(*codec_settings));
}
if (fmtp) {
int x, argc;
char *argv[10];
char *fmtp_dup = strdup(fmtp);
switch_assert(fmtp_dup);
argc = switch_separate_string((char *) fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
/*
if (!strcasecmp(data, "bitrate")) {
bit_rate = atoi(arg);
}
*/
if (codec_settings) {
if (!strcasecmp(data, "octet-align")) {
if (atoi(arg)) {
switch_set_flag(codec_settings, AMR_OPT_OCTET_ALIGN);
}
} else if (!strcasecmp(data, "mode-change-neighbor")) {
if (atoi(arg)) {
switch_set_flag(codec_settings, AMR_OPT_MODE_CHANGE_NEIGHBOR);
}
} else if (!strcasecmp(data, "crc")) {
if (atoi(arg)) {
switch_set_flag(codec_settings, AMR_OPT_CRC);
}
} else if (!strcasecmp(data, "robust-sorting")) {
if (atoi(arg)) {
switch_set_flag(codec_settings, AMR_OPT_ROBUST_SORTING);
}
} else if (!strcasecmp(data, "interveaving")) {
if (atoi(arg)) {
switch_set_flag(codec_settings, AMR_OPT_INTERLEAVING);
}
} else if (!strcasecmp(data, "mode-change-period")) {
codec_settings->change_period = atoi(arg);
} else if (!strcasecmp(data, "ptime")) {
codec_settings->ptime = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "channels")) {
codec_settings->channels = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "maxptime")) {
codec_settings->max_ptime = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "mode-set")) {
int y, m_argc;
char *m_argv[7];
m_argc = switch_separate_string(arg, ',', m_argv, (sizeof(m_argv) / sizeof(m_argv[0])));
for (y = 0; y < m_argc; y++) {
codec_settings->enc_modes |= (1 << atoi(m_argv[y]));
}
} else if (!strcasecmp(data, "dtx")) {
codec_settings->dtx_mode = (atoi(arg)) ? AMR_DTX_ENABLED : AMR_DTX_DISABLED;
}
}
}
}
free(fmtp_dup);
}
//codec_fmtp->bits_per_second = bit_rate;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
#endif
static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
@@ -128,7 +225,10 @@ static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_
}
return SWITCH_STATUS_SUCCESS;
#else
struct amr_context *context = NULL;
switch_codec_fmtp_t codec_fmtp;
amr_codec_settings_t amr_codec_settings;
int encoding, decoding;
int x, i, argc;
char *argv[10];
@@ -141,58 +241,9 @@ static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_
return SWITCH_STATUS_FALSE;
} else {
context->dtx_mode = AMR_DTX_ENABLED;
if (codec->fmtp_in) {
argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
while (*data && *data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (!strcasecmp(data, "octet-align")) {
if (atoi(arg)) {
switch_set_flag(context, AMR_OPT_OCTET_ALIGN);
}
} else if (!strcasecmp(data, "mode-change-neighbor")) {
if (atoi(arg)) {
switch_set_flag(context, AMR_OPT_MODE_CHANGE_NEIGHBOR);
}
} else if (!strcasecmp(data, "crc")) {
if (atoi(arg)) {
switch_set_flag(context, AMR_OPT_CRC);
}
} else if (!strcasecmp(data, "robust-sorting")) {
if (atoi(arg)) {
switch_set_flag(context, AMR_OPT_ROBUST_SORTING);
}
} else if (!strcasecmp(data, "interveaving")) {
if (atoi(arg)) {
switch_set_flag(context, AMR_OPT_INTERLEAVING);
}
} else if (!strcasecmp(data, "mode-change-period")) {
context->change_period = atoi(arg);
} else if (!strcasecmp(data, "ptime")) {
context->ptime = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "channels")) {
context->channels = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "maxptime")) {
context->max_ptime = (switch_byte_t) atoi(arg);
} else if (!strcasecmp(data, "mode-set")) {
int y, m_argc;
char *m_argv[7];
m_argc = switch_separate_string(arg, ',', m_argv, (sizeof(m_argv) / sizeof(m_argv[0])));
for (y = 0; y < m_argc; y++) {
context->enc_modes |= (1 << atoi(m_argv[y]));
}
} else if (!strcasecmp(data, "dtx")) {
context->dtx_mode = (atoi(arg)) ? AMR_DTX_ENABLED : AMR_DTX_DISABLED;
}
}
}
}
memset(&codec_fmtp, '\0', sizeof(struct switch_codec_fmtp));
codec_fmtp.private_info = &amr_codec_settings;
switch_amr_fmtp_parse(codec->fmtp_in, &codec_fmtp);
if (context->enc_modes) {
for (i = 7; i > -1; i++) {
@@ -321,6 +372,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "AMR");
#ifndef AMR_PASSTHROUGH
codec_interface->parse_fmtp = switch_amr_fmtp_parse;
#endif
switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
96, /* the IANA code number */
"AMR", /* the IANA code name */
+14
View File
@@ -0,0 +1,14 @@
BASE=../../../..
CODEC2_DIR=$(switch_srcdir)/libs/libcodec2
CODEC2_BUILDDIR=$(switch_builddir)/libs/libcodec2
CODEC2LA=$(CODEC2_BUILDDIR)/src/libcodec2.la
LOCAL_CFLAGS=-I$(CODEC2_DIR)/include -I$(CODEC2_BUILDDIR)/src
LOCAL_LIBADD=$(CODEC2LA)
include $(BASE)/build/modmake.rules
$(CODEC2LA): $(CODEC2_DIR) $(CODEC2_DIR)/.update
cd $(CODEC2_BUILDDIR) && $(MAKE)
$(TOUCH_TARGET)
+264
View File
@@ -0,0 +1,264 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2010, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library
*
* The Initial Developer of the Original Code is
* Brian West <brian@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mathieu Rene <mrene@avgs.ca>
*
* mod_codec2 -- FreeSWITCH CODEC2 Module
*
*/
#include <switch.h>
#include <codec2.h>
/* Uncomment to log input/output data for debugging
#define LOG_DATA
#define CODEC2_DEBUG
*/
#ifdef CODEC2_DEBUG
#define codec2_assert(_x) switch_assert(_x)
#else
#define codec2_assert(_x)
#endif
SWITCH_MODULE_LOAD_FUNCTION(mod_codec2_load);
SWITCH_MODULE_DEFINITION(mod_codec2, mod_codec2_load, NULL, NULL);
struct codec2_context {
void *encoder;
void *decoder;
#ifdef LOG_DATA
FILE *encoder_in;
FILE *encoder_out;
FILE *encoder_out_unpacked;
FILE *decoder_in;
FILE *decoder_in_unpacked;
FILE *decoder_out;
#endif
};
#ifdef LOG_DATA
static int c2_count = 0;
#endif
static switch_status_t switch_codec2_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
uint32_t encoding, decoding;
struct codec2_context *context = NULL;
encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
if (!(encoding || decoding)) {
return SWITCH_STATUS_FALSE;
}
if (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context)))) {
return SWITCH_STATUS_FALSE;
}
if (encoding) {
context->encoder = codec2_create();
}
if (decoding) {
context->decoder = codec2_create();
}
codec->private_info = context;
#ifdef LOG_DATA
{
int c = c2_count++;
char buf[1024];
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Logging as /tmp/c2-%d-*\n", c);
if (encoding) {
snprintf(buf, sizeof(buf), "/tmp/c2-%d-enc-in", c);
context->encoder_in = fopen(buf, "w");
snprintf(buf, sizeof(buf), "/tmp/c2-%d-enc-out", c);
context->encoder_out = fopen(buf, "w");
snprintf(buf, sizeof(buf), "/tmp/c2-%d-enc-out-unpacked", c);
context->encoder_out_unpacked = fopen(buf, "w");
}
if (decoding) {
snprintf(buf, sizeof(buf), "/tmp/c2-%d-dec-in", c);
context->decoder_in = fopen(buf, "w");
snprintf(buf, sizeof(buf), "/tmp/c2-%d-dec-out", c);
context->decoder_out = fopen(buf, "w");
snprintf(buf, sizeof(buf), "/tmp/c2-%d-dec-out-unpacked", c);
context->decoder_in_unpacked = fopen(buf, "w");
}
}
#endif
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t switch_codec2_encode(switch_codec_t *codec, switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
void *encoded_data,
uint32_t *encoded_data_len,
uint32_t *encoded_rate,
unsigned int *flag)
{
struct codec2_context *context = codec->private_info;
codec2_assert(decoded_data_len == CODEC2_SAMPLES_PER_FRAME * 2);
#ifdef LOG_DATA
fwrite(decoded_data, decoded_data_len, 1, context->encoder_in);
fflush(context->encoder_in);
#endif
codec2_encode(context->encoder, encoded_data, decoded_data);
#ifdef LOG_DATA
fwrite(encode_buf, sizeof(encode_buf), 1, context->encoder_out_unpacked);
fflush(context->encoder_out_unpacked);
fwrite(encoded_data, 8, 1, context->encoder_out);
fflush(context->encoder_out);
#endif
*encoded_data_len = 8;
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t switch_codec2_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
void *decoded_data,
uint32_t *decoded_data_len,
uint32_t *decoded_rate,
unsigned int *flag)
{
struct codec2_context *context = codec->private_info;
codec2_assert(encoded_data_len == 8 /* aligned to 8 */);
#ifdef LOG_DATA
fwrite(encoded_data, encoded_data_len, 1, context->decoder_in);
fflush(context->decoder_in);
fwrite(bits, sizeof(bits), 1, context->decoder_in_unpacked);
fflush(context->decoder_in_unpacked);
#endif
codec2_decode(context->decoder, decoded_data, encoded_data);
#ifdef LOG_DATA
fwrite(decoded_data, CODEC2_SAMPLES_PER_FRAME, 2, context->decoder_out);
fflush(context->decoder_out);
#endif
*decoded_data_len = CODEC2_SAMPLES_PER_FRAME * 2; /* 160 samples */
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t switch_codec2_destroy(switch_codec_t *codec)
{
struct codec2_context *context = codec->private_info;
codec2_destroy(context->encoder);
codec2_destroy(context->decoder);
context->encoder = NULL;
context->decoder = NULL;
#ifdef LOG_DATA
if (context->encoder_in) {
fclose(context->encoder_in);
}
if (context->encoder_out) {
fclose(context->encoder_out);
}
if (context->encoder_out_unpacked) {
fclose(context->encoder_out_unpacked);
}
if (context->decoder_in) {
fclose(context->decoder_in);
}
if (context->decoder_in_unpacked) {
fclose(context->decoder_in_unpacked);
}
if (context->decoder_out) {
fclose(context->decoder_out);
}
#endif
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_LOAD_FUNCTION(mod_codec2_load)
{
switch_codec_interface_t *codec_interface;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "CODEC2 2550bps");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO,
111,
"CODEC2",
NULL,
8000, /* samples/sec */
8000, /* samples/sec */
2550, /* bps */
20000, /* ptime */
CODEC2_SAMPLES_PER_FRAME, /* samples decoded */
CODEC2_SAMPLES_PER_FRAME*2, /* bytes decoded */
0, /* bytes encoded */
1, /* channels */
1, /* frames/packet */
switch_codec2_init,
switch_codec2_encode,
switch_codec2_decode,
switch_codec2_destroy);
return SWITCH_STATUS_SUCCESS;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
+22 -20
View File
@@ -40,6 +40,27 @@ struct ilbc_context {
ilbc_decode_state_t decoder_object;
};
static switch_status_t switch_ilbc_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
{
if (codec_fmtp) {
char *mode = NULL;
int codec_ms = 0;
memset(codec_fmtp, '\0', sizeof(struct switch_codec_fmtp));
if (fmtp && (mode = strstr(fmtp, "mode=")) && (mode + 5)) {
codec_ms = atoi(mode + 5);
}
if (!codec_ms) {
/* default to 30 when no mode is defined for ilbc ONLY */
codec_ms = 30;
}
codec_fmtp->microseconds_per_packet = (codec_ms * 1000);
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
static switch_status_t switch_ilbc_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
struct ilbc_context *context;
@@ -51,26 +72,6 @@ static switch_status_t switch_ilbc_init(switch_codec_t *codec, switch_codec_flag
return SWITCH_STATUS_FALSE;
}
if (codec->fmtp_in) {
int x, argc;
char *argv[10];
argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (!strcasecmp(data, "mode")) {
mode = atoi(arg);
}
}
}
}
codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "mode=%d", mode);
if (encoding) {
@@ -136,6 +137,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "iLBC");
codec_interface->parse_fmtp = switch_ilbc_fmtp_parse;
switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
98, /* the IANA code number */
@@ -128,6 +128,9 @@ struct codec_data {
long lastrxseqno;
unsigned long rxlost;
/* discarded silence packets */
unsigned long rxdiscarded;
/* avg Rx time */
switch_time_t avgrxus;
switch_time_t last_rx_time;
@@ -196,6 +199,8 @@ static int sangoma_create_rtp_port(void *usr_priv, uint32_t host_ip, uint32_t *p
static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_req_leg, sngtc_codec_reply_leg_t* codec_reply_leg, void **rtp_fd)
{
switch_status_t status;
switch_memory_pool_t *sesspool = NULL;
switch_rtp_t *rtp_session = NULL;
char codec_ip[255];
switch_rtp_flag_t flags = 0;
@@ -205,6 +210,18 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
char local_ip[255];
switch_port_t rtp_port;
struct sangoma_transcoding_session *sess = usr_priv;
/*
* We *MUST* use a new pool
* Do not use the session pool since the session may go away while the RTP socket should linger around
* until sangoma_transcode decides to kill it (possibly because the same RTP session is used for a different call)
* also do not use the module pool otherwise memory would keep growing because switch_rtp_destroy does not
* free the memory used (is assumed it'll be freed when the pool is destroyed)
*/
status = switch_core_new_memory_pool(&sesspool);
if (status != SWITCH_STATUS_SUCCESS) {
return -1;
}
rtp_port = (switch_port_t)(long)*rtp_fd;
@@ -219,20 +236,20 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
local_ip, rtp_port, codec_ip, codec_reply_leg->codec_udp_port, iana,
codec_req_leg->ms*1000, sess->sessid);
/* create the RTP socket, dont use the session pool since the session may go away while the RTP socket should linger around
* until sangoma_transcode decides to kill it (possibly because the same RTP session is used for a different call) */
/* create the RTP socket */
rtp_session = switch_rtp_new(local_ip, rtp_port,
codec_ip, codec_reply_leg->codec_udp_port,
iana,
sess->impl->samples_per_packet,
codec_req_leg->ms * 1000, /* microseconds per packet */
flags, NULL, &err, g_pool);
flags, NULL, &err, sesspool);
if (!rtp_session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to create switch rtp session: %s\n", err);
switch_core_destroy_memory_pool(&sesspool);
return -1;
}
switch_rtp_set_private(rtp_session, sesspool);
*rtp_fd = rtp_session;
return 0;
@@ -240,8 +257,11 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
static int sangoma_destroy_rtp(void *usr_priv, void *fd)
{
switch_memory_pool_t *sesspool;
switch_rtp_t *rtp = fd;
sesspool = switch_rtp_get_private(rtp);
switch_rtp_destroy(&rtp);
switch_core_destroy_memory_pool(&sesspool);
return 0;
}
@@ -404,25 +424,31 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec
/* do the reading */
memset(&encoded_frame, 0, sizeof(encoded_frame));
sres = switch_rtp_zerocopy_read_frame(sess->encoder.rxrtp, &encoded_frame, SWITCH_IO_FLAG_NOBLOCK);
if (sres == SWITCH_STATUS_GENERR) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read on Sangoma encoder RTP session: %d\n", sres);
return SWITCH_STATUS_FALSE;
}
for ( ; ; ) {
sres = switch_rtp_zerocopy_read_frame(sess->encoder.rxrtp, &encoded_frame, SWITCH_IO_FLAG_NOBLOCK);
if (sres == SWITCH_STATUS_GENERR) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read on Sangoma encoder RTP session: %d\n", sres);
return SWITCH_STATUS_FALSE;
}
if (0 == encoded_frame.datalen) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on Sangoma encoder RTP session.\n");
return SWITCH_STATUS_SUCCESS;
}
if (0 == encoded_frame.datalen) {
break;
}
if (encoded_frame.payload != codec->implementation->ianacode
&& encoded_frame.payload != IANACODE_CN) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma encoder RTP session, expecting %d\n",
encoded_frame.payload, codec->implementation->ianacode);
return SWITCH_STATUS_FALSE;
if (encoded_frame.payload != codec->implementation->ianacode
&& encoded_frame.payload != IANACODE_CN) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma encoder RTP session, expecting %d\n",
encoded_frame.payload, codec->implementation->ianacode);
break;
}
if (*encoded_data_len) {
sess->encoder.rxdiscarded++;
}
memcpy(encoded_data, encoded_frame.data, encoded_frame.datalen);
*encoded_data_len = encoded_frame.datalen;
}
memcpy(encoded_data, encoded_frame.data, encoded_frame.datalen);
*encoded_data_len = encoded_frame.datalen;
/* update encoding stats */
sess->encoder.rx++;
@@ -518,29 +544,34 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses
/* do the reading */
memset(&ulaw_frame, 0, sizeof(ulaw_frame));
sres = switch_rtp_zerocopy_read_frame(sess->decoder.rxrtp, &ulaw_frame, SWITCH_IO_FLAG_NOBLOCK);
if (sres == SWITCH_STATUS_GENERR) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read on Sangoma decoder RTP session: %d\n", sres);
return SWITCH_STATUS_FALSE;
}
for ( ; ; ) {
sres = switch_rtp_zerocopy_read_frame(sess->decoder.rxrtp, &ulaw_frame, SWITCH_IO_FLAG_NOBLOCK);
if (sres == SWITCH_STATUS_GENERR) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read on Sangoma decoder RTP session: %d\n", sres);
return SWITCH_STATUS_FALSE;
}
if (0 == ulaw_frame.datalen) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on Sangoma decoder RTP session.\n");
return SWITCH_STATUS_SUCCESS;
}
if (0 == ulaw_frame.datalen) {
break;
}
if (ulaw_frame.payload != IANA_ULAW
&& ulaw_frame.payload != IANACODE_CN) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma decoder RTP session, expecting %d\n",
ulaw_frame.payload, IANA_ULAW);
return SWITCH_STATUS_FALSE;
}
if (ulaw_frame.payload != IANA_ULAW
&& ulaw_frame.payload != IANACODE_CN) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read unexpected payload %d in Sangoma decoder RTP session, expecting %d\n",
ulaw_frame.payload, IANA_ULAW);
break;
}
/* transcode to linear */
for (i = 0; i < ulaw_frame.datalen; i++) {
dbuf_linear[i] = ulaw_to_linear(((char *)ulaw_frame.data)[i]);
if (*decoded_data_len) {
sess->decoder.rxdiscarded++;
}
/* transcode to linear */
for (i = 0; i < ulaw_frame.datalen; i++) {
dbuf_linear[i] = ulaw_to_linear(((char *)ulaw_frame.data)[i]);
}
*decoded_data_len = i * 2;
}
*decoded_data_len = i * 2;
/* update decoding stats */
sess->decoder.rx++;
@@ -714,6 +745,7 @@ SWITCH_STANDARD_API(sangoma_function)
if (sess->encoder.rxrtp) {
stats = switch_rtp_get_stats(sess->encoder.rxrtp, NULL);
stream->write_function(stream, "-- Encoder Inbound Stats --\n");
stream->write_function(stream, "Rx Discarded: %lu\n", sess->encoder.rxdiscarded);
sangoma_print_stats(stream, &stats->inbound);
@@ -725,6 +757,7 @@ SWITCH_STANDARD_API(sangoma_function)
if (sess->decoder.rxrtp) {
stats = switch_rtp_get_stats(sess->decoder.rxrtp, NULL);
stream->write_function(stream, "-- Decoder Inbound Stats --\n");
stream->write_function(stream, "Rx Discarded: %lu\n", sess->decoder.rxdiscarded);
sangoma_print_stats(stream, &stats->inbound);
stats = switch_rtp_get_stats(sess->decoder.txrtp, NULL);
+123 -76
View File
@@ -41,6 +41,22 @@ SWITCH_MODULE_DEFINITION(mod_silk, mod_silk_load, NULL, NULL);
#define MAX_LBRR_DELAY 2
#define MAX_FRAME_LENGTH 480
/*! \brief Various codec settings */
struct silk_codec_settings {
SKP_int useinbandfec;
SKP_int usedtx;
SKP_int maxaveragebitrate;
SKP_int plpct;
};
typedef struct silk_codec_settings silk_codec_settings_t;
static silk_codec_settings_t default_codec_settings = {
/*.useinbandfec */ 0,
/*.usedtx */ 0,
/*.maxaveragebitrate */ 0,
/*.plpct */ 10, // 10% for now
};
struct silk_context {
SKP_SILK_SDK_EncControlStruct encoder_object;
SKP_SILK_SDK_DecControlStruct decoder_object;
@@ -48,12 +64,105 @@ struct silk_context {
void *dec_state;
};
static switch_status_t switch_silk_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
{
if (codec_fmtp) {
silk_codec_settings_t *codec_settings = NULL;
if (codec_fmtp->private_info) {
codec_settings = codec_fmtp->private_info;
memcpy(codec_settings, &default_codec_settings, sizeof(*codec_settings));
}
if (fmtp) {
int x, argc;
char *argv[10];
char *fmtp_dup = strdup(fmtp);
switch_assert(fmtp_dup);
argc = switch_separate_string(fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (codec_settings) {
if (!strcasecmp(data, "useinbandfec")) {
if (switch_true(arg)) {
codec_settings->useinbandfec = 1;
}
}
if (!strcasecmp(data, "usedtx")) {
if (switch_true(arg)) {
codec_settings->usedtx = 1;
}
}
if (!strcasecmp(data, "maxaveragebitrate")) {
codec_settings->maxaveragebitrate = atoi(arg);
switch(codec_fmtp->actual_samples_per_second) {
case 8000:
{
if(codec_settings->maxaveragebitrate < 6000 || codec_settings->maxaveragebitrate > 20000) {
codec_settings->maxaveragebitrate = 20000;
}
break;
}
case 12000:
{
if(codec_settings->maxaveragebitrate < 7000 || codec_settings->maxaveragebitrate > 25000) {
codec_settings->maxaveragebitrate = 25000;
}
break;
}
case 16000:
{
if(codec_settings->maxaveragebitrate < 8000 || codec_settings->maxaveragebitrate > 30000) {
codec_settings->maxaveragebitrate = 30000;
}
break;
}
case 24000:
{
if(codec_settings->maxaveragebitrate < 12000 || codec_settings->maxaveragebitrate > 40000) {
codec_settings->maxaveragebitrate = 40000;
}
break;
}
default:
/* this should never happen but 20000 is common among all rates */
codec_settings->maxaveragebitrate = 20000;
break;
}
}
}
}
}
free(fmtp_dup);
}
//codec_fmtp->bits_per_second = bit_rate;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
static switch_status_t switch_silk_init(switch_codec_t *codec,
switch_codec_flag_t freeswitch_flags,
const switch_codec_settings_t *codec_settings)
{
struct silk_context *context = NULL;
SKP_int useinbandfec = 0, usedtx = 0, maxaveragebitrate = 0, plpct =0;
switch_codec_fmtp_t codec_fmtp;
silk_codec_settings_t silk_codec_settings;
SKP_int32 encSizeBytes;
SKP_int32 decSizeBytes;
int encoding = (freeswitch_flags & SWITCH_CODEC_FLAG_ENCODE);
@@ -62,78 +171,15 @@ static switch_status_t switch_silk_init(switch_codec_t *codec,
if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context))))) {
return SWITCH_STATUS_FALSE;
}
if (codec->fmtp_in) {
int x, argc;
char *argv[10];
argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (!strcasecmp(data, "useinbandfec")) {
if (switch_true(arg)) {
useinbandfec = 1;
plpct = 10;// 10% for now
}
}
if (!strcasecmp(data, "usedtx")) {
if (switch_true(arg)) {
usedtx = 1;
}
}
if (!strcasecmp(data, "maxaveragebitrate")) {
maxaveragebitrate = atoi(arg);
switch(codec->implementation->actual_samples_per_second) {
case 8000:
{
if(maxaveragebitrate < 6000 || maxaveragebitrate > 20000) {
maxaveragebitrate = 20000;
}
break;
}
case 12000:
{
if(maxaveragebitrate < 7000 || maxaveragebitrate > 25000) {
maxaveragebitrate = 25000;
}
break;
}
case 16000:
{
if(maxaveragebitrate < 8000 || maxaveragebitrate > 30000) {
maxaveragebitrate = 30000;
}
break;
}
case 24000:
{
if(maxaveragebitrate < 12000 || maxaveragebitrate > 40000) {
maxaveragebitrate = 40000;
}
break;
}
default:
/* this should never happen but 20000 is common among all rates */
maxaveragebitrate = 20000;
break;
}
}
}
}
}
memset(&codec_fmtp, '\0', sizeof(struct switch_codec_fmtp));
codec_fmtp.private_info = &silk_codec_settings;
switch_silk_fmtp_parse(codec->fmtp_in, &codec_fmtp);
codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "useinbandfec=%s; usedtx=%s; maxaveragebitrate=%d",
useinbandfec ? "1" : "0",
usedtx ? "1" : "0",
maxaveragebitrate ? maxaveragebitrate : codec->implementation->bits_per_second);
silk_codec_settings.useinbandfec ? "1" : "0",
silk_codec_settings.usedtx ? "1" : "0",
silk_codec_settings.maxaveragebitrate ? silk_codec_settings.maxaveragebitrate : codec->implementation->bits_per_second);
if (encoding) {
if (SKP_Silk_SDK_Get_Encoder_Size(&encSizeBytes)) {
@@ -148,11 +194,11 @@ static switch_status_t switch_silk_init(switch_codec_t *codec,
context->encoder_object.sampleRate = codec->implementation->actual_samples_per_second;
context->encoder_object.packetSize = codec->implementation->samples_per_packet;
context->encoder_object.useInBandFEC = useinbandfec;
context->encoder_object.useInBandFEC = silk_codec_settings.useinbandfec;
context->encoder_object.complexity = 0;
context->encoder_object.bitRate = maxaveragebitrate ? maxaveragebitrate : codec->implementation->bits_per_second;
context->encoder_object.useDTX = usedtx;
context->encoder_object.packetLossPercentage = plpct;;
context->encoder_object.bitRate = silk_codec_settings.maxaveragebitrate ? silk_codec_settings.maxaveragebitrate : codec->implementation->bits_per_second;
context->encoder_object.useDTX = silk_codec_settings.usedtx;
context->encoder_object.packetLossPercentage = silk_codec_settings.plpct;
}
if (decoding) {
@@ -174,7 +220,7 @@ static switch_status_t switch_silk_init(switch_codec_t *codec,
static switch_status_t switch_silk_destroy(switch_codec_t *codec)
{
codec->private_info = NULL;
codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS;
}
@@ -299,6 +345,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_silk_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "SILK");
codec_interface->parse_fmtp = switch_silk_fmtp_parse;
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
117, /* the IANA code number */
+56 -20
View File
@@ -47,6 +47,40 @@ struct siren_context {
g722_1_encode_state_t encoder_object;
};
static switch_status_t switch_siren_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
{
if (codec_fmtp) {
int bit_rate = 0;
memset(codec_fmtp, '\0', sizeof(struct switch_codec_fmtp));
if (fmtp) {
int x, argc;
char *argv[10];
char *fmtp_dup = strdup(fmtp);
switch_assert(fmtp_dup);
argc = switch_separate_string(fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (!strcasecmp(data, "bitrate")) {
bit_rate = atoi(arg);
}
}
}
free(fmtp_dup);
}
codec_fmtp->bits_per_second = bit_rate;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
static switch_status_t switch_siren_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
struct siren_context *context = NULL;
@@ -58,26 +92,6 @@ static switch_status_t switch_siren_init(switch_codec_t *codec, switch_codec_fla
return SWITCH_STATUS_FALSE;
}
if (codec->fmtp_in) {
int x, argc;
char *argv[10];
argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
if (!strcasecmp(data, "bitrate")) {
bit_rate = atoi(arg);
}
}
}
}
codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "bitrate=%d", bit_rate);
if (encoding) {
@@ -145,6 +159,28 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_siren_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "Polycom(R) G722.1/G722.1C");
codec_interface->parse_fmtp = switch_siren_fmtp_parse;
spf = 320, bpf = 640;
for (count = 3; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
107, /* the IANA code number */
"G7221", /* the IANA code name */
"bitrate=24000", /* default fmtp to send (can be overridden by the init function) */
16000, /* samples transferred per second */
16000, /* actual samples transferred per second */
24000, /* bits transferred per second */
mpf * count, /* number of microseconds per frame */
spf * count, /* number of samples per frame */
bpf * count, /* number of bytes per frame decompressed */
0, /* number of bytes per frame compressed */
1, /* number of channels represented */
1, /* number of frames per network packet */
switch_siren_init, /* function to initialize a codec handle using this implementation */
switch_siren_encode, /* function to encode raw data into encoded data */
switch_siren_decode, /* function to decode encoded data into raw data */
switch_siren_destroy); /* deinitalize a codec handle using this implementation */
}
spf = 320, bpf = 640;
for (count = 3; count > 0; count--) {
+123 -30
View File
@@ -37,7 +37,46 @@
SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load);
SWITCH_MODULE_DEFINITION(mod_speex, mod_speex_load, NULL, NULL);
static switch_codec_settings_t default_codec_settings = {
/* nobody has more setting than speex so we will let them set the standard */
/*! \brief Various codec settings (currently only relevant to speex) */
struct speex_codec_settings {
/*! desired quality */
int quality;
/*! desired complexity */
int complexity;
/*! desired enhancement */
int enhancement;
/*! desired vad level */
int vad;
/*! desired vbr level */
int vbr;
/*! desired vbr quality */
float vbr_quality;
/*! desired abr level */
int abr;
/*! desired dtx setting */
int dtx;
/*! desired preprocessor settings */
int preproc;
/*! preprocessor vad settings */
int pp_vad;
/*! preprocessor gain control settings */
int pp_agc;
/*! preprocessor gain level */
float pp_agc_level;
/*! preprocessor denoise level */
int pp_denoise;
/*! preprocessor dereverb settings */
int pp_dereverb;
/*! preprocessor dereverb decay level */
float pp_dereverb_decay;
/*! preprocessor dereverb level */
float pp_dereverb_level;
};
typedef struct speex_codec_settings speex_codec_settings_t;
static speex_codec_settings_t default_codec_settings = {
/*.quality */ 5,
/*.complexity */ 5,
/*.enhancement */ 1,
@@ -58,6 +97,7 @@ static switch_codec_settings_t default_codec_settings = {
struct speex_context {
switch_codec_t *codec;
speex_codec_settings_t codec_settings;
unsigned int flags;
/* Encoder */
@@ -74,6 +114,56 @@ struct speex_context {
int decoder_mode;
};
static switch_status_t switch_speex_fmtp_parse(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
{
if (codec_fmtp) {
speex_codec_settings_t *codec_settings = NULL;
if (codec_fmtp->private_info) {
codec_settings = codec_fmtp->private_info;
memcpy(codec_settings, &default_codec_settings, sizeof(*codec_settings));
}
if (fmtp) {
int x, argc;
char *argv[10];
char *fmtp_dup = strdup(fmtp);
switch_assert(fmtp_dup);
argc = switch_separate_string(fmtp_dup, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *data = argv[x];
char *arg;
switch_assert(data);
while (*data == ' ') {
data++;
}
if ((arg = strchr(data, '='))) {
*arg++ = '\0';
/*
if (!strcasecmp(data, "bitrate")) {
bit_rate = atoi(arg);
}
*/
/*
if (codec_settings) {
if (!strcasecmp(data, "vad")) {
bit_rate = atoi(arg);
}
}
*/
}
}
free(fmtp_dup);
}
/*codec_fmtp->bits_per_second = bit_rate;*/
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
struct speex_context *context = NULL;
@@ -82,16 +172,18 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla
encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
if (!codec_settings) {
codec_settings = &default_codec_settings;
}
memcpy(&codec->codec_settings, codec_settings, sizeof(codec->codec_settings));
if (!(encoding || decoding) || ((context = switch_core_alloc(codec->memory_pool, sizeof(*context))) == 0)) {
return SWITCH_STATUS_FALSE;
} else {
const SpeexMode *mode = NULL;
switch_codec_fmtp_t codec_fmtp;
speex_codec_settings_t codec_settings;
memset(&codec_fmtp, '\0', sizeof(struct switch_codec_fmtp));
codec_fmtp.private_info = &codec_settings;
switch_speex_fmtp_parse(codec->fmtp_in, &codec_fmtp);
memcpy(&context->codec_settings, &codec_settings, sizeof(context->codec_settings));
context->codec = codec;
if (codec->implementation->actual_samples_per_second == 8000) {
@@ -110,41 +202,41 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla
speex_bits_init(&context->encoder_bits);
context->encoder_state = speex_encoder_init(mode);
speex_encoder_ctl(context->encoder_state, SPEEX_GET_FRAME_SIZE, &context->encoder_frame_size);
speex_encoder_ctl(context->encoder_state, SPEEX_SET_COMPLEXITY, &codec->codec_settings.complexity);
if (codec->codec_settings.preproc) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_COMPLEXITY, &context->codec_settings.complexity);
if (context->codec_settings.preproc) {
context->pp = speex_preprocess_state_init(context->encoder_frame_size, codec->implementation->actual_samples_per_second);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_VAD, &codec->codec_settings.pp_vad);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC, &codec->codec_settings.pp_agc);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC_LEVEL, &codec->codec_settings.pp_agc_level);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DENOISE, &codec->codec_settings.pp_denoise);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB, &codec->codec_settings.pp_dereverb);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &codec->codec_settings.pp_dereverb_decay);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &codec->codec_settings.pp_dereverb_level);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_VAD, &context->codec_settings.pp_vad);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC, &context->codec_settings.pp_agc);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC_LEVEL, &context->codec_settings.pp_agc_level);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DENOISE, &context->codec_settings.pp_denoise);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB, &context->codec_settings.pp_dereverb);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_DECAY, &context->codec_settings.pp_dereverb_decay);
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_DEREVERB_LEVEL, &context->codec_settings.pp_dereverb_level);
}
if (!codec->codec_settings.abr && !codec->codec_settings.vbr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_QUALITY, &codec->codec_settings.quality);
if (codec->codec_settings.vad) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VAD, &codec->codec_settings.vad);
if (!context->codec_settings.abr && !context->codec_settings.vbr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_QUALITY, &context->codec_settings.quality);
if (context->codec_settings.vad) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VAD, &context->codec_settings.vad);
}
}
if (codec->codec_settings.vbr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR, &codec->codec_settings.vbr);
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR_QUALITY, &codec->codec_settings.vbr_quality);
if (context->codec_settings.vbr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR, &context->codec_settings.vbr);
speex_encoder_ctl(context->encoder_state, SPEEX_SET_VBR_QUALITY, &context->codec_settings.vbr_quality);
}
if (codec->codec_settings.abr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_ABR, &codec->codec_settings.abr);
if (context->codec_settings.abr) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_ABR, &context->codec_settings.abr);
}
if (codec->codec_settings.dtx) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_DTX, &codec->codec_settings.dtx);
if (context->codec_settings.dtx) {
speex_encoder_ctl(context->encoder_state, SPEEX_SET_DTX, &context->codec_settings.dtx);
}
}
if (decoding) {
speex_bits_init(&context->decoder_bits);
context->decoder_state = speex_decoder_init(mode);
if (codec->codec_settings.enhancement) {
speex_decoder_ctl(context->decoder_state, SPEEX_SET_ENH, &codec->codec_settings.enhancement);
if (context->codec_settings.enhancement) {
speex_decoder_ctl(context->decoder_state, SPEEX_SET_ENH, &context->codec_settings.enhancement);
}
}
@@ -178,7 +270,7 @@ static switch_status_t switch_speex_encode(switch_codec_t *codec,
if (is_speech) {
is_speech = speex_encode_int(context->encoder_state, buf, &context->encoder_bits)
|| !context->codec->codec_settings.dtx;
|| !context->codec_settings.dtx;
} else {
speex_bits_pack(&context->encoder_bits, 0, 5);
}
@@ -270,6 +362,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load)
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_CODEC(codec_interface, "Speex");
codec_interface->parse_fmtp = switch_speex_fmtp_parse;
for (counta = 1; counta <= 3; counta++) {
for (countb = 1; countb > 0; countb--) {
switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
@@ -52,7 +52,8 @@ typedef enum {
TFLAG_BRIDGE = (1 << 4),
TFLAG_BOWOUT = (1 << 5),
TFLAG_BLEG = (1 << 6),
TFLAG_APP = (1 << 7)
TFLAG_APP = (1 << 7),
TFLAG_BOWOUT_USED = (1 << 8)
} TFLAGS;
struct private_object {
@@ -635,7 +636,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || switch_test_flag(tech_pvt, TFLAG_BOWOUT)) {
if (switch_test_flag(frame, SFF_CNG) || switch_test_flag(tech_pvt, TFLAG_CNG) || (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {
return SWITCH_STATUS_SUCCESS;
}
@@ -662,6 +663,9 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
switch_clear_flag_locked(tech_pvt, TFLAG_WRITE);
switch_clear_flag_locked(tech_pvt->other_tech_pvt, TFLAG_WRITE);
switch_set_flag_locked(tech_pvt, TFLAG_BOWOUT_USED);
switch_set_flag_locked(tech_pvt->other_tech_pvt, TFLAG_BOWOUT_USED);
if (a_uuid && b_uuid) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"%s detected bridge on both ends, attempting direct connection.\n", switch_channel_get_name(channel));
+72 -20
View File
@@ -1343,19 +1343,6 @@ static switch_status_t kill_listener(listener_t *listener, void *pvt)
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t kill_expired_listener(listener_t *listener, void *pvt)
{
switch_event_t *event = NULL;
if(listener->expire_time < switch_epoch_time_now(NULL)) {
/* skinny::expire event */
skinny_device_event(listener, &event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_EXPIRE);
switch_event_fire(&event);
return kill_listener(listener, pvt);
}
return SWITCH_STATUS_SUCCESS;
}
switch_status_t keepalive_listener(listener_t *listener, void *pvt)
{
skinny_profile_t *profile;
@@ -1414,6 +1401,13 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
case SWITCH_STATUS_TIMEOUT:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Communication Time Out with %s:%d.\n",
listener->remote_ip, listener->remote_port);
if(listener->expire_time < switch_epoch_time_now(NULL)) {
switch_event_t *event = NULL;
/* skinny::expire event */
skinny_device_event(listener, &event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_EXPIRE);
switch_event_fire(&event);
}
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Communication Error with %s:%d.\n",
@@ -1917,9 +1911,57 @@ static switch_status_t load_skinny_config(void)
return SWITCH_STATUS_SUCCESS;
}
static void skinny_heartbeat_event_handler(switch_event_t *event)
static void skinny_user_to_device_event_handler(switch_event_t *event)
{
walk_listeners(kill_expired_listener, NULL);
char *profile_name = switch_event_get_header_nil(event, "Skinny-Profile-Name");
skinny_profile_t *profile;
if ((profile = skinny_find_profile(profile_name))) {
char *device_name = switch_event_get_header_nil(event, "Skinny-Device-Name");
uint32_t device_instance = atoi(switch_event_get_header_nil(event, "Skinny-Station-Instance"));
listener_t *listener = NULL;
skinny_profile_find_listener_by_device_name_and_instance(profile, device_name, device_instance, &listener);
if(listener) {
uint32_t message_type = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Message-Id"));
uint32_t application_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Application-Id"));
uint32_t line_instance = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Line-Instance"));
uint32_t call_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Call-Id"));
uint32_t transaction_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Transaction-Id"));
uint32_t data_length = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Data-Length"));
uint32_t sequence_flag = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Sequence-Flag"));
uint32_t display_priority = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Display-Priority"));
uint32_t conference_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Conference-Id"));
uint32_t app_instance_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-App-Instance-Id"));
uint32_t routing_id = atoi(switch_event_get_header_nil(event, "Skinny-UserToDevice-Routing-Id"));
char *data = switch_event_get_body(event);
if (message_type == 0) {
message_type = skinny_str2message_type(switch_event_get_header_nil(event, "Skinny-UserToDevice-Message-Id-String"));
}
switch(message_type) {
case USER_TO_DEVICE_DATA_MESSAGE:
data_length = strlen(data); /* we ignore data_length sent */
send_data(listener, message_type,
application_id, line_instance, call_id, transaction_id, data_length,
data);
case USER_TO_DEVICE_DATA_VERSION1_MESSAGE:
data_length = strlen(data); /* we ignore data_length sent */
send_extended_data(listener, message_type,
application_id, line_instance, call_id, transaction_id, data_length,
sequence_flag, display_priority, conference_id, app_instance_id, routing_id,
data);
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Incorrect message type %s (%d).\n", skinny_message_type2str(message_type), message_type);
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Device %s:%d in profile '%s' not found.\n", device_name, device_instance, profile_name);
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Profile '%s' not found.\n", profile_name);
}
}
static void skinny_call_state_event_handler(switch_event_t *event)
@@ -2129,10 +2171,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
return SWITCH_STATUS_TERM;
}
/* bind to events */
if ((switch_event_bind_removable(modname, SWITCH_EVENT_HEARTBEAT, NULL, skinny_heartbeat_event_handler, NULL, &globals.heartbeat_node) != SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Couldn't bind our heartbeat handler!\n");
/* Not such severe to prevent loading */
}
if ((switch_event_bind_removable(modname, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_CALL_STATE, skinny_call_state_event_handler, NULL, &globals.call_state_node) != SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind our call_state handler!\n");
return SWITCH_STATUS_TERM;
@@ -2145,6 +2183,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Couldn't bind our trap handler!\n");
/* Not such severe to prevent loading */
}
if ((switch_event_bind_removable(modname, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_USER_TO_DEVICE, skinny_user_to_device_event_handler, NULL, &globals.user_to_device_node) != SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind our user_to_device handler!\n");
/* Not such severe to prevent loading */
}
/* reserve events */
if (switch_event_reserve_subclass(SKINNY_EVENT_REGISTER) != SWITCH_STATUS_SUCCESS) {
@@ -2167,6 +2209,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skinny_load)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SKINNY_EVENT_CALL_STATE);
return SWITCH_STATUS_TERM;
}
if (switch_event_reserve_subclass(SKINNY_EVENT_USER_TO_DEVICE) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SKINNY_EVENT_USER_TO_DEVICE);
return SWITCH_STATUS_TERM;
}
if (switch_event_reserve_subclass(SKINNY_EVENT_DEVICE_TO_USER) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", SKINNY_EVENT_DEVICE_TO_USER);
return SWITCH_STATUS_TERM;
}
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(globals.pool, modname);
@@ -2205,7 +2255,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
skinny_api_unregister();
/* release events */
switch_event_unbind(&globals.heartbeat_node);
switch_event_unbind(&globals.user_to_device_node);
switch_event_unbind(&globals.call_state_node);
switch_event_unbind(&globals.message_waiting_node);
switch_event_unbind(&globals.trap_node);
@@ -2214,6 +2264,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skinny_shutdown)
switch_event_free_subclass(SKINNY_EVENT_EXPIRE);
switch_event_free_subclass(SKINNY_EVENT_ALARM);
switch_event_free_subclass(SKINNY_EVENT_CALL_STATE);
switch_event_free_subclass(SKINNY_EVENT_USER_TO_DEVICE);
switch_event_free_subclass(SKINNY_EVENT_DEVICE_TO_USER);
switch_mutex_lock(mutex);
+3 -1
View File
@@ -43,13 +43,15 @@
#define SKINNY_EVENT_EXPIRE "skinny::expire"
#define SKINNY_EVENT_ALARM "skinny::alarm"
#define SKINNY_EVENT_CALL_STATE "skinny::call_state"
#define SKINNY_EVENT_USER_TO_DEVICE "skinny::user_to_device"
#define SKINNY_EVENT_DEVICE_TO_USER "skinny::device_to_user"
struct skinny_globals {
int running;
switch_memory_pool_t *pool;
switch_mutex_t *mutex;
switch_hash_t *profile_hash;
switch_event_node_t *heartbeat_node;
switch_event_node_t *user_to_device_node;
switch_event_node_t *call_state_node;
switch_event_node_t *message_waiting_node;
switch_event_node_t *trap_node;
+69
View File
@@ -366,6 +366,62 @@ static switch_status_t skinny_api_cmd_profile_device_send_reset_message(const ch
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t skinny_api_cmd_profile_device_send_data(const char *profile_name, const char *device_name, const char *message_type, char *params, const char *body, switch_stream_handle_t *stream)
{
skinny_profile_t *profile;
if ((profile = skinny_find_profile(profile_name))) {
listener_t *listener = NULL;
skinny_profile_find_listener_by_device_name(profile, device_name, &listener);
if(listener) {
switch_event_t *event = NULL;
char *argv[64] = { 0 };
int argc = 0;
int x = 0;
/* skinny::user_to_device event */
skinny_device_event(listener, &event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_USER_TO_DEVICE);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Message-Id-String", "%s", message_type);
argc = switch_separate_string(params, ';', argv, (sizeof(argv) / sizeof(argv[0])));
for (x = 0; x < argc; x++) {
char *var_name, *var_value = NULL;
var_name = argv[x];
if (var_name && (var_value = strchr(var_name, '='))) {
*var_value++ = '\0';
}
if (zstr(var_name)) {
stream->write_function(stream, "-ERR No variable specified\n");
} else {
char *tmp = switch_mprintf("Skinny-UserToDevice-%s", var_name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, tmp, "%s", var_value);
switch_safe_free(tmp);
/*
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Application-Id", "%d", request->data.extended_data.application_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Line-Instance", "%d", request->data.extended_data.line_instance);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Call-Id", "%d", request->data.extended_data.call_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Transaction-Id", "%d", request->data.extended_data.transaction_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Data-Length", "%d", request->data.extended_data.data_length);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Sequence-Flag", "%d", request->data.extended_data.sequence_flag);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Display-Priority", "%d", request->data.extended_data.display_priority);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Conference-Id", "%d", request->data.extended_data.conference_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-App-Instance-Id", "%d", request->data.extended_data.app_instance_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-UserToDevice-Routing-Id", "%d", request->data.extended_data.routing_id);
*/
}
}
switch_event_add_body(event, "%s", body);
switch_event_fire(&event);
stream->write_function(stream, "+OK\n");
} else {
stream->write_function(stream, "Listener not found!\n");
}
} else {
stream->write_function(stream, "Profile not found!\n");
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t skinny_api_cmd_profile_set(const char *profile_name, const char *name, const char *value, switch_stream_handle_t *stream)
{
skinny_profile_t *profile;
@@ -403,6 +459,7 @@ SWITCH_STANDARD_API(skinny_function)
"skinny profile <profile_name> device <device_name> send SetLampMessage <stimulus> <instance> <lamp_mode>\n"
"skinny profile <profile_name> device <device_name> send SetSpeakerModeMessage <speaker_mode>\n"
"skinny profile <profile_name> device <device_name> send CallStateMessage <call_state> <line_instance> <call_id>\n"
"skinny profile <profile_name> device <device_name> send <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> [ <param>=<value>;... ] <data>\n"
"skinny profile <profile_name> set <name> <value>\n"
"--------------------------------------------------------------------------------\n";
if (session) {
@@ -465,6 +522,16 @@ SWITCH_STANDARD_API(skinny_function)
status = skinny_api_cmd_profile_device_send_reset_message(argv[1], argv[3], argv[6], stream);
}
break;
case USER_TO_DEVICE_DATA_MESSAGE:
case USER_TO_DEVICE_DATA_VERSION1_MESSAGE:
if(argc == 8) {
/* <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> [ <param>=<value>;... ] <data> */
status = skinny_api_cmd_profile_device_send_data(argv[1], argv[3], argv[5], argv[6], argv[7], stream);
} else if(argc == 7) {
/* <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> <data> */
status = skinny_api_cmd_profile_device_send_data(argv[1], argv[3], argv[5], "", argv[6], stream);
}
break;
default:
stream->write_function(stream, "Unhandled message %s\n", argv[5]);
}
@@ -495,6 +562,8 @@ switch_status_t skinny_api_register(switch_loadable_module_interface_t **module_
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send SetLampMessage ::skinny::list_stimuli ::skinny::list_stimulus_instances ::skinny::list_stimulus_modes");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send SetSpeakerModeMessage ::skinny::list_speaker_modes");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send CallStateMessage ::skinny::list_call_states ::skinny::list_line_instances ::skinny::list_call_ids");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataMessage");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataVersion1Message");
switch_console_set_complete("add skinny profile ::skinny::list_profiles set ::skinny::list_settings");
switch_console_add_complete_func("::skinny::list_profiles", skinny_api_list_profiles);
@@ -135,6 +135,10 @@ switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t **req)
status = switch_socket_recv(listener->sock, ptr, &mlen);
if (listener->expire_time && listener->expire_time < switch_epoch_time_now(NULL)) {
return SWITCH_STATUS_TIMEOUT;
}
if (!listener_is_ready(listener)) {
break;
}
@@ -898,6 +902,68 @@ switch_status_t send_reset(listener_t *listener, uint32_t reset_type)
return skinny_send_reply(listener, message);
}
switch_status_t send_data(listener_t *listener, uint32_t message_type,
uint32_t application_id,
uint32_t line_instance,
uint32_t call_id,
uint32_t transaction_id,
uint32_t data_length,
const char *data)
{
skinny_message_t *message;
switch_assert(data_length == strlen(data));
/* data_length should be a multiple of 4 */
if ((data_length % 4) != 0) {
data_length = (data_length / 4 + 1) * 4;
}
message = switch_core_alloc(listener->pool, 12+sizeof(message->data.data)+data_length-1);
message->type = message_type;
message->length = 4 + sizeof(message->data.data)+data_length-1;
message->data.data.application_id = application_id;
message->data.data.line_instance = line_instance;
message->data.data.call_id = call_id;
message->data.data.transaction_id = transaction_id;
message->data.data.data_length = data_length;
strncpy(message->data.data.data, data, data_length);
return skinny_send_reply(listener, message);
}
switch_status_t send_extended_data(listener_t *listener, uint32_t message_type,
uint32_t application_id,
uint32_t line_instance,
uint32_t call_id,
uint32_t transaction_id,
uint32_t data_length,
uint32_t sequence_flag,
uint32_t display_priority,
uint32_t conference_id,
uint32_t app_instance_id,
uint32_t routing_id,
const char *data)
{
skinny_message_t *message;
switch_assert(data_length == strlen(data));
/* data_length should be a multiple of 4 */
if ((data_length % 4) != 0) {
data_length = (data_length / 4 + 1) * 4;
}
message = switch_core_alloc(listener->pool, 12+sizeof(message->data.extended_data)+data_length-1);
message->type = message_type;
message->length = 4 + sizeof(message->data.extended_data)+data_length-1;
message->data.extended_data.application_id = application_id;
message->data.extended_data.line_instance = line_instance;
message->data.extended_data.call_id = call_id;
message->data.extended_data.transaction_id = transaction_id;
message->data.extended_data.data_length = data_length;
message->data.extended_data.sequence_flag = sequence_flag;
message->data.extended_data.display_priority = display_priority;
message->data.extended_data.conference_id = conference_id;
message->data.extended_data.app_instance_id = app_instance_id;
message->data.extended_data.routing_id = routing_id;
strncpy(message->data.extended_data.data, data, data_length);
return skinny_send_reply(listener, message);
}
switch_status_t skinny_perform_send_reply(listener_t *listener, const char *file, const char *func, int line, skinny_message_t *reply)
{
char *ptr;
+85 -2
View File
@@ -174,6 +174,21 @@ struct PACKED register_available_lines_message {
uint32_t count;
};
/* DeviceToUserDataMessage */
#define DEVICE_TO_USER_DATA_MESSAGE 0x002E
struct PACKED data_message {
uint32_t application_id;
uint32_t line_instance;
uint32_t call_id;
uint32_t transaction_id;
uint32_t data_length;
char data[1];
};
/* DeviceToUserDataResponseMessage */
#define DEVICE_TO_USER_DATA_RESPONSE_MESSAGE 0x002F
/* See struct PACKED data_message */
/* ServiceUrlStatReqMessage */
#define SERVICE_URL_STAT_REQ_MESSAGE 0x0033
struct PACKED service_url_stat_req_message {
@@ -186,6 +201,26 @@ struct PACKED feature_stat_req_message {
uint32_t feature_index;
};
/* DeviceToUserDataVersion1Message */
#define DEVICE_TO_USER_DATA_VERSION1_MESSAGE 0x0041
struct PACKED extended_data_message {
uint32_t application_id;
uint32_t line_instance;
uint32_t call_id;
uint32_t transaction_id;
uint32_t data_length;
uint32_t sequence_flag;
uint32_t display_priority;
uint32_t conference_id;
uint32_t app_instance_id;
uint32_t routing_id;
char data[1];
};
/* DeviceToUserDataResponseVersion1Message */
#define DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE 0x0042
/* See struct PACKED extended_data_message */
/* RegisterAckMessage */
#define REGISTER_ACK_MESSAGE 0x0081
struct PACKED register_ack_message {
@@ -479,6 +514,10 @@ struct PACKED dialed_number_message {
uint32_t call_id;
};
/* UserToDeviceDataMessage */
#define USER_TO_DEVICE_DATA_MESSAGE 0x011E
/* See struct PACKED data_message */
/* FeatureStatMessage */
#define FEATURE_STAT_RES_MESSAGE 0x011F
struct PACKED feature_stat_res_message {
@@ -504,6 +543,10 @@ struct PACKED service_url_stat_res_message {
char display_name[40];
};
/* UserToDeviceDataVersion1Message */
#define USER_TO_DEVICE_DATA_VERSION1_MESSAGE 0x013F
/* See struct PACKED extended_data_message */
/*****************************************************************************/
/* SKINNY MESSAGE */
/*****************************************************************************/
@@ -512,6 +555,7 @@ struct PACKED service_url_stat_res_message {
#define SKINNY_MESSAGE_MAXSIZE 1000
union skinny_data {
/* no data for KEEP_ALIVE_MESSAGE */
struct register_message reg;
struct port_message port;
struct keypad_button_message keypad_button;
@@ -520,14 +564,25 @@ union skinny_data {
struct on_hook_message on_hook;
struct speed_dial_stat_req_message speed_dial_req;
struct line_stat_req_message line_req;
/* no data for CONFIG_STAT_REQ_MESSAGE */
/* no data for TIME_DATE_REQ_MESSAGE */
/* no data for BUTTON_TEMPLATE_REQ_MESSAGE */
/* no data for VERSION_REQ_MESSAGE */
struct capabilities_res_message cap_res;
struct alarm_message alarm;
struct open_receive_channel_ack_message open_receive_channel_ack;
/* no data for SOFT_KEY_SET_REQ_MESSAGE */
struct soft_key_event_message soft_key_event;
struct service_url_stat_req_message service_url_req;
struct feature_stat_req_message feature_req;
/* no data for UNREGISTER_MESSAGE */
/* no data for SOFT_KEY_TEMPLATE_REQ_MESSAGE */
struct headset_status_message headset_status;
struct register_available_lines_message reg_lines;
/* see field "data" for DEVICE_TO_USER_DATA_MESSAGE */
/* see field "data" for DEVICE_TO_USER_DATA_RESPONSE_MESSAGE */
struct service_url_stat_req_message service_url_req;
struct feature_stat_req_message feature_req;
/* see field "extended_data" for DEVICE_TO_USER_DATA_VERSION1_MESSAGE */
/* see field "extended_data" for DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE */
struct register_ack_message reg_ack;
struct start_tone_message start_tone;
struct stop_tone_message stop_tone;
@@ -543,8 +598,10 @@ union skinny_data {
struct define_time_date_message define_time_date;
struct button_template_message button_template;
struct version_message version;
/* no data for CAPABILITIES_REQ_MESSAGE */
struct register_reject_message reg_rej;
struct reset_message reset;
/* no data for KEEP_ALIVE_ACK_MESSAGE */
struct open_receive_channel_message open_receive_channel;
struct close_receive_channel_message close_receive_channel;
struct soft_key_template_res_message soft_key_template;
@@ -557,9 +614,14 @@ union skinny_data {
struct unregister_ack_message unregister_ack;
struct back_space_req_message back_space_req;
struct dialed_number_message dialed_number;
/* see field "data" for USER_TO_DEVICE_DATA_MESSAGE */
struct feature_stat_res_message feature_res;
struct display_pri_notify_message display_pri_notify;
struct service_url_stat_res_message service_url_res;
/* see field "extended_data" for USER_TO_DEVICE_DATA_VERSION1_MESSAGE */
struct data_message data;
struct extended_data_message extended_data;
uint16_t as_uint16;
char as_char;
@@ -777,6 +839,27 @@ switch_status_t send_display_pri_notify(listener_t *listener,
switch_status_t send_reset(listener_t *listener,
uint32_t reset_type);
switch_status_t send_data(listener_t *listener, uint32_t message_type,
uint32_t application_id,
uint32_t line_instance,
uint32_t call_id,
uint32_t transaction_id,
uint32_t data_length,
const char *data);
switch_status_t send_extended_data(listener_t *listener, uint32_t message_type,
uint32_t application_id,
uint32_t line_instance,
uint32_t call_id,
uint32_t transaction_id,
uint32_t data_length,
uint32_t sequence_flag,
uint32_t display_priority,
uint32_t conference_id,
uint32_t app_instance_id,
uint32_t routing_id,
const char *data);
#endif /* _SKINNY_PROTOCOL_H */
/* For Emacs:
@@ -1864,6 +1864,33 @@ switch_status_t skinny_handle_register_available_lines_message(listener_t *liste
return SWITCH_STATUS_SUCCESS;
}
switch_status_t skinny_handle_data_message(listener_t *listener, skinny_message_t *request)
{
switch_event_t *event = NULL;
char *tmp = NULL;
skinny_check_data_length(request, sizeof(request->data.data));
skinny_check_data_length(request, sizeof(request->data.data) + request->data.data.data_length - 1);
/* skinny::device_to_user event */
skinny_device_event(listener, &event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_DEVICE_TO_USER);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Message-Id", "%d", request->type);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Message-Id-String", "%s", skinny_message_type2str(request->type));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Application-Id", "%d", request->data.data.application_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Line-Instance", "%d", request->data.data.line_instance);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Call-Id", "%d", request->data.data.call_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Transaction-Id", "%d", request->data.data.transaction_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Data-Length", "%d", request->data.data.data_length);
/* Ensure that the body is null-terminated */
tmp = malloc(request->data.data.data_length + 1);
memcpy(tmp, request->data.data.data, request->data.data.data_length);
tmp[request->data.data.data_length] = '\0';
switch_event_add_body(event, "%s", tmp);
switch_safe_free(tmp);
switch_event_fire(&event);
return SWITCH_STATUS_SUCCESS;
}
switch_status_t skinny_handle_service_url_stat_request(listener_t *listener, skinny_message_t *request)
{
skinny_message_t *message;
@@ -1904,6 +1931,38 @@ switch_status_t skinny_handle_feature_stat_request(listener_t *listener, skinny_
return SWITCH_STATUS_SUCCESS;
}
switch_status_t skinny_handle_extended_data_message(listener_t *listener, skinny_message_t *request)
{
switch_event_t *event = NULL;
char *tmp = NULL;
skinny_check_data_length(request, sizeof(request->data.extended_data));
skinny_check_data_length(request, sizeof(request->data.extended_data)+request->data.extended_data.data_length-1);
/* skinny::device_to_user event */
skinny_device_event(listener, &event, SWITCH_EVENT_CUSTOM, SKINNY_EVENT_DEVICE_TO_USER);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Message-Id", "%d", request->type);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Message-Id-String", "%s", skinny_message_type2str(request->type));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Application-Id", "%d", request->data.extended_data.application_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Line-Instance", "%d", request->data.extended_data.line_instance);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Call-Id", "%d", request->data.extended_data.call_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Transaction-Id", "%d", request->data.extended_data.transaction_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Data-Length", "%d", request->data.extended_data.data_length);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Sequence-Flag", "%d", request->data.extended_data.sequence_flag);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Display-Priority", "%d", request->data.extended_data.display_priority);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Conference-Id", "%d", request->data.extended_data.conference_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-App-Instance-Id", "%d", request->data.extended_data.app_instance_id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Skinny-DeviceToUser-Routing-Id", "%d", request->data.extended_data.routing_id);
/* Ensure that the body is null-terminated */
tmp = malloc(request->data.data.data_length + 1);
memcpy(tmp, request->data.data.data, request->data.data.data_length);
tmp[request->data.data.data_length] = '\0';
switch_event_add_body(event, "%s", tmp);
switch_safe_free(tmp);
switch_event_fire(&event);
return SWITCH_STATUS_SUCCESS;
}
switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *request)
{
if (listener->profile->debug >= 10 || request->type != KEEP_ALIVE_MESSAGE) {
@@ -1961,10 +2020,18 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
return skinny_headset_status_message(listener, request);
case REGISTER_AVAILABLE_LINES_MESSAGE:
return skinny_handle_register_available_lines_message(listener, request);
case DEVICE_TO_USER_DATA_MESSAGE:
return skinny_handle_data_message(listener, request);
case DEVICE_TO_USER_DATA_RESPONSE_MESSAGE:
return skinny_handle_data_message(listener, request);
case SERVICE_URL_STAT_REQ_MESSAGE:
return skinny_handle_service_url_stat_request(listener, request);
case FEATURE_STAT_REQ_MESSAGE:
return skinny_handle_feature_stat_request(listener, request);
case DEVICE_TO_USER_DATA_VERSION1_MESSAGE:
return skinny_handle_extended_data_message(listener, request);
case DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE:
return skinny_handle_extended_data_message(listener, request);
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Unhandled request %s (type=%x,length=%d).\n", skinny_message_type2str(request->type), request->type, request->length);
+8 -2
View File
@@ -55,10 +55,14 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
{"SoftKeyEventMessage", SOFT_KEY_EVENT_MESSAGE},
{"UnregisterMessage", UNREGISTER_MESSAGE},
{"SoftKeyTemplateReqMessage", SOFT_KEY_TEMPLATE_REQ_MESSAGE},
{"ServiceUrlStatReqMessage", SERVICE_URL_STAT_REQ_MESSAGE},
{"FeatureStatReqMessage", FEATURE_STAT_REQ_MESSAGE},
{"HeadsetStatusMessage", HEADSET_STATUS_MESSAGE},
{"RegisterAvailableLinesMessage", REGISTER_AVAILABLE_LINES_MESSAGE},
{"DeviceToUserDataMessage", DEVICE_TO_USER_DATA_MESSAGE},
{"DeviceToUserDataResponseMessage", DEVICE_TO_USER_DATA_RESPONSE_MESSAGE},
{"ServiceUrlStatReqMessage", SERVICE_URL_STAT_REQ_MESSAGE},
{"FeatureStatReqMessage", FEATURE_STAT_REQ_MESSAGE},
{"DeviceToUserDataVersion1Message", DEVICE_TO_USER_DATA_VERSION1_MESSAGE},
{"DeviceToUserDataResponseVersion1Message", DEVICE_TO_USER_DATA_RESPONSE_VERSION1_MESSAGE},
{"RegisterAckMessage", REGISTER_ACK_MESSAGE},
{"StartToneMessage", START_TONE_MESSAGE},
{"StopToneMessage", STOP_TONE_MESSAGE},
@@ -90,9 +94,11 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
{"UnregisterAckMessage", UNREGISTER_ACK_MESSAGE},
{"BackSpaceReqMessage", BACK_SPACE_REQ_MESSAGE},
{"DialedNumberMessage", DIALED_NUMBER_MESSAGE},
{"UserToDeviceDataMessage", USER_TO_DEVICE_DATA_MESSAGE},
{"FeatureResMessage", FEATURE_STAT_RES_MESSAGE},
{"DisplayPriNotifyMessage", DISPLAY_PRI_NOTIFY_MESSAGE},
{"ServiceUrlStatMessage", SERVICE_URL_STAT_RES_MESSAGE},
{"UserToDeviceDataVersion1Message", USER_TO_DEVICE_DATA_VERSION1_MESSAGE},
{NULL, 0}
};
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
+1 -1
View File
@@ -87,7 +87,7 @@ uint32_t func(const char *str)\
}
extern struct skinny_table SKINNY_MESSAGE_TYPES[59];
extern struct skinny_table SKINNY_MESSAGE_TYPES[65];
const char *skinny_message_type2str(uint32_t id);
uint32_t skinny_str2message_type(const char *str);
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
+66 -32
View File
@@ -1238,7 +1238,12 @@ static void start_udptl(private_object_t *tech_pvt, switch_t38_options_t *t38_op
switch_rtp_udptl_mode(tech_pvt->rtp_session);
if (remote_host && remote_port && !strcmp(remote_host, t38_options->remote_ip) && remote_port == t38_options->remote_port) {
if (!t38_options || !t38_options->remote_ip) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "No remote address\n");
return;
}
if (remote_host && remote_port && remote_port == t38_options->remote_port && !strcmp(remote_host, t38_options->remote_ip)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Remote address:port [%s:%d] has not changed.\n",
t38_options->remote_ip, t38_options->remote_port);
return;
@@ -1477,12 +1482,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ:
{
const char *pl =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n"
" <media_control>\r\n"
" <vc_primitive>\r\n"
" <to_encoder>\r\n"
" <picture_fast_update>\r\n" " </picture_fast_update>\r\n" " </to_encoder>\r\n" " </vc_primitive>\r\n" " </media_control>\r\n";
const char *pl = "<media_control><vc_primitive><to_encoder><picture_fast_update/></to_encoder></vc_primitive></media_control>";
if (!zstr(msg->string_arg)) {
pl = msg->string_arg;
}
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END());
@@ -1771,7 +1775,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
nua_update(tech_pvt->nh,
TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END());
} else if ((ua && (switch_stristr("cisco", ua)))) {
} else if ((ua && (switch_stristr("cisco/spa50", ua) || switch_stristr("cisco/spa525", ua)))) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
@@ -2011,6 +2015,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options");
if (t38_options) {
sofia_glue_set_image_sdp(tech_pvt, t38_options, 0);
if (switch_rtp_ready(tech_pvt->rtp_session)) {
switch_rtp_udptl_mode(tech_pvt->rtp_session);
}
}
} else {
sofia_glue_tech_set_local_sdp(tech_pvt, sdp, SWITCH_TRUE);
@@ -2096,6 +2103,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
case SWITCH_MESSAGE_INDICATE_ANSWER:
status = sofia_answer_channel(session);
if (switch_channel_test_flag(tech_pvt->channel, CF_VIDEO)) {
sofia_glue_build_vid_refresh_message(session, NULL);
}
break;
case SWITCH_MESSAGE_INDICATE_PROGRESS:
{
@@ -2321,7 +2331,7 @@ static int show_reg_callback(void *pArg, int argc, char **argv, char **columnNam
switch_time_t etime = atoi(argv[6]);
switch_size_t retsize;
exp_secs = etime - now;
exp_secs = (int)(etime - now);
switch_time_exp_lt(&tm, switch_time_from_sec(etime));
switch_strftime_nocheck(exp_buf, &retsize, sizeof(exp_buf), "%Y-%m-%d %T", &tm);
}
@@ -2361,7 +2371,7 @@ static int show_reg_callback_xml(void *pArg, int argc, char **argv, char **colum
switch_time_t etime = atoi(argv[6]);
switch_size_t retsize;
exp_secs = etime - now;
exp_secs = (int)(etime - now);
switch_time_exp_lt(&tm, switch_time_from_sec(etime));
switch_strftime_nocheck(exp_buf, &retsize, sizeof(exp_buf), "%Y-%m-%d %T", &tm);
}
@@ -2428,7 +2438,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
ob_failed += gp->ob_failed_calls;
ob += gp->ob_calls;
stream->write_function(stream, "%25s\t%32s\t%s\t%ld/%ld\t%ld/%ld",
stream->write_function(stream, "%25s\t%32s\t%s\t%u/%u\t%u/%u",
pkey, gp->register_to, sofia_state_names[gp->state],
gp->ib_failed_calls, gp->ib_calls, gp->ob_failed_calls, gp->ob_calls);
@@ -2447,8 +2457,8 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
stream->write_function(stream, "%s\n", line);
stream->write_function(stream, "%d gateway%s: Inound(Failed/Total): %ld/%ld,"
"Outbound(Failed/Total):%ld/%ld\n", c, c == 1 ? "" : "s", ib_failed, ib, ob_failed, ob);
stream->write_function(stream, "%d gateway%s: Inbound(Failed/Total): %u/%u,"
"Outbound(Failed/Total):%u/%u\n", c, c == 1 ? "" : "s", ib_failed, ib, ob_failed, ob);
return SWITCH_STATUS_SUCCESS;
}
@@ -2477,10 +2487,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
stream->write_function(stream, "PingState\t%d/%d/%d\n", gp->ping_min, gp->ping_count, gp->ping_max);
stream->write_function(stream, "State \t%s\n", sofia_state_names[gp->state]);
stream->write_function(stream, "Status \t%s%s\n", status_names[gp->status], gp->pinging ? " (ping)" : "");
stream->write_function(stream, "CallsIN \t%d\n", gp->ib_calls);
stream->write_function(stream, "CallsOUT\t%d\n", gp->ob_calls);
stream->write_function(stream, "FailedCallsIN\t%d\n", gp->ib_failed_calls);
stream->write_function(stream, "FailedCallsOUT\t%d\n", gp->ob_failed_calls);
stream->write_function(stream, "CallsIN \t%u\n", gp->ib_calls);
stream->write_function(stream, "CallsOUT\t%u\n", gp->ob_calls);
stream->write_function(stream, "FailedCallsIN\t%u\n", gp->ib_failed_calls);
stream->write_function(stream, "FailedCallsOUT\t%u\n", gp->ob_failed_calls);
stream->write_function(stream, "%s\n", line);
sofia_reg_release_gateway(gp);
} else {
@@ -2489,7 +2499,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
} else if (!strcasecmp(argv[0], "profile")) {
struct cb_helper cb;
char *sql = NULL;
int x = 0;
uint32_t x = 0;
cb.row_process = 0;
@@ -2554,10 +2564,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
if (profile->max_registrations_perext > 0) {
stream->write_function(stream, "MAX-REG-PEREXT \t%d\n", profile->max_registrations_perext);
}
stream->write_function(stream, "CALLS-IN \t%d\n", profile->ib_calls);
stream->write_function(stream, "FAILED-CALLS-IN \t%d\n", profile->ib_failed_calls);
stream->write_function(stream, "CALLS-OUT \t%d\n", profile->ob_calls);
stream->write_function(stream, "FAILED-CALLS-OUT \t%d\n", profile->ob_failed_calls);
stream->write_function(stream, "CALLS-IN \t%u\n", profile->ib_calls);
stream->write_function(stream, "FAILED-CALLS-IN \t%u\n", profile->ib_failed_calls);
stream->write_function(stream, "CALLS-OUT \t%u\n", profile->ob_calls);
stream->write_function(stream, "FAILED-CALLS-OUT \t%u\n", profile->ob_failed_calls);
}
stream->write_function(stream, "\nRegistrations:\n%s\n", line);
@@ -2703,10 +2713,10 @@ static void xml_gateway_status(sofia_gateway_t *gp, switch_stream_handle_t *stre
stream->write_function(stream, " <pingfreq>%d</pingfreq>\n", gp->ping_freq);
stream->write_function(stream, " <state>%s</state>\n", sofia_state_names[gp->state]);
stream->write_function(stream, " <status>%s%s</status>\n", status_names[gp->status], gp->pinging ? " (ping)" : "");
stream->write_function(stream, " <calls-in>%d</calls-in>\n", gp->ib_calls);
stream->write_function(stream, " <calls-out>%d</calls-out>\n", gp->ob_calls);
stream->write_function(stream, " <failed-calls-in>%d</failed-calls-in>\n", gp->ib_failed_calls);
stream->write_function(stream, " <failed-calls-out>%d</failed-calls-out>\n", gp->ob_failed_calls);
stream->write_function(stream, " <calls-in>%u</calls-in>\n", gp->ib_calls);
stream->write_function(stream, " <calls-out>%u</calls-out>\n", gp->ob_calls);
stream->write_function(stream, " <failed-calls-in>%u</failed-calls-in>\n", gp->ib_failed_calls);
stream->write_function(stream, " <failed-calls-out>%u</failed-calls-out>\n", gp->ob_failed_calls);
if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
time_t now = switch_epoch_time_now(NULL);
@@ -2769,7 +2779,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
} else if (!strcasecmp(argv[0], "profile")) {
struct cb_helper cb;
char *sql = NULL;
int x = 0;
uint32_t x = 0;
cb.row_process = 0;
@@ -2825,10 +2835,10 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
stream->write_function(stream, " <user-agent-filter>%s</user-agent-filter>\n", switch_str_nil(profile->user_agent_filter));
stream->write_function(stream, " <max-registrations-per-extension>%d</max-registrations-per-extension>\n",
profile->max_registrations_perext);
stream->write_function(stream, " <calls-in>%d</calls-in>\n", profile->ib_calls);
stream->write_function(stream, " <calls-out>%d</calls-out>\n", profile->ob_calls);
stream->write_function(stream, " <failed-calls-in>%d</failed-calls-in>\n", profile->ib_failed_calls);
stream->write_function(stream, " <failed-calls-out>%d</failed-calls-out>\n", profile->ob_failed_calls);
stream->write_function(stream, " <calls-in>%u</calls-in>\n", profile->ib_calls);
stream->write_function(stream, " <calls-out>%u</calls-out>\n", profile->ob_calls);
stream->write_function(stream, " <failed-calls-in>%u</failed-calls-in>\n", profile->ib_failed_calls);
stream->write_function(stream, " <failed-calls-out>%u</failed-calls-out>\n", profile->ob_failed_calls);
stream->write_function(stream, " </profile-info>\n");
}
stream->write_function(stream, " <registrations>\n");
@@ -3596,6 +3606,7 @@ SWITCH_STANDARD_API(sofia_function)
"sofia status|xmlstatus gateway <name>\n"
"sofia loglevel <all|default|tport|iptsec|nea|nta|nth_client|nth_server|nua|soa|sresolv|stun> [0-9]\n"
"sofia tracelevel <console|alert|crit|err|warning|notice|info|debug>\n"
"sofa global siptrace [on|off]\n"
"--------------------------------------------------------------------------------\n";
if (session) {
@@ -3651,6 +3662,26 @@ SWITCH_STANDARD_API(sofia_function)
} else if (!strcasecmp(argv[0], "help")) {
stream->write_function(stream, "%s", usage_string);
goto done;
} else if (!strcasecmp(argv[0], "global")) {
int on = -1;
if (argc > 1) {
if (!strcasecmp(argv[1], "siptrace")) {
if (argc > 2) {
on = switch_true(argv[2]);
}
}
}
if (on != -1) {
sofia_glue_global_siptrace(on);
stream->write_function(stream, "+OK Global siptrace %s", on ? "on" : "off");
} else {
stream->write_function(stream, "-ERR Usage: siptrace on|off");
}
goto done;
} else if (!strcasecmp(argv[0], "recover")) {
if (argv[1] && !strcasecmp(argv[1], "flush")) {
sofia_glue_recover(SWITCH_TRUE);
@@ -4452,7 +4483,8 @@ static void general_event_handler(switch_event_t *event)
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
int rb = 0, x = 0;
int rb = 0;
uint32_t x = 0;
switch_hash_this(hi, &var, NULL, &val);
if ((profile = (sofia_profile_t *) val) && profile->auto_restart) {
if (!strcmp(profile->sipip, old_ip4)) {
@@ -4726,6 +4758,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
switch_console_set_complete("add sofia loglevel ::[all:default:tport:iptsec:nea:nta:nth_client:nth_server:nua:soa:sresolv:stun ::[0:1:2:3:4:5:6:7:8:9");
switch_console_set_complete("add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug");
switch_console_set_complete("add sofia global siptrace ::[on:off");
switch_console_set_complete("add sofia profile");
switch_console_set_complete("add sofia profile restart all");
+7
View File
@@ -220,6 +220,7 @@ typedef enum {
PFLAG_T38_PASSTHRU,
PFLAG_CID_IN_1XX,
PFLAG_IN_DIALOG_CHAT,
PFLAG_DEL_SUBS_ON_REG,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
@@ -577,6 +578,7 @@ struct private_object {
switch_codec_t read_codec;
switch_codec_t write_codec;
uint32_t codec_ms;
uint32_t bitrate;
switch_caller_profile_t *caller_profile;
uint32_t timestamp_send;
switch_rtp_t *rtp_session;
@@ -926,6 +928,7 @@ sofia_transport_t sofia_glue_str2transport(const char *str);
const char *sofia_glue_transport2str(const sofia_transport_t tp);
char *sofia_glue_find_parameter(const char *str, const char *param);
char *sofia_glue_find_parameter_value(switch_core_session_t *session, const char *str, const char *param);
char *sofia_glue_create_via(switch_core_session_t *session, const char *ip, switch_port_t port, sofia_transport_t transport);
char *sofia_glue_create_external_via(switch_core_session_t *session, sofia_profile_t *profile, sofia_transport_t transport);
char *sofia_glue_strip_uri(const char *str);
@@ -1012,3 +1015,7 @@ char *sofia_glue_get_multipart(switch_core_session_t *session, const char *prefi
void sofia_glue_tech_simplify(private_object_t *tech_pvt);
switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *profile, const char *user, const char *host);
switch_bool_t sofia_glue_profile_exists(const char *key);
void sofia_glue_global_siptrace(switch_bool_t on);
void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp);
switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt);
void sofia_glue_build_vid_refresh_message(switch_core_session_t *session, const char *pl);
+1 -1
View File
@@ -785,7 +785,7 @@ int dig_addr(struct dig *dig,
char const *tport2 = NULL;
sres_record_t **answers1 = NULL, **answers2 = NULL;
unsigned count1 = 0, count2 = 0, tcount = 0;
int type1 = 0, type2 = 0, family1 = 0, family2 = 0;
uint16_t type1 = 0, type2 = 0, family1 = 0, family2 = 0;
if (dig->ip6 > dig->ip4) {
type1 = sres_type_aaaa, family1 = AF_INET6;
+118 -19
View File
@@ -1268,7 +1268,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
iterations++;
if (len + newlen + 10 > sql_len) {
int new_mlen = len + newlen + 10 + 10240;
switch_size_t new_mlen = len + newlen + 10 + 10240;
if (new_mlen < SQLLEN) {
sql_len = new_mlen;
@@ -2223,6 +2223,35 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
goto done;
}
if ((settings = switch_xml_child(cfg, "global_settings"))) {
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "log-level")) {
su_log_set_level(NULL, atoi(val));
} else if (!strcasecmp(var, "tracelevel")) {
mod_sofia_globals.tracelevel = switch_log_str2level(val);
} else if (!strcasecmp(var, "debug-presence")) {
mod_sofia_globals.debug_presence = atoi(val);
} else if (!strcasecmp(var, "debug-sla")) {
mod_sofia_globals.debug_sla = atoi(val);
} else if (!strcasecmp(var, "auto-restart")) {
mod_sofia_globals.auto_restart = switch_true(val);
} else if (!strcasecmp(var, "rewrite-multicasted-fs-path")) {
if( (!strcasecmp(val, "to_host")) || (!strcasecmp(val, "1")) ) {
/* old behaviour */
mod_sofia_globals.rewrite_multicasted_fs_path = 1;
} else if (!strcasecmp(val, "original_server_host")) {
mod_sofia_globals.rewrite_multicasted_fs_path = 2;
} else if (!strcasecmp(val, "original_hostname")) {
mod_sofia_globals.rewrite_multicasted_fs_path = 3;
} else {
mod_sofia_globals.rewrite_multicasted_fs_path = SWITCH_FALSE;
}
}
}
}
if ((profiles = switch_xml_child(cfg, "profiles"))) {
for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
char *xprofilename = (char *) switch_xml_attr_soft(xprofile, "name");
@@ -2257,14 +2286,18 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
profile->debug = atoi(val);
} else if (!strcasecmp(var, "shutdown-on-fail")) {
profile->shutdown_type = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "tracelevel")) {
mod_sofia_globals.tracelevel = switch_log_str2level(val);
} else if (!strcasecmp(var, "pass-callee-id")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
} else {
sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
}
} else if (!strcasecmp(var, "delete-subs-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
} else {
sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
}
} else if (!strcasecmp(var, "in-dialog-chat")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_IN_DIALOG_CHAT);
@@ -2312,12 +2345,6 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else {
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
}
} else if (!strcasecmp(var, "forward-unsolicited-mwi-notify")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
} else {
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
}
} else if (!strcasecmp(var, "t38-passthru")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_T38_PASSTHRU);
@@ -2444,7 +2471,7 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
sofia_clear_pflag(profile, PFLAG_STUN_AUTO_DISABLE);
}
} else if (!strcasecmp(var, "apply-nat-acl")) {
if (profile->acl_count < SOFIA_MAX_ACL) {
if (profile->nat_acl_count < SOFIA_MAX_ACL) {
if (!profile->extsipip && switch_check_network_list_ip(profile->sipip, val)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Not adding acl %s because it's the local network\n", val);
} else {
@@ -2817,6 +2844,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "log-level")) {
su_log_set_level(NULL, atoi(val));
} else if (!strcasecmp(var, "tracelevel")) {
mod_sofia_globals.tracelevel = switch_log_str2level(val);
} else if (!strcasecmp(var, "debug-presence")) {
mod_sofia_globals.debug_presence = atoi(val);
} else if (!strcasecmp(var, "debug-sla")) {
@@ -2933,6 +2962,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
}
} else if (!strcasecmp(var, "forward-unsolicited-mwi-notify")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
} else {
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
}
} else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "auto-restart")) {
@@ -2949,6 +2984,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_IN_DIALOG_CHAT);
}
} else if (!strcasecmp(var, "delete-subs-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
} else {
sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
}
} else if (!strcasecmp(var, "t38-passthru")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_T38_PASSTHRU);
@@ -3431,7 +3472,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else if (!strcasecmp(var, "context")) {
profile->context = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "apply-nat-acl")) {
if (profile->acl_count < SOFIA_MAX_ACL) {
if (profile->nat_acl_count < SOFIA_MAX_ACL) {
if (!profile->extsipip && profile->sipip && switch_check_network_list_ip(profile->sipip, val)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Not adding acl %s because it's the local network\n", val);
} else {
@@ -3933,6 +3974,23 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
}
}
#if 0
if (status == 200 && switch_channel_test_flag(channel, CF_PROXY_MEDIA) &&
sip->sip_payload && sip->sip_payload->pl_data && !strcasecmp(tech_pvt->iananame, "PROXY")) {
switch_core_session_t *other_session;
sofia_glue_proxy_codec(session, sip->sip_payload->pl_data);
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
if (switch_core_session_compare(session, other_session)) {
sofia_glue_proxy_codec(other_session, sip->sip_payload->pl_data);
}
switch_core_session_rwunlock(other_session);
}
}
#endif
if ((status == 180 || status == 183 || status == 200)) {
const char *x_freeswitch_support;
@@ -3959,7 +4017,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
}
if (channel && sip && (status == 300 || status == 302 || status == 305) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
if (channel && sip && (status == 300 || status == 301 || status == 302 || status == 305) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
sip_contact_t *p_contact = sip->sip_contact;
int i = 0;
char var_name[80];
@@ -4138,6 +4196,36 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if (status == 200 && sofia_test_flag(tech_pvt, TFLAG_T38_PASSTHRU) && has_t38) {
if (sip->sip_payload && sip->sip_payload->pl_data) {
switch_t38_options_t *t38_options = sofia_glue_extract_t38_options(session, sip->sip_payload->pl_data);
char *remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session);
switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
char tmp[32] = "";
tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(tech_pvt->session, t38_options->remote_ip);
tech_pvt->remote_sdp_audio_port = t38_options->remote_port;
if (remote_host && remote_port && !strcmp(remote_host, tech_pvt->remote_sdp_audio_ip) &&
remote_port == tech_pvt->remote_sdp_audio_port) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG,
"Audio params are unchanged for %s.\n",
switch_channel_get_name(tech_pvt->channel));
} else {
const char *err = NULL;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG,
"Audio params changed for %s from %s:%d to %s:%d\n",
switch_channel_get_name(tech_pvt->channel),
remote_host, remote_port, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port);
switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
if (switch_rtp_set_remote_address(tech_pvt->rtp_session, tech_pvt->remote_sdp_audio_ip,
tech_pvt->remote_sdp_audio_port, 0, SWITCH_TRUE, &err) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "AUDIO RTP REPORTS ERROR: [%s]\n", err);
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
}
}
if (t38_options) {
sofia_glue_copy_t38_options(t38_options, other_session);
@@ -4167,14 +4255,11 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if (status == 200 && sofia_test_flag(tech_pvt, TFLAG_T38_PASSTHRU) && has_t38) {
if (switch_rtp_ready(tech_pvt->rtp_session) && switch_rtp_ready(other_tech_pvt->rtp_session)) {
switch_rtp_udptl_mode(tech_pvt->rtp_session);
switch_rtp_udptl_mode(other_tech_pvt->rtp_session);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Activating T38 Passthru\n");
}
switch_core_session_receive_message(other_session, msg);
} else {
switch_core_session_queue_message(other_session, msg);
}
switch_core_session_queue_message(other_session, msg);
switch_core_session_rwunlock(other_session);
}
@@ -4394,7 +4479,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (ss_state == nua_callstate_terminated) {
if ((status == 300 || status == 302 || status == 305) && session) {
if ((status == 300 || status == 301 || status == 302 || status == 305) && session) {
channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
@@ -4467,6 +4552,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
state_process:
switch ((enum nua_callstate) ss_state) {
@@ -4945,6 +5032,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
sofia_set_flag(tech_pvt, TFLAG_SDP);
switch_channel_mark_answered(channel);
if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
&& (other_session = switch_core_session_locate(uuid))) {
@@ -4965,6 +5053,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
sofia_set_flag_locked(tech_pvt, TFLAG_SDP);
switch_channel_mark_answered(channel);
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
goto done;
@@ -5070,6 +5159,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
done:
if ((enum nua_callstate) ss_state == nua_callstate_ready && channel && session && tech_pvt) {
sofia_glue_tech_simplify(tech_pvt);
@@ -5221,7 +5311,6 @@ nua_handle_t *sofia_global_nua_handle_by_replaces(sip_replaces_t *replaces)
}
void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[])
{
/* Incoming refer */
@@ -5794,7 +5883,17 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (sip && sip->sip_content_type && sip->sip_content_type->c_type && sip->sip_content_type->c_subtype &&
sip->sip_payload && sip->sip_payload->pl_data) {
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) {
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) {
switch_core_session_t *other_session;
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data);
switch_core_session_rwunlock(other_session);
} else {
sofia_glue_build_vid_refresh_message(session, sip->sip_payload->pl_data);
}
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) {
/* Try and find signal information in the payload */
if ((signal_ptr = switch_stristr("Signal=", sip->sip_payload->pl_data))) {
int tmp;
File diff suppressed because it is too large. Load diff
+26 -8
View File
@@ -571,22 +571,22 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
switch_safe_free(sql);
sql = switch_mprintf("select sip_registrations.sip_user, sip_registrations.orig_server_host, sip_registrations.status, "
sql = switch_mprintf("select sip_registrations.sip_user, sip_registrations.orig_hostname, sip_registrations.status, "
"sip_registrations.rpid,'', sip_dialogs.uuid, sip_dialogs.state, sip_dialogs.direction, "
"sip_dialogs.sip_to_user, sip_dialogs.sip_to_host, sip_presence.status,sip_presence.rpid,sip_presence.open_closed,"
"'%q','%q' "
"from sip_registrations left join sip_dialogs on "
"(sip_dialogs.sip_from_user = sip_registrations.sip_user "
"and (sip_dialogs.sip_from_host = sip_registrations.orig_server_host or "
"and (sip_dialogs.sip_from_host = sip_registrations.orig_hostname or "
"sip_dialogs.sip_from_host = sip_registrations.sip_host) ) "
"left join sip_presence on "
"(sip_registrations.sip_user=sip_presence.sip_user and sip_registrations.orig_server_host=sip_presence.sip_host and "
"(sip_registrations.sip_user=sip_presence.sip_user and sip_registrations.orig_hostname=sip_presence.sip_host and "
"sip_registrations.profile_name=sip_presence.profile_name) "
"where sip_registrations.sip_user='%q' and "
"(sip_registrations.orig_server_host='%q' or sip_registrations.sip_host='%q' "
"(sip_registrations.orig_hostname='%q' or sip_registrations.sip_host='%q' "
"or sip_registrations.presence_hosts like '%%%q%%')",
dh.status, dh.rpid, probe_euser, probe_host, probe_host, probe_host);
switch_assert(sql);
@@ -700,7 +700,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
"sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from,"
"sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent,"
"sip_subscriptions.accept,sip_subscriptions.profile_name"
",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q' "
",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q',sip_subscriptions.version "
"from sip_subscriptions "
"left join sip_presence on "
"(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and "
@@ -743,6 +743,15 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_presence_sub_callback, &helper);
sql = switch_mprintf("update sip_subscriptions set version=version+1 where event='dialog' and sub_to_user='%q' "
"and (sub_to_host='%q' or presence_hosts like '%%%q%%') "
"and (profile_name = '%q' or presence_hosts != sub_to_host)",
euser, host, host, profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
if (mod_sofia_globals.debug_presence > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END_PRESENCE_SQL (%s)\n",
event->event_id == SWITCH_EVENT_PRESENCE_IN ? "IN" : "OUT", profile->name);
@@ -1193,7 +1202,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
int kill_handle = 0;
char expires_str[10] = "";
char status_line[256] = "";
char *version = "0";
//int i;
//for(i = 0; i < argc; i++) {
@@ -1213,6 +1223,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
if (argc > 20) {
dialog_status = argv[20];
dialog_rpid = argv[21];
version = argv[22];
}
in = helper->event && helper->event->event_id == SWITCH_EVENT_PRESENCE_IN;
@@ -1317,8 +1328,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
}
if (is_dialog) {
char *version = switch_event_get_header(helper->event, "event_count");
if (!version) {
if (zstr(version)) {
version = "0";
}
@@ -1983,12 +1993,20 @@ void sofia_presence_handle_sip_i_subscribe(int status,
is_nat = NULL;
}
if (zstr(contact_host)) {
is_nat = "No contact host";
}
if (is_nat) {
contact_host = network_ip;
switch_snprintf(new_port, sizeof(new_port), ":%d", network_port);
port = NULL;
}
if (zstr(contact_host)) {
nua_respond(nh, 481, "INVALID SUBSCRIPTION", TAG_END());
return;
}
if (port) {
switch_snprintf(new_port, sizeof(new_port), ":%s", port);
+8 -10
View File
@@ -820,9 +820,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_event_t *auth_params = NULL;
int r = 0;
long reg_count = 0;
int delete_subs = 1;
int delete_subs;
const char *agent = "unknown";
delete_subs = sofia_test_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
/* all callers must confirm that sip, sip->sip_request and sip->sip_contact are not NULL */
switch_assert(sip != NULL && sip->sip_contact != NULL && sip->sip_request != NULL);
@@ -841,10 +842,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
if (sip->sip_user_agent) {
agent = sip->sip_user_agent->g_string;
if (switch_stristr("snom", agent)) {
delete_subs = 0;
}
}
if (from) {
@@ -934,7 +931,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
if (sip->sip_path) {
path_val = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_path);
path_encoded_len = (strlen(path_val) * 3) + 1;
path_encoded_len = (int)(strlen(path_val) * 3) + 1;
switch_zmalloc(path_encoded, path_encoded_len);
switch_copy_string(path_encoded, ";fs_path=", 10);
switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9);
@@ -947,7 +944,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_snprintf(my_contact_str, sizeof(my_contact_str), "sip:%s@%s:%d", contact->m_url->url_user, url_ip, network_port);
}
path_encoded_len = (strlen(my_contact_str) * 3) + 1;
path_encoded_len = (int)(strlen(my_contact_str) * 3) + 1;
switch_zmalloc(path_encoded, path_encoded_len);
switch_copy_string(path_encoded, ";fs_path=", 10);
@@ -2126,7 +2123,8 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
if (auth_acl) {
if (!switch_check_network_list_ip(ip, auth_acl)) {
int network_ip_is_proxy = 0, x = 0;
int network_ip_is_proxy = 0;
uint32_t x = 0;
char *last_acl = NULL;
if (profile->proxy_acl_count == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by user acl [%s] and no proxy acl present\n", ip, auth_acl);
@@ -2223,7 +2221,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
if (max_registrations_perext > 0 && (sip && sip->sip_contact && (sip->sip_contact->m_expires == NULL || atol(sip->sip_contact->m_expires) > 0))) {
/* if expires is null still process */
/* expires == 0 means the phone is going to unregiser, so don't count against max */
int count = 0;
uint32_t count = 0;
call_id = sip->sip_call_id->i_id;
switch_assert(call_id);
@@ -2498,7 +2496,7 @@ sofia_gateway_t *sofia_reg_find_gateway_by_realm__(const char *file, const char
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(NULL, mod_sofia_globals.gateway_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((gateway = (sofia_gateway_t *) val) && gateway->register_realm && !strcasecmp(gateway->register_realm, key)) {
if (key && (gateway = (sofia_gateway_t *) val) && gateway->register_realm && !strcasecmp(gateway->register_realm, key)) {
break;
} else {
gateway = NULL;
+1 -1
View File
@@ -1100,7 +1100,7 @@ static int web_callback(void *pArg, int argc, char **argv, char **columnNames)
{
struct holder *holder = (struct holder *) pArg;
char title_b4[128] = "";
char title_aft[128 * 3] = "";
char title_aft[128 * 3 + 1] = "";
char *mp3, *m3u;
/*
@@ -213,12 +213,12 @@ public class CoreSession {
return freeswitchJNI.CoreSession_transfer(swigCPtr, this, extension, dialplan, context);
}
public String read(int min_digits, int max_digits, String prompt_audio_file, int timeout, String valid_terminators) {
return freeswitchJNI.CoreSession_read(swigCPtr, this, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators);
public String read(int min_digits, int max_digits, String prompt_audio_file, int timeout, String valid_terminators, int digit_timeout) {
return freeswitchJNI.CoreSession_read(swigCPtr, this, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout);
}
public String playAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, String terminators, String audio_files, String bad_input_audio_files, String digits_regex, String var_name) {
return freeswitchJNI.CoreSession_playAndGetDigits(swigCPtr, this, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name);
public String playAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, String terminators, String audio_files, String bad_input_audio_files, String digits_regex, String var_name, int digit_timeout) {
return freeswitchJNI.CoreSession_playAndGetDigits(swigCPtr, this, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout);
}
public int streamFile(String file, int starting_sample_count) {
@@ -125,8 +125,8 @@ class freeswitchJNI {
public final static native String CoreSession_getDigits__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4);
public final static native String CoreSession_getDigits__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4, int jarg5);
public final static native int CoreSession_transfer(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
public final static native String CoreSession_read(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, String jarg4, int jarg5, String jarg6);
public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10);
public final static native String CoreSession_read(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, String jarg4, int jarg5, String jarg6, int jarg7);
public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10, int jarg11);
public final static native int CoreSession_streamFile(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
public final static native int CoreSession_sleep(long jarg1, CoreSession jarg1_, int jarg2, int jarg3);
public final static native int CoreSession_flushEvents(long jarg1, CoreSession jarg1_);
@@ -2405,7 +2405,7 @@ SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1tran
}
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jstring jarg4, jint jarg5, jstring jarg6) {
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jstring jarg4, jint jarg5, jstring jarg6, jint jarg7) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
@@ -2413,6 +2413,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
char *arg4 = (char *) 0 ;
int arg5 ;
char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ;
(void)jenv;
@@ -2432,7 +2433,8 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0);
if (!arg6) return 0;
}
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6);
arg7 = (int)jarg7;
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
if(result) jresult = jenv->NewStringUTF((const char *)result);
if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6);
@@ -2440,7 +2442,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
}
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9, jstring jarg10) {
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9, jstring jarg10, jint jarg11) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
@@ -2452,6 +2454,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ;
(void)jenv;
@@ -2487,7 +2490,8 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
arg10 = (char *)jenv->GetStringUTFChars(jarg10, 0);
if (!arg10) return 0;
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10);
arg11 = (int)jarg11;
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
if(result) jresult = jenv->NewStringUTF((const char *)result);
if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6);
if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7);
+14 -4
View File
@@ -5175,15 +5175,17 @@ static int _wrap_CoreSession_read(lua_State* L) {
char *arg4 = (char *) 0 ;
int arg5 ;
char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ;
SWIG_check_num_args("read",6,6)
SWIG_check_num_args("read",6,7)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"CoreSession *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("read",2,"int");
if(!lua_isnumber(L,3)) SWIG_fail_arg("read",3,"int");
if(!lua_isstring(L,4)) SWIG_fail_arg("read",4,"char const *");
if(!lua_isnumber(L,5)) SWIG_fail_arg("read",5,"int");
if(!lua_isstring(L,6)) SWIG_fail_arg("read",6,"char const *");
if(lua_gettop(L)>=7 && !lua_isnumber(L,7)) SWIG_fail_arg("read",7,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_read",1,SWIGTYPE_p_CoreSession);
@@ -5194,7 +5196,10 @@ static int _wrap_CoreSession_read(lua_State* L) {
arg4 = (char *)lua_tostring(L, 4);
arg5 = (int)lua_tonumber(L, 5);
arg6 = (char *)lua_tostring(L, 6);
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6);
if(lua_gettop(L)>=7){
arg7 = (int)lua_tonumber(L, 7);
}
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
SWIG_arg=0;
lua_pushstring(L,(const char*)result); SWIG_arg++;
return SWIG_arg;
@@ -5219,9 +5224,10 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ;
SWIG_check_num_args("playAndGetDigits",9,10)
SWIG_check_num_args("playAndGetDigits",9,11)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("playAndGetDigits",1,"CoreSession *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("playAndGetDigits",2,"int");
if(!lua_isnumber(L,3)) SWIG_fail_arg("playAndGetDigits",3,"int");
@@ -5232,6 +5238,7 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
if(!lua_isstring(L,8)) SWIG_fail_arg("playAndGetDigits",8,"char *");
if(!lua_isstring(L,9)) SWIG_fail_arg("playAndGetDigits",9,"char *");
if(lua_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char const *");
if(lua_gettop(L)>=11 && !lua_isnumber(L,11)) SWIG_fail_arg("playAndGetDigits",11,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession);
@@ -5248,7 +5255,10 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
if(lua_gettop(L)>=10){
arg10 = (char *)lua_tostring(L, 10);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10);
if(lua_gettop(L)>=11){
arg11 = (int)lua_tonumber(L, 11);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
SWIG_arg=0;
lua_pushstring(L,(const char*)result); SWIG_arg++;
return SWIG_arg;
File diff suppressed because it is too large. Load diff
+204 -402
View File
@@ -3776,25 +3776,25 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_remote_ip_get(void * j
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_set(void * jarg1, unsigned long jarg2) {
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_set(void * jarg1, unsigned short jarg2) {
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
uint32_t arg2 ;
uint16_t arg2 ;
arg1 = (switch_t38_options_t *)jarg1;
arg2 = (uint32_t)jarg2;
arg2 = (uint16_t)jarg2;
if (arg1) (arg1)->remote_port = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_get(void * jarg1) {
unsigned long jresult ;
SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_get(void * jarg1) {
unsigned short jresult ;
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
uint32_t result;
uint16_t result;
arg1 = (switch_t38_options_t *)jarg1;
result = (uint32_t) ((arg1)->remote_port);
jresult = (unsigned long)result;
result = (uint16_t) ((arg1)->remote_port);
jresult = result;
return jresult;
}
@@ -3828,25 +3828,25 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_local_ip_get(void * ja
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_local_port_set(void * jarg1, unsigned long jarg2) {
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_local_port_set(void * jarg1, unsigned short jarg2) {
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
uint32_t arg2 ;
uint16_t arg2 ;
arg1 = (switch_t38_options_t *)jarg1;
arg2 = (uint32_t)jarg2;
arg2 = (uint16_t)jarg2;
if (arg1) (arg1)->local_port = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_local_port_get(void * jarg1) {
unsigned long jresult ;
SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_t38_options_t_local_port_get(void * jarg1) {
unsigned short jresult ;
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
uint32_t result;
uint16_t result;
arg1 = (switch_t38_options_t *)jarg1;
result = (uint32_t) ((arg1)->local_port);
jresult = (unsigned long)result;
result = (uint16_t) ((arg1)->local_port);
jresult = result;
return jresult;
}
@@ -8152,7 +8152,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_timer_destroy(void * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_init(void * jarg1, char * jarg2, char * jarg3, unsigned long jarg4, int jarg5, int jarg6, unsigned long jarg7, void * jarg8, void * jarg9) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_init_with_bitrate(void * jarg1, char * jarg2, char * jarg3, unsigned long jarg4, int jarg5, int jarg6, unsigned long jarg7, unsigned long jarg8, void * jarg9, void * jarg10) {
int jresult ;
switch_codec_t *arg1 = (switch_codec_t *) 0 ;
char *arg2 = (char *) 0 ;
@@ -8161,8 +8161,9 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_init(void * jarg1, char * ja
int arg5 ;
int arg6 ;
uint32_t arg7 ;
switch_codec_settings_t *arg8 = (switch_codec_settings_t *) 0 ;
switch_memory_pool_t *arg9 = (switch_memory_pool_t *) 0 ;
uint32_t arg8 ;
switch_codec_settings_t *arg9 = (switch_codec_settings_t *) 0 ;
switch_memory_pool_t *arg10 = (switch_memory_pool_t *) 0 ;
switch_status_t result;
arg1 = (switch_codec_t *)jarg1;
@@ -8172,9 +8173,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_init(void * jarg1, char * ja
arg5 = (int)jarg5;
arg6 = (int)jarg6;
arg7 = (uint32_t)jarg7;
arg8 = (switch_codec_settings_t *)jarg8;
arg9 = (switch_memory_pool_t *)jarg9;
result = (switch_status_t)switch_core_codec_init(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7,(switch_codec_settings const *)arg8,arg9);
arg8 = (uint32_t)jarg8;
arg9 = (switch_codec_settings_t *)jarg9;
arg10 = (switch_memory_pool_t *)jarg10;
result = (switch_status_t)switch_core_codec_init_with_bitrate(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8,(switch_codec_settings const *)arg9,arg10);
jresult = result;
return jresult;
}
@@ -12098,6 +12100,20 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_char_to_rfc2833(char jarg1) {
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_default_ptime(char * jarg1, unsigned long jarg2) {
unsigned long jresult ;
char *arg1 = (char *) 0 ;
uint32_t arg2 ;
uint32_t result;
arg1 = (char *)jarg1;
arg2 = (uint32_t)jarg2;
result = (uint32_t)switch_default_ptime((char const *)arg1,arg2);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_sanitize_number(char * jarg1) {
char * jresult ;
char *arg1 = (char *) 0 ;
@@ -20549,369 +20565,24 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_directory_handle(void * jarg1)
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_quality_set(void * jarg1, int jarg2) {
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_unused_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->quality = arg2;
if (arg1) (arg1)->unused = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_quality_get(void * jarg1) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_unused_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->quality);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_complexity_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->complexity = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_complexity_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->complexity);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_enhancement_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->enhancement = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_enhancement_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->enhancement);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_vad_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->vad = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_vad_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->vad);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_vbr_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->vbr = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_vbr_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->vbr);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_vbr_quality_set(void * jarg1, float jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (float)jarg2;
if (arg1) (arg1)->vbr_quality = arg2;
}
SWIGEXPORT float SWIGSTDCALL CSharp_switch_codec_settings_vbr_quality_get(void * jarg1) {
float jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float result;
arg1 = (switch_codec_settings *)jarg1;
result = (float) ((arg1)->vbr_quality);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_abr_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->abr = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_abr_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->abr);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_dtx_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->dtx = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_dtx_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->dtx);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_preproc_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->preproc = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_preproc_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->preproc);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_vad_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->pp_vad = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_pp_vad_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->pp_vad);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_agc_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->pp_agc = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_pp_agc_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->pp_agc);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_agc_level_set(void * jarg1, float jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (float)jarg2;
if (arg1) (arg1)->pp_agc_level = arg2;
}
SWIGEXPORT float SWIGSTDCALL CSharp_switch_codec_settings_pp_agc_level_get(void * jarg1) {
float jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float result;
arg1 = (switch_codec_settings *)jarg1;
result = (float) ((arg1)->pp_agc_level);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_denoise_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->pp_denoise = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_pp_denoise_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->pp_denoise);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_set(void * jarg1, int jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->pp_dereverb = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_get(void * jarg1) {
int jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
int result;
arg1 = (switch_codec_settings *)jarg1;
result = (int) ((arg1)->pp_dereverb);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_decay_set(void * jarg1, float jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (float)jarg2;
if (arg1) (arg1)->pp_dereverb_decay = arg2;
}
SWIGEXPORT float SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_decay_get(void * jarg1) {
float jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float result;
arg1 = (switch_codec_settings *)jarg1;
result = (float) ((arg1)->pp_dereverb_decay);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_level_set(void * jarg1, float jarg2) {
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float arg2 ;
arg1 = (switch_codec_settings *)jarg1;
arg2 = (float)jarg2;
if (arg1) (arg1)->pp_dereverb_level = arg2;
}
SWIGEXPORT float SWIGSTDCALL CSharp_switch_codec_settings_pp_dereverb_level_get(void * jarg1) {
float jresult ;
switch_codec_settings *arg1 = (switch_codec_settings *) 0 ;
float result;
arg1 = (switch_codec_settings *)jarg1;
result = (float) ((arg1)->pp_dereverb_level);
result = (int) ((arg1)->unused);
jresult = result;
return jresult;
}
@@ -20936,6 +20607,117 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_codec_settings(void * jarg1) {
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_fmtp_actual_samples_per_second_set(void * jarg1, unsigned long jarg2) {
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
uint32_t arg2 ;
arg1 = (switch_codec_fmtp *)jarg1;
arg2 = (uint32_t)jarg2;
if (arg1) (arg1)->actual_samples_per_second = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_codec_fmtp_actual_samples_per_second_get(void * jarg1) {
unsigned long jresult ;
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
uint32_t result;
arg1 = (switch_codec_fmtp *)jarg1;
result = (uint32_t) ((arg1)->actual_samples_per_second);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_fmtp_bits_per_second_set(void * jarg1, int jarg2) {
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
int arg2 ;
arg1 = (switch_codec_fmtp *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->bits_per_second = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_fmtp_bits_per_second_get(void * jarg1) {
int jresult ;
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
int result;
arg1 = (switch_codec_fmtp *)jarg1;
result = (int) ((arg1)->bits_per_second);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_fmtp_microseconds_per_packet_set(void * jarg1, int jarg2) {
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
int arg2 ;
arg1 = (switch_codec_fmtp *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->microseconds_per_packet = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_codec_fmtp_microseconds_per_packet_get(void * jarg1) {
int jresult ;
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
int result;
arg1 = (switch_codec_fmtp *)jarg1;
result = (int) ((arg1)->microseconds_per_packet);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_fmtp_private_info_set(void * jarg1, void * jarg2) {
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
void *arg2 = (void *) 0 ;
arg1 = (switch_codec_fmtp *)jarg1;
arg2 = (void *)jarg2;
if (arg1) (arg1)->private_info = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_fmtp_private_info_get(void * jarg1) {
void * jresult ;
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
void *result = 0 ;
arg1 = (switch_codec_fmtp *)jarg1;
result = (void *) ((arg1)->private_info);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_codec_fmtp() {
void * jresult ;
switch_codec_fmtp *result = 0 ;
result = (switch_codec_fmtp *)new switch_codec_fmtp();
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_codec_fmtp(void * jarg1) {
switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
arg1 = (switch_codec_fmtp *)jarg1;
delete arg1;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_codec_interface_set(void * jarg1, void * jarg2) {
switch_codec *arg1 = (switch_codec *) 0 ;
switch_codec_interface_t *arg2 = (switch_codec_interface_t *) 0 ;
@@ -21042,29 +20824,6 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_codec_fmtp_out_get(void * jarg1) {
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_codec_settings_set(void * jarg1, void * jarg2) {
switch_codec *arg1 = (switch_codec *) 0 ;
switch_codec_settings_t *arg2 = (switch_codec_settings_t *) 0 ;
arg1 = (switch_codec *)jarg1;
arg2 = (switch_codec_settings_t *)jarg2;
if (arg1) (arg1)->codec_settings = *arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_codec_settings_get(void * jarg1) {
void * jresult ;
switch_codec *arg1 = (switch_codec *) 0 ;
switch_codec_settings_t *result = 0 ;
arg1 = (switch_codec *)jarg1;
result = (switch_codec_settings_t *)& ((arg1)->codec_settings);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_flags_set(void * jarg1, unsigned long jarg2) {
switch_codec *arg1 = (switch_codec *) 0 ;
uint32_t arg2 ;
@@ -21767,6 +21526,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_interface_implementations_get(
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_interface_parse_fmtp_set(void * jarg1, void * jarg2) {
switch_codec_interface *arg1 = (switch_codec_interface *) 0 ;
switch_core_codec_fmtp_parse_func_t arg2 = (switch_core_codec_fmtp_parse_func_t) 0 ;
arg1 = (switch_codec_interface *)jarg1;
arg2 = (switch_core_codec_fmtp_parse_func_t)jarg2;
if (arg1) (arg1)->parse_fmtp = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_interface_parse_fmtp_get(void * jarg1) {
void * jresult ;
switch_codec_interface *arg1 = (switch_codec_interface *) 0 ;
switch_core_codec_fmtp_parse_func_t result;
arg1 = (switch_codec_interface *)jarg1;
result = (switch_core_codec_fmtp_parse_func_t) ((arg1)->parse_fmtp);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_interface_codec_id_set(void * jarg1, unsigned long jarg2) {
switch_codec_interface *arg1 = (switch_codec_interface *) 0 ;
uint32_t arg2 ;
@@ -26802,7 +26584,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_file(void * jarg1, void * ja
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, unsigned long jarg11, char * jarg12) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, unsigned long jarg11, char * jarg12, unsigned long jarg13) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
uint32_t arg2 ;
@@ -26816,6 +26598,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
char *arg10 = (char *) 0 ;
uint32_t arg11 ;
char *arg12 = (char *) 0 ;
uint32_t arg13 ;
switch_status_t result;
arg1 = (switch_core_session_t *)jarg1;
@@ -26830,7 +26613,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
arg10 = (char *)jarg10;
arg11 = (uint32_t)jarg11;
arg12 = (char *)jarg12;
result = (switch_status_t)switch_play_and_get_digits(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,arg10,arg11,(char const *)arg12);
arg13 = (uint32_t)jarg13;
result = (switch_status_t)switch_play_and_get_digits(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,arg10,arg11,(char const *)arg12,arg13);
jresult = result;
return jresult;
}
@@ -27604,7 +27388,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_wait_for_answer(void * jarg1, void
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4, char * jarg5, char * jarg6, void * jarg7, unsigned long jarg8, char * jarg9) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4, char * jarg5, char * jarg6, void * jarg7, unsigned long jarg8, char * jarg9, unsigned long jarg10) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
uint32_t arg2 ;
@@ -27615,6 +27399,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
switch_size_t arg7 ;
uint32_t arg8 ;
char *arg9 = (char *) 0 ;
uint32_t arg10 ;
switch_status_t result;
switch_size_t *argp7 ;
@@ -27632,7 +27417,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
arg7 = *argp7;
arg8 = (uint32_t)jarg8;
arg9 = (char *)jarg9;
result = (switch_status_t)switch_ivr_read(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7,arg8,(char const *)arg9);
arg10 = (uint32_t)jarg10;
result = (switch_status_t)switch_ivr_read(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7,arg8,(char const *)arg9,arg10);
jresult = result;
return jresult;
}
@@ -28850,6 +28636,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_get_stats(void * jarg1, void * j
}
SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_rtp_check_auto_adj(void * jarg1) {
unsigned char jresult ;
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
switch_byte_t result;
arg1 = (switch_rtp_t *)jarg1;
result = (switch_byte_t)switch_rtp_check_auto_adj(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_log_node_t_data_set(void * jarg1, char * jarg2) {
switch_log_node_t *arg1 = (switch_log_node_t *) 0 ;
char *arg2 = (char *) 0 ;
@@ -33600,7 +33398,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_Transfer(void * jarg1, char * jarg
}
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, int jarg3, char * jarg4, int jarg5, char * jarg6) {
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, int jarg3, char * jarg4, int jarg5, char * jarg6, int jarg7) {
char * jresult ;
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
@@ -33608,6 +33406,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
char *arg4 = (char *) 0 ;
int arg5 ;
char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ;
arg1 = (CoreSession *)jarg1;
@@ -33616,13 +33415,14 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
arg4 = (char *)jarg4;
arg5 = (int)jarg5;
arg6 = (char *)jarg6;
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6);
arg7 = (int)jarg7;
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1, int jarg2, int jarg3, int jarg4, int jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10) {
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1, int jarg2, int jarg3, int jarg4, int jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, int jarg11) {
char * jresult ;
CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ;
@@ -33634,6 +33434,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ;
arg1 = (CoreSession *)jarg1;
@@ -33646,7 +33447,8 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
arg8 = (char *)jarg8;
arg9 = (char *)jarg9;
arg10 = (char *)jarg10;
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10);
arg11 = (int)jarg11;
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
+309 -294
View File
@@ -327,13 +327,13 @@ public class CoreSession : IDisposable {
return ret;
}
public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators) {
string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators);
public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout);
return ret;
}
public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name) {
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name);
public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout);
return ret;
}
@@ -1673,8 +1673,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_core_codec_init(switch_codec codec, string codec_name, string fmtp, uint rate, int ms, int channels, uint flags, switch_codec_settings codec_settings, SWIGTYPE_p_apr_pool_t pool) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_init(switch_codec.getCPtr(codec), codec_name, fmtp, rate, ms, channels, flags, switch_codec_settings.getCPtr(codec_settings), SWIGTYPE_p_apr_pool_t.getCPtr(pool));
public static switch_status_t switch_core_codec_init_with_bitrate(switch_codec codec, string codec_name, string fmtp, uint rate, int ms, int channels, uint bitrate, uint flags, switch_codec_settings codec_settings, SWIGTYPE_p_apr_pool_t pool) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_init_with_bitrate(switch_codec.getCPtr(codec), codec_name, fmtp, rate, ms, channels, bitrate, flags, switch_codec_settings.getCPtr(codec_settings), SWIGTYPE_p_apr_pool_t.getCPtr(pool));
return ret;
}
@@ -1683,6 +1683,11 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_core_codec_parse_fmtp(string codec_name, string fmtp, uint rate, switch_codec_fmtp codec_fmtp) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_parse_fmtp(codec_name, fmtp, rate, switch_codec_fmtp.getCPtr(codec_fmtp));
return ret;
}
public static switch_status_t switch_core_codec_reset(switch_codec codec) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_reset(switch_codec.getCPtr(codec));
return ret;
@@ -2645,6 +2650,11 @@ public class freeswitch {
return ret;
}
public static uint switch_known_bitrate(byte payload) {
uint ret = freeswitchPINVOKE.switch_known_bitrate(payload);
return ret;
}
public static SWIGTYPE_p_switch_size_t switch_fd_read_line(int fd, string buf, SWIGTYPE_p_switch_size_t len) {
SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_fd_read_line(fd, buf, SWIGTYPE_p_switch_size_t.getCPtr(len)), true);
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
@@ -2725,6 +2735,11 @@ public class freeswitch {
return ret;
}
public static uint switch_default_ptime(string name, uint number) {
uint ret = freeswitchPINVOKE.switch_default_ptime(name, number);
return ret;
}
public static string switch_sanitize_number(string number) {
string ret = freeswitchPINVOKE.switch_sanitize_number(number);
return ret;
@@ -2928,11 +2943,44 @@ public class freeswitch {
return ret;
}
public static string switch_dow_int2str(int val) {
string ret = freeswitchPINVOKE.switch_dow_int2str(val);
return ret;
}
public static int switch_dow_str2int(string exp) {
int ret = freeswitchPINVOKE.switch_dow_str2int(exp);
return ret;
}
public static int switch_dow_cmp(string exp, int val) {
int ret = freeswitchPINVOKE.switch_dow_cmp(exp, val);
return ret;
}
public static int switch_number_cmp(string exp, int val) {
int ret = freeswitchPINVOKE.switch_number_cmp(exp, val);
return ret;
}
public static int switch_tod_cmp(string exp, int val) {
int ret = freeswitchPINVOKE.switch_tod_cmp(exp, val);
return ret;
}
public static int switch_fulldate_cmp(string exp, SWIGTYPE_p_switch_time_t ts) {
int ret = freeswitchPINVOKE.switch_fulldate_cmp(exp, SWIGTYPE_p_switch_time_t.getCPtr(ts));
return ret;
}
public static void switch_split_date(string exp, SWIGTYPE_p_int year, SWIGTYPE_p_int month, SWIGTYPE_p_int day) {
freeswitchPINVOKE.switch_split_date(exp, SWIGTYPE_p_int.getCPtr(year), SWIGTYPE_p_int.getCPtr(month), SWIGTYPE_p_int.getCPtr(day));
}
public static void switch_split_time(string exp, SWIGTYPE_p_int hour, SWIGTYPE_p_int min, SWIGTYPE_p_int sec) {
freeswitchPINVOKE.switch_split_time(exp, SWIGTYPE_p_int.getCPtr(hour), SWIGTYPE_p_int.getCPtr(min), SWIGTYPE_p_int.getCPtr(sec));
}
public static int switch_split_user_domain(string arg0, ref string user, ref string domain) {
int ret = freeswitchPINVOKE.switch_split_user_domain(arg0, ref user, ref domain);
return ret;
@@ -3150,13 +3198,17 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_channel_export_variable_var_check(SWIGTYPE_p_switch_channel channel, string varname, string value, switch_bool_t var_check) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_export_variable_var_check(SWIGTYPE_p_switch_channel.getCPtr(channel), varname, value, (int)var_check);
public static switch_status_t switch_channel_export_variable_var_check(SWIGTYPE_p_switch_channel channel, string varname, string val, string export_varname, switch_bool_t var_check) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_export_variable_var_check(SWIGTYPE_p_switch_channel.getCPtr(channel), varname, val, export_varname, (int)var_check);
return ret;
}
public static switch_status_t switch_channel_export_variable_printf(SWIGTYPE_p_switch_channel channel, string varname, string fmt) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_export_variable_printf(SWIGTYPE_p_switch_channel.getCPtr(channel), varname, fmt);
public static void switch_channel_process_export(SWIGTYPE_p_switch_channel channel, SWIGTYPE_p_switch_channel peer_channel, switch_event var_event, string export_varname) {
freeswitchPINVOKE.switch_channel_process_export(SWIGTYPE_p_switch_channel.getCPtr(channel), SWIGTYPE_p_switch_channel.getCPtr(peer_channel), switch_event.getCPtr(var_event), export_varname);
}
public static switch_status_t switch_channel_export_variable_printf(SWIGTYPE_p_switch_channel channel, string varname, string export_varname, string fmt) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_export_variable_printf(SWIGTYPE_p_switch_channel.getCPtr(channel), varname, export_varname, fmt);
return ret;
}
@@ -3986,8 +4038,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex);
public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex, digit_timeout);
return ret;
}
@@ -4216,8 +4268,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators);
public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators, digit_timeout);
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
@@ -4567,6 +4619,11 @@ public class freeswitch {
return ret;
}
public static byte switch_rtp_check_auto_adj(SWIGTYPE_p_switch_rtp rtp_session) {
byte ret = freeswitchPINVOKE.switch_rtp_check_auto_adj(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
return ret;
}
public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize);
return ret;
@@ -4762,6 +4819,11 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_xml_reload(ref string err) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_reload(ref err);
return ret;
}
public static switch_status_t switch_xml_destroy() {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_xml_destroy();
return ret;
@@ -5158,6 +5220,7 @@ public class freeswitch {
public static readonly string SWITCH_ENDPOINT_DISPOSITION_VARIABLE = freeswitchPINVOKE.SWITCH_ENDPOINT_DISPOSITION_VARIABLE_get();
public static readonly string SWITCH_HOLD_MUSIC_VARIABLE = freeswitchPINVOKE.SWITCH_HOLD_MUSIC_VARIABLE_get();
public static readonly string SWITCH_EXPORT_VARS_VARIABLE = freeswitchPINVOKE.SWITCH_EXPORT_VARS_VARIABLE_get();
public static readonly string SWITCH_BRIDGE_EXPORT_VARS_VARIABLE = freeswitchPINVOKE.SWITCH_BRIDGE_EXPORT_VARS_VARIABLE_get();
public static readonly string SWITCH_R_SDP_VARIABLE = freeswitchPINVOKE.SWITCH_R_SDP_VARIABLE_get();
public static readonly string SWITCH_L_SDP_VARIABLE = freeswitchPINVOKE.SWITCH_L_SDP_VARIABLE_get();
public static readonly string SWITCH_B_SDP_VARIABLE = freeswitchPINVOKE.SWITCH_B_SDP_VARIABLE_get();
@@ -5747,6 +5810,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_EXPORT_VARS_VARIABLE_get")]
public static extern string SWITCH_EXPORT_VARS_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_BRIDGE_EXPORT_VARS_VARIABLE_get")]
public static extern string SWITCH_BRIDGE_EXPORT_VARS_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_R_SDP_VARIABLE_get")]
public static extern string SWITCH_R_SDP_VARIABLE_get();
@@ -6333,10 +6399,10 @@ class freeswitchPINVOKE {
public static extern string switch_t38_options_t_remote_ip_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_set")]
public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, uint jarg2);
public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, ushort jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_get")]
public static extern uint switch_t38_options_t_remote_port_get(HandleRef jarg1);
public static extern ushort switch_t38_options_t_remote_port_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_ip_set")]
public static extern void switch_t38_options_t_local_ip_set(HandleRef jarg1, string jarg2);
@@ -6345,10 +6411,10 @@ class freeswitchPINVOKE {
public static extern string switch_t38_options_t_local_ip_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_set")]
public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, uint jarg2);
public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, ushort jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_get")]
public static extern uint switch_t38_options_t_local_port_get(HandleRef jarg1);
public static extern ushort switch_t38_options_t_local_port_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_t38_options_t")]
public static extern IntPtr new_switch_t38_options_t();
@@ -7361,12 +7427,15 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_timer_destroy")]
public static extern int switch_core_timer_destroy(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_init")]
public static extern int switch_core_codec_init(HandleRef jarg1, string jarg2, string jarg3, uint jarg4, int jarg5, int jarg6, uint jarg7, HandleRef jarg8, HandleRef jarg9);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_init_with_bitrate")]
public static extern int switch_core_codec_init_with_bitrate(HandleRef jarg1, string jarg2, string jarg3, uint jarg4, int jarg5, int jarg6, uint jarg7, uint jarg8, HandleRef jarg9, HandleRef jarg10);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_copy")]
public static extern int switch_core_codec_copy(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_parse_fmtp")]
public static extern int switch_core_codec_parse_fmtp(string jarg1, string jarg2, uint jarg3, HandleRef jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_reset")]
public static extern int switch_core_codec_reset(HandleRef jarg1);
@@ -8219,6 +8288,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_is_digit_string")]
public static extern int switch_is_digit_string(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_known_bitrate")]
public static extern uint switch_known_bitrate(byte jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_fd_read_line")]
public static extern IntPtr switch_fd_read_line(int jarg1, string jarg2, HandleRef jarg3);
@@ -8264,6 +8336,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_char_to_rfc2833")]
public static extern byte switch_char_to_rfc2833(char jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_default_ptime")]
public static extern uint switch_default_ptime(string jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sanitize_number")]
public static extern string switch_sanitize_number(string jarg1);
@@ -8384,9 +8459,30 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_network_list_validate_ip_token")]
public static extern int switch_network_list_validate_ip_token(HandleRef jarg1, uint jarg2, ref string jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_dow_int2str")]
public static extern string switch_dow_int2str(int jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_dow_str2int")]
public static extern int switch_dow_str2int(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_dow_cmp")]
public static extern int switch_dow_cmp(string jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_number_cmp")]
public static extern int switch_number_cmp(string jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_tod_cmp")]
public static extern int switch_tod_cmp(string jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_fulldate_cmp")]
public static extern int switch_fulldate_cmp(string jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_split_date")]
public static extern void switch_split_date(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_split_time")]
public static extern void switch_split_time(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_split_user_domain")]
public static extern int switch_split_user_domain(string jarg1, ref string jarg2, ref string jarg3);
@@ -10319,101 +10415,11 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_directory_handle")]
public static extern void delete_switch_directory_handle(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_quality_set")]
public static extern void switch_codec_settings_quality_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_unused_set")]
public static extern void switch_codec_settings_unused_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_quality_get")]
public static extern int switch_codec_settings_quality_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_complexity_set")]
public static extern void switch_codec_settings_complexity_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_complexity_get")]
public static extern int switch_codec_settings_complexity_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_enhancement_set")]
public static extern void switch_codec_settings_enhancement_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_enhancement_get")]
public static extern int switch_codec_settings_enhancement_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vad_set")]
public static extern void switch_codec_settings_vad_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vad_get")]
public static extern int switch_codec_settings_vad_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_set")]
public static extern void switch_codec_settings_vbr_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_get")]
public static extern int switch_codec_settings_vbr_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_quality_set")]
public static extern void switch_codec_settings_vbr_quality_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_quality_get")]
public static extern float switch_codec_settings_vbr_quality_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_abr_set")]
public static extern void switch_codec_settings_abr_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_abr_get")]
public static extern int switch_codec_settings_abr_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_dtx_set")]
public static extern void switch_codec_settings_dtx_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_dtx_get")]
public static extern int switch_codec_settings_dtx_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_preproc_set")]
public static extern void switch_codec_settings_preproc_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_preproc_get")]
public static extern int switch_codec_settings_preproc_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_vad_set")]
public static extern void switch_codec_settings_pp_vad_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_vad_get")]
public static extern int switch_codec_settings_pp_vad_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_set")]
public static extern void switch_codec_settings_pp_agc_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_get")]
public static extern int switch_codec_settings_pp_agc_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_level_set")]
public static extern void switch_codec_settings_pp_agc_level_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_level_get")]
public static extern float switch_codec_settings_pp_agc_level_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_denoise_set")]
public static extern void switch_codec_settings_pp_denoise_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_denoise_get")]
public static extern int switch_codec_settings_pp_denoise_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_set")]
public static extern void switch_codec_settings_pp_dereverb_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_get")]
public static extern int switch_codec_settings_pp_dereverb_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_decay_set")]
public static extern void switch_codec_settings_pp_dereverb_decay_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_decay_get")]
public static extern float switch_codec_settings_pp_dereverb_decay_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_level_set")]
public static extern void switch_codec_settings_pp_dereverb_level_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_level_get")]
public static extern float switch_codec_settings_pp_dereverb_level_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_unused_get")]
public static extern int switch_codec_settings_unused_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_codec_settings")]
public static extern IntPtr new_switch_codec_settings();
@@ -10421,6 +10427,36 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_codec_settings")]
public static extern void delete_switch_codec_settings(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_actual_samples_per_second_set")]
public static extern void switch_codec_fmtp_actual_samples_per_second_set(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_actual_samples_per_second_get")]
public static extern uint switch_codec_fmtp_actual_samples_per_second_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_bits_per_second_set")]
public static extern void switch_codec_fmtp_bits_per_second_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_bits_per_second_get")]
public static extern int switch_codec_fmtp_bits_per_second_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_microseconds_per_packet_set")]
public static extern void switch_codec_fmtp_microseconds_per_packet_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_microseconds_per_packet_get")]
public static extern int switch_codec_fmtp_microseconds_per_packet_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_private_info_set")]
public static extern void switch_codec_fmtp_private_info_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_private_info_get")]
public static extern IntPtr switch_codec_fmtp_private_info_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_codec_fmtp")]
public static extern IntPtr new_switch_codec_fmtp();
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_codec_fmtp")]
public static extern void delete_switch_codec_fmtp(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_interface_set")]
public static extern void switch_codec_codec_interface_set(HandleRef jarg1, HandleRef jarg2);
@@ -10445,12 +10481,6 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_out_get")]
public static extern string switch_codec_fmtp_out_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_settings_set")]
public static extern void switch_codec_codec_settings_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_settings_get")]
public static extern IntPtr switch_codec_codec_settings_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_flags_set")]
public static extern void switch_codec_flags_set(HandleRef jarg1, uint jarg2);
@@ -10631,6 +10661,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_implementations_get")]
public static extern IntPtr switch_codec_interface_implementations_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_parse_fmtp_set")]
public static extern void switch_codec_interface_parse_fmtp_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_parse_fmtp_get")]
public static extern IntPtr switch_codec_interface_parse_fmtp_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_codec_id_set")]
public static extern void switch_codec_interface_codec_id_set(HandleRef jarg1, uint jarg2);
@@ -10968,10 +11004,13 @@ class freeswitchPINVOKE {
public static extern string switch_channel_get_variable_partner(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_export_variable_var_check")]
public static extern int switch_channel_export_variable_var_check(HandleRef jarg1, string jarg2, string jarg3, int jarg4);
public static extern int switch_channel_export_variable_var_check(HandleRef jarg1, string jarg2, string jarg3, string jarg4, int jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_process_export")]
public static extern void switch_channel_process_export(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_export_variable_printf")]
public static extern int switch_channel_export_variable_printf(HandleRef jarg1, string jarg2, string jarg3);
public static extern int switch_channel_export_variable_printf(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_variable_dup")]
public static extern string switch_channel_get_variable_dup(HandleRef jarg1, string jarg2, int jarg3);
@@ -11748,7 +11787,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_record_file(HandleRef jarg1, HandleRef jarg2, string jarg3, HandleRef jarg4, uint jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_play_and_get_digits")]
public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12);
public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12, uint jarg13);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_speak_text_handle")]
public static extern int switch_ivr_speak_text_handle(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6);
@@ -11886,7 +11925,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_wait_for_answer(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_read")]
public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9);
public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9, uint jarg10);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_block_dtmf_session")]
public static extern int switch_ivr_block_dtmf_session(HandleRef jarg1);
@@ -12158,6 +12197,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_get_stats")]
public static extern IntPtr switch_rtp_get_stats(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_check_auto_adj")]
public static extern byte switch_rtp_check_auto_adj(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_data_set")]
public static extern void switch_log_node_t_data_set(HandleRef jarg1, string jarg2);
@@ -12404,6 +12446,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_xml_init")]
public static extern int switch_xml_init(HandleRef jarg1, ref string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_xml_reload")]
public static extern int switch_xml_reload(ref string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_xml_destroy")]
public static extern int switch_xml_destroy();
@@ -13290,10 +13335,10 @@ class freeswitchPINVOKE {
public static extern int CoreSession_Transfer(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_read")]
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6);
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6, int jarg7);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_PlayAndGetDigits")]
public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10);
public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_StreamFile")]
public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3);
@@ -14011,6 +14056,36 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
private HandleRef swigCPtr;
internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
private HandleRef swigCPtr;
@@ -21249,17 +21324,6 @@ public class switch_codec : IDisposable {
}
}
public switch_codec_settings codec_settings {
set {
freeswitchPINVOKE.switch_codec_codec_settings_set(swigCPtr, switch_codec_settings.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_codec_settings_get(swigCPtr);
switch_codec_settings ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_settings(cPtr, false);
return ret;
}
}
public uint flags {
set {
freeswitchPINVOKE.switch_codec_flags_set(swigCPtr, value);
@@ -21366,6 +21430,96 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class switch_codec_fmtp : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_codec_fmtp(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
internal static HandleRef getCPtr(switch_codec_fmtp obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
~switch_codec_fmtp() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_codec_fmtp(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
GC.SuppressFinalize(this);
}
}
public uint actual_samples_per_second {
set {
freeswitchPINVOKE.switch_codec_fmtp_actual_samples_per_second_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_codec_fmtp_actual_samples_per_second_get(swigCPtr);
return ret;
}
}
public int bits_per_second {
set {
freeswitchPINVOKE.switch_codec_fmtp_bits_per_second_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_fmtp_bits_per_second_get(swigCPtr);
return ret;
}
}
public int microseconds_per_packet {
set {
freeswitchPINVOKE.switch_codec_fmtp_microseconds_per_packet_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_fmtp_microseconds_per_packet_get(swigCPtr);
return ret;
}
}
public SWIGTYPE_p_void private_info {
set {
freeswitchPINVOKE.switch_codec_fmtp_private_info_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_fmtp_private_info_get(swigCPtr);
SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false);
return ret;
}
}
public switch_codec_fmtp() : this(freeswitchPINVOKE.new_switch_codec_fmtp(), true) {
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class switch_codec_implementation : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
@@ -21671,6 +21825,17 @@ public class switch_codec_interface : IDisposable {
}
}
public SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t parse_fmtp {
set {
freeswitchPINVOKE.switch_codec_interface_parse_fmtp_set(swigCPtr, SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_interface_parse_fmtp_get(swigCPtr);
SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(cPtr, false);
return ret;
}
}
public uint codec_id {
set {
freeswitchPINVOKE.switch_codec_interface_codec_id_set(swigCPtr, value);
@@ -21784,162 +21949,12 @@ public class switch_codec_settings : IDisposable {
}
}
public int quality {
public int unused {
set {
freeswitchPINVOKE.switch_codec_settings_quality_set(swigCPtr, value);
freeswitchPINVOKE.switch_codec_settings_unused_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_quality_get(swigCPtr);
return ret;
}
}
public int complexity {
set {
freeswitchPINVOKE.switch_codec_settings_complexity_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_complexity_get(swigCPtr);
return ret;
}
}
public int enhancement {
set {
freeswitchPINVOKE.switch_codec_settings_enhancement_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_enhancement_get(swigCPtr);
return ret;
}
}
public int vad {
set {
freeswitchPINVOKE.switch_codec_settings_vad_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_vad_get(swigCPtr);
return ret;
}
}
public int vbr {
set {
freeswitchPINVOKE.switch_codec_settings_vbr_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_vbr_get(swigCPtr);
return ret;
}
}
public float vbr_quality {
set {
freeswitchPINVOKE.switch_codec_settings_vbr_quality_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_vbr_quality_get(swigCPtr);
return ret;
}
}
public int abr {
set {
freeswitchPINVOKE.switch_codec_settings_abr_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_abr_get(swigCPtr);
return ret;
}
}
public int dtx {
set {
freeswitchPINVOKE.switch_codec_settings_dtx_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_dtx_get(swigCPtr);
return ret;
}
}
public int preproc {
set {
freeswitchPINVOKE.switch_codec_settings_preproc_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_preproc_get(swigCPtr);
return ret;
}
}
public int pp_vad {
set {
freeswitchPINVOKE.switch_codec_settings_pp_vad_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_vad_get(swigCPtr);
return ret;
}
}
public int pp_agc {
set {
freeswitchPINVOKE.switch_codec_settings_pp_agc_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_agc_get(swigCPtr);
return ret;
}
}
public float pp_agc_level {
set {
freeswitchPINVOKE.switch_codec_settings_pp_agc_level_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_agc_level_get(swigCPtr);
return ret;
}
}
public int pp_denoise {
set {
freeswitchPINVOKE.switch_codec_settings_pp_denoise_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_denoise_get(swigCPtr);
return ret;
}
}
public int pp_dereverb {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_get(swigCPtr);
return ret;
}
}
public float pp_dereverb_decay {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_decay_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_decay_get(swigCPtr);
return ret;
}
}
public float pp_dereverb_level {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_level_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_level_get(swigCPtr);
int ret = freeswitchPINVOKE.switch_codec_settings_unused_get(swigCPtr);
return ret;
}
}
@@ -29671,12 +29686,12 @@ public class switch_t38_options_t : IDisposable {
}
}
public uint remote_port {
public ushort remote_port {
set {
freeswitchPINVOKE.switch_t38_options_t_remote_port_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr);
ushort ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr);
return ret;
}
}
@@ -29691,12 +29706,12 @@ public class switch_t38_options_t : IDisposable {
}
}
public uint local_port {
public ushort local_port {
set {
freeswitchPINVOKE.switch_t38_options_t_local_port_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr);
ushort ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr);
return ret;
}
}
+212 -288
View File
@@ -323,13 +323,13 @@ public class CoreSession : IDisposable {
return ret;
}
public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators) {
string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators);
public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout);
return ret;
}
public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name) {
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name);
public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout);
return ret;
}
@@ -1663,8 +1663,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_core_codec_init(switch_codec codec, string codec_name, string fmtp, uint rate, int ms, int channels, uint flags, switch_codec_settings codec_settings, SWIGTYPE_p_apr_pool_t pool) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_init(switch_codec.getCPtr(codec), codec_name, fmtp, rate, ms, channels, flags, switch_codec_settings.getCPtr(codec_settings), SWIGTYPE_p_apr_pool_t.getCPtr(pool));
public static switch_status_t switch_core_codec_init_with_bitrate(switch_codec codec, string codec_name, string fmtp, uint rate, int ms, int channels, uint bitrate, uint flags, switch_codec_settings codec_settings, SWIGTYPE_p_apr_pool_t pool) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_codec_init_with_bitrate(switch_codec.getCPtr(codec), codec_name, fmtp, rate, ms, channels, bitrate, flags, switch_codec_settings.getCPtr(codec_settings), SWIGTYPE_p_apr_pool_t.getCPtr(pool));
return ret;
}
@@ -2715,6 +2715,11 @@ public class freeswitch {
return ret;
}
public static uint switch_default_ptime(string name, uint number) {
uint ret = freeswitchPINVOKE.switch_default_ptime(name, number);
return ret;
}
public static string switch_sanitize_number(string number) {
string ret = freeswitchPINVOKE.switch_sanitize_number(number);
return ret;
@@ -4009,8 +4014,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex);
public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex, digit_timeout);
return ret;
}
@@ -4239,8 +4244,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators);
public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators, digit_timeout);
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
@@ -4590,6 +4595,11 @@ public class freeswitch {
return ret;
}
public static byte switch_rtp_check_auto_adj(SWIGTYPE_p_switch_rtp rtp_session) {
byte ret = freeswitchPINVOKE.switch_rtp_check_auto_adj(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
return ret;
}
public static switch_status_t switch_log_init(SWIGTYPE_p_apr_pool_t pool, switch_bool_t colorize) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_log_init(SWIGTYPE_p_apr_pool_t.getCPtr(pool), (int)colorize);
return ret;
@@ -6357,10 +6367,10 @@ class freeswitchPINVOKE {
public static extern string switch_t38_options_t_remote_ip_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_set")]
public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, uint jarg2);
public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, ushort jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_get")]
public static extern uint switch_t38_options_t_remote_port_get(HandleRef jarg1);
public static extern ushort switch_t38_options_t_remote_port_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_ip_set")]
public static extern void switch_t38_options_t_local_ip_set(HandleRef jarg1, string jarg2);
@@ -6369,10 +6379,10 @@ class freeswitchPINVOKE {
public static extern string switch_t38_options_t_local_ip_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_set")]
public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, uint jarg2);
public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, ushort jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_get")]
public static extern uint switch_t38_options_t_local_port_get(HandleRef jarg1);
public static extern ushort switch_t38_options_t_local_port_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_t38_options_t")]
public static extern IntPtr new_switch_t38_options_t();
@@ -7385,8 +7395,8 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_timer_destroy")]
public static extern int switch_core_timer_destroy(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_init")]
public static extern int switch_core_codec_init(HandleRef jarg1, string jarg2, string jarg3, uint jarg4, int jarg5, int jarg6, uint jarg7, HandleRef jarg8, HandleRef jarg9);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_init_with_bitrate")]
public static extern int switch_core_codec_init_with_bitrate(HandleRef jarg1, string jarg2, string jarg3, uint jarg4, int jarg5, int jarg6, uint jarg7, uint jarg8, HandleRef jarg9, HandleRef jarg10);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_copy")]
public static extern int switch_core_codec_copy(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);
@@ -8288,6 +8298,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_char_to_rfc2833")]
public static extern byte switch_char_to_rfc2833(char jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_default_ptime")]
public static extern uint switch_default_ptime(string jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sanitize_number")]
public static extern string switch_sanitize_number(string jarg1);
@@ -10364,101 +10377,11 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_directory_handle")]
public static extern void delete_switch_directory_handle(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_quality_set")]
public static extern void switch_codec_settings_quality_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_unused_set")]
public static extern void switch_codec_settings_unused_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_quality_get")]
public static extern int switch_codec_settings_quality_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_complexity_set")]
public static extern void switch_codec_settings_complexity_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_complexity_get")]
public static extern int switch_codec_settings_complexity_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_enhancement_set")]
public static extern void switch_codec_settings_enhancement_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_enhancement_get")]
public static extern int switch_codec_settings_enhancement_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vad_set")]
public static extern void switch_codec_settings_vad_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vad_get")]
public static extern int switch_codec_settings_vad_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_set")]
public static extern void switch_codec_settings_vbr_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_get")]
public static extern int switch_codec_settings_vbr_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_quality_set")]
public static extern void switch_codec_settings_vbr_quality_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_vbr_quality_get")]
public static extern float switch_codec_settings_vbr_quality_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_abr_set")]
public static extern void switch_codec_settings_abr_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_abr_get")]
public static extern int switch_codec_settings_abr_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_dtx_set")]
public static extern void switch_codec_settings_dtx_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_dtx_get")]
public static extern int switch_codec_settings_dtx_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_preproc_set")]
public static extern void switch_codec_settings_preproc_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_preproc_get")]
public static extern int switch_codec_settings_preproc_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_vad_set")]
public static extern void switch_codec_settings_pp_vad_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_vad_get")]
public static extern int switch_codec_settings_pp_vad_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_set")]
public static extern void switch_codec_settings_pp_agc_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_get")]
public static extern int switch_codec_settings_pp_agc_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_level_set")]
public static extern void switch_codec_settings_pp_agc_level_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_agc_level_get")]
public static extern float switch_codec_settings_pp_agc_level_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_denoise_set")]
public static extern void switch_codec_settings_pp_denoise_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_denoise_get")]
public static extern int switch_codec_settings_pp_denoise_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_set")]
public static extern void switch_codec_settings_pp_dereverb_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_get")]
public static extern int switch_codec_settings_pp_dereverb_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_decay_set")]
public static extern void switch_codec_settings_pp_dereverb_decay_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_decay_get")]
public static extern float switch_codec_settings_pp_dereverb_decay_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_level_set")]
public static extern void switch_codec_settings_pp_dereverb_level_set(HandleRef jarg1, float jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_pp_dereverb_level_get")]
public static extern float switch_codec_settings_pp_dereverb_level_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_settings_unused_get")]
public static extern int switch_codec_settings_unused_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_codec_settings")]
public static extern IntPtr new_switch_codec_settings();
@@ -10466,6 +10389,36 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_codec_settings")]
public static extern void delete_switch_codec_settings(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_actual_samples_per_second_set")]
public static extern void switch_codec_fmtp_actual_samples_per_second_set(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_actual_samples_per_second_get")]
public static extern uint switch_codec_fmtp_actual_samples_per_second_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_bits_per_second_set")]
public static extern void switch_codec_fmtp_bits_per_second_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_bits_per_second_get")]
public static extern int switch_codec_fmtp_bits_per_second_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_microseconds_per_packet_set")]
public static extern void switch_codec_fmtp_microseconds_per_packet_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_microseconds_per_packet_get")]
public static extern int switch_codec_fmtp_microseconds_per_packet_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_private_info_set")]
public static extern void switch_codec_fmtp_private_info_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_private_info_get")]
public static extern IntPtr switch_codec_fmtp_private_info_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_codec_fmtp")]
public static extern IntPtr new_switch_codec_fmtp();
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_codec_fmtp")]
public static extern void delete_switch_codec_fmtp(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_interface_set")]
public static extern void switch_codec_codec_interface_set(HandleRef jarg1, HandleRef jarg2);
@@ -10490,12 +10443,6 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_fmtp_out_get")]
public static extern string switch_codec_fmtp_out_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_settings_set")]
public static extern void switch_codec_codec_settings_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_codec_settings_get")]
public static extern IntPtr switch_codec_codec_settings_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_flags_set")]
public static extern void switch_codec_flags_set(HandleRef jarg1, uint jarg2);
@@ -10676,6 +10623,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_implementations_get")]
public static extern IntPtr switch_codec_interface_implementations_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_parse_fmtp_set")]
public static extern void switch_codec_interface_parse_fmtp_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_parse_fmtp_get")]
public static extern IntPtr switch_codec_interface_parse_fmtp_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_interface_codec_id_set")]
public static extern void switch_codec_interface_codec_id_set(HandleRef jarg1, uint jarg2);
@@ -11793,7 +11746,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_record_file(HandleRef jarg1, HandleRef jarg2, string jarg3, HandleRef jarg4, uint jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_play_and_get_digits")]
public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12);
public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12, uint jarg13);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_speak_text_handle")]
public static extern int switch_ivr_speak_text_handle(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6);
@@ -11931,7 +11884,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_wait_for_answer(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_read")]
public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9);
public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9, uint jarg10);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_block_dtmf_session")]
public static extern int switch_ivr_block_dtmf_session(HandleRef jarg1);
@@ -12203,6 +12156,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_get_stats")]
public static extern IntPtr switch_rtp_get_stats(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_check_auto_adj")]
public static extern byte switch_rtp_check_auto_adj(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_log_node_t_data_set")]
public static extern void switch_log_node_t_data_set(HandleRef jarg1, string jarg2);
@@ -13338,10 +13294,10 @@ class freeswitchPINVOKE {
public static extern int CoreSession_Transfer(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_read")]
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6);
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6, int jarg7);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_PlayAndGetDigits")]
public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10);
public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_StreamFile")]
public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3);
@@ -14051,6 +14007,36 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
private HandleRef swigCPtr;
internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
private HandleRef swigCPtr;
@@ -21253,17 +21239,6 @@ public class switch_codec : IDisposable {
}
}
public switch_codec_settings codec_settings {
set {
freeswitchPINVOKE.switch_codec_codec_settings_set(swigCPtr, switch_codec_settings.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_codec_settings_get(swigCPtr);
switch_codec_settings ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_settings(cPtr, false);
return ret;
}
}
public uint flags {
set {
freeswitchPINVOKE.switch_codec_flags_set(swigCPtr, value);
@@ -21370,6 +21345,94 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class switch_codec_fmtp : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_codec_fmtp(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
internal static HandleRef getCPtr(switch_codec_fmtp obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
~switch_codec_fmtp() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_codec_fmtp(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
GC.SuppressFinalize(this);
}
}
public uint actual_samples_per_second {
set {
freeswitchPINVOKE.switch_codec_fmtp_actual_samples_per_second_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_codec_fmtp_actual_samples_per_second_get(swigCPtr);
return ret;
}
}
public int bits_per_second {
set {
freeswitchPINVOKE.switch_codec_fmtp_bits_per_second_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_fmtp_bits_per_second_get(swigCPtr);
return ret;
}
}
public int microseconds_per_packet {
set {
freeswitchPINVOKE.switch_codec_fmtp_microseconds_per_packet_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_fmtp_microseconds_per_packet_get(swigCPtr);
return ret;
}
}
public SWIGTYPE_p_void private_info {
set {
freeswitchPINVOKE.switch_codec_fmtp_private_info_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_fmtp_private_info_get(swigCPtr);
SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false);
return ret;
}
}
public switch_codec_fmtp() : this(freeswitchPINVOKE.new_switch_codec_fmtp(), true) {
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.35
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class switch_codec_implementation : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
@@ -21671,6 +21734,17 @@ public class switch_codec_interface : IDisposable {
}
}
public SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t parse_fmtp {
set {
freeswitchPINVOKE.switch_codec_interface_parse_fmtp_set(swigCPtr, SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_interface_parse_fmtp_get(swigCPtr);
SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(cPtr, false);
return ret;
}
}
public uint codec_id {
set {
freeswitchPINVOKE.switch_codec_interface_codec_id_set(swigCPtr, value);
@@ -21782,162 +21856,12 @@ public class switch_codec_settings : IDisposable {
}
}
public int quality {
public int unused {
set {
freeswitchPINVOKE.switch_codec_settings_quality_set(swigCPtr, value);
freeswitchPINVOKE.switch_codec_settings_unused_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_quality_get(swigCPtr);
return ret;
}
}
public int complexity {
set {
freeswitchPINVOKE.switch_codec_settings_complexity_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_complexity_get(swigCPtr);
return ret;
}
}
public int enhancement {
set {
freeswitchPINVOKE.switch_codec_settings_enhancement_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_enhancement_get(swigCPtr);
return ret;
}
}
public int vad {
set {
freeswitchPINVOKE.switch_codec_settings_vad_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_vad_get(swigCPtr);
return ret;
}
}
public int vbr {
set {
freeswitchPINVOKE.switch_codec_settings_vbr_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_vbr_get(swigCPtr);
return ret;
}
}
public float vbr_quality {
set {
freeswitchPINVOKE.switch_codec_settings_vbr_quality_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_vbr_quality_get(swigCPtr);
return ret;
}
}
public int abr {
set {
freeswitchPINVOKE.switch_codec_settings_abr_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_abr_get(swigCPtr);
return ret;
}
}
public int dtx {
set {
freeswitchPINVOKE.switch_codec_settings_dtx_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_dtx_get(swigCPtr);
return ret;
}
}
public int preproc {
set {
freeswitchPINVOKE.switch_codec_settings_preproc_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_preproc_get(swigCPtr);
return ret;
}
}
public int pp_vad {
set {
freeswitchPINVOKE.switch_codec_settings_pp_vad_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_vad_get(swigCPtr);
return ret;
}
}
public int pp_agc {
set {
freeswitchPINVOKE.switch_codec_settings_pp_agc_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_agc_get(swigCPtr);
return ret;
}
}
public float pp_agc_level {
set {
freeswitchPINVOKE.switch_codec_settings_pp_agc_level_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_agc_level_get(swigCPtr);
return ret;
}
}
public int pp_denoise {
set {
freeswitchPINVOKE.switch_codec_settings_pp_denoise_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_denoise_get(swigCPtr);
return ret;
}
}
public int pp_dereverb {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_get(swigCPtr);
return ret;
}
}
public float pp_dereverb_decay {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_decay_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_decay_get(swigCPtr);
return ret;
}
}
public float pp_dereverb_level {
set {
freeswitchPINVOKE.switch_codec_settings_pp_dereverb_level_set(swigCPtr, value);
}
get {
float ret = freeswitchPINVOKE.switch_codec_settings_pp_dereverb_level_get(swigCPtr);
int ret = freeswitchPINVOKE.switch_codec_settings_unused_get(swigCPtr);
return ret;
}
}
@@ -29567,12 +29491,12 @@ public class switch_t38_options_t : IDisposable {
}
}
public uint remote_port {
public ushort remote_port {
set {
freeswitchPINVOKE.switch_t38_options_t_remote_port_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr);
ushort ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr);
return ret;
}
}
@@ -29587,12 +29511,12 @@ public class switch_t38_options_t : IDisposable {
}
}
public uint local_port {
public ushort local_port {
set {
freeswitchPINVOKE.switch_t38_options_t_local_port_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr);
ushort ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr);
return ret;
}
}
+30 -6
View File
@@ -6637,6 +6637,7 @@ XS(_wrap_CoreSession_read) {
char *arg4 = (char *) 0 ;
int arg5 ;
char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -6652,11 +6653,13 @@ XS(_wrap_CoreSession_read) {
int res6 ;
char *buf6 = 0 ;
int alloc6 = 0 ;
int val7 ;
int ecode7 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 6) || (items > 6)) {
SWIG_croak("Usage: CoreSession_read(self,min_digits,max_digits,prompt_audio_file,timeout,valid_terminators);");
if ((items < 6) || (items > 7)) {
SWIG_croak("Usage: CoreSession_read(self,min_digits,max_digits,prompt_audio_file,timeout,valid_terminators,digit_timeout);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
@@ -6688,7 +6691,14 @@ XS(_wrap_CoreSession_read) {
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CoreSession_read" "', argument " "6"" of type '" "char const *""'");
}
arg6 = reinterpret_cast< char * >(buf6);
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6);
if (items > 6) {
ecode7 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
if (!SWIG_IsOK(ecode7)) {
SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CoreSession_read" "', argument " "7"" of type '" "int""'");
}
arg7 = static_cast< int >(val7);
}
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -6696,6 +6706,7 @@ XS(_wrap_CoreSession_read) {
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
XSRETURN(argvi);
fail:
@@ -6704,6 +6715,7 @@ XS(_wrap_CoreSession_read) {
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
SWIG_croak_null();
}
}
@@ -6721,6 +6733,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -6747,11 +6760,13 @@ XS(_wrap_CoreSession_playAndGetDigits) {
int res10 ;
char *buf10 = 0 ;
int alloc10 = 0 ;
int val11 ;
int ecode11 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 9) || (items > 10)) {
SWIG_croak("Usage: CoreSession_playAndGetDigits(self,min_digits,max_digits,max_tries,timeout,terminators,audio_files,bad_input_audio_files,digits_regex,var_name);");
if ((items < 9) || (items > 11)) {
SWIG_croak("Usage: CoreSession_playAndGetDigits(self,min_digits,max_digits,max_tries,timeout,terminators,audio_files,bad_input_audio_files,digits_regex,var_name,digit_timeout);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
@@ -6805,7 +6820,14 @@ XS(_wrap_CoreSession_playAndGetDigits) {
}
arg10 = reinterpret_cast< char * >(buf10);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10);
if (items > 10) {
ecode11 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(10), &val11);
if (!SWIG_IsOK(ecode11)) {
SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "CoreSession_playAndGetDigits" "', argument " "11"" of type '" "int""'");
}
arg11 = static_cast< int >(val11);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -6817,6 +6839,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
XSRETURN(argvi);
fail:
@@ -6829,6 +6852,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
SWIG_croak_null();
}
}
@@ -7025,6 +7025,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_read(PyObject *SWIGUNUSEDPARM(self), PyOb
char *arg4 = (char *) 0 ;
int arg5 ;
char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7040,14 +7041,17 @@ SWIGINTERN PyObject *_wrap_CoreSession_read(PyObject *SWIGUNUSEDPARM(self), PyOb
int res6 ;
char *buf6 = 0 ;
int alloc6 = 0 ;
int val7 ;
int ecode7 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
PyObject * obj4 = 0 ;
PyObject * obj5 = 0 ;
PyObject * obj6 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CoreSession_read",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
if (!PyArg_ParseTuple(args,(char *)"OOOOOO|O:CoreSession_read",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_read" "', argument " "1"" of type '" "CoreSession *""'");
@@ -7078,7 +7082,14 @@ SWIGINTERN PyObject *_wrap_CoreSession_read(PyObject *SWIGUNUSEDPARM(self), PyOb
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CoreSession_read" "', argument " "6"" of type '" "char const *""'");
}
arg6 = reinterpret_cast< char * >(buf6);
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6);
if (obj6) {
ecode7 = SWIG_AsVal_int(obj6, &val7);
if (!SWIG_IsOK(ecode7)) {
SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "CoreSession_read" "', argument " "7"" of type '" "int""'");
}
arg7 = static_cast< int >(val7);
}
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
@@ -7102,6 +7113,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7128,6 +7140,8 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
int res10 ;
char *buf10 = 0 ;
int alloc10 = 0 ;
int val11 ;
int ecode11 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
@@ -7138,8 +7152,9 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
PyObject * obj7 = 0 ;
PyObject * obj8 = 0 ;
PyObject * obj9 = 0 ;
PyObject * obj10 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO|O:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO|OO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playAndGetDigits" "', argument " "1"" of type '" "CoreSession *""'");
@@ -7192,7 +7207,14 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
}
arg10 = reinterpret_cast< char * >(buf10);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10);
if (obj10) {
ecode11 = SWIG_AsVal_int(obj10, &val11);
if (!SWIG_IsOK(ecode11)) {
SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "CoreSession_playAndGetDigits" "', argument " "11"" of type '" "int""'");
}
arg11 = static_cast< int >(val11);
}
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
+1 -1
View File
@@ -264,7 +264,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
if (globals.encode == ENCODING_TEXTXML) {
headers = curl_slist_append(headers, "Content-Type: text/xml");
} else if (globals.encode) {
switch_size_t need_bytes = strlen(xml_text) * 3;
switch_size_t need_bytes = strlen(xml_text) * 3 + 1;
xml_text_escaped = malloc(need_bytes);
switch_assert(xml_text_escaped);