indent again

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4799 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-03-30 00:15:25 +00:00
parent debdfb1aab
commit c15d7892c0
91 changed files with 546 additions and 491 deletions
@@ -80,7 +80,8 @@ static switch_status_t status_function(char *cmd, switch_core_session_t *session
"UP %u year%s, %u day%s, %u hour%s, %u minute%s, %u second%s, %u millisecond%s, %u microsecond%s\n",
duration.yr, duration.yr == 1 ? "" : "s", duration.day, duration.day == 1 ? "" : "s",
duration.hr, duration.hr == 1 ? "" : "s", duration.min, duration.min == 1 ? "" : "s",
duration.sec, duration.sec == 1 ? "" : "s", duration.ms, duration.ms == 1 ? "" : "s", duration.mms, duration.mms == 1 ? "" : "s");
duration.sec, duration.sec == 1 ? "" : "s", duration.ms, duration.ms == 1 ? "" : "s", duration.mms,
duration.mms == 1 ? "" : "s");
stream->write_function(stream, "%d sessions\n", switch_core_session_count());
@@ -301,7 +301,7 @@ static switch_status_t conference_local_play_file(conference_obj_t * conference,
static switch_status_t conference_member_play_file(conference_member_t * member, char *file, uint32_t leadin);
static switch_status_t conference_member_say(conference_member_t * member, char *text, uint32_t leadin);
static uint32_t conference_member_stop_file(conference_member_t * member, file_stop_t stop);
static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_memory_pool_t * pool);
static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_memory_pool_t *pool);
static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
static void launch_conference_record_thread(conference_obj_t * conference, char *path);
@@ -1384,7 +1384,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread,
}
/* launch an input thread for the call leg */
static void launch_conference_loop_input(conference_member_t * member, switch_memory_pool_t * pool)
static void launch_conference_loop_input(conference_member_t * member, switch_memory_pool_t *pool)
{
if (member != NULL) {
switch_thread_t *thread;
@@ -1457,7 +1457,8 @@ static void conference_loop_output(conference_member_t * member)
launch_conference_loop_input(member, switch_core_session_get_pool(member->session));
/* build a digit stream object */
if (member->conference->dtmf_parser != NULL && switch_ivr_digit_stream_new(member->conference->dtmf_parser, &member->digit_stream) != SWITCH_STATUS_SUCCESS) {
if (member->conference->dtmf_parser != NULL
&& switch_ivr_digit_stream_new(member->conference->dtmf_parser, &member->digit_stream) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Warning Will Robinson, there is no digit parser stream object\n");
}
@@ -1748,7 +1749,8 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t * t
}
if (switch_core_file_open(&fh,
rec->path, (uint8_t) 1, conference->rate, SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, rec->pool) != SWITCH_STATUS_SUCCESS) {
rec->path, (uint8_t) 1, conference->rate, SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT,
rec->pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening File [%s]\n", rec->path);
goto end;
}
@@ -1954,7 +1956,8 @@ static switch_status_t conference_play_file(conference_obj_t * conference, char
fnode->leadin = leadin;
/* Open the file */
if (switch_core_file_open(&fnode->fh, file, (uint8_t) 1, conference->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, pool) != SWITCH_STATUS_SUCCESS) {
if (switch_core_file_open(&fnode->fh, file, (uint8_t) 1, conference->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, pool) !=
SWITCH_STATUS_SUCCESS) {
switch_core_destroy_memory_pool(&pool);
status = SWITCH_STATUS_NOTFOUND;
goto done;
@@ -2054,7 +2057,8 @@ static switch_status_t conference_member_play_file(conference_member_t * member,
/* Open the file */
if (switch_core_file_open(&fnode->fh,
file, (uint8_t) 1, member->conference->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, pool) != SWITCH_STATUS_SUCCESS) {
file, (uint8_t) 1, member->conference->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
pool) != SWITCH_STATUS_SUCCESS) {
switch_core_destroy_memory_pool(&pool);
status = SWITCH_STATUS_NOTFOUND;
goto done;
@@ -2120,7 +2124,8 @@ static switch_status_t conference_member_say(conference_member_t * member, char
fnode->pool = pool;
memset(&fnode->sh, 0, sizeof(fnode->sh));
if (switch_core_speech_open(&fnode->sh, conference->tts_engine, conference->tts_voice, conference->rate, &flags, fnode->pool) != SWITCH_STATUS_SUCCESS) {
if (switch_core_speech_open(&fnode->sh, conference->tts_engine, conference->tts_voice, conference->rate, &flags, fnode->pool) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module [%s]!\n", conference->tts_engine);
return SWITCH_STATUS_FALSE;
}
@@ -2191,7 +2196,8 @@ static switch_status_t conference_say(conference_obj_t * conference, const char
fnode->leadin = leadin;
memset(&fnode->sh, 0, sizeof(fnode->sh));
if (switch_core_speech_open(&fnode->sh, conference->tts_engine, conference->tts_voice, conference->rate, &flags, conference->pool) != SWITCH_STATUS_SUCCESS) {
if (switch_core_speech_open(&fnode->sh, conference->tts_engine, conference->tts_voice, conference->rate, &flags, conference->pool) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module [%s]!\n", conference->tts_engine);
return SWITCH_STATUS_FALSE;
}
@@ -3519,7 +3525,8 @@ static switch_status_t conference_outcall(conference_obj_t * conference,
/* establish an outbound call leg */
if (switch_ivr_originate(session,
&peer_session, cause, bridgeto, timeout, &audio_bridge_peer_state_handlers, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
&peer_session, cause, bridgeto, timeout, &audio_bridge_peer_state_handlers, cid_name, cid_num,
NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot create outgoing channel, cause: %s\n", switch_channel_cause2str(*cause));
if (caller_channel) {
switch_channel_hangup(caller_channel, *cause);
@@ -4340,7 +4347,7 @@ static switch_status_t conference_new_install_caller_controls_custom(conference_
}
/* create a new conferene with a specific profile */
static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_memory_pool_t * pool)
static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_memory_pool_t *pool)
{
conference_obj_t *conference;
switch_xml_t xml_kvp;
@@ -272,7 +272,8 @@ static void asrtest_function(switch_core_session_t *session, char *data)
if (switch_core_asr_open(&ah, "lumenvox",
read_codec->implementation->iananame, 8000, "127.0.0.1", &flags, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
read_codec->implementation->iananame, 8000, "127.0.0.1", &flags,
switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
if (strcmp(ah.codec, read_codec->implementation->iananame)) {
if (switch_core_codec_init(&codec,
ah.codec,
+2 -1
View File
@@ -254,7 +254,8 @@ static void rss_function(switch_core_session_t *session, char *data)
NULL,
(int) rate,
interval,
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activated\n");
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16@%uhz 1 channel %dms\n", rate, interval);
+4 -2
View File
@@ -243,7 +243,8 @@ static switch_status_t switch_amr_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
#ifdef AMR_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
@@ -265,7 +266,8 @@ static switch_status_t switch_amr_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
#ifdef AMR_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+8 -4
View File
@@ -55,7 +55,8 @@ static switch_status_t switch_g711u_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
short *dbuf;
unsigned char *ebuf;
@@ -77,7 +78,8 @@ static switch_status_t switch_g711u_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
short *dbuf;
unsigned char *ebuf;
@@ -125,7 +127,8 @@ static switch_status_t switch_g711a_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
short *dbuf;
unsigned char *ebuf;
@@ -147,7 +150,8 @@ static switch_status_t switch_g711a_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
short *dbuf;
unsigned char *ebuf;
+4 -2
View File
@@ -76,7 +76,8 @@ static switch_status_t switch_g722_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
struct g722_context *context = codec->private_info;
@@ -93,7 +94,8 @@ static switch_status_t switch_g722_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
struct g722_context *context = codec->private_info;
+4 -2
View File
@@ -109,7 +109,8 @@ static switch_status_t switch_g723_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
#ifdef G723_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
@@ -139,7 +140,8 @@ static switch_status_t switch_g723_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
#ifdef G723_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+4 -2
View File
@@ -114,7 +114,8 @@ static switch_status_t switch_g726_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
g726_handle_t *handle = codec->private_info;
@@ -160,7 +161,8 @@ static switch_status_t switch_g726_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
g726_handle_t *handle = codec->private_info;
+4 -2
View File
@@ -95,7 +95,8 @@ static switch_status_t switch_g729_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
#ifdef G729_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
@@ -137,7 +138,8 @@ static switch_status_t switch_g729_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
#ifdef G729_PASSTHROUGH
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "This codec is only usable in passthrough mode!\n");
+4 -2
View File
@@ -98,7 +98,8 @@ static switch_status_t switch_ilbc_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
struct ilbc_context *context = codec->private_info;
@@ -137,7 +138,8 @@ static switch_status_t switch_ilbc_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
struct ilbc_context *context = codec->private_info;
+4 -2
View File
@@ -52,7 +52,8 @@ static switch_status_t switch_raw_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
/* NOOP indicates that the audio in is already the same as the audio out, so no conversion was necessary. */
if (codec && other_codec && codec->implementation->samples_per_second != other_codec->implementation->samples_per_second) {
@@ -67,7 +68,8 @@ static switch_status_t switch_raw_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
if (codec && other_codec && codec->implementation->samples_per_second != other_codec->implementation->samples_per_second) {
memcpy(decoded_data, encoded_data, encoded_data_len);
+4 -2
View File
@@ -87,7 +87,8 @@ static switch_status_t switch_lpc10_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
struct lpc10_context *context = codec->private_info;
uint8_t i;
@@ -120,7 +121,8 @@ static switch_status_t switch_lpc10_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
struct lpc10_context *context = codec->private_info;
int i;
+4 -2
View File
@@ -157,7 +157,8 @@ static switch_status_t switch_speex_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate, unsigned int *flag)
uint32_t decoded_rate, void *encoded_data, uint32_t * encoded_data_len, uint32_t * encoded_rate,
unsigned int *flag)
{
struct speex_context *context = codec->private_info;
short *buf;
@@ -208,7 +209,8 @@ static switch_status_t switch_speex_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag)
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate,
unsigned int *flag)
{
struct speex_context *context = codec->private_info;
short *buf;
@@ -99,7 +99,8 @@ static switch_caller_extension_t *directory_dialplan_hunt(switch_core_session_t
caller_profile = switch_channel_get_caller_profile(channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Hello %s You Dialed %s!\n", caller_profile->caller_id_name, caller_profile->destination_number);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Hello %s You Dialed %s!\n", caller_profile->caller_id_name,
caller_profile->destination_number);
if (!(globals.directory_name && globals.host && globals.dn && globals.base && globals.pass)) {
@@ -188,7 +188,8 @@ static int parse_exten(switch_core_session_t *session, switch_xml_t xexten, swit
return proceed;
}
static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t * root, switch_xml_t * node)
static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t * root,
switch_xml_t * node)
{
switch_status_t status = SWITCH_STATUS_GENERR;
switch_channel_t *channel;
@@ -46,7 +46,8 @@ static switch_memory_pool_t *module_pool = NULL;
static char sub_sql[] =
"CREATE TABLE subscriptions (\n"
" sub_from VARCHAR(255),\n" " sub_to VARCHAR(255),\n" " show VARCHAR(255),\n" " status VARCHAR(255)\n" ");\n";
" sub_from VARCHAR(255),\n" " sub_to VARCHAR(255),\n" " show VARCHAR(255),\n" " status VARCHAR(255)\n"
");\n";
typedef enum {
@@ -178,7 +179,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
static switch_status_t channel_on_transmit(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_core_session_t **new_session, switch_memory_pool_t **pool);
static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
@@ -957,7 +958,8 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
while (!(switch_test_flag(tech_pvt, TFLAG_CODEC_READY) &&
switch_test_flag(tech_pvt, TFLAG_RTP_READY) &&
switch_test_flag(tech_pvt, TFLAG_ANSWER) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT_ACCEPT) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT))) {
switch_test_flag(tech_pvt, TFLAG_ANSWER) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT_ACCEPT)
&& switch_test_flag(tech_pvt, TFLAG_TRANSPORT))) {
now = switch_time_now();
elapsed = (unsigned int) ((now - started) / 1000);
@@ -1502,7 +1504,7 @@ static const switch_loadable_module_interface_t channel_module_interface = {
*/
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
@@ -1758,7 +1760,8 @@ static switch_status_t init_profile(struct mdl_profile *profile, uint8_t login)
"message[%s]\n"
"rtp-ip[%s]\n"
"name[%s]\n"
"exten[%s]\n", profile->login, profile->password, profile->dialplan, profile->message, profile->ip, profile->name, profile->exten);
"exten[%s]\n", profile->login, profile->password, profile->dialplan, profile->message, profile->ip, profile->name,
profile->exten);
return SWITCH_STATUS_FALSE;
}
@@ -2129,7 +2132,8 @@ static void do_vcard(ldl_handle_t * handle, char *to, char *from, char *id)
switch_safe_free(xmlstr);
}
static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlsession, ldl_signal_t dl_signal, char *to, char *from, char *subject, char *msg)
static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlsession, ldl_signal_t dl_signal, char *to, char *from, char *subject,
char *msg)
{
struct mdl_profile *profile = NULL;
switch_core_session_t *session = NULL;
@@ -2267,7 +2271,8 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
if (profile->auto_reply) {
ldl_handle_send_msg(handle,
(profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle), from, "", profile->auto_reply);
(profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle), from, "",
profile->auto_reply);
}
if (strchr(to, '+')) {
@@ -2482,7 +2487,8 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
if (match && payloads[x].rate == tech_pvt->codecs[y]->samples_per_second) {
tech_pvt->codec_index = y;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Choosing Payload index %u %s %u\n", y, payloads[x].name, payloads[x].id);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Choosing Payload index %u %s %u\n", y, payloads[x].name,
payloads[x].id);
tech_pvt->codec_name = tech_pvt->codecs[y]->iananame;
tech_pvt->codec_num = tech_pvt->codecs[y]->ianacode;
tech_pvt->r_codec_num = (switch_payload_t) (payloads[x].id);
@@ -2636,7 +2642,8 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
ldl_session_get_value(dlsession,
"aniii"),
ldl_session_get_value(dlsession,
"rdnis"), (char *) modname, context, exten)) != 0) {
"rdnis"), (char *) modname, context,
exten)) != 0) {
char name[128];
snprintf(name, sizeof(name), "DingaLing/%s", tech_pvt->caller_profile->destination_number);
switch_channel_set_name(channel, name);
+2 -2
View File
@@ -417,7 +417,7 @@ static switch_status_t channel_on_loopback(switch_core_session_t *session);
static switch_status_t channel_on_transmit(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_core_session_t **new_session, switch_memory_pool_t **pool);
static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
@@ -790,7 +790,7 @@ that allocate memory or you will have 1 channel with memory allocated from anoth
*/
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
private_t *tech_pvt;
@@ -144,7 +144,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
static switch_status_t channel_on_transmit(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_core_session_t **new_session, switch_memory_pool_t **pool);
static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
@@ -821,7 +821,7 @@ static const switch_loadable_module_interface_t channel_module_interface = {
*/
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
@@ -1248,7 +1248,8 @@ static int dump_info(void)
if (inputParameters.channelCount > 0 && outputParameters.channelCount > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO,
"full-duplex 16 bit %d channel input, %d channel output rates:", inputParameters.channelCount, outputParameters.channelCount);
"full-duplex 16 bit %d channel input, %d channel output rates:", inputParameters.channelCount,
outputParameters.channelCount);
PrintSupportedStandardSampleRates(&inputParameters, &outputParameters);
}
}
@@ -1281,14 +1282,16 @@ static switch_status_t engage_device(int sample_rate, int codec_ms)
if (switch_core_codec_init(&globals.read_codec,
"L16",
NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
return SWITCH_STATUS_FALSE;
} else {
if (switch_core_codec_init(&globals.write_codec,
"L16",
NULL,
sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_core_codec_destroy(&globals.read_codec);
return SWITCH_STATUS_FALSE;
@@ -1296,7 +1299,8 @@ static switch_status_t engage_device(int sample_rate, int codec_ms)
}
if (switch_core_timer_init(&globals.timer,
globals.timer_name, codec_ms, globals.read_codec.implementation->samples_per_frame, module_pool) != SWITCH_STATUS_SUCCESS) {
globals.timer_name, codec_ms, globals.read_codec.implementation->samples_per_frame,
module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
switch_core_codec_destroy(&globals.read_codec);
switch_core_codec_destroy(&globals.write_codec);
@@ -1674,9 +1678,11 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
NULL,
dialplan, cid_name, cid_num, NULL, NULL, NULL, NULL, (char *) modname, NULL, dest)) != 0) {
dialplan, cid_name, cid_num, NULL, NULL, NULL, NULL, (char *) modname, NULL,
dest)) != 0) {
char name[128];
snprintf(name, sizeof(name), "PortAudio/%s", tech_pvt->caller_profile->destination_number ? tech_pvt->caller_profile->destination_number : modname);
snprintf(name, sizeof(name), "PortAudio/%s",
tech_pvt->caller_profile->destination_number ? tech_pvt->caller_profile->destination_number : modname);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
+2 -1
View File
@@ -191,7 +191,8 @@ static unsigned long RoundUpToNextPowerOf2(unsigned long n)
*
*/
PaError OpenAudioStream(PABLIO_Stream ** rwblPtr,
const PaStreamParameters * inputParameters, const PaStreamParameters * outputParameters, double sampleRate, PaStreamFlags streamFlags)
const PaStreamParameters * inputParameters, const PaStreamParameters * outputParameters, double sampleRate,
PaStreamFlags streamFlags)
{
long bytesPerSample;
PaError err;
+26 -14
View File
@@ -108,7 +108,8 @@ static char sub_sql[] =
static char auth_sql[] =
"CREATE TABLE sip_authentication (\n"
" user VARCHAR(255),\n"
" host VARCHAR(255),\n" " passwd VARCHAR(255),\n" " nonce VARCHAR(255),\n" " expires INTEGER(8)" ");\n";
" host VARCHAR(255),\n" " passwd VARCHAR(255),\n" " nonce VARCHAR(255),\n" " expires INTEGER(8)"
");\n";
static const char modname[] = "mod_sofia";
#define STRLEN 15
@@ -331,7 +332,8 @@ static switch_status_t sofia_on_loopback(switch_core_session_t *session);
static switch_status_t sofia_on_transmit(switch_core_session_t *session);
static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
switch_memory_pool_t **pool);
static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
@@ -610,7 +612,7 @@ static int del_callback(void *pArg, int argc, char **argv, char **columnNames)
return 0;
}
static void check_expire(switch_core_db_t * db, sofia_profile_t * profile, time_t now)
static void check_expire(switch_core_db_t *db, sofia_profile_t * profile, time_t now)
{
char sql[1024];
char *errmsg;
@@ -912,7 +914,7 @@ static void terminate_session(switch_core_session_t **session, switch_call_cause
static switch_status_t sofia_ext_address_lookup(char **ip, switch_port_t *port, char *sourceip, switch_memory_pool_t * pool)
static switch_status_t sofia_ext_address_lookup(char **ip, switch_port_t *port, char *sourceip, switch_memory_pool_t *pool)
{
char *error;
@@ -956,7 +958,8 @@ static switch_status_t tech_choose_port(private_object_t * tech_pvt)
sdp_port = tech_pvt->local_sdp_audio_port;
if (tech_pvt->profile->extrtpip) {
if (sofia_ext_address_lookup(&ip, &sdp_port, tech_pvt->profile->extrtpip, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
if (sofia_ext_address_lookup(&ip, &sdp_port, tech_pvt->profile->extrtpip, switch_core_session_get_pool(tech_pvt->session)) !=
SWITCH_STATUS_SUCCESS) {
terminate_session(&tech_pvt->session, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, __LINE__);
return SWITCH_STATUS_FALSE;
}
@@ -1065,7 +1068,8 @@ static switch_status_t do_invite(switch_core_session_t *session)
char *url = get_url_from_contact(tech_pvt->dest, 1);
tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
NUTAG_URL(url),
SIPTAG_TO_STR(tech_pvt->dest_to), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url), TAG_END());
SIPTAG_TO_STR(tech_pvt->dest_to), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
TAG_END());
switch_safe_free(url);
if (!(tech_pvt->sofia_private = malloc(sizeof(*tech_pvt->sofia_private)))) {
@@ -1158,7 +1162,8 @@ static void do_xfer_invite(switch_core_session_t *session)
char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
tech_pvt->nh2 = nua_handle(tech_pvt->profile->nua, NULL,
SIPTAG_TO_STR(tech_pvt->dest), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url), TAG_END());
SIPTAG_TO_STR(tech_pvt->dest), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
TAG_END());
nua_handle_bind(tech_pvt->nh2, tech_pvt->sofia_private);
@@ -1557,7 +1562,8 @@ static switch_status_t activate_rtp(private_object_t * tech_pvt)
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_REINVITE)) {
switch_clear_flag_locked(tech_pvt, TFLAG_REINVITE);
if (switch_rtp_set_remote_address(tech_pvt->rtp_session, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port, &err) != SWITCH_STATUS_SUCCESS) {
if (switch_rtp_set_remote_address(tech_pvt->rtp_session, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port, &err) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP CHANGING DEST TO: [%s:%d]\n",
@@ -1694,7 +1700,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
if (tech_pvt->nh) {
if (tech_pvt->local_sdp_str) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP %s:\n%s\n", switch_channel_get_name(channel), tech_pvt->local_sdp_str);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP %s:\n%s\n", switch_channel_get_name(channel),
tech_pvt->local_sdp_str);
}
}
}
@@ -2233,7 +2240,8 @@ static void logger(void *logarg, char const *fmt, va_list ap)
static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
switch_memory_pool_t **pool)
{
switch_call_cause_t cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
switch_core_session_t *nsession;
@@ -2621,7 +2629,8 @@ static switch_call_cause_t sip_cause_to_freeswitch(int status)
static void set_hash_key(char *hash_key, int32_t len, sip_t const *sip)
{
snprintf(hash_key, len, "%s%s%s", (char *) sip->sip_from->a_url->url_user, (char *) sip->sip_from->a_url->url_host, (char *) sip->sip_to->a_url->url_user);
snprintf(hash_key, len, "%s%s%s", (char *) sip->sip_from->a_url->url_user, (char *) sip->sip_from->a_url->url_host,
(char *) sip->sip_to->a_url->url_user);
#if 0
@@ -3227,7 +3236,8 @@ typedef enum {
REG_INVITE
} sofia_regtype_t;
static uint8_t handle_register(nua_t * nua, sofia_profile_t * profile, nua_handle_t * nh, sip_t const *sip, sofia_regtype_t regtype, char *key, uint32_t keylen)
static uint8_t handle_register(nua_t * nua, sofia_profile_t * profile, nua_handle_t * nh, sip_t const *sip, sofia_regtype_t regtype, char *key,
uint32_t keylen)
{
sip_from_t const *from = NULL;
sip_expires_t const *expires = NULL;
@@ -3389,7 +3399,8 @@ static uint8_t handle_register(nua_t * nua, sofia_profile_t * profile, nua_handl
sql = switch_mprintf("delete from sip_authentication where user='%q' and host='%q';\n"
"insert into sip_authentication values('%q','%q','%q','%q', %ld)",
from_user, from_host, from_user, from_host, a1_hash, uuid_str, time(NULL) + profile->nonce_ttl);
auth_str = switch_mprintf("Digest realm=\"%q\", nonce=\"%q\",%s algorithm=MD5, qop=\"auth\"", from_host, uuid_str, stale ? " stale=\"true\"," : "");
auth_str =
switch_mprintf("Digest realm=\"%q\", nonce=\"%q\",%s algorithm=MD5, qop=\"auth\"", from_host, uuid_str, stale ? " stale=\"true\"," : "");
if (regtype == REG_REGISTER) {
@@ -3980,7 +3991,8 @@ static void sip_i_refer(nua_t * nua, sofia_profile_t * profile, nua_handle_t * n
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a);
switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR");
nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"), SIPTAG_EVENT_STR(etmp), TAG_END());
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"), SIPTAG_EVENT_STR(etmp),
TAG_END());
}
}
} else {
@@ -30,7 +30,8 @@ int tdmv_api_ioctl(HANDLE fd, wanpipe_tdm_api_cmd_t * tdm_api_cmd)
if (DeviceIoControl(fd,
IoctlManagementCommand,
(LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPDWORD) (&ln), (LPOVERLAPPED) NULL) == FALSE) {
(LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPDWORD) (&ln),
(LPOVERLAPPED) NULL) == FALSE) {
//actual ioctl failed
err = 1;
prn(1, "Error: tdmv_api_ioctl(): DeviceIoControl failed!!\n");
@@ -68,7 +69,8 @@ int wanpipe_api_ioctl(HANDLE fd, wan_cmd_api_t * api_cmd)
if (DeviceIoControl(fd,
IoctlManagementCommand,
(LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPDWORD) (&ln), (LPOVERLAPPED) NULL) == FALSE) {
(LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPVOID) & wan_udp, sizeof(wan_udp_hdr_t), (LPDWORD) (&ln),
(LPOVERLAPPED) NULL) == FALSE) {
err = 1;
prn(1, "Error: wanpipe_api_ioctl(): DeviceIoControl failed!!\n");
return err;
@@ -108,7 +110,8 @@ static UCHAR DoWriteCommand(HANDLE drv, TX_DATA_STRUCT * pTx)
if (DeviceIoControl(drv,
IoctlWriteCommand,
(LPVOID) pTx, (ULONG) sizeof(TX_DATA_STRUCT), (LPVOID) pTx, sizeof(TX_DATA_STRUCT), (LPDWORD) (&ln), (LPOVERLAPPED) NULL) == FALSE) {
(LPVOID) pTx, (ULONG) sizeof(TX_DATA_STRUCT), (LPVOID) pTx, sizeof(TX_DATA_STRUCT), (LPDWORD) (&ln),
(LPOVERLAPPED) NULL) == FALSE) {
//check messages log
prn(1, "Error: DoWriteCommand(): DeviceIoControl failed!\n");
return 1;
@@ -122,7 +125,8 @@ static USHORT DoApiPollCommand(HANDLE drv, API_POLL_STRUCT * api_poll_ptr)
{
DWORD ln;
if (DeviceIoControl(drv, IoctlApiPoll, (LPVOID) NULL, 0L, (LPVOID) api_poll_ptr, sizeof(API_POLL_STRUCT), (LPDWORD) (&ln), (LPOVERLAPPED) NULL) == FALSE) {
if (DeviceIoControl(drv, IoctlApiPoll, (LPVOID) NULL, 0L, (LPVOID) api_poll_ptr, sizeof(API_POLL_STRUCT), (LPDWORD) (&ln), (LPOVERLAPPED) NULL) ==
FALSE) {
//check messages log
prn(1, "Error: DoApiPollCommand(): DeviceIoControl failed!\n");
return 1;
+14 -8
View File
@@ -462,7 +462,7 @@ static switch_status_t wanpipe_on_loopback(switch_core_session_t *session);
static switch_status_t wanpipe_on_transmit(switch_core_session_t *session);
static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_core_session_t **new_session, switch_memory_pool_t **pool);
static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t wanpipe_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static int on_info(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri_event * pevent);
@@ -580,7 +580,8 @@ static switch_status_t wanpipe_on_init(switch_core_session_t *session)
switch_core_session_get_uuid(session), sizeof(tech_pvt->ss7boost_handle->setup_array[tech_pvt->setup_index]));
ss7boost_client_call_init(&event, tech_pvt->caller_profile->caller_id_number, tech_pvt->caller_profile->destination_number, tech_pvt->setup_index);
ss7boost_client_call_init(&event, tech_pvt->caller_profile->caller_id_number, tech_pvt->caller_profile->destination_number,
tech_pvt->setup_index);
if (ss7boost_client_connection_write(&tech_pvt->ss7boost_handle->mcon, &event) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Critical System Error: Failed to tx on ISUP socket [%s]\n", strerror(errno));
@@ -985,7 +986,7 @@ static const switch_loadable_module_interface_t wanpipe_module_interface = {
static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
char *bchan = NULL;
char name[128] = "";
@@ -1194,8 +1195,10 @@ static switch_call_cause_t wanpipe_outgoing_channel(switch_core_session_t *sessi
pri_sr_set_bearer(sr, 0, SPANS[span]->l1);
pri_sr_set_called(sr, caller_profile->destination_number, SPANS[span]->dp, 1);
pri_sr_set_caller(sr,
caller_profile->caller_id_number, caller_profile->caller_id_name, SPANS[span]->dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN);
pri_sr_set_redirecting(sr, caller_profile->caller_id_number, SPANS[span]->dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
caller_profile->caller_id_number, caller_profile->caller_id_name, SPANS[span]->dp,
PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN);
pri_sr_set_redirecting(sr, caller_profile->caller_id_number, SPANS[span]->dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN,
PRI_REDIR_UNCONDITIONAL);
if (pri_setup(spri->pri, tech_pvt->call, sr)) {
switch_core_session_destroy(new_session);
@@ -1432,7 +1435,8 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
switch_core_session_rwunlock(session);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"-- Ringing on channel s%dc%d %s but it's not in use?\n", spri->span, pevent->ringing.channel, chanmap->map[pevent->ringing.channel]);
"-- Ringing on channel s%dc%d %s but it's not in use?\n", spri->span, pevent->ringing.channel,
chanmap->map[pevent->ringing.channel]);
}
return 0;
@@ -1982,7 +1986,8 @@ static int parse_ss7_event(ss7boost_handle_t * ss7boost_handle, ss7boost_client_
event->chan + 1,
(event->called_number_digits_count ? (char *) event->called_number_digits : "N/A"),
(event->calling_number_digits_count ? (char *) event->calling_number_digits : "N/A"),
switch_channel_cause2str(event->release_cause), event->span + 1, event->chan + 1, event->event_id, event->call_setup_id, event->seqno);
switch_channel_cause2str(event->release_cause), event->span + 1, event->chan + 1, event->event_id, event->call_setup_id,
event->seqno);
switch (event->event_id) {
@@ -2012,7 +2017,8 @@ static int parse_ss7_event(ss7boost_handle_t * ss7boost_handle, ss7boost_client_
handle_call_stop_ack(ss7boost_handle, event);
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Warning no handler implemented for [%s]\n", ss7boost_client_event_id_name(event->event_id));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Warning no handler implemented for [%s]\n",
ss7boost_client_event_id_name(event->event_id));
break;
}
switch_mutex_unlock(ss7boost_handle->mutex);
@@ -98,7 +98,7 @@ SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_close(ss7boost_client
}
SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_open(ss7boost_client_connection_t * mcon,
char *local_ip, int local_port, char *ip, int port, switch_memory_pool_t * pool)
char *local_ip, int local_port, char *ip, int port, switch_memory_pool_t *pool)
{
memset(mcon, 0, sizeof(*mcon));
mcon->pool = pool;
@@ -91,7 +91,7 @@ typedef struct ss7boost_client_connection ss7boost_client_connection_t;
SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_close(ss7boost_client_connection_t * mcon);
SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_open(ss7boost_client_connection_t * mcon,
char *local_ip, int local_port, char *ip, int port, switch_memory_pool_t * pool);
char *local_ip, int local_port, char *ip, int port, switch_memory_pool_t *pool);
SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_read(ss7boost_client_connection_t * mcon, ss7boost_client_event_t ** event);
SWITCH_DECLARE(switch_status_t) ss7boost_client_connection_write(ss7boost_client_connection_t * mcon, ss7boost_client_event_t * event);
SWITCH_DECLARE(void) ss7boost_client_event_init(ss7boost_client_event_t * event, ss7boost_client_event_id_t event_id, int chan, int span);
+2 -2
View File
@@ -171,7 +171,7 @@ static switch_status_t woomera_on_loopback(switch_core_session_t *session);
static switch_status_t woomera_on_transmit(switch_core_session_t *session);
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool);
switch_core_session_t **new_session, switch_memory_pool_t **pool);
static switch_status_t woomera_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t woomera_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t woomera_kill_channel(switch_core_session_t *session, int sig);
@@ -478,7 +478,7 @@ static const switch_loadable_module_interface_t woomera_module_interface = {
*/
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t ** pool)
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
if ((*new_session = switch_core_session_request(&woomera_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
@@ -54,8 +54,8 @@ extern "C" {
class CDRContainer {
public:
CDRContainer();
CDRContainer(switch_memory_pool_t * module_pool);
~CDRContainer();
CDRContainer(switch_memory_pool_t *module_pool);
~CDRContainer();
void add_cdr(switch_core_session_t *session);
void process_records();
#ifdef SWITCH_QUEUE_ENHANCED
+2 -1
View File
@@ -557,7 +557,8 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, char *path)
context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path);
launch_read_stream_thread(context);
} else {
if (switch_file_open(&context->fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, handle->memory_pool) != SWITCH_STATUS_SUCCESS) {
if (switch_file_open(&context->fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, handle->memory_pool) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", path);
goto error;
}
@@ -468,7 +468,8 @@ extern "C" {
if (s->next) {
s->next->prev = s->prev;
}
/* Insert s as second element in the list */ s->next = ty->next;
/* Insert s as second element in the list */
s-> next = ty->next;
if (ty->next)
ty->next->prev = s;
ty->next = s;
@@ -1697,13 +1698,15 @@ extern "C" {
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_switch_channel_t[] = { {"_p_switch_channel_t", 0, "switch_channel_t *", 0}, {"_p_switch_channel_t"}, {0} };
static swig_type_info _swigt__p_switch_file_handle_t[] = { {"_p_switch_file_handle_t", 0, "switch_file_handle_t *", 0}, {"_p_switch_file_handle_t"}, {0} };
static swig_type_info _swigt__p_switch_file_handle_t[] =
{ {"_p_switch_file_handle_t", 0, "switch_file_handle_t *", 0}, {"_p_switch_file_handle_t"}, {0} };
static swig_type_info _swigt__p_switch_core_session_t[] =
{ {"_p_switch_core_session_t", 0, "switch_core_session_t *", 0}, {"_p_switch_core_session_t"}, {0} };
static swig_type_info _swigt__p_p_switch_core_session_t[] =
{ {"_p_p_switch_core_session_t", 0, "switch_core_session_t **", 0}, {"_p_p_switch_core_session_t"}, {0} };
static swig_type_info _swigt__p_uint32_t[] = { {"_p_uint32_t", 0, "uint32_t *", 0}, {"_p_uint32_t"}, {0} };
static swig_type_info _swigt__p_switch_input_callback_function_t[] = { {"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},
static swig_type_info _swigt__p_switch_input_callback_function_t[] =
{ {"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},
{"_p_switch_input_callback_function_t"}, {0}
};
+14 -10
View File
@@ -571,7 +571,7 @@ extern "C" {
* type checking.
*
* Author : David Beazley (beazley@cs.uchicago.edu)
************************************************************************//* Common SWIG API */
************************************************************************//* Common SWIG API */
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags)
#define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags)
#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
@@ -583,11 +583,11 @@ extern "C" {
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
/* -----------------------------------------------------------------------------
* Pointer declarations
* ----------------------------------------------------------------------------- *//*
Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
C/C++ pointers in the python side. Very useful for debugging, but
not always safe.
*/
* ----------------------------------------------------------------------------- *//*
Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
C/C++ pointers in the python side. Very useful for debugging, but
not always safe.
*/
#if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
# define SWIG_COBJECT_TYPES
#endif
@@ -1538,7 +1538,8 @@ extern "C" {
resultobj = Py_None;
return resultobj;
fail:return NULL;
} static PyObject *_wrap_fs_core_init(PyObject * self, PyObject * args) {
}
static PyObject *_wrap_fs_core_init(PyObject * self, PyObject * args) {
PyObject *resultobj = NULL;
char *arg1 = (char *) 0;
int result;
@@ -2448,11 +2449,13 @@ extern "C" {
static swig_type_info _swigt__p_char = { "_p_char", "char *", 0, 0, 0 };
static swig_type_info _swigt__p_p_switch_core_session_t = { "_p_p_switch_core_session_t", "switch_core_session_t **", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_state_t = { "_p_switch_channel_state_t", "enum switch_channel_state_t *|switch_channel_state_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_state_t =
{ "_p_switch_channel_state_t", "enum switch_channel_state_t *|switch_channel_state_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_channel_t = { "_p_switch_channel_t", "switch_channel_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_core_session_t = { "_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_file_handle_t = { "_p_switch_file_handle_t", "switch_file_handle_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_input_callback_function_t = { "_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0 };
static swig_type_info _swigt__p_switch_input_callback_function_t =
{ "_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0 };
static swig_type_info _swigt__ptrdiff_t = { "_ptrdiff_t", "ptrdiff_t", 0, 0, 0 };
static swig_type_info _swigt__size_t = { "_size_t", "size_t", 0, 0, 0 };
@@ -2680,7 +2683,8 @@ extern "C" {
SWIGINTERN PyObject *swig_varlink_repr(swig_varlinkobject * v) {
v = v;
return PyString_FromString("<Swig global variables>");
} SWIGINTERN int swig_varlink_print(swig_varlinkobject * v, FILE * fp, int flags) {
}
SWIGINTERN int swig_varlink_print(swig_varlinkobject * v, FILE * fp, int flags) {
swig_globalvar *var;
flags = flags;
fprintf(fp, "Swig global variables { ");
@@ -1337,7 +1337,8 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval *
args.input_callback = dtmf_func;
args.buf = bp;
args.buflen = len;
switch_ivr_speak_text(jss->session, tts_name, voice_name && strlen(voice_name) ? voice_name : NULL, codec->implementation->samples_per_second, text, &args);
switch_ivr_speak_text(jss->session, tts_name, voice_name
&& strlen(voice_name) ? voice_name : NULL, codec->implementation->samples_per_second, text, &args);
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
@@ -2135,7 +2136,8 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
}
caller_profile = switch_caller_profile_new(pool,
username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, (char *) modname, context, dest);
username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, (char *) modname, context,
dest);
if (switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot Create Outgoing Channel! [%s]\n", dest);
@@ -407,7 +407,8 @@ int send_message(char *data, size_t len, char **rcpts)
/* recipients */
for (r = rcpts; *r != NULL; r++) {
if ((ret = (esmtp ?
mailesmtp_rcpt(smtp, *r, MAILSMTP_DSN_NOTIFY_FAILURE | MAILSMTP_DSN_NOTIFY_DELAY, NULL) : mailsmtp_rcpt(smtp, *r))) != MAILSMTP_NO_ERROR) {
mailesmtp_rcpt(smtp, *r, MAILSMTP_DSN_NOTIFY_FAILURE | MAILSMTP_DSN_NOTIFY_DELAY, NULL) : mailsmtp_rcpt(smtp,
*r))) != MAILSMTP_NO_ERROR) {
fprintf(stderr, "mailsmtp_rcpt: %s: %s\n", *r, mailsmtp_strerror(ret));
goto error;
}
+4 -2
View File
@@ -256,7 +256,8 @@ static switch_status_t en_ip(switch_core_session_t *session, char *tosay, switch
}
static switch_status_t en_say_time(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
static switch_status_t en_say_time(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
switch_input_args_t *args)
{
int32_t t;
switch_time_t target = 0;
@@ -402,7 +403,8 @@ static switch_status_t en_say_time(switch_core_session_t *session, char *tosay,
}
static switch_status_t en_say_money(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
static switch_status_t en_say_money(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
switch_input_args_t *args)
{
switch_channel_t *channel;
+2 -1
View File
@@ -56,7 +56,8 @@ static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
}
static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, const char *params, void *user_data)
static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, const char *params,
void *user_data)
{
char filename[512] = "";
CURL *curl_handle = NULL;