This commit is contained in:
Ken Rice 2012-11-30 04:53:03 +00:00
commit aa0815748e
48 changed files with 935 additions and 190 deletions

View File

@ -606,6 +606,10 @@ version:
reinstall: modwipe uninstall install
pristine:
git clean -fdx
git reset --hard
update-clean: clean libs/openzap/Makefile python-reconf
cd libs/sofia-sip && $(MAKE) clean
cd libs/openzap && $(MAKE) clean
@ -618,13 +622,6 @@ swigall:
@echo reswigging all
sh $(switch_srcdir)/build/swigall.sh
sure: current
speedy-sure: update-clean
$(MAKE) -j core
cd libs/sofia-sip && $(MAKE) -j
$(MAKE) -j modules
speex-reconf:
cd libs/speex && autoreconf
cd libs/speex && ./config.status --recheck
@ -680,6 +677,14 @@ cluecon:
@echo
@echo http://www.cluecon.com
@sleep 5
sure: is-scm pristine update
git pull
sh bootstrap.sh
sh configure $(CONFIGURE_ARGS)
make $(MAKE_ARGS)
make reinstall
current: cluecon update-clean is-scm
$(MAKE) update
$(MAKE) all

View File

@ -3,10 +3,10 @@
# Must change all of the below together
# For a release, set revision for that tagged release as well and uncomment
AC_INIT([freeswitch], [1.2.5.1], BUG-REPORT-ADDRESS)
AC_INIT([freeswitch], [1.2.5.2], BUG-REPORT-ADDRESS)
AC_SUBST(SWITCH_VERSION_MAJOR, [1])
AC_SUBST(SWITCH_VERSION_MINOR, [2])
AC_SUBST(SWITCH_VERSION_MICRO, [5.1])
AC_SUBST(SWITCH_VERSION_MICRO, [5.2])
AC_SUBST(SWITCH_VERSION_REVISION, [])
AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])

View File

@ -779,6 +779,9 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
case FTDM_CHANNEL_STATE_GET_CALLERID:
{
memset(&ftdmchan->caller_data, 0, sizeof(ftdmchan->caller_data));
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Initializing cid data!\n");
ftdm_set_string(ftdmchan->caller_data.ani.digits, "unknown");
ftdm_set_string(ftdmchan->caller_data.cid_name, ftdmchan->caller_data.ani.digits);
ftdm_channel_command(ftdmchan, FTDM_COMMAND_ENABLE_CALLERID_DETECT, NULL);
continue;
}

View File

@ -116,7 +116,7 @@ NAWK = @AWK@
# You should not have to change anything below this line
###############################################################################
TCC += -DSQLITE_OMIT_LOAD_EXTENSION=1
#TCC += -DSQLITE_OMIT_LOAD_EXTENSION=1
# Object files for the SQLite library.
#

View File

@ -26,7 +26,7 @@
#ifdef MEMORY_DEBUG
# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
#undef SQLITE_OMIT_LOAD_EXTENSION
/*
* When testing, this global variable stores the location of the

View File

@ -541,6 +541,10 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
\return number of digits in the queue
*/
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(_In_ switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_lock(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_try_dtmf_lock(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_unlock(switch_channel_t *channel);
/*!
\brief Queue DTMF on a given channel

View File

@ -2042,6 +2042,8 @@ SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel);
*/
SWITCH_DECLARE(switch_bool_t) switch_core_ready(void);
SWITCH_DECLARE(switch_bool_t) switch_core_running(void);
/*!
\brief Determines if the core is ready to take inbound calls
\return SWITCH_TRUE or SWITCH_FALSE
@ -2358,6 +2360,13 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql_callback(switch_cach
*/
SWITCH_DECLARE(int) switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh);
/*!
\brief load an external extension to db
\param [in] dbh The handle
\param [out] the path to the extension
*/
SWITCH_DECLARE(int) switch_cache_db_load_extension(switch_cache_db_handle_t *dbh, const char *extension);
/*!
\brief Provides some feedback as to the status of the db connection pool
\param [in] stream stream for status

View File

@ -462,6 +462,11 @@ SWITCH_DECLARE(void) switch_core_db_free(char *z);
*/
SWITCH_DECLARE(int) switch_core_db_changes(switch_core_db_t *db);
/**
* Call this routine to load an external extension
*/
SWITCH_DECLARE(int) switch_core_db_load_extension(switch_core_db_t *db, const char *extension);
/** Return values for switch_core_db_exec() and switch_core_db_step()*/
#define SWITCH_CORE_DB_OK 0 /* Successful result */
/* beginning-of-error-codes */

View File

@ -71,6 +71,7 @@ SWITCH_DECLARE(char *) getGlobalVariable(char *var_name);
SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg);
SWITCH_DECLARE(void) consoleCleanLog(char *msg);
SWITCH_DECLARE(bool) running(void);
SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *body = NULL,
char *file = NULL, char *convert_cmd = NULL, char *convert_ext = NULL);

View File

@ -1762,10 +1762,13 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Hangup-Cause", switch_channel_cause2str(cause));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Agent", h->agent_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Agent-System", h->agent_system);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "CC-Agent-Called-Time", "%" SWITCH_TIME_T_FMT, t_agent_called);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "CC-Agent-Aborted-Time", "%" SWITCH_TIME_T_FMT, local_epoch_time_now(NULL));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Member-UUID", h->member_uuid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Member-Session-UUID", h->member_session_uuid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Member-CID-Name", h->member_cid_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "CC-Member-CID-Number", h->member_cid_number);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "CC-Member-Joined-Time", "%" SWITCH_TIME_T_FMT, t_member_called);
switch_event_fire(&event);
}

View File

@ -8620,6 +8620,7 @@ static void call_setup_event_handler(switch_event_t *event)
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "conference_track_status", "true");
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "conference_track_call_id", call_id);
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "sip_invite_domain", domain);
if (!strncasecmp(ostr, "url+", 4)) {
ostr += 4;

View File

@ -4478,11 +4478,6 @@ static switch_status_t next_file(switch_file_handle_t *handle)
}
}
if (switch_file_exists(file, handle->memory_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] does not exist.\n", file);
goto top;
}
if (switch_core_file_open(&context->fh, file, handle->channels, handle->samplerate, handle->flags, NULL) != SWITCH_STATUS_SUCCESS) {
goto top;
}

View File

