Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
ea83534163
|
@ -12,9 +12,11 @@ avoid_mods=(
|
|||
applications/mod_limit
|
||||
applications/mod_mongo
|
||||
applications/mod_mp4
|
||||
applications/mod_oreka
|
||||
applications/mod_osp
|
||||
applications/mod_rad_auth
|
||||
applications/mod_skel
|
||||
applications/mod_sonar
|
||||
applications/mod_soundtouch
|
||||
asr_tts/mod_cepstral
|
||||
asr_tts/mod_flite
|
||||
|
@ -26,6 +28,7 @@ avoid_mods=(
|
|||
codecs/mod_voipcodecs
|
||||
endpoints/mod_gsmopen
|
||||
endpoints/mod_h323
|
||||
endpoints/mod_html5
|
||||
endpoints/mod_khomp
|
||||
endpoints/mod_opal
|
||||
endpoints/mod_reference
|
||||
|
@ -35,6 +38,7 @@ avoid_mods=(
|
|||
languages/mod_spidermonkey
|
||||
sdk/autotools
|
||||
xml_int/mod_xml_ldap
|
||||
xml_int/mod_xml_radius
|
||||
)
|
||||
avoid_mods_sid=(
|
||||
endpoints/mod_portaudio
|
||||
|
|
|
@ -147,6 +147,11 @@ Description: Nibblebill
|
|||
This module allows for real-time accounting of a cash balance and
|
||||
using that information for call routing.
|
||||
|
||||
Module: applications/mod_oreka
|
||||
Description: Media recording with Oreka
|
||||
This module provides media recording with the Oreka cross-platfor
|
||||
audio stream recording and retrieval system.
|
||||
|
||||
Module: applications/mod_osp
|
||||
Description: Open Settlement Protocol
|
||||
This module adds support for the Open Settlement Protocol (OSP).
|
||||
|
@ -192,6 +197,11 @@ Module: applications/mod_snom
|
|||
Description: SNOM specific features
|
||||
This module implements features specific to SNOM phones.
|
||||
|
||||
Module: applications/mod_sonar
|
||||
Description: Sonar ping timer
|
||||
This module measures the latency on an audio link by sending audible
|
||||
audio sonar pings.
|
||||
|
||||
Module: applications/mod_soundtouch
|
||||
Description: Soundtouch
|
||||
This module implements example media bugs.
|
||||
|
@ -335,6 +345,10 @@ Module: codecs/mod_voipcodecs
|
|||
Description: mod_voipcodecs
|
||||
Adds mod_voipcodecs.
|
||||
|
||||
Module: codecs/mod_vp8
|
||||
Description: VP8 video codec
|
||||
This module adds the VP8 video codec, also known as WebM.
|
||||
|
||||
## mod/dialplans
|
||||
|
||||
Module: dialplans/mod_dialplan_asterisk
|
||||
|
@ -376,6 +390,10 @@ Description: mod_h323
|
|||
Adds mod_h323.
|
||||
Build-Depends: libopenh323-dev, libpt-dev
|
||||
|
||||
Module: endpoints/mod_html5
|
||||
Description: HTML5 endpoint module
|
||||
This module adds support for HTML5 technologies such as WebRTC.
|
||||
|
||||
Module: endpoints/mod_khomp
|
||||
Description: mod_khomp
|
||||
Adds mod_khomp.
|
||||
|
@ -651,6 +669,10 @@ Description: mod_xml_ldap
|
|||
Adds mod_xml_ldap.
|
||||
Build-Depends: libsasl2-dev
|
||||
|
||||
Module: xml_int/mod_xml_radius
|
||||
Description: mod_xml_radius
|
||||
Adds mod_xml_radius
|
||||
|
||||
Module: xml_int/mod_xml_rpc
|
||||
Description: mod_xml_rpc
|
||||
Adds mod_xml_rpc.
|
||||
|
|
|
@ -2285,6 +2285,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxo_signal)
|
|||
}
|
||||
break;
|
||||
case FTDM_SIGEVENT_SIGSTATUS_CHANGED:
|
||||
case FTDM_SIGEVENT_COLLECTED_DIGIT: /* Analog E&M */
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
|
|
@ -1091,7 +1091,7 @@ void sngisdn_rcv_sng_log(uint8_t level, char *fmt,...)
|
|||
|
||||
switch (level) {
|
||||
case SNG_LOGLEVEL_DEBUG:
|
||||
ftdm_log(FTDM_LOG_DEBUG, "sng_isdn->%s\n", data);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "sng_isdn->%s", data);
|
||||
break;
|
||||
case SNG_LOGLEVEL_WARN:
|
||||
if ( strncmp(data, "Invalid Q.921/Q.931 frame", 25) ) {
|
||||
|
|
|
@ -737,6 +737,7 @@ static FIO_COMMAND_FUNCTION(zt_command)
|
|||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "OFFHOOK Failed");
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Channel is now offhook\n");
|
||||
ftdm_set_flag_locked(ftdmchan, FTDM_CHANNEL_OFFHOOK);
|
||||
}
|
||||
break;
|
||||
|
@ -747,6 +748,7 @@ static FIO_COMMAND_FUNCTION(zt_command)
|
|||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_ERROR, "ONHOOK Failed");
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Channel is now onhook\n");
|
||||
ftdm_clear_flag_locked(ftdmchan, FTDM_CHANNEL_OFFHOOK);
|
||||
}
|
||||
break;
|
||||
|
@ -1084,7 +1086,10 @@ static __inline__ ftdm_status_t zt_channel_process_event(ftdm_channel_t *fchan,
|
|||
case ZT_EVENT_RINGOFFHOOK:
|
||||
{
|
||||
if (fchan->type == FTDM_CHAN_TYPE_FXS || (fchan->type == FTDM_CHAN_TYPE_EM && fchan->state != FTDM_CHANNEL_STATE_UP)) {
|
||||
ftdm_set_flag_locked(fchan, FTDM_CHANNEL_OFFHOOK);
|
||||
if (fchan->type != FTDM_CHAN_TYPE_EM) {
|
||||
/* In E&M we're supposed to set this flag when the tx side goes offhook, not the rx */
|
||||
ftdm_set_flag_locked(fchan, FTDM_CHANNEL_OFFHOOK);
|
||||
}
|
||||
*event_id = FTDM_OOB_OFFHOOK;
|
||||
} else if (fchan->type == FTDM_CHAN_TYPE_FXO) {
|
||||
*event_id = FTDM_OOB_RING_START;
|
||||
|
|
|
@ -1910,7 +1910,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
|||
int32_t z = 0;
|
||||
int member_score_sum = 0;
|
||||
int divisor = 0;
|
||||
|
||||
|
||||
if (!(divisor = conference->rate / 8000)) {
|
||||
divisor = 1;
|
||||
}
|
||||
|
@ -1932,6 +1932,13 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
|||
conference->is_recording = 0;
|
||||
conference->record_count = 0;
|
||||
|
||||
|
||||
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-create");
|
||||
switch_event_fire(&event);
|
||||
|
||||
while (globals.running && !switch_test_flag(conference, CFLAG_DESTRUCT)) {
|
||||
switch_size_t file_sample_len = samples;
|
||||
switch_size_t file_data_len = samples * 2;
|
||||
|
@ -2448,6 +2455,11 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "conference-destroy");
|
||||
switch_event_fire(&event);
|
||||
|
||||
switch_core_timer_destroy(&timer);
|
||||
switch_mutex_lock(globals.hash_mutex);
|
||||
|
|
|
@ -567,6 +567,22 @@ SWITCH_STANDARD_APP(mkdir_function)
|
|||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s MKDIR: %s\n",
|
||||
switch_channel_get_name(switch_core_session_get_channel(session)), data);
|
||||
}
|
||||
#define RENAME_SYNTAX "<from_path> <to_path>"
|
||||
SWITCH_STANDARD_APP(rename_function)
|
||||
{
|
||||
char *argv[2] = { 0 };
|
||||
char *lbuf = NULL;
|
||||
|
||||
if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
|
||||
&& switch_split(lbuf, ' ', argv) == 2) {
|
||||
switch_file_rename(argv[0], argv[1], switch_core_session_get_pool(session));
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s RENAME: %s %s\n",
|
||||
switch_channel_get_name(switch_core_session_get_channel(session)), argv[0], argv[1]);
|
||||
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", RENAME_SYNTAX);
|
||||
}
|
||||
}
|
||||
|
||||
#define SOFT_HOLD_SYNTAX "<unhold key> [<moh_a>] [<moh_b>]"
|
||||
SWITCH_STANDARD_APP(soft_hold_function)
|
||||
|
@ -4403,7 +4419,7 @@ struct file_string_context {
|
|||
typedef struct file_string_context file_string_context_t;
|
||||
|
||||
|
||||
static int next_file(switch_file_handle_t *handle)
|
||||
static switch_status_t next_file(switch_file_handle_t *handle)
|
||||
{
|
||||
file_string_context_t *context = handle->private_info;
|
||||
char *file;
|
||||
|
@ -4418,7 +4434,7 @@ static int next_file(switch_file_handle_t *handle)
|
|||
}
|
||||
|
||||
if (context->index >= context->argc) {
|
||||
return 0;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4434,8 +4450,23 @@ static int next_file(switch_file_handle_t *handle)
|
|||
file = switch_core_sprintf(handle->memory_pool, "%s%s%s", prefix, SWITCH_PATH_SEPARATOR, context->argv[context->index]);
|
||||
}
|
||||
|
||||
if (switch_core_file_open(&context->fh,
|
||||
file, handle->channels, handle->samplerate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) {
|
||||
char *path = switch_core_strdup(handle->memory_pool, file);
|
||||
char *p;
|
||||
|
||||
if ((p = strrchr(path, *SWITCH_PATH_SEPARATOR))) {
|
||||
*p = '\0';
|
||||
if (switch_dir_make_recursive(path, SWITCH_DEFAULT_DIR_PERMS, handle->memory_pool) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error creating %s\n", path);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error finding the folder path section in '%s'\n", path);
|
||||
}
|
||||
|
||||
}
|
||||
if (switch_core_file_open(&context->fh, file, handle->channels, handle->samplerate, handle->flags, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
goto top;
|
||||
}
|
||||
|
||||
|
@ -4461,7 +4492,7 @@ static int next_file(switch_file_handle_t *handle)
|
|||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4487,11 +4518,6 @@ static switch_status_t file_string_file_open(switch_file_handle_t *handle, const
|
|||
file_string_context_t *context;
|
||||
char *file_dup;
|
||||
|
||||
if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This format does not support writing!\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
context = switch_core_alloc(handle->memory_pool, sizeof(*context));
|
||||
|
||||
file_dup = switch_core_strdup(handle->memory_pool, path);
|
||||
|
@ -4500,7 +4526,7 @@ static switch_status_t file_string_file_open(switch_file_handle_t *handle, const
|
|||
|
||||
handle->private_info = context;
|
||||
|
||||
return next_file(handle) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
return next_file(handle);
|
||||
}
|
||||
|
||||
static switch_status_t file_string_file_close(switch_file_handle_t *handle)
|
||||
|
@ -4533,16 +4559,35 @@ static switch_status_t file_string_file_read(switch_file_handle_t *handle, void
|
|||
}
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS) {
|
||||
if (!next_file(handle)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
if ((status = next_file(handle)) != SWITCH_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
*len = llen;
|
||||
status = switch_core_file_read(&context->fh, data, len);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static switch_status_t file_string_file_write(switch_file_handle_t *handle, void *data, size_t *len)
|
||||
{
|
||||
file_string_context_t *context = handle->private_info;
|
||||
switch_status_t status;
|
||||
size_t llen = *len;
|
||||
|
||||
status = switch_core_file_write(&context->fh, data, len);
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS) {
|
||||
if ((status = next_file(handle)) != SWITCH_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
*len = llen;
|
||||
status = switch_core_file_write(&context->fh, data, len);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/* Registration */
|
||||
|
||||
static char *file_string_supported_formats[SWITCH_MAX_CODECS] = { 0 };
|
||||
|
@ -4963,6 +5008,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
|||
file_interface->file_open = file_string_file_open;
|
||||
file_interface->file_close = file_string_file_close;
|
||||
file_interface->file_read = file_string_file_read;
|
||||
file_interface->file_write = file_string_file_write;
|
||||
file_interface->file_seek = file_string_file_seek;
|
||||
|
||||
|
||||
|
@ -5103,6 +5149,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
|||
SWITCH_ADD_APP(app_interface, "enable_heartbeat", "Enable Media Heartbeat", "Enable Media Heartbeat",
|
||||
heartbeat_function, HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA);
|
||||
SWITCH_ADD_APP(app_interface, "mkdir", "Create a directory", "Create a directory", mkdir_function, MKDIR_SYNTAX, SAF_SUPPORT_NOMEDIA);
|
||||
SWITCH_ADD_APP(app_interface, "rename", "Rename file", "Rename file", rename_function, RENAME_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC);
|
||||
SWITCH_ADD_APP(app_interface, "soft_hold", "Put a bridged channel on hold", "Put a bridged channel on hold", soft_hold_function, SOFT_HOLD_SYNTAX,
|
||||
SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "bind_meta_app", "Bind a key to an application", "Bind a key to an application", dtmf_bind_function, BIND_SYNTAX,
|
||||
|
|
|
@ -61,7 +61,7 @@ switch_bool_t sonar_ping_callback(switch_core_session_t *session, const char *ap
|
|||
end = switch_time_now();
|
||||
diff = end - start;
|
||||
start = 0;
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sonar ping took %lu milliseconds\n", diff / 1000);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sonar ping took %ld milliseconds\n", (long)diff / 1000);
|
||||
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
|
|
|
@ -46,22 +46,39 @@ struct mod_spy_globals {
|
|||
uint32_t spy_count;
|
||||
} globals;
|
||||
|
||||
typedef struct spy {
|
||||
const char *uuid;
|
||||
struct spy *next;
|
||||
} spy_t;
|
||||
|
||||
|
||||
static switch_status_t spy_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
const char *data = switch_channel_get_private(channel, "_userspy_");
|
||||
const char *uuid = switch_core_session_get_uuid(session);
|
||||
spy_t *spy = NULL, *p = NULL, *prev = NULL;
|
||||
|
||||
char *data = switch_channel_get_private(channel, "_userspy_");
|
||||
switch_thread_rwlock_wrlock(globals.spy_hash_lock);
|
||||
|
||||
if ((switch_core_hash_delete(globals.spy_hash, data) != SWITCH_STATUS_SUCCESS)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No such key in userspy: %s \n", data);
|
||||
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Userspy deactivated on %s\n", data);
|
||||
globals.spy_count--;
|
||||
spy = switch_core_hash_find(globals.spy_hash, data);
|
||||
for (p = spy; p; p = p->next) {
|
||||
if (p->uuid == uuid) {
|
||||
if (prev) {
|
||||
prev->next = p->next;
|
||||
} else {
|
||||
spy = p->next;
|
||||
}
|
||||
globals.spy_count--;
|
||||
break;
|
||||
}
|
||||
prev = p;
|
||||
}
|
||||
|
||||
switch_core_hash_insert(globals.spy_hash, data, spy);
|
||||
|
||||
switch_thread_rwlock_unlock(globals.spy_hash_lock);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -115,12 +132,20 @@ SWITCH_STANDARD_API(dump_hash)
|
|||
switch_hash_index_t *hi;
|
||||
const void *key;
|
||||
void *val;
|
||||
spy_t *spy;
|
||||
|
||||
switch_thread_rwlock_rdlock(globals.spy_hash_lock);
|
||||
|
||||
for (hi = switch_hash_first(NULL, globals.spy_hash); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &key, NULL, &val);
|
||||
stream->write_function(stream, "%s : %s\n", (char *) key, (const char *) val);
|
||||
spy = (spy_t *) val;
|
||||
|
||||
stream->write_function(stream, "%s :");
|
||||
while (spy) {
|
||||
stream->write_function(stream, " %s", spy->uuid);
|
||||
spy = spy->next;
|
||||
}
|
||||
stream->write_function(stream, "\n");
|
||||
}
|
||||
|
||||
stream->write_function(stream, "\n%d total spy\n", globals.spy_count);
|
||||
|
@ -130,9 +155,10 @@ SWITCH_STANDARD_API(dump_hash)
|
|||
|
||||
static switch_status_t process_event(switch_event_t *event)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
switch_core_session_t *session = NULL;
|
||||
char *username[3] = { 0 };
|
||||
char *domain[3] = { 0 };
|
||||
char *username[3] = { NULL };
|
||||
char *domain[3] = { NULL };
|
||||
char key[512];
|
||||
char *uuid = NULL, *my_uuid = NULL;
|
||||
int i;
|
||||
|
@ -147,8 +173,8 @@ static switch_status_t process_event(switch_event_t *event)
|
|||
username[0] = switch_event_get_header(event, "Caller-Username");
|
||||
domain[0] = switch_event_get_header(event, "variable_domain_name");
|
||||
|
||||
domain[1] = switch_event_get_header(event, "variable_dialed_domain");
|
||||
username[1] = switch_event_get_header(event, "variable_dialed_user");
|
||||
domain[1] = switch_event_get_header(event, "variable_dialed_domain");
|
||||
|
||||
username[2] = switch_event_get_header(event, "variable_user_name");
|
||||
domain[2] = switch_event_get_header(event, "variable_domain_name");
|
||||
|
@ -156,35 +182,39 @@ static switch_status_t process_event(switch_event_t *event)
|
|||
for (i = 0; i < 3; i++) {
|
||||
|
||||
if (username[i] && domain[i]) {
|
||||
spy_t *spy = NULL;
|
||||
switch_snprintf(key, sizeof(key), "%s@%s", username[i], domain[i]);
|
||||
|
||||
if ((uuid = switch_core_hash_find(globals.spy_hash, key))) {
|
||||
if ((spy = switch_core_hash_find(globals.spy_hash, key))) {
|
||||
while (spy) {
|
||||
if ((session = switch_core_session_locate(spy->uuid))) {
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "UserSpy retrieved uuid %s for key %s, activating eavesdrop\n", uuid, key);
|
||||
my_uuid = switch_event_get_header(event, "Unique-ID");
|
||||
|
||||
switch_channel_set_variable(channel, "spy_uuid", my_uuid);
|
||||
|
||||
switch_channel_set_state(channel, CS_EXCHANGE_MEDIA);
|
||||
switch_channel_set_flag(channel, CF_BREAK);
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
}
|
||||
spy = spy->next;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
/* not found */
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
done:
|
||||
switch_thread_rwlock_unlock(globals.spy_hash_lock);
|
||||
return status;
|
||||
|
||||
if (!uuid) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if ((session = switch_core_session_locate(uuid))) {
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "UserSpy retrieved uuid %s for key %s, activating eavesdrop \n", uuid, key);
|
||||
my_uuid = switch_event_get_header(event, "Unique-ID");
|
||||
|
||||
switch_channel_set_variable(channel, "spy_uuid", my_uuid);
|
||||
|
||||
switch_channel_set_state(channel, CS_EXCHANGE_MEDIA);
|
||||
switch_channel_set_flag(channel, CF_BREAK);
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
@ -233,20 +263,20 @@ SWITCH_STANDARD_APP(userspy_function)
|
|||
|
||||
if (!zstr(data) && (params = switch_core_session_strdup(session, data))) {
|
||||
if ((argc = switch_separate_string(params, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
|
||||
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
char *uuid = switch_core_session_get_uuid(session);
|
||||
switch_status_t status;
|
||||
spy_t *spy = NULL;
|
||||
|
||||
spy = switch_core_session_alloc(session, sizeof(spy_t));
|
||||
switch_assert(spy != NULL);
|
||||
spy->uuid = uuid;
|
||||
|
||||
switch_thread_rwlock_wrlock(globals.spy_hash_lock);
|
||||
if (switch_core_hash_find(globals.spy_hash, argv[0])) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Spy already exists for %s\n", argv[0]);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||
switch_thread_rwlock_unlock(globals.spy_hash_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
status = switch_core_hash_insert(globals.spy_hash, argv[0], (void *) uuid);
|
||||
spy->next = (spy_t *) switch_core_hash_find(globals.spy_hash, argv[0]);
|
||||
|
||||
status = switch_core_hash_insert(globals.spy_hash, argv[0], (void *) spy);
|
||||
|
||||
if ((status != SWITCH_STATUS_SUCCESS)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't insert to spy hash\n");
|
||||
|
@ -270,11 +300,10 @@ SWITCH_STANDARD_APP(userspy_function)
|
|||
}
|
||||
|
||||
switch_channel_set_state(channel, CS_PARK);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", USERSPY_SYNTAX);
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", USERSPY_SYNTAX);
|
||||
}
|
||||
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_spy_load)
|
||||
|
|
|
@ -812,7 +812,6 @@ static void handle_exit(listener_t *listener, erlang_pid * pid)
|
|||
|
||||
}
|
||||
|
||||
|
||||
if (listener->log_process.type == ERLANG_PID && !ei_compare_pids(&listener->log_process.pid, pid)) {
|
||||
void *pop;
|
||||
|
||||
|
@ -1477,15 +1476,14 @@ SWITCH_STANDARD_APP(erlang_outbound_function)
|
|||
int argc = 0, argc2 = 0;
|
||||
char *argv[80] = { 0 }, *argv2[80] = { 0 };
|
||||
char *mydata, *myarg;
|
||||
char uuid[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||
session_elem_t *session_element = NULL;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
/* process app arguments */
|
||||
if (data && (mydata = switch_core_session_strdup(session, data))) {
|
||||
argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
/* XXX else? */
|
||||
memcpy(uuid, switch_core_session_get_uuid(session), SWITCH_UUID_FORMATTED_LENGTH);
|
||||
|
||||
if (argc < 2) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Parse Error - need registered name and node!\n");
|
||||
|
@ -1518,6 +1516,13 @@ SWITCH_STANDARD_APP(erlang_outbound_function)
|
|||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "enter erlang_outbound_function %s %s\n", argv[0], node);
|
||||
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_CONTROLLED)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel is already under control\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* first work out if there is a listener already talking to the node we want to talk to */
|
||||
listener = find_listener(node);
|
||||
/* if there is no listener, then create one */
|
||||
|
@ -1551,7 +1556,7 @@ SWITCH_STANDARD_APP(erlang_outbound_function)
|
|||
switch_thread_rwlock_unlock(globals.listener_rwlock);
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "exit erlang_outbound_function\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "exit erlang_outbound_function\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3274,7 +3274,7 @@ static void do_execute_on(switch_channel_t *channel, const char *variable)
|
|||
app = switch_core_session_strdup(channel->session, variable);
|
||||
|
||||
for(p = app; p && *p; p++) {
|
||||
if (*p == ' ') {
|
||||
if (*p == ' ' || (*p == ':' && (*(p+1) != ':'))) {
|
||||
*p++ = '\0';
|
||||
arg = p;
|
||||
break;
|
||||
|
|
|
@ -1692,7 +1692,7 @@ static void switch_load_core_config(const char *file)
|
|||
switch_core_session_ctl(SCSC_LOGLEVEL, &level);
|
||||
}
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
} else if (!strcasecmp(var, "dump-cores")) {
|
||||
} else if (!strcasecmp(var, "dump-cores") && switch_true(val)) {
|
||||
struct rlimit rlp;
|
||||
memset(&rlp, 0, sizeof(rlp));
|
||||
rlp.rlim_cur = RLIM_INFINITY;
|
||||
|
|
|
@ -1083,16 +1083,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
|
|||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "record_post_process_exec_app"))) {
|
||||
char *app = switch_core_session_strdup(session, var);
|
||||
char *data;
|
||||
|
||||
if ((data = strchr(app, ':'))) {
|
||||
*data++ = '\0';
|
||||
}
|
||||
|
||||
switch_core_session_execute_application(session, app, data);
|
||||
}
|
||||
switch_channel_execute_on(channel, "record_post_process_exec_app");
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "record_post_process_exec_api"))) {
|
||||
char *cmd = switch_core_session_strdup(session, var);
|
||||
|
@ -1834,7 +1825,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
|
|||
file_path = switch_core_session_strdup(session, file);
|
||||
}
|
||||
|
||||
if (file_path) {
|
||||
if (file_path && !strstr(file_path, SWITCH_URL_SEPARATOR)) {
|
||||
char *p;
|
||||
char *path = switch_core_session_strdup(session, file_path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue