mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-04 01:37:14 +00:00
code formating cleanup, More when I land at PHX
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7392 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e1fa84444d
commit
c815c0599e
@ -97,7 +97,6 @@ SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t * hi, const void **key
|
|||||||
apr_hash_this(hi, key, klen, val);
|
apr_hash_this(hi, key, klen, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_memory_pool_t *) switch_hash_pool_get(switch_hash_t * ht)
|
SWITCH_DECLARE(switch_memory_pool_t *) switch_hash_pool_get(switch_hash_t * ht)
|
||||||
{
|
{
|
||||||
return apr_hash_pool_get(ht);
|
return apr_hash_pool_get(ht);
|
||||||
@ -109,7 +108,6 @@ SWITCH_DECLARE(unsigned int) switch_hashfunc_default(const char *key, switch_ssi
|
|||||||
return apr_hashfunc_default(key, klen);
|
return apr_hashfunc_default(key, klen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* DSO functions */
|
/* DSO functions */
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t ** res_handle, const char *path, switch_memory_pool_t *ctx)
|
SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t ** res_handle, const char *path, switch_memory_pool_t *ctx)
|
||||||
@ -132,7 +130,6 @@ SWITCH_DECLARE(const char *) switch_dso_error(switch_dso_handle_t * dso, char *b
|
|||||||
return apr_dso_error(dso, buf, bufsize);
|
return apr_dso_error(dso, buf, bufsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* string functions */
|
/* string functions */
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_strftime(char *s, switch_size_t *retsize, switch_size_t max, const char *format, switch_time_exp_t * tm)
|
SWITCH_DECLARE(switch_status_t) switch_strftime(char *s, switch_size_t *retsize, switch_size_t max, const char *format, switch_time_exp_t * tm)
|
||||||
@ -273,7 +270,6 @@ SWITCH_DECLARE(switch_time_t) switch_time_make(switch_time_t sec, int32_t usec)
|
|||||||
return ((switch_time_t) (sec) * APR_USEC_PER_SEC + (switch_time_t) (usec));
|
return ((switch_time_t) (sec) * APR_USEC_PER_SEC + (switch_time_t) (usec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Thread condition locks */
|
/* Thread condition locks */
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_thread_cond_create(switch_thread_cond_t ** cond, switch_memory_pool_t *pool)
|
SWITCH_DECLARE(switch_status_t) switch_thread_cond_create(switch_thread_cond_t ** cond, switch_memory_pool_t *pool)
|
||||||
@ -438,7 +434,6 @@ SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename, switch_
|
|||||||
|
|
||||||
/* #define SWITCH_FPROT_OS_DEFAULT 0x0FFF /\**< use OS's default permissions *\/ */
|
/* #define SWITCH_FPROT_OS_DEFAULT 0x0FFF /\**< use OS's default permissions *\/ */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new directory on the file system.
|
* Create a new directory on the file system.
|
||||||
* @param path the path for the directory to be created. (use / on all systems)
|
* @param path the path for the directory to be created. (use / on all systems)
|
||||||
@ -465,7 +460,6 @@ SWITCH_DECLARE(switch_status_t) switch_dir_make_recursive(const char *path,
|
|||||||
return apr_dir_make_recursive(path, perm, pool);
|
return apr_dir_make_recursive(path, perm, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct switch_dir {
|
struct switch_dir {
|
||||||
apr_dir_t *dir_handle;
|
apr_dir_t *dir_handle;
|
||||||
apr_finfo_t finfo;
|
apr_finfo_t finfo;
|
||||||
@ -531,10 +525,8 @@ SWITCH_DECLARE(const char *) switch_dir_next_file(switch_dir_t *thedir, char *bu
|
|||||||
return fname;
|
return fname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* thread stubs */
|
/* thread stubs */
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t ** new_attr, switch_memory_pool_t *pool)
|
SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t ** new_attr, switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
return apr_threadattr_create(new_attr, pool);
|
return apr_threadattr_create(new_attr, pool);
|
||||||
@ -593,7 +585,6 @@ SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t * sock, sw
|
|||||||
return apr_socket_connect(sock, sa);
|
return apr_socket_connect(sock, sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t * sock, const char *buf, switch_size_t *len)
|
SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t * sock, const char *buf, switch_size_t *len)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
@ -742,15 +733,10 @@ SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t ** p
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* apr-util stubs */
|
/* apr-util stubs */
|
||||||
|
|
||||||
/* UUID Handling (apr-util) */
|
/* UUID Handling (apr-util) */
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_uuid_format(char *buffer, const switch_uuid_t * uuid)
|
SWITCH_DECLARE(void) switch_uuid_format(char *buffer, const switch_uuid_t * uuid)
|
||||||
{
|
{
|
||||||
apr_uuid_format(buffer, (const apr_uuid_t *) uuid);
|
apr_uuid_format(buffer, (const apr_uuid_t *) uuid);
|
||||||
@ -766,7 +752,6 @@ SWITCH_DECLARE(switch_status_t) switch_uuid_parse(switch_uuid_t * uuid, const ch
|
|||||||
return apr_uuid_parse((apr_uuid_t *) uuid, uuid_str);
|
return apr_uuid_parse((apr_uuid_t *) uuid, uuid_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIFO queues (apr-util) */
|
/* FIFO queues (apr-util) */
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t ** queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
|
SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t ** queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
|
||||||
@ -853,7 +838,6 @@ SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_ar
|
|||||||
return apr_match_glob(pattern, (apr_array_header_t **)result, p);
|
return apr_match_glob(pattern, (apr_array_header_t **)result, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* mode:c
|
* mode:c
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* switch_buffer.c -- Data Buffering Code
|
* switch_buffer.c -- Data Buffering Code
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_buffer.h>
|
#include <switch_buffer.h>
|
||||||
|
|
||||||
@ -132,7 +133,6 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer)
|
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
switch_assert(buffer != NULL);
|
switch_assert(buffer != NULL);
|
||||||
|
@ -29,10 +29,10 @@
|
|||||||
* switch_caller.c -- Caller Identification
|
* switch_caller.c -- Caller Identification
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_caller.h>
|
#include <switch_caller.h>
|
||||||
|
|
||||||
|
|
||||||
#define profile_dup(a,b,p) if (!switch_strlen_zero(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
|
#define profile_dup(a,b,p) if (!switch_strlen_zero(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
|
||||||
#define profile_dup_clean(a,b,p) if (!switch_strlen_zero(a)) { b = switch_clean_string(switch_core_strdup(p, a)); } else { b = SWITCH_BLANK_STRING; }
|
#define profile_dup_clean(a,b,p) if (!switch_strlen_zero(a)) { b = switch_clean_string(switch_core_strdup(p, a)); } else { b = SWITCH_BLANK_STRING; }
|
||||||
|
|
||||||
@ -49,8 +49,6 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
|
|||||||
const char *context,
|
const char *context,
|
||||||
const char *destination_number)
|
const char *destination_number)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
switch_caller_profile_t *profile = NULL;
|
switch_caller_profile_t *profile = NULL;
|
||||||
|
|
||||||
profile = switch_core_alloc(pool, sizeof(*profile));
|
profile = switch_core_alloc(pool, sizeof(*profile));
|
||||||
@ -79,7 +77,6 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
|
|||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memory_pool_t *pool, switch_caller_profile_t *tocopy)
|
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memory_pool_t *pool, switch_caller_profile_t *tocopy)
|
||||||
{
|
{
|
||||||
switch_caller_profile_t *profile = NULL;
|
switch_caller_profile_t *profile = NULL;
|
||||||
@ -115,7 +112,6 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memor
|
|||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_core_session_t *session, switch_caller_profile_t *tocopy)
|
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_core_session_t *session, switch_caller_profile_t *tocopy)
|
||||||
{
|
{
|
||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
@ -125,7 +121,6 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_cor
|
|||||||
return switch_caller_profile_dup(pool, tocopy);
|
return switch_caller_profile_dup(pool, tocopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name)
|
SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(name, "dialplan")) {
|
if (!strcasecmp(name, "dialplan")) {
|
||||||
@ -198,7 +193,6 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
|
|||||||
{
|
{
|
||||||
char header_name[1024];
|
char header_name[1024];
|
||||||
|
|
||||||
|
|
||||||
if (!switch_strlen_zero(caller_profile->username)) {
|
if (!switch_strlen_zero(caller_profile->username)) {
|
||||||
switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
|
switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->username);
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->username);
|
||||||
@ -270,9 +264,6 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
|
|||||||
|
|
||||||
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
|
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, const char *extension_name, const char *extension_number)
|
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, const char *extension_name, const char *extension_number)
|
||||||
@ -288,7 +279,6 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_c
|
|||||||
return caller_extension;
|
return caller_extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
|
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
|
||||||
switch_caller_extension_t *caller_extension, const char *application_name, const char *application_data)
|
switch_caller_extension_t *caller_extension, const char *application_name, const char *application_data)
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
* switch_channel.c -- Media Channel Interface
|
* switch_channel.c -- Media Channel Interface
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_channel.h>
|
#include <switch_channel.h>
|
||||||
|
|
||||||
@ -123,7 +124,6 @@ struct switch_channel {
|
|||||||
int event_count;
|
int event_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause)
|
SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause)
|
||||||
{
|
{
|
||||||
uint8_t x;
|
uint8_t x;
|
||||||
@ -238,7 +238,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *chan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -248,7 +247,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *chan
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_t *channel, const char *dtmf_string)
|
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_t *channel, const char *dtmf_string)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
@ -321,7 +319,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(switch_channel_t *ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(switch_channel_t *channel, char *dtmf_str, switch_size_t len)
|
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(switch_channel_t *channel, char *dtmf_str, switch_size_t len)
|
||||||
@ -398,10 +395,8 @@ SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const ch
|
|||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", channel->event_count++);
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", channel->event_count++);
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname)
|
SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname)
|
||||||
{
|
{
|
||||||
const char *v = NULL;
|
const char *v = NULL;
|
||||||
@ -454,7 +449,6 @@ SWITCH_DECLARE(switch_event_header_t *) switch_channel_variable_first(switch_cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
return hi;
|
return hi;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, const char *key, const void *private_info)
|
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, const char *key, const void *private_info)
|
||||||
@ -485,7 +479,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_name(switch_channel_t *channe
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
|
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
|
||||||
{
|
{
|
||||||
switch_assert(channel != NULL);
|
switch_assert(channel != NULL);
|
||||||
@ -758,7 +751,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_mutex_unlock(channel->flag_mutex);
|
switch_mutex_unlock(channel->flag_mutex);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
@ -770,7 +762,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
|
|||||||
switch_channel_state_t last_state;
|
switch_channel_state_t last_state;
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
|
||||||
|
|
||||||
switch_assert(channel != NULL);
|
switch_assert(channel != NULL);
|
||||||
switch_assert(state <= CS_DONE);
|
switch_assert(state <= CS_DONE);
|
||||||
switch_mutex_lock(channel->flag_mutex);
|
switch_mutex_lock(channel->flag_mutex);
|
||||||
@ -950,7 +941,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "%s State Change %s -> %s\n",
|
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "%s State Change %s -> %s\n",
|
||||||
channel->name, state_names[last_state], state_names[state]);
|
channel->name, state_names[last_state], state_names[state]);
|
||||||
@ -965,7 +955,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
|
|||||||
if (state < CS_DONE) {
|
if (state < CS_DONE) {
|
||||||
switch_core_session_signal_state_change(channel->session);
|
switch_core_session_signal_state_change(channel->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_WARNING,
|
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_WARNING,
|
||||||
"%s Invalid State Change %s -> %s\n", channel->name, state_names[last_state], state_names[state]);
|
"%s Invalid State Change %s -> %s\n", channel->name, state_names[last_state], state_names[state]);
|
||||||
@ -1026,7 +1015,6 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
|
|||||||
switch_caller_profile_event_set_data(caller_profile, "Caller", event);
|
switch_caller_profile_event_set_data(caller_profile, "Caller", event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (originator_caller_profile && originatee_caller_profile) {
|
if (originator_caller_profile && originatee_caller_profile) {
|
||||||
/* Index Originator's Profile */
|
/* Index Originator's Profile */
|
||||||
switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
|
switch_caller_profile_event_set_data(originator_caller_profile, "Originator", event);
|
||||||
@ -1058,7 +1046,6 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_mutex_unlock(channel->profile_mutex);
|
switch_mutex_unlock(channel->profile_mutex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
|
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
|
||||||
@ -1145,7 +1132,6 @@ SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel
|
|||||||
}
|
}
|
||||||
switch_assert(channel->caller_profile->originatee_caller_profile->next != channel->caller_profile->originatee_caller_profile);
|
switch_assert(channel->caller_profile->originatee_caller_profile->next != channel->caller_profile->originatee_caller_profile);
|
||||||
switch_mutex_unlock(channel->profile_mutex);
|
switch_mutex_unlock(channel->profile_mutex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_profile(switch_channel_t *channel)
|
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_profile(switch_channel_t *channel)
|
||||||
@ -1255,7 +1241,6 @@ SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channe
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_mutex_unlock(channel->flag_mutex);
|
switch_mutex_unlock(channel->flag_mutex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
|
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
|
||||||
@ -1324,7 +1309,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
|
|||||||
return channel->state;
|
return channel->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
|
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
|
||||||
{
|
{
|
||||||
if (!switch_channel_test_flag(channel, CF_RING_READY)) {
|
if (!switch_channel_test_flag(channel, CF_RING_READY)) {
|
||||||
@ -1336,8 +1320,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_ch
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_channel_t *channel, const char *file, const char *func, int line)
|
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_channel_t *channel, const char *file, const char *func, int line)
|
||||||
{
|
{
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
@ -1958,7 +1940,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_channel_set_variable(channel, "last_app", last_app);
|
switch_channel_set_variable(channel, "last_app", last_app);
|
||||||
switch_channel_set_variable(channel, "last_arg", last_arg);
|
switch_channel_set_variable(channel, "last_arg", last_arg);
|
||||||
switch_channel_set_variable(channel, "caller_id", cid_buf);
|
switch_channel_set_variable(channel, "caller_id", cid_buf);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* switch_config.c -- Configuration File Parser
|
* switch_config.c -- Configuration File Parser
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_config.h>
|
#include <switch_config.h>
|
||||||
|
|
||||||
@ -87,7 +88,6 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg)
|
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -98,8 +98,6 @@ SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg)
|
|||||||
memset(cfg, 0, sizeof(*cfg));
|
memset(cfg, 0, sizeof(*cfg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, char **val)
|
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, char **val)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -143,8 +141,6 @@ SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, c
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (**var == '#' || **var == ';' || **var == '\n' || **var == '\r') {
|
if (**var == '#' || **var == ';' || **var == '\n' || **var == '\r') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -153,7 +149,6 @@ SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((end = strchr(*var, '#')) != 0 || (end = strchr(*var, ';')) != 0) {
|
if ((end = strchr(*var, '#')) != 0 || (end = strchr(*var, ';')) != 0) {
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
end--;
|
end--;
|
||||||
@ -171,7 +166,6 @@ SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, c
|
|||||||
}
|
}
|
||||||
*var = p;
|
*var = p;
|
||||||
|
|
||||||
|
|
||||||
if ((*val = strchr(*var, '=')) == 0) {
|
if ((*val = strchr(*var, '=')) == 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
/* log_printf(0, server.log, "Invalid syntax on %s: line %d\n", cfg->path, cfg->lineno); */
|
/* log_printf(0, server.log, "Invalid syntax on %s: line %d\n", cfg->path, cfg->lineno); */
|
||||||
@ -201,9 +195,7 @@ SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* switch_console.c -- Simple Console
|
* switch_console.c -- Simple Console
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_console.h>
|
#include <switch_console.h>
|
||||||
#include <switch_version.h>
|
#include <switch_version.h>
|
||||||
@ -70,7 +71,6 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream
|
|||||||
switch_size_t remaining = handle->data_size - handle->data_len;
|
switch_size_t remaining = handle->data_size - handle->data_len;
|
||||||
switch_size_t need = strlen(data) + 1;
|
switch_size_t need = strlen(data) + 1;
|
||||||
|
|
||||||
|
|
||||||
if ((remaining < need) && handle->alloc_len) {
|
if ((remaining < need) && handle->alloc_len) {
|
||||||
switch_size_t new_len;
|
switch_size_t new_len;
|
||||||
void *new_data;
|
void *new_data;
|
||||||
@ -104,7 +104,6 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream
|
|||||||
return ret ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
return ret ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int switch_console_process(char *cmd)
|
static int switch_console_process(char *cmd)
|
||||||
{
|
{
|
||||||
char *arg = NULL;
|
char *arg = NULL;
|
||||||
@ -186,7 +185,6 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, const
|
|||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (data) {
|
if (data) {
|
||||||
free(data);
|
free(data);
|
||||||
@ -208,7 +206,6 @@ char * prompt(EditLine *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return prompt_str;
|
return prompt_str;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static EditLine *el;
|
static EditLine *el;
|
||||||
@ -283,7 +280,6 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
el_set(el, EL_HIST, history, myhistory);
|
el_set(el, EL_HIST, history, myhistory);
|
||||||
history(myhistory, &ev, H_LOAD, hfile);
|
history(myhistory, &ev, H_LOAD, hfile);
|
||||||
|
|
||||||
|
|
||||||
switch_threadattr_create(&thd_attr, pool);
|
switch_threadattr_create(&thd_attr, pool);
|
||||||
switch_threadattr_detach_set(thd_attr, 1);
|
switch_threadattr_detach_set(thd_attr, 1);
|
||||||
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
@ -304,8 +300,6 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
/* Clean up our memory */
|
/* Clean up our memory */
|
||||||
history_end(myhistory);
|
history_end(myhistory);
|
||||||
el_end(el);
|
el_end(el);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -355,8 +349,6 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
memset(&cmd, 0, sizeof(cmd));
|
memset(&cmd, 0, sizeof(cmd));
|
||||||
for (x = 0; x < (sizeof(cmd) - 1); x++) {
|
for (x = 0; x < (sizeof(cmd) - 1); x++) {
|
||||||
int c = getchar();
|
int c = getchar();
|
||||||
@ -378,8 +370,6 @@ SWITCH_DECLARE(void) switch_console_loop(void)
|
|||||||
running = switch_console_process(cmd);
|
running = switch_console_process(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ SWITCH_DECLARE(const switch_state_handler_table_t *) switch_core_get_state_handl
|
|||||||
return runtime.state_handlers[index];
|
return runtime.state_handlers[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
@ -225,7 +224,6 @@ SWITCH_DECLARE(void) switch_core_service_session(switch_core_session_t *session,
|
|||||||
switch_core_session_launch_thread(session, switch_core_service_thread, thread_session);
|
switch_core_session_launch_thread(session, switch_core_service_thread, thread_session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* This function abstracts the thread creation for modules by allowing you to pass a function ptr and
|
/* This function abstracts the thread creation for modules by allowing you to pass a function ptr and
|
||||||
a void object and trust that that the function will be run in a thread with arg This lets
|
a void object and trust that that the function will be run in a thread with arg This lets
|
||||||
you request and activate a thread without giving up any knowledge about what is in the thread
|
you request and activate a thread without giving up any knowledge about what is in the thread
|
||||||
@ -267,7 +265,6 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
|
|||||||
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
switch_thread_create(&thread, thd_attr, func, ts, pool);
|
switch_thread_create(&thread, thd_attr, func, ts, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_set_globals(void)
|
SWITCH_DECLARE(void) switch_core_set_globals(void)
|
||||||
@ -367,14 +364,12 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dir_path = switch_mprintf("%s%ssounds", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR);
|
dir_path = switch_mprintf("%s%ssounds", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR);
|
||||||
switch_dir_make_recursive(dir_path,
|
switch_dir_make_recursive(dir_path,
|
||||||
SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE,
|
SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE,
|
||||||
runtime.memory_pool);
|
runtime.memory_pool);
|
||||||
switch_safe_free(dir_path);
|
switch_safe_free(dir_path);
|
||||||
|
|
||||||
|
|
||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.base_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.base_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.mod_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.mod_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.conf_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.conf_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
@ -384,12 +379,8 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
|
|||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.htdocs_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.htdocs_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.temp_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
switch_dir_make_recursive(SWITCH_GLOBAL_dirs.temp_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(int32_t) set_high_priority(void)
|
SWITCH_DECLARE(int32_t) set_high_priority(void)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -654,10 +645,8 @@ static void load_mime_types(void)
|
|||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_setrlimits(void)
|
SWITCH_DECLARE(void) switch_core_setrlimits(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SETRLIMIT
|
#ifdef HAVE_SETRLIMIT
|
||||||
@ -694,7 +683,6 @@ SWITCH_DECLARE(void) switch_core_setrlimits(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switch_bool_t console, const char **err)
|
SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switch_bool_t console, const char **err)
|
||||||
{
|
{
|
||||||
switch_xml_t xml = NULL, cfg = NULL;
|
switch_xml_t xml = NULL, cfg = NULL;
|
||||||
@ -735,8 +723,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
|||||||
switch_core_set_variable("local_ip_v6", guess_ip);
|
switch_core_set_variable("local_ip_v6", guess_ip);
|
||||||
switch_core_set_variable("base_dir", SWITCH_GLOBAL_dirs.base_dir);
|
switch_core_set_variable("base_dir", SWITCH_GLOBAL_dirs.base_dir);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (switch_xml_init(runtime.memory_pool, err) != SWITCH_STATUS_SUCCESS) {
|
if (switch_xml_init(runtime.memory_pool, err) != SWITCH_STATUS_SUCCESS) {
|
||||||
apr_terminate();
|
apr_terminate();
|
||||||
return SWITCH_STATUS_MEMERR;
|
return SWITCH_STATUS_MEMERR;
|
||||||
@ -774,7 +760,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
|||||||
rlp.rlim_max = RLIM_INFINITY;
|
rlp.rlim_max = RLIM_INFINITY;
|
||||||
setrlimit(RLIMIT_CORE, &rlp);
|
setrlimit(RLIMIT_CORE, &rlp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else if (!strcasecmp(var, "mailer-app")) {
|
} else if (!strcasecmp(var, "mailer-app")) {
|
||||||
runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
|
runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
|
||||||
} else if (!strcasecmp(var, "mailer-app-args")) {
|
} else if (!strcasecmp(var, "mailer-app-args")) {
|
||||||
@ -830,7 +815,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
|||||||
|
|
||||||
switch_scheduler_add_task(switch_timestamp(NULL), heartbeat_callback, "heartbeat", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
|
switch_scheduler_add_task(switch_timestamp(NULL), heartbeat_callback, "heartbeat", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
|
||||||
|
|
||||||
|
|
||||||
switch_uuid_get(&uuid);
|
switch_uuid_get(&uuid);
|
||||||
switch_uuid_format(runtime.uuid_str, &uuid);
|
switch_uuid_format(runtime.uuid_str, &uuid);
|
||||||
|
|
||||||
@ -1026,7 +1010,6 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, int32_
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_core_flag_t) switch_core_flags(void)
|
SWITCH_DECLARE(switch_core_flag_t) switch_core_flags(void)
|
||||||
{
|
{
|
||||||
return runtime.flags;
|
return runtime.flags;
|
||||||
@ -1037,7 +1020,6 @@ 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)) ? SWITCH_FALSE : SWITCH_TRUE;
|
return (switch_test_flag((&runtime), SCF_SHUTTING_DOWN) || switch_test_flag((&runtime), SCF_NO_NEW_SESSIONS)) ? SWITCH_FALSE : SWITCH_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
|
SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
|
||||||
{
|
{
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
@ -1049,7 +1031,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
|
|||||||
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
|
switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
|
||||||
switch_set_flag((&runtime), SCF_SHUTTING_DOWN);
|
switch_set_flag((&runtime), SCF_SHUTTING_DOWN);
|
||||||
|
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "End existing sessions\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "End existing sessions\n");
|
||||||
switch_core_session_hupall(SWITCH_CAUSE_SYSTEM_SHUTDOWN);
|
switch_core_session_hupall(SWITCH_CAUSE_SYSTEM_SHUTDOWN);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n");
|
||||||
@ -1084,7 +1065,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
|
|||||||
switch_safe_free(SWITCH_GLOBAL_dirs.grammar_dir);
|
switch_safe_free(SWITCH_GLOBAL_dirs.grammar_dir);
|
||||||
switch_safe_free(SWITCH_GLOBAL_dirs.temp_dir);
|
switch_safe_free(SWITCH_GLOBAL_dirs.temp_dir);
|
||||||
|
|
||||||
|
|
||||||
switch_core_hash_destroy(&runtime.global_vars);
|
switch_core_hash_destroy(&runtime.global_vars);
|
||||||
switch_core_hash_destroy(&runtime.mime_types);
|
switch_core_hash_destroy(&runtime.mime_types);
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
* switch_core_asr.c -- Main Core Library (Speech Detection Interface)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_codec.c -- Main Core Library (codec functions)
|
* switch_core_codec.c -- Main Core Library (codec functions)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -80,7 +81,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_write_codec(switch_core_
|
|||||||
switch_assert(session != NULL);
|
switch_assert(session != NULL);
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
|
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
|
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_channel_event_set_data(session->channel, event);
|
switch_channel_event_set_data(session->channel, event);
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
|
||||||
@ -117,7 +117,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, ch
|
|||||||
|
|
||||||
memset(codec, 0, sizeof(*codec));
|
memset(codec, 0, sizeof(*codec));
|
||||||
|
|
||||||
|
|
||||||
if (channels == 2) {
|
if (channels == 2) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stereo is currently unsupported. please downsample audio source to mono.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stereo is currently unsupported. please downsample audio source to mono.\n");
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
@ -189,7 +188,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_NOTIMPL;
|
return SWITCH_STATUS_NOTIMPL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_encode(switch_codec_t *codec,
|
SWITCH_DECLARE(switch_status_t) switch_core_codec_encode(switch_codec_t *codec,
|
||||||
@ -213,10 +211,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_encode(switch_codec_t *codec,
|
|||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return codec->implementation->encode(codec, other_codec, decoded_data, decoded_data_len, decoded_rate, encoded_data, encoded_data_len, encoded_rate,
|
return codec->implementation->encode(codec, other_codec, decoded_data, decoded_data_len, decoded_rate, encoded_data, encoded_data_len, encoded_rate,
|
||||||
flag);
|
flag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(switch_codec_t *codec,
|
SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(switch_codec_t *codec,
|
||||||
@ -226,13 +222,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(switch_codec_t *codec,
|
|||||||
uint32_t encoded_rate,
|
uint32_t encoded_rate,
|
||||||
void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
|
void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch_assert(codec != NULL);
|
switch_assert(codec != NULL);
|
||||||
switch_assert(encoded_data != NULL);
|
switch_assert(encoded_data != NULL);
|
||||||
switch_assert(decoded_data != NULL);
|
switch_assert(decoded_data != NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!codec->implementation) {
|
if (!codec->implementation) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initialized!\n");
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
@ -243,10 +236,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(switch_codec_t *codec,
|
|||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return codec->implementation->decode(codec, other_codec, encoded_data, encoded_data_len, encoded_rate, decoded_data, decoded_data_len, decoded_rate,
|
return codec->implementation->decode(codec, other_codec, encoded_data, encoded_data_len, encoded_rate, decoded_data, decoded_data_len, decoded_rate,
|
||||||
flag);
|
flag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||||
@ -266,3 +257,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
|||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -45,7 +45,6 @@ static void db_pick_path(char *dbname, char *buf, switch_size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb)
|
SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t **ppDb)
|
||||||
{
|
{
|
||||||
return sqlite3_open(filename, ppDb);
|
return sqlite3_open(filename, ppDb);
|
||||||
@ -185,7 +184,6 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(char *filename)
|
|||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *test_sql, char *drop_sql, char *reactive_sql)
|
SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *test_sql, char *drop_sql, char *reactive_sql)
|
||||||
{
|
{
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
@ -218,7 +216,6 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* mode:c
|
* mode:c
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_directory.c -- Main Core Library (Directory Interface)
|
* switch_core_directory.c -- Main Core Library (Directory Interface)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
#include "switch.h"
|
#include "switch.h"
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NEW_HOOK_DECL(outgoing_channel)
|
NEW_HOOK_DECL(outgoing_channel)
|
||||||
NEW_HOOK_DECL(receive_message)
|
NEW_HOOK_DECL(receive_message)
|
||||||
NEW_HOOK_DECL(receive_event)
|
NEW_HOOK_DECL(receive_event)
|
||||||
@ -46,3 +44,14 @@ NEW_HOOK_DECL(waitfor_read)
|
|||||||
NEW_HOOK_DECL(waitfor_write)
|
NEW_HOOK_DECL(waitfor_write)
|
||||||
NEW_HOOK_DECL(send_dtmf)
|
NEW_HOOK_DECL(send_dtmf)
|
||||||
NEW_HOOK_DECL(recv_dtmf)
|
NEW_HOOK_DECL(recv_dtmf)
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_file.c -- Main Core Library (File I/O Functions)
|
* switch_core_file.c -- Main Core Library (File I/O Functions)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -272,10 +273,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
return fh->file_interface->file_get_string(fh, col, string);
|
return fh->file_interface->file_get_string(fh, col, string);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
||||||
{
|
{
|
||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
@ -292,7 +291,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
|||||||
|
|
||||||
switch_resample_destroy(&fh->resampler);
|
switch_resample_destroy(&fh->resampler);
|
||||||
|
|
||||||
|
|
||||||
if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
|
if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
|
||||||
switch_core_destroy_memory_pool(&fh->memory_pool);
|
switch_core_destroy_memory_pool(&fh->memory_pool);
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,16 @@
|
|||||||
* switch_core_hash.c -- Main Core Library (hash functions)
|
* switch_core_hash.c -- Main Core Library (hash functions)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#include "../../../libs/sqlite/src/hash.h"
|
#include "../../../libs/sqlite/src/hash.h"
|
||||||
|
|
||||||
|
|
||||||
struct switch_hash {
|
struct switch_hash {
|
||||||
Hash table;
|
Hash table;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_init(switch_hash_t ** hash, switch_memory_pool_t *pool)
|
SWITCH_DECLARE(switch_status_t) switch_core_hash_init(switch_hash_t ** hash, switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
switch_hash_t *newhash;
|
switch_hash_t *newhash;
|
||||||
@ -53,7 +52,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_init(switch_hash_t ** hash, swi
|
|||||||
*hash = newhash;
|
*hash = newhash;
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t **hash)
|
SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t **hash)
|
||||||
@ -106,7 +104,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_locked(switch_hash_t * h
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t * hash, const char *key)
|
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t * hash, const char *key)
|
||||||
{
|
{
|
||||||
return sqlite3HashFind(&hash->table, key, (int)strlen(key)+1);
|
return sqlite3HashFind(&hash->table, key, (int)strlen(key)+1);
|
||||||
@ -129,13 +126,11 @@ SWITCH_DECLARE(void *) switch_core_hash_find_locked(switch_hash_t * hash, const
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(char *depricate_me, switch_hash_t *hash)
|
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_first(char *depricate_me, switch_hash_t *hash)
|
||||||
{
|
{
|
||||||
return (switch_hash_index_t *) sqliteHashFirst(&hash->table);
|
return (switch_hash_index_t *) sqliteHashFirst(&hash->table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *hi)
|
SWITCH_DECLARE(switch_hash_index_t *) switch_hash_next(switch_hash_index_t *hi)
|
||||||
{
|
{
|
||||||
return (switch_hash_index_t *) sqliteHashNext((HashElem *) hi);
|
return (switch_hash_index_t *) sqliteHashNext((HashElem *) hi);
|
||||||
|
@ -31,10 +31,10 @@
|
|||||||
* switch_core_io.c -- Main Core Library (Media I/O)
|
* switch_core_io.c -- Main Core Library (Media I/O)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, int stream_id)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, int stream_id)
|
||||||
{
|
{
|
||||||
switch_io_event_hook_video_write_frame_t *ptr;
|
switch_io_event_hook_video_write_frame_t *ptr;
|
||||||
@ -89,7 +89,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, int stream_id)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, int stream_id)
|
||||||
{
|
{
|
||||||
switch_io_event_hook_read_frame_t *ptr;
|
switch_io_event_hook_read_frame_t *ptr;
|
||||||
@ -137,7 +136,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
is_cng = 1;
|
is_cng = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_assert((*frame)->codec != NULL);
|
switch_assert((*frame)->codec != NULL);
|
||||||
@ -352,7 +350,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
|||||||
session->read_codec->implementation->actual_samples_per_second,
|
session->read_codec->implementation->actual_samples_per_second,
|
||||||
session->enc_read_frame.data, &session->enc_read_frame.datalen, &session->enc_read_frame.rate, &flag);
|
session->enc_read_frame.data, &session->enc_read_frame.datalen, &session->enc_read_frame.rate, &flag);
|
||||||
|
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case SWITCH_STATUS_RESAMPLE:
|
case SWITCH_STATUS_RESAMPLE:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 1\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 1\n");
|
||||||
@ -431,7 +428,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
|||||||
switch_thread_rwlock_unlock(session->bug_rwlock);
|
switch_thread_rwlock_unlock(session->bug_rwlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,11 +466,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (switch_test_flag(frame, SFF_CNG)) {
|
if (switch_test_flag(frame, SFF_CNG)) {
|
||||||
|
|
||||||
if (switch_channel_test_flag(session->channel, CF_ACCEPT_CNG)) {
|
if (switch_channel_test_flag(session->channel, CF_ACCEPT_CNG)) {
|
||||||
return perform_write(session, frame, timeout, flag, stream_id);
|
return perform_write(session, frame, timeout, flag, stream_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,13 +565,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
|||||||
session->write_resampler->from_len = write_frame->datalen / 2;
|
session->write_resampler->from_len = write_frame->datalen / 2;
|
||||||
switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
|
switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
session->write_resampler->to_len = (uint32_t)
|
session->write_resampler->to_len = (uint32_t)
|
||||||
switch_resample_process(session->write_resampler, session->write_resampler->from,
|
switch_resample_process(session->write_resampler, session->write_resampler->from,
|
||||||
session->write_resampler->from_len, session->write_resampler->to, session->write_resampler->to_size, 0);
|
session->write_resampler->from_len, session->write_resampler->to, session->write_resampler->to_size, 0);
|
||||||
|
|
||||||
|
|
||||||
switch_float_to_short(session->write_resampler->to, data, session->write_resampler->to_len);
|
switch_float_to_short(session->write_resampler->to, data, session->write_resampler->to_len);
|
||||||
|
|
||||||
write_frame->samples = session->write_resampler->to_len;
|
write_frame->samples = session->write_resampler->to_len;
|
||||||
@ -748,7 +739,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
|||||||
session->enc_write_frame.data,
|
session->enc_write_frame.data,
|
||||||
&session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
|
&session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
|
||||||
|
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case SWITCH_STATUS_RESAMPLE:
|
case SWITCH_STATUS_RESAMPLE:
|
||||||
session->enc_write_frame.codec = session->write_codec;
|
session->enc_write_frame.codec = session->write_codec;
|
||||||
@ -844,7 +834,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
|||||||
if (do_write) {
|
if (do_write) {
|
||||||
return perform_write(session, frame, timeout, io_flag, stream_id);
|
return perform_write(session, frame, timeout, io_flag, stream_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -874,9 +863,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout, int stream_id)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout, int stream_id)
|
||||||
@ -893,9 +880,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_ses
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout, int stream_id)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout, int stream_id)
|
||||||
@ -912,11 +897,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
|
||||||
{
|
{
|
||||||
switch_io_event_hook_recv_dtmf_t *ptr;
|
switch_io_event_hook_recv_dtmf_t *ptr;
|
||||||
@ -951,12 +934,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_sessio
|
|||||||
status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf);
|
status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core_session_t *session, const char *dtmf_string)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core_session_t *session, const char *dtmf_string)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
@ -1007,7 +987,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return sent ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
return sent ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_media_bug.c -- Main Core Library (Media Bugs)
|
* switch_core_media_bug.c -- Main Core Library (Media Bugs)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "switch.h"
|
#include "switch.h"
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -101,10 +102,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
maxlen = sizeof(data) > frame->buflen ? frame->buflen : sizeof(data);
|
maxlen = sizeof(data) > frame->buflen ? frame->buflen : sizeof(data);
|
||||||
|
|
||||||
|
|
||||||
if ((rdlen = rlen > wlen ? wlen : rlen) > maxlen) {
|
if ((rdlen = rlen > wlen ? wlen : rlen) > maxlen) {
|
||||||
rdlen = maxlen;
|
rdlen = maxlen;
|
||||||
}
|
}
|
||||||
@ -249,7 +248,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t
|
|||||||
bug->thread_id = switch_thread_self();
|
bug->thread_id = switch_thread_self();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bug->ready = 1;
|
bug->ready = 1;
|
||||||
switch_thread_rwlock_wrlock(session->bug_rwlock);
|
switch_thread_rwlock_wrlock(session->bug_rwlock);
|
||||||
bug->next = session->bugs;
|
bug->next = session->bugs;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_memory.c -- Main Core Library (memory management)
|
* switch_core_memory.c -- Main Core Library (memory management)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
/*#define LOCK_MORE*/
|
/*#define LOCK_MORE*/
|
||||||
@ -151,7 +152,6 @@ SWITCH_DECLARE(char *) switch_core_session_sprintf(switch_core_session_t *sessio
|
|||||||
switch_assert(result != NULL);
|
switch_assert(result != NULL);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOCK_MORE
|
#ifdef LOCK_MORE
|
||||||
switch_mutex_unlock(memory_manager.mem_lock);
|
switch_mutex_unlock(memory_manager.mem_lock);
|
||||||
#endif
|
#endif
|
||||||
@ -183,7 +183,6 @@ SWITCH_DECLARE(char *) switch_core_sprintf(switch_memory_pool_t *pool, const cha
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, const char *todup)
|
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, const char *todup)
|
||||||
{
|
{
|
||||||
char *duped = NULL;
|
char *duped = NULL;
|
||||||
@ -216,7 +215,6 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session
|
|||||||
return duped;
|
return duped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, const char *todup)
|
SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, const char *todup)
|
||||||
{
|
{
|
||||||
char *duped = NULL;
|
char *duped = NULL;
|
||||||
@ -268,6 +266,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor
|
|||||||
tmp = switch_core_sprintf(*pool, "%s:%d", func, line);
|
tmp = switch_core_sprintf(*pool, "%s:%d", func, line);
|
||||||
apr_pool_tag(*pool, tmp);
|
apr_pool_tag(*pool, tmp);
|
||||||
switch_mutex_unlock(memory_manager.mem_lock);
|
switch_mutex_unlock(memory_manager.mem_lock);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,11 +286,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_m
|
|||||||
}
|
}
|
||||||
*pool = NULL;
|
*pool = NULL;
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory)
|
SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory)
|
||||||
{
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
@ -311,7 +308,6 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size
|
|||||||
switch_assert(ptr != NULL);
|
switch_assert(ptr != NULL);
|
||||||
memset(ptr, 0, memory);
|
memset(ptr, 0, memory);
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOCK_MORE
|
#ifdef LOCK_MORE
|
||||||
switch_mutex_unlock(memory_manager.mem_lock);
|
switch_mutex_unlock(memory_manager.mem_lock);
|
||||||
#endif
|
#endif
|
||||||
@ -319,7 +315,6 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_memory_reclaim(void)
|
SWITCH_DECLARE(void) switch_core_memory_reclaim(void)
|
||||||
{
|
{
|
||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
@ -391,10 +386,10 @@ static void *SWITCH_THREAD_FUNC pool_thread(switch_thread_t * thread, void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memory_manager.pool_thread_running = 0;
|
memory_manager.pool_thread_running = 0;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void switch_core_memory_stop(void)
|
void switch_core_memory_stop(void)
|
||||||
{
|
{
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping memory pool queue.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping memory pool queue.\n");
|
||||||
@ -430,3 +425,14 @@ switch_memory_pool_t *switch_core_memory_init(void)
|
|||||||
|
|
||||||
return memory_manager.memory_pool;
|
return memory_manager.memory_pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_port_allocator.c -- Main Core Library (port allocator)
|
* switch_core_port_allocator.c -- Main Core Library (port allocator)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -109,7 +110,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t sta
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc, switch_port_t *port_ptr)
|
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc, switch_port_t *port_ptr)
|
||||||
{
|
{
|
||||||
switch_port_t port = 0;
|
switch_port_t port = 0;
|
||||||
@ -168,7 +168,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_free_port(switch_core_port_allocator_t *alloc, switch_port_t port)
|
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_free_port(switch_core_port_allocator_t *alloc, switch_port_t port)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
@ -191,10 +190,20 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_free_port(switch_core
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocator_t **alloc)
|
SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocator_t **alloc)
|
||||||
{
|
{
|
||||||
switch_memory_pool_t *pool = (*alloc)->pool;
|
switch_memory_pool_t *pool = (*alloc)->pool;
|
||||||
switch_core_destroy_memory_pool(&pool);
|
switch_core_destroy_memory_pool(&pool);
|
||||||
*alloc = NULL;
|
*alloc = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_rwlock.c -- Main Core Library (read / write locks)
|
* switch_core_rwlock.c -- Main Core Library (read / write locks)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_session.c -- Main Core Library (session routines)
|
* switch_core_session.c -- Main Core Library (session routines)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "switch.h"
|
#include "switch.h"
|
||||||
#include "switch_core.h"
|
#include "switch_core.h"
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
@ -43,7 +44,6 @@ static struct {
|
|||||||
switch_size_t session_id;
|
switch_size_t session_id;
|
||||||
} session_manager;
|
} session_manager;
|
||||||
|
|
||||||
|
|
||||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
|
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
|
||||||
#else
|
#else
|
||||||
@ -344,7 +344,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_receive_message(switch_core_
|
|||||||
|
|
||||||
if (session->endpoint_interface->io_routines->receive_message) {
|
if (session->endpoint_interface->io_routines->receive_message) {
|
||||||
status = session->endpoint_interface->io_routines->receive_message(session, message);
|
status = session->endpoint_interface->io_routines->receive_message(session, message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == SWITCH_STATUS_SUCCESS) {
|
if (status == SWITCH_STATUS_SUCCESS) {
|
||||||
@ -578,7 +577,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf)
|
SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
@ -605,9 +603,7 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_ivr_deactivate_unicast(session);
|
switch_ivr_deactivate_unicast(session);
|
||||||
|
|
||||||
switch_channel_clear_flag(channel, CF_BREAK);
|
switch_channel_clear_flag(channel, CF_BREAK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -616,8 +612,6 @@ SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(switch_core_s
|
|||||||
return session->channel;
|
return session->channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
|
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
@ -708,7 +702,6 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t * thr
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_session_thread_launch(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_core_session_thread_launch(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
@ -738,7 +731,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_thread_launch(switch_core_se
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session, switch_thread_start_t func, void *obj)
|
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session, switch_thread_start_t func, void *obj)
|
||||||
{
|
{
|
||||||
switch_thread_t *thread;
|
switch_thread_t *thread;
|
||||||
@ -751,7 +743,6 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *se
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t
|
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t
|
||||||
*endpoint_interface, switch_memory_pool_t **pool)
|
*endpoint_interface, switch_memory_pool_t **pool)
|
||||||
{
|
{
|
||||||
@ -788,7 +779,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch
|
|||||||
switch_core_new_memory_pool(&usepool);
|
switch_core_new_memory_pool(&usepool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
session = switch_core_alloc(usepool, sizeof(*session));
|
session = switch_core_alloc(usepool, sizeof(*session));
|
||||||
session->pool = usepool;
|
session->pool = usepool;
|
||||||
|
|
||||||
@ -798,7 +788,6 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch
|
|||||||
|
|
||||||
switch_channel_init(session->channel, session, CS_NEW, 0);
|
switch_channel_init(session->channel, session, CS_NEW, 0);
|
||||||
|
|
||||||
|
|
||||||
/* The session *IS* the pool you may not alter it because you have no idea how
|
/* The session *IS* the pool you may not alter it because you have no idea how
|
||||||
its all private it will be passed to the thread run function */
|
its all private it will be passed to the thread run function */
|
||||||
|
|
||||||
@ -858,12 +847,10 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(cons
|
|||||||
return switch_core_session_request(endpoint_interface, pool);
|
return switch_core_session_request(endpoint_interface, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef SWITCH_PREFIX_DIR
|
#ifndef SWITCH_PREFIX_DIR
|
||||||
#define SWITCH_PREFIX_DIR "."
|
#define SWITCH_PREFIX_DIR "."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b)
|
SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b)
|
||||||
{
|
{
|
||||||
switch_assert(a != NULL);
|
switch_assert(a != NULL);
|
||||||
@ -896,7 +883,6 @@ SWITCH_DECLARE(uint32_t) switch_core_sessions_per_second(uint32_t new_limit)
|
|||||||
return runtime.sps_total;
|
return runtime.sps_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void switch_core_session_init(switch_memory_pool_t *pool)
|
void switch_core_session_init(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
memset(&session_manager, 0, sizeof(session_manager));
|
memset(&session_manager, 0, sizeof(session_manager));
|
||||||
@ -1103,7 +1089,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
|
|||||||
session->stack_count--;
|
session->stack_count--;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_speech.c -- Main Core Library (speech functions)
|
* switch_core_speech.c -- Main Core Library (speech functions)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -58,7 +59,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((sh->speech_interface = switch_loadable_module_get_speech_interface(module_name)) == 0) {
|
if ((sh->speech_interface = switch_loadable_module_get_speech_interface(module_name)) == 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid speech module [%s]!\n", module_name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid speech module [%s]!\n", module_name);
|
||||||
return SWITCH_STATUS_GENERR;
|
return SWITCH_STATUS_GENERR;
|
||||||
@ -79,7 +79,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *
|
|||||||
sh->param = switch_core_strdup(sh->memory_pool, param);
|
sh->param = switch_core_strdup(sh->memory_pool, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sh->rate = rate;
|
sh->rate = rate;
|
||||||
sh->name = switch_core_strdup(pool, module_name);
|
sh->name = switch_core_strdup(pool, module_name);
|
||||||
sh->samples = switch_bytes_per_frame(rate, interval);
|
sh->samples = switch_bytes_per_frame(rate, interval);
|
||||||
@ -87,7 +86,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *
|
|||||||
return sh->speech_interface->speech_open(sh, voice_name, rate, flags);
|
return sh->speech_interface->speech_open(sh, voice_name, rate, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
|
SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
|
||||||
{
|
{
|
||||||
switch_assert(sh != NULL);
|
switch_assert(sh != NULL);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_sqldb.c -- Main Core Library (statistics tracker)
|
* switch_core_sqldb.c -- Main Core Library (statistics tracker)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -88,9 +89,6 @@ static switch_status_t switch_core_db_persistant_execute_trans(switch_core_db_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (retries > 0) {
|
while (retries > 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch_core_db_exec(db, sql, NULL, NULL, &errmsg);
|
switch_core_db_exec(db, sql, NULL, NULL, &errmsg);
|
||||||
if (errmsg) {
|
if (errmsg) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", errmsg);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", errmsg);
|
||||||
@ -107,7 +105,6 @@ static switch_status_t switch_core_db_persistant_execute_trans(switch_core_db_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
switch_core_db_exec(db, "end transaction", NULL, NULL, &errmsg);
|
switch_core_db_exec(db, "end transaction", NULL, NULL, &errmsg);
|
||||||
@ -347,7 +344,6 @@ static void core_event_handler(switch_event_t *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void switch_core_sqldb_start(switch_memory_pool_t *pool)
|
void switch_core_sqldb_start(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
switch_thread_t *thread;
|
switch_thread_t *thread;
|
||||||
@ -431,3 +427,14 @@ void switch_core_sqldb_stop(void)
|
|||||||
switch_core_db_close(sql_manager.event_db);
|
switch_core_db_close(sql_manager.event_db);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_state_maching.c -- Main Core Library (state machine)
|
* switch_core_state_maching.c -- Main Core Library (state machine)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ static void switch_core_standard_on_hangup(switch_core_session_t *session)
|
|||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HANGUP %s, cause: %s\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HANGUP %s, cause: %s\n",
|
||||||
switch_channel_get_name(session->channel), switch_channel_cause2str(switch_channel_get_cause(session->channel)));
|
switch_channel_get_name(session->channel), switch_channel_cause2str(switch_channel_get_cause(session->channel)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void switch_core_standard_on_reset(switch_core_session_t *session)
|
static void switch_core_standard_on_reset(switch_core_session_t *session)
|
||||||
@ -52,7 +52,6 @@ static void switch_core_standard_on_reset(switch_core_session_t *session)
|
|||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RESET %s\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RESET %s\n",
|
||||||
switch_channel_get_name(session->channel));
|
switch_channel_get_name(session->channel));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void switch_core_standard_on_ring(switch_core_session_t *session)
|
static void switch_core_standard_on_ring(switch_core_session_t *session)
|
||||||
@ -119,7 +118,6 @@ static void switch_core_standard_on_ring(switch_core_session_t *session)
|
|||||||
if (expanded && dpstr && expanded != dpstr) {
|
if (expanded && dpstr && expanded != dpstr) {
|
||||||
free(expanded);
|
free(expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void switch_core_standard_on_execute(switch_core_session_t *session)
|
static void switch_core_standard_on_execute(switch_core_session_t *session)
|
||||||
@ -167,7 +165,6 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
|
|||||||
extension->current_application->application_data)) != extension->current_application->application_data) {
|
extension->current_application->application_data)) != extension->current_application->application_data) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Expanded String %s(%s)\n", switch_channel_get_name(session->channel),
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Expanded String %s(%s)\n", switch_channel_get_name(session->channel),
|
||||||
extension->current_application->application_name, expanded);
|
extension->current_application->application_name, expanded);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_get_variable(session->channel, "presence_id")) {
|
if (switch_channel_get_variable(session->channel, "presence_id")) {
|
||||||
@ -274,7 +271,6 @@ static void print_trace(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void handle_fatality(int sig)
|
static void handle_fatality(int sig)
|
||||||
{
|
{
|
||||||
switch_thread_id_t thread_id;
|
switch_thread_id_t thread_id;
|
||||||
@ -291,7 +287,6 @@ static void handle_fatality(int sig)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void switch_core_state_machine_init(switch_memory_pool_t *pool)
|
void switch_core_state_machine_init(switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -300,8 +295,6 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define STATE_MACRO(__STATE, __STATE_STR) do { \
|
#define STATE_MACRO(__STATE, __STATE_STR) do { \
|
||||||
midstate = state; \
|
midstate = state; \
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State %s\n", switch_channel_get_name(session->channel), __STATE_STR); \
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State %s\n", switch_channel_get_name(session->channel), __STATE_STR); \
|
||||||
@ -371,7 +364,6 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Life of the channel. you have channel and pool in your session
|
Life of the channel. you have channel and pool in your session
|
||||||
everywhere you go you use the session to malloc with
|
everywhere you go you use the session to malloc with
|
||||||
@ -477,10 +469,8 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
endstate = switch_channel_get_state(session->channel);
|
endstate = switch_channel_get_state(session->channel);
|
||||||
|
|
||||||
|
|
||||||
if (endstate == switch_channel_get_running_state(session->channel)) {
|
if (endstate == switch_channel_get_running_state(session->channel)) {
|
||||||
if (endstate == CS_NEW) {
|
if (endstate == CS_NEW) {
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
@ -488,7 +478,6 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
switch_thread_cond_wait(session->cond, session->mutex);
|
switch_thread_cond_wait(session->cond, session->mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
switch_mutex_unlock(session->mutex);
|
switch_mutex_unlock(session->mutex);
|
||||||
@ -498,5 +487,15 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
//apr_hash_set(stack_table, &thread_id, sizeof(thread_id), NULL);
|
//apr_hash_set(stack_table, &thread_id, sizeof(thread_id), NULL);
|
||||||
}
|
}
|
||||||
session->thread_running = 0;
|
session->thread_running = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For Emacs:
|
||||||
|
* Local Variables:
|
||||||
|
* mode:c
|
||||||
|
* indent-tabs-mode:t
|
||||||
|
* tab-width:4
|
||||||
|
* c-basic-offset:4
|
||||||
|
* End:
|
||||||
|
* For VIM:
|
||||||
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
*/
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_core_timer.c -- Main Core Library (timer interface)
|
* switch_core_timer.c -- Main Core Library (timer interface)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include "private/switch_core_pvt.h"
|
#include "private/switch_core_pvt.h"
|
||||||
|
|
||||||
|
@ -703,12 +703,10 @@ switch_status_t process_callback_result(char *ret,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no match, return false\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no match, return false\n");
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* mode:c
|
* mode:c
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* switch_event.c -- Event System
|
* switch_event.c -- Event System
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_event.h>
|
#include <switch_event.h>
|
||||||
|
|
||||||
@ -326,7 +327,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(const cha
|
|||||||
switch_core_hash_insert(CUSTOM_HASH, subclass->name, subclass);
|
switch_core_hash_insert(CUSTOM_HASH, subclass->name, subclass);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
|
SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
|
||||||
@ -391,7 +391,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
|
|||||||
switch_core_hash_destroy(&CUSTOM_HASH);
|
switch_core_hash_destroy(&CUSTOM_HASH);
|
||||||
switch_core_memory_reclaim_events();
|
switch_core_memory_reclaim_events();
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,8 +413,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
|
|||||||
switch_queue_create(&EVENT_RECYCLE_QUEUE, SWITCH_CORE_QUEUE_LEN, THRUNTIME_POOL);
|
switch_queue_create(&EVENT_RECYCLE_QUEUE, SWITCH_CORE_QUEUE_LEN, THRUNTIME_POOL);
|
||||||
switch_queue_create(&EVENT_HEADER_RECYCLE_QUEUE, SWITCH_CORE_QUEUE_LEN, THRUNTIME_POOL);
|
switch_queue_create(&EVENT_HEADER_RECYCLE_QUEUE, SWITCH_CORE_QUEUE_LEN, THRUNTIME_POOL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Eventing Engine.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Eventing Engine.\n");
|
||||||
switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||||
switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL);
|
||||||
@ -430,7 +427,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool)
|
|||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
}
|
}
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, const char *subclass_name)
|
SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, const char *subclass_name)
|
||||||
@ -794,7 +790,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, int offset)
|
static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, int offset)
|
||||||
{
|
{
|
||||||
switch_xml_t header = NULL;
|
switch_xml_t header = NULL;
|
||||||
@ -1012,7 +1007,6 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(char *file,
|
|||||||
return SWITCH_STATUS_MEMERR;
|
return SWITCH_STATUS_MEMERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define resize(l) {\
|
#define resize(l) {\
|
||||||
char *dp;\
|
char *dp;\
|
||||||
olen += (len + l + block);\
|
olen += (len + l + block);\
|
||||||
@ -1273,7 +1267,6 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix)
|
SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix)
|
||||||
{
|
{
|
||||||
switch_stream_handle_t stream = { 0 };
|
switch_stream_handle_t stream = { 0 };
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
* switch_ivr.c -- IVR Library
|
* switch_ivr.c -- IVR Library
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
#include <switch_ivr.h>
|
#include <switch_ivr.h>
|
||||||
#include "stfu.h"
|
#include "stfu.h"
|
||||||
@ -78,7 +79,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void *SWITCH_THREAD_FUNC unicast_thread_run(switch_thread_t *thread, void *obj)
|
static void *SWITCH_THREAD_FUNC unicast_thread_run(switch_thread_t *thread, void *obj)
|
||||||
{
|
{
|
||||||
switch_unicast_conninfo_t *conninfo = (switch_unicast_conninfo_t *) obj;
|
switch_unicast_conninfo_t *conninfo = (switch_unicast_conninfo_t *) obj;
|
||||||
@ -596,7 +596,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_s
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_session_t *session,
|
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_session_t *session,
|
||||||
char *buf,
|
char *buf,
|
||||||
switch_size_t buflen,
|
switch_size_t buflen,
|
||||||
@ -645,8 +644,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
|||||||
digit_started = switch_timestamp_now();
|
digit_started = switch_timestamp_now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (switch_channel_ready(channel)) {
|
while (switch_channel_ready(channel)) {
|
||||||
switch_frame_t *read_frame;
|
switch_frame_t *read_frame;
|
||||||
|
|
||||||
@ -709,7 +706,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_core_session_message_t msg = { 0 };
|
switch_core_session_message_t msg = { 0 };
|
||||||
@ -823,7 +819,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_media_flag_t flags)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_media_flag_t flags)
|
||||||
{
|
{
|
||||||
const char *other_uuid;
|
const char *other_uuid;
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
* switch_ivr_async.c -- IVR Library (async operations)
|
* switch_ivr_async.c -- IVR Library (async operations)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
struct echo_helper {
|
struct echo_helper {
|
||||||
@ -94,7 +95,6 @@ SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
switch_file_handle_t fh;
|
switch_file_handle_t fh;
|
||||||
int mux;
|
int mux;
|
||||||
@ -174,8 +174,6 @@ static switch_bool_t write_displace_callback(switch_media_bug_t *bug, void *user
|
|||||||
return SWITCH_TRUE;
|
return SWITCH_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static switch_bool_t read_displace_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
|
static switch_bool_t read_displace_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
|
||||||
{
|
{
|
||||||
displace_helper_t *dh = (displace_helper_t *) user_data;
|
displace_helper_t *dh = (displace_helper_t *) user_data;
|
||||||
@ -261,7 +259,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_ses
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, const char *file, uint32_t limit, const char *flags)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, const char *file, uint32_t limit, const char *flags)
|
||||||
@ -273,7 +270,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_
|
|||||||
time_t to = 0;
|
time_t to = 0;
|
||||||
displace_helper_t *dh;
|
displace_helper_t *dh;
|
||||||
|
|
||||||
|
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
switch_assert(channel != NULL);
|
switch_assert(channel != NULL);
|
||||||
|
|
||||||
@ -334,7 +330,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
|
static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
|
||||||
{
|
{
|
||||||
switch_file_handle_t *fh = (switch_file_handle_t *) user_data;
|
switch_file_handle_t *fh = (switch_file_handle_t *) user_data;
|
||||||
@ -397,10 +392,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_sessi
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct eavesdrop_pvt {
|
struct eavesdrop_pvt {
|
||||||
switch_buffer_t *buffer;
|
switch_buffer_t *buffer;
|
||||||
switch_mutex_t *mutex;
|
switch_mutex_t *mutex;
|
||||||
@ -489,7 +482,6 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data
|
|||||||
return SWITCH_TRUE;
|
return SWITCH_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session_t *session, const char *uuid, switch_eavesdrop_flag_t flags)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session_t *session, const char *uuid, switch_eavesdrop_flag_t flags)
|
||||||
{
|
{
|
||||||
switch_core_session_t *tsession;
|
switch_core_session_t *tsession;
|
||||||
@ -649,7 +641,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
switch_core_codec_destroy(&codec);
|
switch_core_codec_destroy(&codec);
|
||||||
@ -883,7 +874,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_inband_dtmf_session(switch_core_sessi
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
switch_core_session_t *session;
|
switch_core_session_t *session;
|
||||||
teletone_generation_session_t ts;
|
teletone_generation_session_t ts;
|
||||||
@ -907,7 +897,6 @@ static int teletone_dtmf_generate_handler(teletone_generation_session_t * ts, te
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static switch_status_t generate_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
|
static switch_status_t generate_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1034,7 +1023,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_inband_dtmf_generate_session(switch_c
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define MAX_TONES 16
|
#define MAX_TONES 16
|
||||||
typedef struct {
|
typedef struct {
|
||||||
teletone_multi_tone_t mt;
|
teletone_multi_tone_t mt;
|
||||||
@ -1045,7 +1033,6 @@ typedef struct {
|
|||||||
int up;
|
int up;
|
||||||
} switch_tone_detect_t;
|
} switch_tone_detect_t;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
switch_tone_detect_t list[MAX_TONES+1];
|
switch_tone_detect_t list[MAX_TONES+1];
|
||||||
int index;
|
int index;
|
||||||
@ -1244,7 +1231,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct speech_thread_handle {
|
struct speech_thread_handle {
|
||||||
switch_core_session_t *session;
|
switch_core_session_t *session;
|
||||||
switch_asr_handle_t *ah;
|
switch_asr_handle_t *ah;
|
||||||
@ -1336,7 +1322,6 @@ static switch_bool_t speech_callback(switch_media_bug_t *bug, void *user_data, s
|
|||||||
switch_threadattr_detach_set(thd_attr, 1);
|
switch_threadattr_detach_set(thd_attr, 1);
|
||||||
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
|
||||||
switch_thread_create(&thread, thd_attr, speech_thread, sth, sth->pool);
|
switch_thread_create(&thread, thd_attr, speech_thread, sth, sth->pool);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SWITCH_ABC_TYPE_CLOSE:{
|
case SWITCH_ABC_TYPE_CLOSE:{
|
||||||
@ -1382,11 +1367,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_sessio
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_pause_detect_speech(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_pause_detect_speech(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
@ -1399,7 +1381,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_pause_detect_speech(switch_core_sessi
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_session_t *session)
|
||||||
@ -1414,10 +1395,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_sess
|
|||||||
}
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *path)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *path)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
@ -1439,7 +1418,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *grammar)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *grammar)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
@ -1536,7 +1514,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct hangup_helper {
|
struct hangup_helper {
|
||||||
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||||
switch_bool_t bleg;
|
switch_bool_t bleg;
|
||||||
@ -1654,7 +1631,6 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, const char
|
|||||||
return switch_scheduler_add_task(runtime, sch_transfer_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG);
|
return switch_scheduler_add_task(runtime, sch_transfer_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct broadcast_helper {
|
struct broadcast_helper {
|
||||||
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||||
char *path;
|
char *path;
|
||||||
@ -1799,11 +1775,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
|
|||||||
switch_core_session_rwunlock(session);
|
switch_core_session_rwunlock(session);
|
||||||
switch_safe_free(mypath);
|
switch_safe_free(mypath);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For Emacs:
|
/* For Emacs:
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* mode:c
|
* mode:c
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* switch_ivr_bridge.c -- IVR Library
|
* switch_ivr_bridge.c -- IVR Library
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
|
static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
|
||||||
@ -43,8 +44,6 @@ struct switch_ivr_bridge_data {
|
|||||||
};
|
};
|
||||||
typedef struct switch_ivr_bridge_data switch_ivr_bridge_data_t;
|
typedef struct switch_ivr_bridge_data switch_ivr_bridge_data_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
|
static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
|
||||||
{
|
{
|
||||||
switch_ivr_bridge_data_t *data = obj;
|
switch_ivr_bridge_data_t *data = obj;
|
||||||
@ -260,7 +259,6 @@ static switch_status_t audio_bridge_on_loopback(switch_core_session_t *session)
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static switch_status_t audio_bridge_on_ring(switch_core_session_t *session)
|
static switch_status_t audio_bridge_on_ring(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = NULL;
|
switch_channel_t *channel = NULL;
|
||||||
@ -298,7 +296,6 @@ static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
|
|||||||
/*.on_hold */ audio_bridge_on_hold,
|
/*.on_hold */ audio_bridge_on_hold,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
|
static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = NULL;
|
switch_channel_t *channel = NULL;
|
||||||
@ -440,7 +437,6 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE))
|
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE))
|
||||||
&& (other_session = switch_core_session_locate(uuid))) {
|
&& (other_session = switch_core_session_locate(uuid))) {
|
||||||
switch_channel_t *other_channel = NULL;
|
switch_channel_t *other_channel = NULL;
|
||||||
@ -468,7 +464,6 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
|
|||||||
switch_core_session_rwunlock(other_session);
|
switch_core_session_rwunlock(other_session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -515,7 +510,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
|
|||||||
switch_channel_add_state_handler(caller_channel, &signal_bridge_state_handlers);
|
switch_channel_add_state_handler(caller_channel, &signal_bridge_state_handlers);
|
||||||
switch_channel_add_state_handler(peer_channel, &signal_bridge_state_handlers);
|
switch_channel_add_state_handler(peer_channel, &signal_bridge_state_handlers);
|
||||||
|
|
||||||
|
|
||||||
/* fire events that will change the data table from "show channels" */
|
/* fire events that will change the data table from "show channels" */
|
||||||
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
|
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_channel_event_set_data(caller_channel, event);
|
switch_channel_event_set_data(caller_channel, event);
|
||||||
@ -651,7 +645,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
|
msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
|
||||||
msg.from = __FILE__;
|
msg.from = __FILE__;
|
||||||
msg.string_arg = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session));
|
msg.string_arg = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session));
|
||||||
@ -669,7 +662,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_CHANNEL_VARIABLE, switch_channel_get_name(peer_channel));
|
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_CHANNEL_VARIABLE, switch_channel_get_name(peer_channel));
|
||||||
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_UUID_VARIABLE, switch_core_session_get_uuid(peer_session));
|
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_UUID_VARIABLE, switch_core_session_get_uuid(peer_session));
|
||||||
switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(peer_session));
|
switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(peer_session));
|
||||||
@ -728,7 +720,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid)
|
||||||
{
|
{
|
||||||
switch_core_session_t *originator_session, *originatee_session, *swap_session;
|
switch_core_session_t *originator_session, *originatee_session, *swap_session;
|
||||||
@ -757,7 +748,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* override transmit state for originator_channel to bridge to originatee_channel
|
/* override transmit state for originator_channel to bridge to originatee_channel
|
||||||
* install pointer to originatee_session into originator_channel
|
* install pointer to originatee_session into originator_channel
|
||||||
* set CF_TRANSFER on both channels and change state to CS_TRANSMIT to
|
* set CF_TRANSFER on both channels and change state to CS_TRANSMIT to
|
||||||
@ -773,8 +763,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
|
|||||||
switch_channel_add_state_handler(originatee_channel, &uuid_bridge_state_handlers);
|
switch_channel_add_state_handler(originatee_channel, &uuid_bridge_state_handlers);
|
||||||
switch_channel_set_variable(originator_channel, SWITCH_UUID_BRIDGE, switch_core_session_get_uuid(originatee_session));
|
switch_channel_set_variable(originator_channel, SWITCH_UUID_BRIDGE, switch_core_session_get_uuid(originatee_session));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch_channel_set_variable(originator_channel, SWITCH_BRIDGE_CHANNEL_VARIABLE, switch_channel_get_name(originatee_channel));
|
switch_channel_set_variable(originator_channel, SWITCH_BRIDGE_CHANNEL_VARIABLE, switch_channel_get_name(originatee_channel));
|
||||||
switch_channel_set_variable(originator_channel, SWITCH_BRIDGE_UUID_VARIABLE, switch_core_session_get_uuid(originatee_session));
|
switch_channel_set_variable(originator_channel, SWITCH_BRIDGE_UUID_VARIABLE, switch_core_session_get_uuid(originatee_session));
|
||||||
switch_channel_set_variable(originator_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(originatee_session));
|
switch_channel_set_variable(originator_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(originatee_session));
|
||||||
@ -795,7 +783,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
|
|||||||
switch_channel_set_variable(originator_channel, "original_caller_id_name", originator_cp->caller_id_name);
|
switch_channel_set_variable(originator_channel, "original_caller_id_name", originator_cp->caller_id_name);
|
||||||
switch_channel_set_variable(originator_channel, "original_caller_id_number", originator_cp->caller_id_number);
|
switch_channel_set_variable(originator_channel, "original_caller_id_number", originator_cp->caller_id_number);
|
||||||
|
|
||||||
|
|
||||||
cp = switch_caller_profile_clone(originatee_session, originatee_cp);
|
cp = switch_caller_profile_clone(originatee_session, originatee_cp);
|
||||||
cp->destination_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
|
cp->destination_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
|
||||||
cp->caller_id_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
|
cp->caller_id_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
|
||||||
@ -838,7 +825,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
|
|||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid)
|
SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid)
|
||||||
@ -868,16 +854,12 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
|
|||||||
switch_channel_set_state_flag(rchannel, CF_TRANSFER);
|
switch_channel_set_state_flag(rchannel, CF_TRANSFER);
|
||||||
switch_channel_set_state(rchannel, CS_RESET);
|
switch_channel_set_state(rchannel, CS_RESET);
|
||||||
|
|
||||||
|
|
||||||
if (bsession) {
|
if (bsession) {
|
||||||
bchannel = switch_core_session_get_channel(bsession);
|
bchannel = switch_core_session_get_channel(bsession);
|
||||||
switch_channel_hangup(bchannel, SWITCH_CAUSE_PICKED_OFF);
|
switch_channel_hangup(bchannel, SWITCH_CAUSE_PICKED_OFF);
|
||||||
switch_core_session_rwunlock(bsession);
|
switch_core_session_rwunlock(bsession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch_core_session_rwunlock(rsession);
|
switch_core_session_rwunlock(rsession);
|
||||||
|
|
||||||
switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
|
switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* switch_ivr_menu.c -- IVR Library (menu code)
|
* switch_ivr_menu.c -- IVR Library (menu code)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
struct switch_ivr_menu_action;
|
struct switch_ivr_menu_action;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* switch_ivr_originate.c -- IVR Library (originate)
|
* switch_ivr_originate.c -- IVR Library (originate)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
static const switch_state_handler_table_t originate_state_handlers;
|
static const switch_state_handler_table_t originate_state_handlers;
|
||||||
@ -60,7 +61,6 @@ static const switch_state_handler_table_t originate_state_handlers = {
|
|||||||
/*.on_hold */ NULL
|
/*.on_hold */ NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
IDX_CANCEL = -2,
|
IDX_CANCEL = -2,
|
||||||
IDX_NADA = -1
|
IDX_NADA = -1
|
||||||
@ -215,7 +215,6 @@ static uint8_t check_channel_status(switch_channel_t **peer_channels,
|
|||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ringback {
|
struct ringback {
|
||||||
@ -622,7 +621,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (caller_channel) { /* ringback is only useful when there is an originator */
|
if (caller_channel) { /* ringback is only useful when there is an originator */
|
||||||
ringback_data = NULL;
|
ringback_data = NULL;
|
||||||
|
|
||||||
@ -691,8 +689,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
|
cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (try = 0; try < retries; try++) {
|
for (try = 0; try < retries; try++) {
|
||||||
switch_safe_free(loop_data);
|
switch_safe_free(loop_data);
|
||||||
loop_data = strdup(data);
|
loop_data = strdup(data);
|
||||||
@ -812,9 +808,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
peer_sessions[i] = NULL;
|
peer_sessions[i] = NULL;
|
||||||
new_session = NULL;
|
new_session = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (and_argc > 1 || or_argc > 1) {
|
if (and_argc > 1 || or_argc > 1) {
|
||||||
myflags |= SOF_FORKED_DIAL;
|
myflags |= SOF_FORKED_DIAL;
|
||||||
} else if (var_event) {
|
} else if (var_event) {
|
||||||
@ -879,7 +872,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
switch_channel_add_state_handler(peer_channels[i], table);
|
switch_channel_add_state_handler(peer_channels[i], table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((flags & SOF_NOBLOCK) && peer_sessions[i]) {
|
if ((flags & SOF_NOBLOCK) && peer_sessions[i]) {
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
*bleg = peer_sessions[i];
|
*bleg = peer_sessions[i];
|
||||||
@ -887,7 +879,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
goto outer_for;
|
goto outer_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (switch_core_session_running(peer_sessions[i])) {
|
if (switch_core_session_running(peer_sessions[i])) {
|
||||||
if (!(flags & SOF_NOBLOCK)) {
|
if (!(flags & SOF_NOBLOCK)) {
|
||||||
switch_channel_set_state(peer_channels[i], CS_RING);
|
switch_channel_set_state(peer_channels[i], CS_RING);
|
||||||
@ -895,8 +886,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
} else {
|
} else {
|
||||||
switch_core_session_thread_launch(peer_sessions[i]);
|
switch_core_session_thread_launch(peer_sessions[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_timestamp(&start);
|
switch_timestamp(&start);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user