@ -594,6 +594,11 @@ static struct {
switch_thread_t *node_thread;
int debug;
struct fifo_node *nodes;
char *pre_trans_execute;
char *post_trans_execute;
char *inner_pre_trans_execute;
char *inner_post_trans_execute;
switch_sql_queue_manager_t *qm;
} globals;
@ -742,7 +747,29 @@ switch_cache_db_handle_t *fifo_get_db_handle(void)
return dbh;
}
static switch_status_t fifo_execute_sql_queued(char **sqlp, switch_bool_t sql_already_dynamic, switch_bool_t block)
{
int index = 1;
char *sql;
switch_assert(sqlp && *sqlp);
sql = *sqlp;
if (switch_stristr("insert", sql)) {
index = 0;
}
switch_sql_queue_manager_push(globals.qm, sql, index, !sql_already_dynamic);
if (sql_already_dynamic) {
*sqlp = NULL;
}
return SWITCH_STATUS_SUCCESS;
}
#if 0
static switch_status_t fifo_execute_sql(char *sql, switch_mutex_t *mutex)
{
switch_cache_db_handle_t *dbh = NULL;
@ -771,6 +798,7 @@ static switch_status_t fifo_execute_sql(char *sql, switch_mutex_t *mutex)
return status;
}
#endif
static switch_bool_t fifo_execute_sql_callback(switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata)
{
@ -937,9 +965,7 @@ static void do_unbridge(switch_core_session_t *consumer_session, switch_core_ses
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
sql = switch_mprintf("delete from fifo_bridge where consumer_uuid='%q'", switch_core_session_get_uuid(consumer_session));
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
switch_channel_set_variable(consumer_channel, "fifo_status", "WAITING");
@ -1025,8 +1051,7 @@ static switch_status_t messagehook (switch_core_session_t *session, switch_core_
switch_str_nil(msg->string_array_arg[0]),
switch_str_nil(msg->string_array_arg[1]),
switch_core_session_get_uuid(session));
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
goto end;
default:
goto end;
@ -1124,8 +1149,7 @@ static switch_status_t messagehook (switch_core_session_t *session, switch_core_
);
}
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
epoch_start = (long)switch_epoch_time_now(NULL);
@ -1381,8 +1405,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
struct call_helper *h = cbh->rows[i];
char *sql = switch_mprintf("update fifo_outbound set ring_count=ring_count+1 where uuid='%s'", h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
@ -1424,8 +1447,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
struct call_helper *h = cbh->rows[i];
char *sql = switch_mprintf("update fifo_outbound set ring_count=ring_count-1 "
"where uuid='%q' and ring_count > 0", h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
}
@ -1439,8 +1461,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
"outbound_fail_total_count = outbound_fail_total_count+1, "
"next_avail=%ld + lag + 1 where uuid='%q' and ring_count > 0",
(long) switch_epoch_time_now(NULL), h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
}
@ -1497,8 +1518,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
for (i = 0; i < cbh->rowcount; i++) {
struct call_helper *h = cbh->rows[i];
char *sql = switch_mprintf("update fifo_outbound set ring_count=ring_count-1 where uuid='%q' and ring_count > 0", h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
end:
@ -1608,8 +1628,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
sql = switch_mprintf("update fifo_outbound set ring_count=ring_count+1 where uuid='%s'", h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
status = switch_ivr_originate(NULL, &session, &cause, originate_string, h->timeout, NULL, NULL, NULL, NULL, ovars, SOF_NONE, NULL);
free(originate_string);
@ -1619,8 +1638,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
sql = switch_mprintf("update fifo_outbound set ring_count=ring_count-1, "
"outbound_fail_count=outbound_fail_count+1, next_avail=%ld + lag + 1 where uuid='%q'",
(long) switch_epoch_time_now(NULL), h->uuid);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", node->name);
@ -2123,15 +2141,12 @@ static void dec_use_count(switch_core_session_t *session, switch_bool_t send_eve
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);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
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);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
if (send_event) {
@ -2198,9 +2213,7 @@ SWITCH_STANDARD_APP(fifo_track_call_function)
sql = switch_mprintf("update fifo_outbound set stop_time=0,start_time=%ld,outbound_fail_count=0,use_count=use_count+1,%s=%s+1,%s=%s+1 where uuid='%q'",
(long) switch_epoch_time_now(NULL), col1, col1, col2, col2, data);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
@ -2235,8 +2248,7 @@ static void fifo_caller_add(fifo_node_t *node, switch_core_session_t *session)
switch_str_nil(switch_channel_get_variable(channel, "caller_id_number")),
switch_epoch_time_now(NULL));
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
}
static void fifo_caller_del(const char *uuid)
@ -2249,8 +2261,7 @@ static void fifo_caller_del(const char *uuid)
sql = switch_mprintf("delete from fifo_callers");
}
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
}
@ -3018,8 +3029,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_epoch_time_now(NULL), outbound_id);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
add_bridge_call(switch_core_session_get_uuid(other_session));
@ -3038,8 +3048,7 @@ SWITCH_STANDARD_APP(fifo_function)
);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(other_session));
@ -3055,8 +3064,7 @@ SWITCH_STANDARD_APP(fifo_function)
"outbound_call_count=outbound_call_count+1, next_avail=%ld + lag + 1 where uuid='%s' and use_count > 0",
now, now, outbound_id);
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
del_bridge_call(outbound_id);
@ -3088,8 +3096,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_set_variable_printf(other_channel, "fifo_bridge_seconds", "%d", epoch_end - epoch_start);
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);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
switch_core_media_bug_pause(session);
@ -4009,6 +4016,14 @@ static switch_status_t load_config(int reload, int del_all)
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
}
} else if (!strcasecmp(var, "db-pre-trans-execute") && !zstr(val)) {
globals.pre_trans_execute = switch_core_strdup(globals.pool, val);
} else if (!strcasecmp(var, "db-post-trans-execute") && !zstr(val)) {
globals.post_trans_execute = switch_core_strdup(globals.pool, val);
} else if (!strcasecmp(var, "db-inner-pre-trans-execute") && !zstr(val)) {
globals.inner_pre_trans_execute = switch_core_strdup(globals.pool, val);
} else if (!strcasecmp(var, "db-inner-post-trans-execute") && !zstr(val)) {
globals.inner_post_trans_execute = switch_core_strdup(globals.pool, val);
} else if (!strcasecmp(var, "delete-all-outbound-member-on-startup")) {
delete_all_outbound_member_on_startup = switch_true(val);
}
@ -4019,6 +4034,18 @@ static switch_status_t load_config(int reload, int del_all)
globals.dbname = "fifo";
}
switch_sql_queue_manager_init_name("fifo",
&globals.qm,
2,
globals.odbc_dsn ? globals.odbc_dsn : globals.dbname,
SWITCH_MAX_TRANS,
globals.pre_trans_execute,
globals.post_trans_execute,
globals.inner_pre_trans_execute,
globals.inner_post_trans_execute);
switch_sql_queue_manager_start(globals.qm);
if (!(dbh = fifo_get_db_handle())) {
@ -4036,8 +4063,8 @@ static switch_status_t load_config(int reload, int del_all)
switch_cache_db_release_db_handle(&dbh);
if (!reload) {
fifo_execute_sql("update fifo_outbound set start_time=0,stop_time=0,ring_count=0,use_count=0,"
"outbound_call_count=0,outbound_fail_count=0 where static=0", globals.sql_mutex);
char *sql= "update fifo_outbound set start_time=0,stop_time=0,ring_count=0,use_count=0,outbound_call_count=0,outbound_fail_count=0 where static=0";
fifo_execute_sql_queued(&sql, SWITCH_FALSE, SWITCH_TRUE);
}
if (reload) {
@ -4060,8 +4087,7 @@ static switch_status_t load_config(int reload, int del_all)
sql = switch_mprintf("delete from fifo_outbound where static=1 and hostname='%q'", globals.hostname);
}
fifo_execute_sql(sql, globals.sql_mutex);
switch_safe_free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
if (!(node = switch_core_hash_find(globals.fifo_hash, MANUAL_QUEUE_NAME))) {
node = create_node(MANUAL_QUEUE_NAME, 0, globals.sql_mutex);
@ -4214,8 +4240,7 @@ static switch_status_t load_config(int reload, int del_all)
(long) switch_epoch_time_now(NULL));
switch_assert(sql);
fifo_execute_sql(sql, globals.sql_mutex);
free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
free(name_dup);
node->has_outbound = 1;
node->member_count++;
@ -4270,8 +4295,7 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q'", fifo_name, digest);
switch_assert(sql);
fifo_execute_sql(sql, globals.sql_mutex);
free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
switch_mutex_lock(globals.mutex);
@ -4293,8 +4317,7 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
digest, fifo_name, originate_string, simo_count, 0, timeout, lag, 0, (long) expires, globals.hostname, taking_calls,
(long)switch_epoch_time_now(NULL));
switch_assert(sql);
fifo_execute_sql(sql, globals.sql_mutex);
free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
free(name_dup);
cbt.buf = outbound_count;
@ -4329,8 +4352,7 @@ static void fifo_member_del(char *fifo_name, char *originate_string)
sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q' and hostname='%q'", fifo_name, digest, globals.hostname);
switch_assert(sql);
fifo_execute_sql(sql, globals.sql_mutex);
free(sql);
fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
switch_mutex_lock(globals.mutex);
if (!(node = switch_core_hash_find(globals.fifo_hash, fifo_name))) {

View File

@ -43,6 +43,8 @@ static void event_handler(switch_event_t *event)
{
const char *dest_proto = switch_event_get_header(event, "dest_proto");
const char *check_failure = switch_event_get_header(event, "Delivery-Failure");
const char *check_nonblocking = switch_event_get_header(event, "Nonblocking-Delivery");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "skip_global_process", "true");
if (switch_true(check_failure)) {
@ -54,6 +56,9 @@ static void event_handler(switch_event_t *event)
} else if ( check_failure && switch_false(check_failure) ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SMS Delivery Success\n");
return;
} else if ( check_nonblocking && switch_true(check_nonblocking) ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SMS Delivery assumed successful due to being sent in non-blocking manner\n");
return;
}
switch_core_chat_send(dest_proto, event);

View File

@ -328,7 +328,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_snapshot_load)
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_API(api_interface, "uuid_snapshot", "Snapshot API", snapshot_function, SNAP_API_SYNTAX);
SWITCH_ADD_APP(app_interface, "snapshot", "", "", snapshot_app_function, SNAP_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "snapshot", "", "", snapshot_app_function, SNAP_SYNTAX, SAF_MEDIA_TAP);
switch_console_set_complete("add uuid_snapshot ::console::list_uuid");
/* indicate that the module should continue to be loaded */

View File

@ -1097,8 +1097,9 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
if (sofia_test_flag(tech_pvt, TFLAG_SIMPLIFY) && sofia_test_flag(tech_pvt, TFLAG_GOT_ACK)) {
sofia_glue_tech_simplify(tech_pvt);
sofia_clear_flag(tech_pvt, TFLAG_SIMPLIFY);
if (sofia_glue_tech_simplify(tech_pvt)) {
sofia_clear_flag(tech_pvt, TFLAG_SIMPLIFY);
}
}
while (sofia_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) {
@ -1565,7 +1566,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (switch_core_session_in_thread(session)) {
de->session = session;
}
sofia_process_dispatch_event(&de);
if (de->data->e_event == nua_i_cancel || de->data->e_event == nua_i_bye) {
sofia_set_flag(tech_pvt, TFLAG_SIGDEAD);
}
if (!sofia_test_flag(tech_pvt, TFLAG_SIGDEAD) && (switch_channel_media_up(channel) || switch_channel_get_state(channel) > CS_ROUTING)) {
sofia_queue_message(de);
} else {
sofia_process_dispatch_event(&de);
}
switch_mutex_unlock(tech_pvt->sofia_mutex);
goto end;
}
@ -1704,7 +1715,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, NULL);
sofia_set_flag(tech_pvt, TFLAG_SIMPLIFY);
if (switch_true(switch_channel_get_variable(tech_pvt->channel, "sip_auto_simplify"))) {
sofia_set_flag(tech_pvt, TFLAG_SIMPLIFY);
}
if (switch_rtp_ready(tech_pvt->rtp_session)) {
@ -2393,7 +2406,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)),
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("aastra", ua)))) {
} else if ((ua && (switch_stristr("aastra", ua) && !switch_stristr("Intelligate", 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);

View File

@ -353,6 +353,7 @@ typedef enum {
TFLAG_PASS_ACK,
TFLAG_CRYPTO_RECOVER,
TFLAG_DROP_DTMF,
TFLAG_SIGDEAD,
/* No new flags below this line */
TFLAG_MAX
} TFLAGS;
@ -859,6 +860,9 @@ struct callback_t {
switch_size_t len;
switch_console_callback_match_t *list;
int matches;
time_t time;
const char *contact_str;
long exptime;
};
typedef enum {
@ -1187,9 +1191,9 @@ uint32_t sofia_reg_reg_count(sofia_profile_t *profile, const char *user, const c
void sofia_glue_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session);
switch_t38_options_t *sofia_glue_extract_t38_options(switch_core_session_t *session, const char *r_sdp);
char *sofia_glue_get_multipart(switch_core_session_t *session, const char *prefix, const char *sdp, char **mp_type);
void sofia_glue_tech_simplify(private_object_t *tech_pvt);
int 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_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_multi(sofia_profile_t *profile, const char *user, const char *host);
switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_multi(sofia_profile_t *profile, const char *user, const char *host, time_t reg_time, const char *contact_str, long exptime);
switch_bool_t sofia_glue_profile_exists(const char *key);
void sofia_glue_global_siptrace(switch_bool_t on);
void sofia_glue_global_capture(switch_bool_t on);
@ -1202,6 +1206,7 @@ void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on);
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep);
void sofia_process_dispatch_event_in_thread(sofia_dispatch_event_t **dep);
char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool);
void sofia_presence_check_subscriptions(sofia_profile_t *profile, time_t now);
void sofia_msg_thread_start(int idx);
@ -1212,6 +1217,7 @@ private_object_t *sofia_glue_new_pvt(switch_core_session_t *session);
switch_status_t sofia_init(void);
void sofia_glue_fire_events(sofia_profile_t *profile);
void sofia_event_fire(sofia_profile_t *profile, switch_event_t **event);
void sofia_queue_message(sofia_dispatch_event_t *de);
/* For Emacs:
* Local Variables:

View File

@ -1686,7 +1686,7 @@ void sofia_msg_thread_start(int idx)
}
//static int foo = 0;
static void sofia_queue_message(sofia_dispatch_event_t *de)
void sofia_queue_message(sofia_dispatch_event_t *de)
{
int launch = 0;
@ -4781,10 +4781,11 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu
gateway->ping = switch_epoch_time_now(NULL) + gateway->ping_freq;
sofia_reg_release_gateway(gateway);
gateway->pinging = 0;
} else if (sofia_test_pflag(profile, PFLAG_UNREG_OPTIONS_FAIL) && (status != 200 && status != 486) && sip && sip->sip_to) {
} else if (sofia_test_pflag(profile, PFLAG_UNREG_OPTIONS_FAIL) && (status != 200 && status != 486) &&
sip && sip->sip_to && sip->sip_call_id && sip->sip_call_id->i_id && strchr(sip->sip_call_id->i_id, '_')) {
char *sql;
time_t now = switch_epoch_time_now(NULL);
const char *call_id = sip->sip_call_id->i_id;
const char *call_id = strchr(sip->sip_call_id->i_id, '_') + 1;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Expire registration '%s@%s' due to options failure\n",
sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host);

View File

@ -3254,13 +3254,11 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
}
if (!sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
if (switch_rtp_ready(tech_pvt->rtp_session)) {
if (sofia_test_flag(tech_pvt, TFLAG_VIDEO) && !switch_rtp_ready(tech_pvt->video_rtp_session)) {
goto video;
} else {
goto end;
}
if (!sofia_test_flag(tech_pvt, TFLAG_REINVITE) && !sofia_test_flag(tech_pvt, TFLAG_SDP) && switch_rtp_ready(tech_pvt->rtp_session)) {
if (sofia_test_flag(tech_pvt, TFLAG_VIDEO) && !switch_rtp_ready(tech_pvt->video_rtp_session)) {
goto video;
} else {
goto end;
}
}
@ -6787,21 +6785,19 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
}
void sofia_glue_tech_simplify(private_object_t *tech_pvt)
int sofia_glue_tech_simplify(private_object_t *tech_pvt)
{
const char *uuid, *network_addr_a = NULL, *network_addr_b = NULL, *simplify, *simplify_other_channel;
switch_channel_t *other_channel = NULL, *inbound_channel = NULL;
switch_core_session_t *other_session = NULL, *inbound_session = NULL;
uint8_t did_simplify = 0;
int r = 0;
if (!switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) || switch_channel_test_flag(tech_pvt->channel, CF_SIMPLIFY)) {
return;
goto end;
}
if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel))
&& (other_session = switch_core_session_locate(uuid))) {
if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel)) && (other_session = switch_core_session_locate(uuid))) {
other_channel = switch_core_session_get_channel(other_session);
@ -6809,6 +6805,8 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt)
simplify = switch_channel_get_variable(tech_pvt->channel, "sip_auto_simplify");
simplify_other_channel = switch_channel_get_variable(other_channel, "sip_auto_simplify");
r = 1;
if (switch_true(simplify) && !switch_channel_test_flag(tech_pvt->channel, CF_BRIDGE_ORIGINATOR)) {
network_addr_a = switch_channel_get_variable(tech_pvt->channel, "network_addr");
network_addr_b = switch_channel_get_variable(other_channel, "network_addr");
@ -6853,6 +6851,11 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt)
switch_core_session_rwunlock(other_session);
}
end:
return r;
}
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on)

View File

@ -939,6 +939,17 @@ static void send_conference_data(sofia_profile_t *profile, switch_event_t *event
}
if (call_id) {
if (switch_true(final)) {
sql = switch_mprintf("update sip_subscriptions set expires=%ld where "
"hostname='%q' and profile_name='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q' "
"and call_id = '%q' ",
(long)0,
mod_sofia_globals.hostname, profile->name,
from_user, from_host, event_str, call_id);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
sql = switch_mprintf("select full_to, full_from, contact %q ';_;isfocus', expires, call_id, event, network_ip, network_port, "
"'%q' as ct,'%q' as pt "
" from sip_subscriptions where "
@ -950,6 +961,16 @@ static void send_conference_data(sofia_profile_t *profile, switch_event_t *event
mod_sofia_globals.hostname, profile->name,
from_user, from_host, event_str, call_id);
} else {
if (switch_true(final)) {
sql = switch_mprintf("update sip_subscriptions set expires=%ld where "
"hostname='%q' and profile_name='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q'",
(long)0,
mod_sofia_globals.hostname, profile->name,
from_user, from_host, event_str);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
sql = switch_mprintf("select full_to, full_from, contact %q ';_;isfocus', expires, call_id, event, network_ip, network_port, "
"'%q' as ct,'%q' as pt "
" from sip_subscriptions where "

View File

@ -524,7 +524,11 @@ int sofia_reg_find_reg_with_positive_expires_callback(void *pArg, int argc, char
long int expires;
char *contact = NULL;
expires = atol(argv[1]) - 60 - (long) switch_epoch_time_now(NULL);
if (argv[0] && cbt->contact_str && !strcasecmp(argv[0], cbt->contact_str)) {
expires = cbt->exptime;
} else {
expires = atol(argv[1]) - 60 - (long) cbt->time;
}
if (expires > 0) {
dst = sofia_glue_get_destination(argv[0]);
@ -553,16 +557,23 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames
{
sofia_profile_t *profile = (sofia_profile_t *) pArg;
nua_handle_t *nh;
char to[512] = "";
char to[512] = "", call_id[512] = "";
sofia_destination_t *dst = NULL;
switch_uuid_t uuid;
switch_snprintf(to, sizeof(to), "sip:%s@%s", argv[1], argv[2]);
// create call-id for OPTIONS in the form "<uuid>_<original-register-call-id>"
switch_uuid_get(&uuid);
switch_uuid_format(call_id, &uuid);
strcat(call_id, "_");
strncat(call_id, argv[0], sizeof(call_id) - SWITCH_UUID_FORMATTED_LENGTH - 2);
dst = sofia_glue_get_destination(argv[3]);
switch_assert(dst);
nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(dst->contact), SIPTAG_CONTACT_STR(profile->url),
SIPTAG_CALL_ID_STR(argv[0]), TAG_END());
SIPTAG_CALL_ID_STR(call_id), TAG_END());
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
nua_options(nh,
NTATAG_SIP_T2(5000),
@ -929,7 +940,7 @@ switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *p
}
switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_multi(sofia_profile_t *profile, const char *user, const char *host)
switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_multi(sofia_profile_t *profile, const char *user, const char *host, time_t reg_time, const char *contact_str, long exptime)
{
struct callback_t cbt = { 0 };
char *sql;
@ -946,6 +957,10 @@ switch_console_callback_match_t *sofia_reg_find_reg_url_with_positive_expires_mu
sql = switch_mprintf("select contact,expires from sip_registrations where sip_user='%q'", user);
}
cbt.time = reg_time;
cbt.contact_str = contact_str;
cbt.exptime = exptime;
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_find_reg_with_positive_expires_callback, &cbt);
free(sql);
@ -1010,6 +1025,7 @@ static int debounce_check(sofia_profile_t *profile, const char *user, const char
snprintf(key, sizeof(key), "%s%s", user, host);
switch_mutex_lock(profile->ireg_mutex);
if ((last = switch_core_hash_find(profile->mwi_debounce_hash, key))) {
if (now - *last > 30) {
*last = now;
@ -1021,6 +1037,7 @@ static int debounce_check(sofia_profile_t *profile, const char *user, const char
switch_core_hash_insert(profile->mwi_debounce_hash, key, last);
r = 1;
}
switch_mutex_unlock(profile->ireg_mutex);
return r;
}
@ -1074,6 +1091,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
int send_pres = 0;
int is_tls = 0, is_tcp = 0;
char expbuf[35] = "";
time_t reg_time = switch_epoch_time_now(NULL);
if (v_event && *v_event) pres_on_reg = switch_event_get_header(*v_event, "send-presence-on-register");
@ -1576,7 +1595,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
contact = sofia_glue_get_url_from_contact(contact_str, 1);
url = switch_mprintf("sofia/%q/sip:%q", profile->name, sofia_glue_strip_proto(contact));
switch_core_add_registration(to_user, reg_host, call_id, url, (long) switch_epoch_time_now(NULL) + (long) exptime + 60,
switch_core_add_registration(to_user, reg_host, call_id, url, (long) reg_time + (long) exptime + 60,
network_ip, network_port_c, is_tls ? "tls" : is_tcp ? "tcp" : "udp", reg_meta);
switch_safe_free(url);
@ -1589,7 +1608,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
"mwi_user,mwi_host, orig_server_host, orig_hostname, sub_host) "
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q','%q')",
call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : "",
contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime + 60,
contact_str, reg_desc, rpid, (long) reg_time + (long) exptime + 60,
agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm,
mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname, sub_host);
} else {
@ -1601,7 +1620,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sub_host, network_ip, network_port_c,
profile->presence_hosts ? profile->presence_hosts : "", guess_ip4, guess_ip4,
mod_sofia_globals.hostname, mod_sofia_globals.hostname,
(long) switch_epoch_time_now(NULL) + (long) exptime + 60,
(long) reg_time + (long) exptime + 60,
to_user, username, reg_host, contact_str);
}
@ -1793,7 +1812,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
TAG_IF(!zstr(expbuf), SIPTAG_EXPIRES_STR(expbuf)),
NUTAG_WITH_THIS_MSG(de->data->e_msg), SIPTAG_DATE_STR(date), TAG_END());
} else if ((contact_list = sofia_reg_find_reg_url_with_positive_expires_multi(profile, from_user, reg_host))) {
} else if ((contact_list = sofia_reg_find_reg_url_with_positive_expires_multi(profile, from_user, reg_host, reg_time, contact_str, exptime))) {
/* all + 1 tag_i elements initialized as NULL - last one implies TAG_END() */
switch_zmalloc(contact_tags, sizeof(*contact_tags) * (contact_list->count + 1));
i = 0;
@ -2357,7 +2376,6 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
if (zstr(np)) {
nonce_cb_t cb = { 0 };
long nc_long = 0;
int sanity = 0;
first = 1;
@ -2373,13 +2391,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
switch_assert(sql != NULL);
do {
if (sanity) {
switch_yield(100000 * sanity);
}
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_nonce_callback, &cb);
} while(nc_long < 2 && ++sanity < 10 && zstr(np));
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_reg_nonce_callback, &cb);
free(sql);
//if (!sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, np, nplen)) {

View File

@ -177,7 +177,7 @@ public class CoreSession {
return freeswitchJNI.CoreSession_recordFile(swigCPtr, this, file_name, time_limit, silence_threshold, silence_hits);
}
public int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
protected int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
return freeswitchJNI.CoreSession_originate(swigCPtr, this, CoreSession.getCPtr(a_leg_session), a_leg_session, dest, timeout, SWIGTYPE_p_switch_state_handler_table_t.getCPtr(handlers));
}

View File

@ -69,4 +69,8 @@ public class JavaSession extends CoreSession {
return new SWIGTYPE_p_switch_status_t(freeswitchJNI.JavaSession_run_dtmf_callback(swigCPtr, this, SWIGTYPE_p_void.getCPtr(input), SWIGTYPE_p_switch_input_type_t.getCPtr(itype)), true);
}
public int originate(JavaSession aleg, String destination, int timeout) {
return freeswitchJNI.JavaSession_originate(swigCPtr, this, JavaSession.getCPtr(aleg), aleg, destination, timeout);
}
}

View File

@ -25,6 +25,10 @@ public class freeswitch {
freeswitchJNI.consoleCleanLog(msg);
}
public static boolean running() {
return freeswitchJNI.running();
}
public static boolean email(String to, String from, String headers, String body, String file, String convert_cmd, String convert_ext) {
return freeswitchJNI.email(to, from, headers, body, file, convert_cmd, convert_ext);
}
@ -62,4 +66,8 @@ public class freeswitch {
return (cPtr == 0) ? null : new SWIGTYPE_p_JavaVM(cPtr, false);
}
public static void setOriginateStateHandler(org.freeswitch.StateHandler stateHandler) throws java.util.TooManyListenersException {
freeswitchJNI.setOriginateStateHandler(stateHandler);
}
}

View File

@ -13,6 +13,7 @@ class freeswitchJNI {
public final static native String getGlobalVariable(String jarg1);
public final static native void consoleLog(String jarg1, String jarg2);
public final static native void consoleCleanLog(String jarg1);
public final static native boolean running();
public final static native boolean email(String jarg1, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7);
public final static native long new_IVRMenu(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10, int jarg11, int jarg12, int jarg13, int jarg14, int jarg15, int jarg16);
public final static native void delete_IVRMenu(long jarg1);
@ -162,6 +163,7 @@ class freeswitchJNI {
public final static native long dtmf_callback(long jarg1, long jarg2, long jarg3, long jarg4, long jarg5);
public final static native void javaVM_set(long jarg1);
public final static native long javaVM_get();
public final static native void setOriginateStateHandler(org.freeswitch.StateHandler jarg1) throws java.util.TooManyListenersException;
public final static native long new_JavaSession__SWIG_0();
public final static native long new_JavaSession__SWIG_1(String jarg1);
public final static native long new_JavaSession__SWIG_2(long jarg1);
@ -172,5 +174,6 @@ class freeswitchJNI {
public final static native void JavaSession_setHangupHook(long jarg1, JavaSession jarg1_, org.freeswitch.HangupHook jarg2);
public final static native void JavaSession_check_hangup_hook(long jarg1, JavaSession jarg1_);
public final static native long JavaSession_run_dtmf_callback(long jarg1, JavaSession jarg1_, long jarg2, long jarg3);
public final static native int JavaSession_originate(long jarg1, JavaSession jarg1_, long jarg2, JavaSession jarg2_, String jarg3, int jarg4);
public final static native long SWIGJavaSessionUpcast(long jarg1);
}

View File

@ -199,6 +199,7 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
#include "switch.h"
#include "switch_cpp.h"
#include "freeswitch_java.h"
@ -286,6 +287,18 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_consoleCleanLog(J
}
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_running(JNIEnv *jenv, jclass jcls) {
jboolean jresult = 0 ;
bool result;
(void)jenv;
(void)jcls;
result = (bool)running();
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_email(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7) {
jboolean jresult = 0 ;
char *arg1 = (char *) 0 ;
@ -3176,6 +3189,16 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_javaVM_1get(JNIE
}
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_setOriginateStateHandler(JNIEnv *jenv, jclass jcls, jobject jarg1) {
jobject arg1 ;
(void)jenv;
(void)jcls;
arg1 = jarg1;
setOriginateStateHandler(arg1);
}
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1JavaSession_1_1SWIG_10(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
JavaSession *result = 0 ;
@ -3331,6 +3354,33 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1run
}
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1originate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jint jarg4) {
jint jresult = 0 ;
JavaSession *arg1 = (JavaSession *) 0 ;
JavaSession *arg2 = (JavaSession *) 0 ;
char *arg3 = (char *) 0 ;
int arg4 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(JavaSession **)&jarg1;
arg2 = *(JavaSession **)&jarg2;
arg3 = 0;
if (jarg3) {
arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3) return 0;
}
arg4 = (int)jarg4;
result = (int)(arg1)->originate(arg2,arg3,arg4);
jresult = (jint)result;
if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
return jresult;
}
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_SWIGJavaSessionUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
jlong baseptr = 0;
(void)jenv;

View File

@ -93,6 +93,7 @@ class Dbh {
bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
bool query(char *sql, SWIGLUA_FN lua_fun);
int affected_rows();
int load_extension(const char *extension);
};
}

View File

@ -438,3 +438,11 @@ int Dbh::affected_rows()
}
return 0;
}
int Dbh::load_extension(const char *extension)
{
if (m_connected) {
return switch_cache_db_load_extension(dbh, extension);
}
return 0;
}

View File

@ -65,6 +65,7 @@ namespace LUA {
bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
bool query(char *sql, SWIGLUA_FN lua_fun);
int affected_rows();
int load_extension(const char *extension);
};
}
#endif

View File

@ -1627,6 +1627,24 @@ fail:
}
static int _wrap_running(lua_State* L) {
int SWIG_arg = -1;
bool result;
SWIG_check_num_args("running",0,0)
result = (bool)running();
SWIG_arg=0;
lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_email(lua_State* L) {
int SWIG_arg = -1;
char *arg1 = (char *) 0 ;
@ -7746,6 +7764,34 @@ fail:
}
static int _wrap_Dbh_load_extension(lua_State* L) {
int SWIG_arg = -1;
LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
char *arg2 = (char *) 0 ;
int result;
SWIG_check_num_args("load_extension",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("load_extension",1,"LUA::Dbh *");
if(!lua_isstring(L,2)) SWIG_fail_arg("load_extension",2,"char const *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
SWIG_fail_ptr("Dbh_load_extension",1,SWIGTYPE_p_LUA__Dbh);
}
arg2 = (char *)lua_tostring(L, 2);
result = (int)(arg1)->load_extension((char const *)arg2);
SWIG_arg=0;
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static void swig_delete_Dbh(void *obj) {
LUA::Dbh *arg1 = (LUA::Dbh *) obj;
delete arg1;
@ -7756,6 +7802,7 @@ static swig_lua_method swig_LUA_Dbh_methods[] = {
{"test_reactive", _wrap_Dbh_test_reactive},
{"query", _wrap_Dbh_query},
{"affected_rows", _wrap_Dbh_affected_rows},
{"load_extension", _wrap_Dbh_load_extension},
{0,0}
};
static swig_lua_attribute swig_LUA_Dbh_attributes[] = {
@ -7774,6 +7821,7 @@ static const struct luaL_reg swig_commands[] = {
{ "getGlobalVariable", _wrap_getGlobalVariable},
{ "consoleLog", _wrap_consoleLog},
{ "consoleCleanLog", _wrap_consoleCleanLog},
{ "running", _wrap_running},
{ "email", _wrap_email},
{ "console_log", _wrap_console_log},
{ "console_clean_log", _wrap_console_clean_log},

View File

@ -1267,6 +1267,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VA
}
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE_get() {
char * jresult ;
char *result = 0 ;
result = (char *) "execute_on_pre_originate";
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE_get() {
char * jresult ;
char *result = 0 ;
@ -1344,6 +1355,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIAB
}
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE_get() {
char * jresult ;
char *result = 0 ;
result = (char *) "api_on_pre_originate";
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CALL_TIMEOUT_VARIABLE_get() {
char * jresult ;
char *result = 0 ;
@ -1982,6 +2004,17 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_DTMF_LOG_LEN_get() {
}
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_MAX_TRANS_get() {
int jresult ;
int result;
result = (int) 2000;
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_dtmf_t_digit_set(void * jarg1, char jarg2) {
switch_dtmf_t *arg1 = (switch_dtmf_t *) 0 ;
char arg2 ;
@ -2801,6 +2834,36 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_sounds_dir_get(void * ja
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_lib_dir_set(void * jarg1, char * jarg2) {
switch_directories *arg1 = (switch_directories *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_directories *)jarg1;
arg2 = (char *)jarg2;
{
if (arg1->lib_dir) delete [] arg1->lib_dir;
if (arg2) {
arg1->lib_dir = (char *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->lib_dir, (const char *)arg2);
} else {
arg1->lib_dir = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_lib_dir_get(void * jarg1) {
char * jresult ;
switch_directories *arg1 = (switch_directories *) 0 ;
char *result = 0 ;
arg1 = (switch_directories *)jarg1;
result = (char *) ((arg1)->lib_dir);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_directories() {
void * jresult ;
switch_directories *result = 0 ;
@ -5381,6 +5444,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_changes(void * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_load_extension(void * jarg1, char * jarg2) {
int jresult ;
switch_core_db_t *arg1 = (switch_core_db_t *) 0 ;
char *arg2 = (char *) 0 ;
int result;
arg1 = (switch_core_db_t *)jarg1;
arg2 = (char *)jarg2;
result = (int)switch_core_db_load_extension(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_CORE_DB_OK_get() {
int jresult ;
int result;
@ -8237,6 +8314,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_get_channel(void * jarg
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_get_mutex(void * jarg1) {
void * jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
switch_mutex_t *result = 0 ;
arg1 = (switch_core_session_t *)jarg1;
result = (switch_mutex_t *)switch_core_session_get_mutex(arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_wake_session_thread(void * jarg1) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
@ -8535,15 +8624,21 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_hupall(int jarg1) {
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_hupall_matching_var(char * jarg1, char * jarg2, int jarg3) {
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_session_hupall_matching_var_ans(char * jarg1, char * jarg2, int jarg3, int jarg4) {
unsigned long jresult ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
switch_call_cause_t arg3 ;
switch_hup_type_t arg4 ;
uint32_t result;
arg1 = (char *)jarg1;
arg2 = (char *)jarg2;
arg3 = (switch_call_cause_t)jarg3;
switch_core_session_hupall_matching_var((char const *)arg1,(char const *)arg2,arg3);
arg4 = (switch_hup_type_t)jarg4;
result = (uint32_t)switch_core_session_hupall_matching_var_ans((char const *)arg1,(char const *)arg2,arg3,arg4);
jresult = (unsigned long)result;
return jresult;
}
@ -10712,6 +10807,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_ready() {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_running() {
int jresult ;
switch_bool_t result;
result = (switch_bool_t)switch_core_running();
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_ready_inbound() {
int jresult ;
switch_bool_t result;
@ -11390,13 +11495,13 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_preprocess_session(void * jarg1, ch
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_sqldb_stop_thread() {
switch_core_sqldb_stop_thread();
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_sqldb_pause() {
switch_core_sqldb_pause();
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_sqldb_start_thread() {
switch_core_sqldb_start_thread();
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_sqldb_resume() {
switch_core_sqldb_resume();
}
@ -11944,6 +12049,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_affected_rows(void * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_cache_db_load_extension(void * jarg1, char * jarg2) {
int jresult ;
switch_cache_db_handle_t *arg1 = (switch_cache_db_handle_t *) 0 ;
char *arg2 = (char *) 0 ;
int result;
arg1 = (switch_cache_db_handle_t *)jarg1;
arg2 = (char *)jarg2;
result = (int)switch_cache_db_load_extension(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_cache_db_status(void * jarg1) {
switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
@ -12324,6 +12443,20 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_recovery_flush(char * jarg1, char
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_sql_queue_manager_size(void * jarg1, unsigned long jarg2) {
int jresult ;
switch_sql_queue_manager_t *arg1 = (switch_sql_queue_manager_t *) 0 ;
uint32_t arg2 ;
int result;
arg1 = (switch_sql_queue_manager_t *)jarg1;
arg2 = (uint32_t)jarg2;
result = (int)switch_sql_queue_manager_size(arg1,arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_sql_queue_manager_push_confirm(void * jarg1, char * jarg2, unsigned long jarg3, int jarg4) {
int jresult ;
switch_sql_queue_manager_t *arg1 = (switch_sql_queue_manager_t *) 0 ;
@ -12372,27 +12505,29 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_sql_queue_manager_destroy(void * jarg1)
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_sql_queue_manager_init_name(char * jarg1, void * jarg2, unsigned long jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7, char * jarg8) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_sql_queue_manager_init_name(char * jarg1, void * jarg2, unsigned long jarg3, char * jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_sql_queue_manager_t **arg2 = (switch_sql_queue_manager_t **) 0 ;
uint32_t arg3 ;
char *arg4 = (char *) 0 ;
char *arg5 = (char *) 0 ;
uint32_t arg5 ;
char *arg6 = (char *) 0 ;
char *arg7 = (char *) 0 ;
char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (switch_sql_queue_manager_t **)jarg2;
arg3 = (uint32_t)jarg3;
arg4 = (char *)jarg4;
arg5 = (char *)jarg5;
arg5 = (uint32_t)jarg5;
arg6 = (char *)jarg6;
arg7 = (char *)jarg7;
arg8 = (char *)jarg8;
result = (switch_status_t)switch_sql_queue_manager_init_name((char const *)arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8);
arg9 = (char *)jarg9;
result = (switch_status_t)switch_sql_queue_manager_init_name((char const *)arg1,arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9);
jresult = result;
return jresult;
}
@ -23976,6 +24111,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_session_get(void * jarg1) {
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_codec_cur_frame_set(void * jarg1, void * jarg2) {
switch_codec *arg1 = (switch_codec *) 0 ;
switch_frame_t *arg2 = (switch_frame_t *) 0 ;
arg1 = (switch_codec *)jarg1;
arg2 = (switch_frame_t *)jarg2;
if (arg1) (arg1)->cur_frame = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_codec_cur_frame_get(void * jarg1) {
void * jresult ;
switch_codec *arg1 = (switch_codec *) 0 ;
switch_frame_t *result = 0 ;
arg1 = (switch_codec *)jarg1;
result = (switch_frame_t *) ((arg1)->cur_frame);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_codec() {
void * jresult ;
switch_codec *result = 0 ;
@ -27217,6 +27375,42 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_has_dtmf(void * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_dtmf_lock(void * jarg1) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
switch_status_t result;
arg1 = (switch_channel_t *)jarg1;
result = (switch_status_t)switch_channel_dtmf_lock(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_try_dtmf_lock(void * jarg1) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
switch_status_t result;
arg1 = (switch_channel_t *)jarg1;
result = (switch_status_t)switch_channel_try_dtmf_lock(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_dtmf_unlock(void * jarg1) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
switch_status_t result;
arg1 = (switch_channel_t *)jarg1;
result = (switch_status_t)switch_channel_dtmf_unlock(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_queue_dtmf(void * jarg1, void * jarg2) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@ -27691,6 +27885,22 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_hold_record(void * jarg1
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_state_thread_lock(void * jarg1) {
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
arg1 = (switch_channel_t *)jarg1;
switch_channel_state_thread_lock(arg1);
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_state_thread_unlock(void * jarg1) {
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
arg1 = (switch_channel_t *)jarg1;
switch_channel_state_thread_unlock(arg1);
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_buffer_create(void * jarg1, void * jarg2, void * jarg3) {
int jresult ;
switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ;
@ -32155,6 +32365,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_uuid_exists(char * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_uuid_force_exists(char * jarg1) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_bool_t result;
arg1 = (char *)jarg1;
result = (switch_bool_t)switch_ivr_uuid_force_exists((char const *)arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_dmachine_last_ping(void * jarg1) {
int jresult ;
switch_ivr_dmachine_t *arg1 = (switch_ivr_dmachine_t *) 0 ;
@ -35117,15 +35339,17 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_xml_parse_section_string(char
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_std_datetime_check(void * jarg1, void * jarg2) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_xml_std_datetime_check(void * jarg1, void * jarg2, char * jarg3) {
int jresult ;
switch_xml_t arg1 = (switch_xml_t) 0 ;
int *arg2 = (int *) 0 ;
char *arg3 = (char *) 0 ;
int result;
arg1 = (switch_xml_t)jarg1;
arg2 = (int *)jarg2;
result = (int)switch_xml_std_datetime_check(arg1,arg2);
arg3 = (char *)jarg3;
result = (int)switch_xml_std_datetime_check(arg1,arg2,(char const *)arg3);
jresult = result;
return jresult;
}
@ -37107,6 +37331,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_consoleCleanLog(char * jarg1) {
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_running() {
unsigned int jresult ;
bool result;
result = (bool)running();
jresult = result;
return jresult;
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_email(char * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7) {
unsigned int jresult ;
char *arg1 = (char *) 0 ;

View File

@ -986,6 +986,11 @@ public class freeswitch {
return ret;
}
public static int switch_core_db_load_extension(SWIGTYPE_p_sqlite3 db, string extension) {
int ret = freeswitchPINVOKE.switch_core_db_load_extension(SWIGTYPE_p_sqlite3.getCPtr(db), extension);
return ret;
}
public static string switch_sql_concat() {
string ret = freeswitchPINVOKE.switch_sql_concat();
return ret;
@ -1473,6 +1478,12 @@ public class freeswitch {
return ret;
}
public static SWIGTYPE_p_switch_mutex_t switch_core_session_get_mutex(SWIGTYPE_p_switch_core_session session) {
IntPtr cPtr = freeswitchPINVOKE.switch_core_session_get_mutex(SWIGTYPE_p_switch_core_session.getCPtr(session));
SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
return ret;
}
public static switch_status_t switch_core_session_wake_session_thread(SWIGTYPE_p_switch_core_session session) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_wake_session_thread(SWIGTYPE_p_switch_core_session.getCPtr(session));
return ret;
@ -1594,8 +1605,9 @@ public class freeswitch {
freeswitchPINVOKE.switch_core_session_hupall((int)cause);
}
public static void switch_core_session_hupall_matching_var(string var_name, string var_val, switch_call_cause_t cause) {
freeswitchPINVOKE.switch_core_session_hupall_matching_var(var_name, var_val, (int)cause);
public static uint switch_core_session_hupall_matching_var_ans(string var_name, string var_val, switch_call_cause_t cause, switch_hup_type_t type) {
uint ret = freeswitchPINVOKE.switch_core_session_hupall_matching_var_ans(var_name, var_val, (int)cause, (int)type);
return ret;
}
public static switch_console_callback_match switch_core_session_findall_matching_var(string var_name, string var_val) {
@ -2344,6 +2356,11 @@ public class freeswitch {
return ret;
}
public static switch_bool_t switch_core_running() {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_running();
return ret;
}
public static switch_bool_t switch_core_ready_inbound() {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_ready_inbound();
return ret;
@ -2630,12 +2647,12 @@ public class freeswitch {
return ret;
}
public static void switch_core_sqldb_stop_thread() {
freeswitchPINVOKE.switch_core_sqldb_stop_thread();
public static void switch_core_sqldb_pause() {
freeswitchPINVOKE.switch_core_sqldb_pause();
}
public static void switch_core_sqldb_start_thread() {
freeswitchPINVOKE.switch_core_sqldb_start_thread();
public static void switch_core_sqldb_resume() {
freeswitchPINVOKE.switch_core_sqldb_resume();
}
public static string switch_cache_db_type_name(switch_cache_db_handle_type_t type) {
@ -2686,6 +2703,11 @@ public class freeswitch {
return ret;
}
public static int switch_cache_db_load_extension(SWIGTYPE_p_switch_cache_db_handle dbh, string extension) {
int ret = freeswitchPINVOKE.switch_cache_db_load_extension(SWIGTYPE_p_switch_cache_db_handle.getCPtr(dbh), extension);
return ret;
}
public static void switch_cache_db_status(switch_stream_handle stream) {
freeswitchPINVOKE.switch_cache_db_status(switch_stream_handle.getCPtr(stream));
}
@ -2830,6 +2852,11 @@ public class freeswitch {
freeswitchPINVOKE.switch_core_recovery_flush(technology, profile_name);
}
public static int switch_sql_queue_manager_size(SWIGTYPE_p_switch_sql_queue_manager qm, uint index) {
int ret = freeswitchPINVOKE.switch_sql_queue_manager_size(SWIGTYPE_p_switch_sql_queue_manager.getCPtr(qm), index);
return ret;
}
public static switch_status_t switch_sql_queue_manager_push_confirm(SWIGTYPE_p_switch_sql_queue_manager qm, string sql, uint pos, switch_bool_t dup) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_sql_queue_manager_push_confirm(SWIGTYPE_p_switch_sql_queue_manager.getCPtr(qm), sql, pos, (int)dup);
return ret;
@ -2845,8 +2872,8 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_sql_queue_manager_init_name(string name, SWIGTYPE_p_p_switch_sql_queue_manager qmp, uint numq, string dsn, string pre_trans_execute, string post_trans_execute, string inner_pre_trans_execute, string inner_post_trans_execute) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_sql_queue_manager_init_name(name, SWIGTYPE_p_p_switch_sql_queue_manager.getCPtr(qmp), numq, dsn, pre_trans_execute, post_trans_execute, inner_pre_trans_execute, inner_post_trans_execute);
public static switch_status_t switch_sql_queue_manager_init_name(string name, SWIGTYPE_p_p_switch_sql_queue_manager qmp, uint numq, string dsn, uint max_trans, string pre_trans_execute, string post_trans_execute, string inner_pre_trans_execute, string inner_post_trans_execute) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_sql_queue_manager_init_name(name, SWIGTYPE_p_p_switch_sql_queue_manager.getCPtr(qmp), numq, dsn, max_trans, pre_trans_execute, post_trans_execute, inner_pre_trans_execute, inner_post_trans_execute);
return ret;
}
@ -4103,6 +4130,21 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_channel_dtmf_lock(SWIGTYPE_p_switch_channel channel) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_dtmf_lock(SWIGTYPE_p_switch_channel.getCPtr(channel));
return ret;
}
public static switch_status_t switch_channel_try_dtmf_lock(SWIGTYPE_p_switch_channel channel) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_try_dtmf_lock(SWIGTYPE_p_switch_channel.getCPtr(channel));
return ret;
}
public static switch_status_t switch_channel_dtmf_unlock(SWIGTYPE_p_switch_channel channel) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_dtmf_unlock(SWIGTYPE_p_switch_channel.getCPtr(channel));
return ret;
}
public static switch_status_t switch_channel_queue_dtmf(SWIGTYPE_p_switch_channel channel, switch_dtmf_t dtmf) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_queue_dtmf(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_dtmf_t.getCPtr(dtmf));
return ret;
@ -4283,6 +4325,14 @@ public class freeswitch {
return ret;
}
public static void switch_channel_state_thread_lock(SWIGTYPE_p_switch_channel channel) {
freeswitchPINVOKE.switch_channel_state_thread_lock(SWIGTYPE_p_switch_channel.getCPtr(channel));
}
public static void switch_channel_state_thread_unlock(SWIGTYPE_p_switch_channel channel) {
freeswitchPINVOKE.switch_channel_state_thread_unlock(SWIGTYPE_p_switch_channel.getCPtr(channel));
}
public static switch_status_t switch_buffer_create(SWIGTYPE_p_apr_pool_t pool, SWIGTYPE_p_p_switch_buffer buffer, SWIGTYPE_p_switch_size_t max_len) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_buffer_create(SWIGTYPE_p_apr_pool_t.getCPtr(pool), SWIGTYPE_p_p_switch_buffer.getCPtr(buffer), SWIGTYPE_p_switch_size_t.getCPtr(max_len));
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
@ -5228,6 +5278,11 @@ public class freeswitch {
return ret;
}
public static switch_bool_t switch_ivr_uuid_force_exists(string uuid) {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_ivr_uuid_force_exists(uuid);
return ret;
}
public static switch_status_t switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine dmachine) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine.getCPtr(dmachine));
return ret;
@ -5984,8 +6039,8 @@ public class freeswitch {
return ret;
}
public static int switch_xml_std_datetime_check(switch_xml xcond, SWIGTYPE_p_int offset) {
int ret = freeswitchPINVOKE.switch_xml_std_datetime_check(switch_xml.getCPtr(xcond), SWIGTYPE_p_int.getCPtr(offset));
public static int switch_xml_std_datetime_check(switch_xml xcond, SWIGTYPE_p_int offset, string tzname) {
int ret = freeswitchPINVOKE.switch_xml_std_datetime_check(switch_xml.getCPtr(xcond), SWIGTYPE_p_int.getCPtr(offset), tzname);
return ret;
}
@ -6169,6 +6224,11 @@ public class freeswitch {
freeswitchPINVOKE.consoleCleanLog(msg);
}
public static bool running() {
bool ret = freeswitchPINVOKE.running();
return ret;
}
public static bool email(string to, string from, string headers, string body, string file, string convert_cmd, string convert_ext) {
bool ret = freeswitchPINVOKE.email(to, from, headers, body, file, convert_cmd, convert_ext);
return ret;
@ -6289,6 +6349,7 @@ public class freeswitch {
public static readonly string SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_PRE_ANSWER_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_PRE_ANSWER_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_MEDIA_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_MEDIA_VARIABLE_get();
@ -6296,6 +6357,7 @@ public class freeswitch {
public static readonly string SWITCH_CHANNEL_API_ON_TONE_DETECT_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_TONE_DETECT_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE_get();
public static readonly string SWITCH_CALL_TIMEOUT_VARIABLE = freeswitchPINVOKE.SWITCH_CALL_TIMEOUT_VARIABLE_get();
public static readonly string SWITCH_HOLDING_UUID_VARIABLE = freeswitchPINVOKE.SWITCH_HOLDING_UUID_VARIABLE_get();
public static readonly string SWITCH_SOFT_HOLDING_UUID_VARIABLE = freeswitchPINVOKE.SWITCH_SOFT_HOLDING_UUID_VARIABLE_get();
@ -6354,6 +6416,7 @@ public class freeswitch {
public static readonly int SWITCH_BITS_PER_BYTE = freeswitchPINVOKE.SWITCH_BITS_PER_BYTE_get();
public static readonly int SWITCH_DEFAULT_FILE_BUFFER_LEN = freeswitchPINVOKE.SWITCH_DEFAULT_FILE_BUFFER_LEN_get();
public static readonly int SWITCH_DTMF_LOG_LEN = freeswitchPINVOKE.SWITCH_DTMF_LOG_LEN_get();
public static readonly int SWITCH_MAX_TRANS = freeswitchPINVOKE.SWITCH_MAX_TRANS_get();
public static readonly int SWITCH_MAX_STACKS = freeswitchPINVOKE.SWITCH_MAX_STACKS_get();
public static readonly int SWITCH_THREAD_STACKSIZE = freeswitchPINVOKE.SWITCH_THREAD_STACKSIZE_get();
public static readonly int SWITCH_SYSTEM_THREAD_STACKSIZE = freeswitchPINVOKE.SWITCH_SYSTEM_THREAD_STACKSIZE_get();
@ -6868,6 +6931,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE_get")]
public static extern string SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE_get")]
public static extern string SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE_get")]
public static extern string SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE_get();
@ -6889,6 +6955,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE_get")]
public static extern string SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE_get")]
public static extern string SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CALL_TIMEOUT_VARIABLE_get")]
public static extern string SWITCH_CALL_TIMEOUT_VARIABLE_get();
@ -7063,6 +7132,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_DTMF_LOG_LEN_get")]
public static extern int SWITCH_DTMF_LOG_LEN_get();
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_MAX_TRANS_get")]
public static extern int SWITCH_MAX_TRANS_get();
[DllImport("mod_managed", EntryPoint="CSharp_switch_dtmf_t_digit_set")]
public static extern void switch_dtmf_t_digit_set(HandleRef jarg1, char jarg2);
@ -7255,6 +7327,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_sounds_dir_get")]
public static extern string switch_directories_sounds_dir_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_lib_dir_set")]
public static extern void switch_directories_lib_dir_set(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_lib_dir_get")]
public static extern string switch_directories_lib_dir_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_directories")]
public static extern IntPtr new_switch_directories();
@ -7900,6 +7978,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_changes")]
public static extern int switch_core_db_changes(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_load_extension")]
public static extern int switch_core_db_load_extension(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CORE_DB_OK_get")]
public static extern int SWITCH_CORE_DB_OK_get();
@ -8575,6 +8656,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_channel")]
public static extern IntPtr switch_core_session_get_channel(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_mutex")]
public static extern IntPtr switch_core_session_get_mutex(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_wake_session_thread")]
public static extern int switch_core_session_wake_session_thread(HandleRef jarg1);
@ -8650,8 +8734,8 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall")]
public static extern void switch_core_session_hupall(int jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall_matching_var")]
public static extern void switch_core_session_hupall_matching_var(string jarg1, string jarg2, int jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall_matching_var_ans")]
public static extern uint switch_core_session_hupall_matching_var_ans(string jarg1, string jarg2, int jarg3, int jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_findall_matching_var")]
public static extern IntPtr switch_core_session_findall_matching_var(string jarg1, string jarg2);
@ -9103,6 +9187,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_ready")]
public static extern int switch_core_ready();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_running")]
public static extern int switch_core_running();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_ready_inbound")]
public static extern int switch_core_ready_inbound();
@ -9280,11 +9367,11 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_preprocess_session")]
public static extern int switch_ivr_preprocess_session(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_sqldb_stop_thread")]
public static extern void switch_core_sqldb_stop_thread();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_sqldb_pause")]
public static extern void switch_core_sqldb_pause();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_sqldb_start_thread")]
public static extern void switch_core_sqldb_start_thread();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_sqldb_resume")]
public static extern void switch_core_sqldb_resume();
[DllImport("mod_managed", EntryPoint="CSharp_CACHE_DB_LEN_get")]
public static extern int CACHE_DB_LEN_get();
@ -9415,6 +9502,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_affected_rows")]
public static extern int switch_cache_db_affected_rows(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_load_extension")]
public static extern int switch_cache_db_load_extension(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_cache_db_status")]
public static extern void switch_cache_db_status(HandleRef jarg1);
@ -9508,6 +9598,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_recovery_flush")]
public static extern void switch_core_recovery_flush(string jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sql_queue_manager_size")]
public static extern int switch_sql_queue_manager_size(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sql_queue_manager_push_confirm")]
public static extern int switch_sql_queue_manager_push_confirm(HandleRef jarg1, string jarg2, uint jarg3, int jarg4);
@ -9518,7 +9611,7 @@ class freeswitchPINVOKE {
public static extern int switch_sql_queue_manager_destroy(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sql_queue_manager_init_name")]
public static extern int switch_sql_queue_manager_init_name(string jarg1, HandleRef jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, string jarg7, string jarg8);
public static extern int switch_sql_queue_manager_init_name(string jarg1, HandleRef jarg2, uint jarg3, string jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sql_queue_manager_start")]
public static extern int switch_sql_queue_manager_start(HandleRef jarg1);
@ -12313,6 +12406,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_session_get")]
public static extern IntPtr switch_codec_session_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_cur_frame_set")]
public static extern void switch_codec_cur_frame_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_codec_cur_frame_get")]
public static extern IntPtr switch_codec_cur_frame_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_codec")]
public static extern IntPtr new_switch_codec();
@ -13078,6 +13177,15 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_has_dtmf")]
public static extern IntPtr switch_channel_has_dtmf(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_dtmf_lock")]
public static extern int switch_channel_dtmf_lock(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_try_dtmf_lock")]
public static extern int switch_channel_try_dtmf_lock(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_dtmf_unlock")]
public static extern int switch_channel_dtmf_unlock(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_queue_dtmf")]
public static extern int switch_channel_queue_dtmf(HandleRef jarg1, HandleRef jarg2);
@ -13192,6 +13300,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_hold_record")]
public static extern IntPtr switch_channel_get_hold_record(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_state_thread_lock")]
public static extern void switch_channel_state_thread_lock(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_state_thread_unlock")]
public static extern void switch_channel_state_thread_unlock(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_buffer_create")]
public static extern int switch_buffer_create(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3);
@ -14101,6 +14215,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_uuid_exists")]
public static extern int switch_ivr_uuid_exists(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_uuid_force_exists")]
public static extern int switch_ivr_uuid_force_exists(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_dmachine_last_ping")]
public static extern int switch_ivr_dmachine_last_ping(HandleRef jarg1);
@ -14762,7 +14879,7 @@ class freeswitchPINVOKE {
public static extern uint switch_xml_parse_section_string(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_xml_std_datetime_check")]
public static extern int switch_xml_std_datetime_check(HandleRef jarg1, HandleRef jarg2);
public static extern int switch_xml_std_datetime_check(HandleRef jarg1, HandleRef jarg2, string jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_xml_locate_language")]
public static extern int switch_xml_locate_language(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5, HandleRef jarg6, string jarg7);
@ -15271,6 +15388,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_consoleCleanLog")]
public static extern void consoleCleanLog(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_running")]
public static extern bool running();
[DllImport("mod_managed", EntryPoint="CSharp_email")]
public static extern bool email(string jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7);
@ -21736,7 +21856,8 @@ namespace FreeSWITCH.Native {
SAF_SUPPORT_NOMEDIA = (1 << 0),
SAF_ROUTING_EXEC = (1 << 1),
SAF_MEDIA_TAP = (1 << 2),
SAF_ZOMBIE_EXEC = (1 << 3)
SAF_ZOMBIE_EXEC = (1 << 3),
SAF_NO_LOOPBACK = (1 << 4)
}
}
@ -24116,6 +24237,7 @@ public enum switch_channel_flag_t {
CF_OUTBOUND,
CF_EARLY_MEDIA,
CF_BRIDGE_ORIGINATOR,
CF_UUID_BRIDGE_ORIGINATOR,
CF_TRANSFER,
CF_ACCEPT_CNG,
CF_REDIRECT,
@ -24197,6 +24319,7 @@ public enum switch_channel_flag_t {
CF_NO_CDR,
CF_EARLY_OK,
CF_MEDIA_TRANS,
CF_HOLD_ON_BRIDGE,
CF_FLAG_MAX
}
@ -24876,6 +24999,17 @@ public class switch_codec : IDisposable {
}
}
public switch_frame cur_frame {
set {
freeswitchPINVOKE.switch_codec_cur_frame_set(swigCPtr, switch_frame.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_cur_frame_get(swigCPtr);
switch_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_frame(cPtr, false);
return ret;
}
}
public switch_codec() : this(freeswitchPINVOKE.new_switch_codec(), true) {
}
@ -26639,6 +26773,16 @@ public class switch_directories : IDisposable {
}
}
public string lib_dir {
set {
freeswitchPINVOKE.switch_directories_lib_dir_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_directories_lib_dir_get(swigCPtr);
return ret;
}
}
public switch_directories() : this(freeswitchPINVOKE.new_switch_directories(), true) {
}
@ -28678,6 +28822,23 @@ public class switch_hold_record_t : IDisposable {
namespace FreeSWITCH.Native {
public enum switch_hup_type_t {
SHT_NONE = 0,
SHT_UNANSWERED = (1 << 0),
SHT_ANSWERED = (1 << 1)
}
}
/* ----------------------------------------------------------------------------
* 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;

View File

@ -52,6 +52,7 @@ package freeswitch;
*getGlobalVariable = *freeswitchc::getGlobalVariable;
*consoleLog = *freeswitchc::consoleLog;
*consoleCleanLog = *freeswitchc::consoleCleanLog;
*running = *freeswitchc::running;
*email = *freeswitchc::email;
*console_log = *freeswitchc::console_log;
*console_clean_log = *freeswitchc::console_clean_log;

View File

@ -2051,6 +2051,24 @@ XS(_wrap_consoleCleanLog) {
}
XS(_wrap_running) {
{
bool result;
int argvi = 0;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: running();");
}
result = (bool)running();
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_email) {
{
char *arg1 = (char *) 0 ;
@ -9642,6 +9660,7 @@ static swig_command_info swig_commands[] = {
{"freeswitchc::getGlobalVariable", _wrap_getGlobalVariable},
{"freeswitchc::consoleLog", _wrap_consoleLog},
{"freeswitchc::consoleCleanLog", _wrap_consoleCleanLog},
{"freeswitchc::running", _wrap_running},
{"freeswitchc::email", _wrap_email},
{"freeswitchc::new_IVRMenu", _wrap_new_IVRMenu},
{"freeswitchc::delete_IVRMenu", _wrap_delete_IVRMenu},

View File

@ -52,6 +52,7 @@ setGlobalVariable = _freeswitch.setGlobalVariable
getGlobalVariable = _freeswitch.getGlobalVariable
consoleLog = _freeswitch.consoleLog
consoleCleanLog = _freeswitch.consoleCleanLog
running = _freeswitch.running
email = _freeswitch.email
class IVRMenu(_object):
__swig_setmethods__ = {}

View File

@ -3133,6 +3133,19 @@ fail:
}
SWIGINTERN PyObject *_wrap_running(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
bool result;
if (!PyArg_ParseTuple(args,(char *)":running")) SWIG_fail;
result = (bool)running();
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_email(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
@ -9169,6 +9182,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"getGlobalVariable", _wrap_getGlobalVariable, METH_VARARGS, NULL},
{ (char *)"consoleLog", _wrap_consoleLog, METH_VARARGS, NULL},
{ (char *)"consoleCleanLog", _wrap_consoleCleanLog, METH_VARARGS, NULL},
{ (char *)"running", _wrap_running, METH_VARARGS, NULL},
{ (char *)"email", _wrap_email, METH_VARARGS, NULL},
{ (char *)"new_IVRMenu", _wrap_new_IVRMenu, METH_VARARGS, NULL},
{ (char *)"delete_IVRMenu", _wrap_delete_IVRMenu, METH_VARARGS, NULL},

View File

@ -291,7 +291,7 @@ SWITCH_DECLARE(switch_channel_callstate_t) switch_channel_str2callstate(const ch
SWITCH_DECLARE(void) switch_channel_perform_audio_sync(switch_channel_t *channel, const char *file, const char *func, int line)
{
if (switch_channel_media_ready(channel)) {
if (switch_channel_media_up(channel)) {
switch_core_session_message_t msg = { 0 };
msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
msg.from = channel->name;
@ -363,6 +363,21 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_lock(switch_channel_t *channel)
{
return switch_mutex_lock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_status_t) switch_channel_try_dtmf_lock(switch_channel_t *channel)
{
return switch_mutex_trylock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_unlock(switch_channel_t *channel)
{
return switch_mutex_unlock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
{
switch_size_t has;
@ -3431,7 +3446,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
switch_channel_presence(channel, "unknown", "answered", NULL);
switch_channel_audio_sync(channel);
//switch_channel_audio_sync(channel);
switch_core_recovery_track(channel->session);

View File

@ -2428,6 +2428,11 @@ SWITCH_DECLARE(switch_core_flag_t) switch_core_flags(void)
return runtime.flags;
}
SWITCH_DECLARE(switch_bool_t) switch_core_running(void)
{
return runtime.running ? SWITCH_TRUE : SWITCH_FALSE;
}
SWITCH_DECLARE(switch_bool_t) switch_core_ready(void)
{
return (switch_test_flag((&runtime), SCF_SHUTTING_DOWN) || switch_test_flag((&runtime), SCF_NO_NEW_SESSIONS) == SCF_NO_NEW_SESSIONS) ? SWITCH_FALSE : SWITCH_TRUE;

View File

@ -178,6 +178,23 @@ SWITCH_DECLARE(int) switch_core_db_changes(switch_core_db_t *db)
return sqlite3_changes(db);
}
SWITCH_DECLARE(int) switch_core_db_load_extension(switch_core_db_t *db, const char *extension)
{
int ret = 0;
char *err = NULL;
sqlite3_enable_load_extension(db, 1);
ret = sqlite3_load_extension(db, extension, 0, &err);
sqlite3_enable_load_extension(db, 0);
if (err) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "LOAD EXTENSION ERR [%s]\n", err);
switch_core_db_free(err);
err = NULL;
}
return ret;
}
SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename)
{
switch_core_db_t *db;

View File

@ -151,7 +151,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
for(i = 0; i < 2; i++) {
if (session->dmachine[i] && !switch_channel_test_flag(session->channel, CF_BROADCAST)) {
switch_ivr_dmachine_ping(session->dmachine[i], NULL);
if (switch_channel_try_dtmf_lock(session->channel) == SWITCH_STATUS_SUCCESS) {
switch_ivr_dmachine_ping(session->dmachine[i], NULL);
switch_channel_dtmf_unlock(session->channel);
}
}
}

View File

@ -891,9 +891,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_se
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
switch_core_session_wake_session_thread(session);
}
switch_core_session_wake_session_thread(session);
}
return status;
@ -975,9 +974,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_signal_data(switch_cor
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
switch_core_session_wake_session_thread(session);
}
switch_core_session_wake_session_thread(session);
}
return status;
@ -1048,9 +1046,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_event(switch_core_sess
*event = NULL;
status = SWITCH_STATUS_SUCCESS;
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
switch_core_session_wake_session_thread(session);
}
switch_core_session_wake_session_thread(session);
}
}

View File

@ -152,7 +152,7 @@ static switch_cache_db_handle_t *get_handle(const char *db_str, const char *user
if (!r) {
for (dbh_ptr = sql_manager.handle_pool; dbh_ptr; dbh_ptr = dbh_ptr->next) {
if (dbh_ptr->hash == hash && !dbh_ptr->use_count && !switch_test_flag(dbh_ptr, CDF_PRUNE) &&
if (dbh_ptr->hash == hash && (dbh_ptr->type != SCDB_TYPE_PGSQL || !dbh_ptr->use_count) && !switch_test_flag(dbh_ptr, CDF_PRUNE) &&
switch_mutex_trylock(dbh_ptr->mutex) == SWITCH_STATUS_SUCCESS) {
r = dbh_ptr;
break;
@ -703,6 +703,29 @@ SWITCH_DECLARE(int) switch_cache_db_affected_rows(switch_cache_db_handle_t *dbh)
return 0;
}
SWITCH_DECLARE(int) switch_cache_db_load_extension(switch_cache_db_handle_t *dbh, const char *extension)
{
switch (dbh->type) {
case SCDB_TYPE_CORE_DB:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "try to load extension [%s]!\n", extension);
return switch_core_db_load_extension(dbh->native_handle.core_db_dbh, extension);
}
break;
case SCDB_TYPE_ODBC:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "load extension not supported by type ODBC!\n");
}
break;
case SCDB_TYPE_PGSQL:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "load extension not supported by type PGSQL!\n");
}
break;
}
return 0;
}
SWITCH_DECLARE(char *) switch_cache_db_execute_sql2str(switch_cache_db_handle_t *dbh, char *sql, char *str, size_t len, char **err)
{
@ -1706,11 +1729,14 @@ static void *SWITCH_THREAD_FUNC switch_user_sql_thread(switch_thread_t *thread,
check:
if ((lc = qm_ttl(qm)) < qm->max_trans / 4) {
switch_yield(500000);
if ((lc = qm_ttl(qm)) == 0) {
switch_thread_cond_wait(qm->cond, qm->cond_mutex);
}
if ((lc = qm_ttl(qm)) == 0) {
switch_thread_cond_wait(qm->cond, qm->cond_mutex);
}
i = 4;
while (--i > 0 && (lc = qm_ttl(qm)) < qm->max_trans / 4) {
switch_yield(50000);
}
}

View File

@ -1205,6 +1205,11 @@ SWITCH_DECLARE(char *) getGlobalVariable(char *var_name)
}
SWITCH_DECLARE(bool) running(void)
{
return switch_core_running() ? true : false;
}
SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg)
{
return console_log(level_str, msg);

View File

@ -1613,6 +1613,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_brackets(char *data, char a,
if (vnext) {
vdata = vnext;
vnext = NULL;
} else {
break;
}

View File

@ -1232,8 +1232,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_channel_set_flag_recursive(caller_channel, CF_BRIDGE_ORIGINATOR);
switch_channel_clear_flag(peer_channel, CF_BRIDGE_ORIGINATOR);
switch_channel_audio_sync(caller_channel);
switch_channel_audio_sync(peer_channel);
//switch_channel_audio_sync(caller_channel);
//switch_channel_audio_sync(peer_channel);
b_leg->session = peer_session;
switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
@ -1368,6 +1368,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_channel_set_private(peer_channel, "_bridge_", b_leg);
switch_channel_set_state(peer_channel, CS_EXCHANGE_MEDIA);
audio_bridge_thread(NULL, (void *) a_leg);
switch_channel_clear_flag_recursive(caller_channel, CF_BRIDGE_ORIGINATOR);

View File

@ -3115,7 +3115,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
do_continue:
if (!read_packet) {
switch_cond_next();
switch_yield(20000);
}
}
@ -3373,13 +3373,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
status = SWITCH_STATUS_SUCCESS;
} else {
status = switch_channel_answer(caller_channel);
status = switch_channel_answer(caller_channel);
}
} else if (switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
status = SWITCH_STATUS_SUCCESS;
} else {
status = switch_channel_pre_answer(caller_channel);
status = switch_channel_pre_answer(caller_channel);
}
} else {
status = SWITCH_STATUS_SUCCESS;
@ -3707,11 +3707,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
switch_cond_next();
}
switch_channel_audio_sync(bchan);
//switch_channel_audio_sync(bchan);
if (caller_channel) {
switch_channel_audio_sync(caller_channel);
}
//if (caller_channel) {
// switch_channel_audio_sync(caller_channel);
//}
}
if (oglobals.session) {

View File

@ -67,6 +67,7 @@ static switch_port_t START_PORT = RTP_START_PORT;
static switch_port_t END_PORT = RTP_END_PORT;
static switch_port_t NEXT_PORT = RTP_START_PORT;
static switch_mutex_t *port_lock = NULL;
static void do_flush(switch_rtp_t *rtp_session);
typedef srtp_hdr_t rtp_hdr_t;
@ -2071,6 +2072,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
rtp_session->ready = 2;
rtp_session->rx_host = switch_core_strdup(rtp_session->pool, rx_host);
rtp_session->rx_port = rx_port;
//switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
} else {
switch_rtp_release_port(rx_host, rx_port);
}
@ -2761,7 +2763,7 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) &&
!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
switch (flush) {
case SWITCH_RTP_FLUSH_STICK:
switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
@ -2780,6 +2782,7 @@ static void do_flush(switch_rtp_t *rtp_session)
{
int was_blocking = 0;
switch_size_t bytes;
uint32_t flushed = 0;
if (!switch_rtp_ready(rtp_session) ||
switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) ||
@ -2787,11 +2790,11 @@ static void do_flush(switch_rtp_t *rtp_session)
) {
return;
}
READ_INC(rtp_session);
if (switch_rtp_ready(rtp_session)) {
uint32_t flushed = 0;
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ)) {
switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
@ -2869,34 +2872,35 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
if (rtp_session->last_seq && rtp_session->last_seq+1 != seq) {
#ifdef DEBUG_MISSED_SEQ
//2012-11-28 18:33:11.799070 [ERR] switch_rtp.c:2883 Missed -65536 RTP frames from sequence [65536] to [-1] (missed). Time since last read [20021]
switch_size_t flushed_packets_diff = rtp_session->stats.inbound.flush_packet_count - rtp_session->last_flush_packet_count;
switch_size_t num_missed = (switch_size_t)seq - (rtp_session->last_seq+1);
if (num_missed == 1) { /* We missed one packet */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missed one RTP frame with sequence [%d]%s. Time since last read [%d]\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missed one RTP frame with sequence [%d]%s. Time since last read [%ld]\n",
rtp_session->last_seq+1, (flushed_packets_diff == 1) ? " (flushed by FS)" : " (missed)",
rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);
} else { /* We missed multiple packets */
if (flushed_packets_diff == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
"Missed %d RTP frames from sequence [%d] to [%d] (missed). Time since last read [%d]\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Missed %ld RTP frames from sequence [%d] to [%d] (missed). Time since last read [%ld]\n",
num_missed, rtp_session->last_seq+1, seq-1,
rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);
} else if (flushed_packets_diff == num_missed) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
"Missed %d RTP frames from sequence [%d] to [%d] (flushed by FS). Time since last read [%d]\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Missed %ld RTP frames from sequence [%d] to [%d] (flushed by FS). Time since last read [%ld]\n",
num_missed, rtp_session->last_seq+1, seq-1,
rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);
} else if (num_missed > flushed_packets_diff) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
"Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS, %d packets missed)."
" Time since last read [%d]\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Missed %ld RTP frames from sequence [%d] to [%d] (%ld packets flushed by FS, %ld packets missed)."
" Time since last read [%ld]\n",
num_missed, rtp_session->last_seq+1, seq-1,
flushed_packets_diff, num_missed-flushed_packets_diff,
rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
"Missed %d RTP frames from sequence [%d] to [%d] (%d packets flushed by FS). Time since last read [%d]\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Missed %ld RTP frames from sequence [%d] to [%d] (%ld packets flushed by FS). Time since last read [%ld]\n",
num_missed, rtp_session->last_seq+1, seq-1,
flushed_packets_diff, rtp_session->last_read_time ? switch_micro_time_now()-rtp_session->last_read_time : 0);
}
@ -3240,15 +3244,17 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if (bytes) {
if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 0) == SWITCH_STATUS_SUCCESS) {
/* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Trigger %d\n", rtp_session->hot_hits); */
rtp_session->hot_hits += rtp_session->samples_per_interval;
rtp_session->hot_hits++;//+= rtp_session->samples_per_interval;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "%s Hot Hit %d\n",
switch_core_session_get_name(session),
rtp_session->hot_hits);
} else {
rtp_session->hot_hits = 0;
}
}
if (rtp_session->hot_hits >= rtp_session->samples_per_second * 5) {
switch_set_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH);
if (rtp_session->hot_hits > 1 && !rtp_session->sync_packets) {// >= (rtp_session->samples_per_second * 30)) {
hot_socket = 1;
}
} else {
@ -3256,19 +3262,27 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
}
}
if (hot_socket) {
if (hot_socket && (rtp_session->hot_hits % 10) != 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "%s timer while HOT\n", switch_core_session_get_name(session));
switch_core_timer_next(&rtp_session->timer);
} else if (hot_socket) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "%s skip timer once\n", switch_core_session_get_name(session));
rtp_session->sync_packets++;
switch_core_timer_sync(&rtp_session->timer);
} else {
if (rtp_session->sync_packets) {
#if 0
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"Auto-Flush catching up %d packets (%d)ms.\n",
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10,
"%s Auto-Flush catching up %d packets (%d)ms.\n",
switch_core_session_get_name(session),
rtp_session->sync_packets, (rtp_session->ms_per_packet * rtp_session->sync_packets) / 1000);
#endif
rtp_session->sync_packets = 0;
} else {
switch_core_timer_next(&rtp_session->timer);
}
switch_core_timer_next(&rtp_session->timer);
rtp_session->sync_packets = 0;
}
}
@ -4787,3 +4801,4 @@ SWITCH_DECLARE(void *) switch_rtp_get_private(switch_rtp_t *rtp_session)
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/

View File

@ -150,7 +150,6 @@ SWITCH_DECLARE(void) switch_os_yield(void)
#if defined(WIN32)
SwitchToThread();
#else
usleep(1);
sched_yield();
#endif
}