[Freeswitch-svn] [commit] r4229 - in freeswitch/trunk/src: . include mod/applications/mod_dptools mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Tue Feb 13 09:58:07 EST 2007
Author: anthm
Date: Tue Feb 13 09:58:06 2007
New Revision: 4229
Modified:
freeswitch/trunk/src/include/switch_channel.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_console.c
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_ivr.c
Log:
update
Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h (original)
+++ freeswitch/trunk/src/include/switch_channel.h Tue Feb 13 09:58:06 2007
@@ -301,16 +301,16 @@
*/
#define switch_channel_mark_pre_answered(channel) switch_channel_perform_mark_pre_answered(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
-SWITCH_DECLARE(switch_status_t) switch_channel_perform_ringback(switch_channel_t *channel,
- const char *file,
- const char *func,
- int line);
+SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel_t *channel,
+ const char *file,
+ const char *func,
+ int line);
/*!
\brief Send Ringing message to a channel
\param channel channel to ring
\return SWITCH_STATUS_SUCCESS if successful
*/
-#define switch_channel_ringback(channel) switch_channel_perform_ringback(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
+#define switch_channel_ring_ready(channel) switch_channel_perform_ring_ready(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel,
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Tue Feb 13 09:58:06 2007
@@ -485,8 +485,8 @@
CF_NOMEDIA = (1 << 13) - Channel has no media
CF_SUSPEND = (1 << 14) - Suspend i/o
CF_EVENT_PARSE = (1 << 15) - Suspend control events
-CF_NO_INDICATE = (1 << 16) - Disable Indications
-CF_REPEAT_STATE = (1 << 17) - Tell the state machine to repeat a state
+CF_REPEAT_STATE = (1 << 16) - Tell the state machine to repeat a state
+CF_GEN_RINGBACK = (1 << 17) - Channel is generating it's own ringback
CF_RING_READY = (1 << 18) - Channel is ready to send ringback
</pre>
*/
@@ -508,8 +508,8 @@
CF_NOMEDIA = (1 << 13),
CF_SUSPEND = (1 << 14),
CF_EVENT_PARSE = (1 << 15),
- CF_NO_INDICATE = (1 << 16),
- CF_REPEAT_STATE = (1 << 17),
+ CF_REPEAT_STATE = (1 << 16),
+ CF_GEN_RINGBACK = (1 << 17),
CF_RING_READY = (1 << 18)
} switch_channel_flag_t;
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Tue Feb 13 09:58:06 2007
@@ -63,12 +63,12 @@
}
-static void ringback_function(switch_core_session_t *session, char *data)
+static void ring_ready_function(switch_core_session_t *session, char *data)
{
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
- switch_channel_ringback(channel);
+ switch_channel_ring_ready(channel);
}
static void queue_dtmf_function(switch_core_session_t *session, char *data)
@@ -538,11 +538,11 @@
/*.next */ &ivr_application_interface
};
-static const switch_application_interface_t ringback_application_interface = {
- /*.interface_name */ "ringback",
- /*.application_function */ ringback_function,
- /* long_desc */ "Indicate Ringback on a channel.",
- /* short_desc */ "Indicate Ringback",
+static const switch_application_interface_t ring_ready_application_interface = {
+ /*.interface_name */ "ring_ready",
+ /*.application_function */ ring_ready_function,
+ /* long_desc */ "Indicate Ring_Ready on a channel.",
+ /* short_desc */ "Indicate Ring_Ready",
/* syntax */ "",
/*.next */ &detect_speech_application_interface
};
@@ -553,7 +553,7 @@
/* long_desc */ "Unset a channel varaible for the channel calling the application.",
/* short_desc */ "Unset a channel varaible",
/* syntax */ "<varname>",
- /*.next */ &ringback_application_interface
+ /*.next */ &ring_ready_application_interface
};
static const switch_application_interface_t set_application_interface = {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Tue Feb 13 09:58:06 2007
@@ -2810,25 +2810,27 @@
break;
case nua_callstate_proceeding:
if (channel) {
- if (status == 180 && !(switch_channel_test_flag(channel, CF_NO_INDICATE))) {
+ if (status == 180) {
switch_channel_mark_ring_ready(channel);
- if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
- if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
- switch_core_session_message_t msg;
- msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
- msg.from = __FILE__;
- switch_core_session_receive_message(other_session, &msg);
- switch_core_session_rwunlock(other_session);
- }
-
- } else {
- switch_core_session_message_t *msg;
- if ((msg = malloc(sizeof(*msg)))) {
- memset(msg, 0, sizeof(*msg));
- msg->message_id = SWITCH_MESSAGE_INDICATE_RINGING;
- msg->from = __FILE__;
- switch_core_session_queue_message(session, msg);
- switch_set_flag(msg, SCSMF_DYNAMIC);
+ if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK)) {
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+ switch_core_session_message_t msg;
+ msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
+ msg.from = __FILE__;
+ switch_core_session_receive_message(other_session, &msg);
+ switch_core_session_rwunlock(other_session);
+ }
+
+ } else {
+ switch_core_session_message_t *msg;
+ if ((msg = malloc(sizeof(*msg)))) {
+ memset(msg, 0, sizeof(*msg));
+ msg->message_id = SWITCH_MESSAGE_INDICATE_RINGING;
+ msg->from = __FILE__;
+ switch_core_session_queue_message(session, msg);
+ switch_set_flag(msg, SCSMF_DYNAMIC);
+ }
}
}
}
@@ -2837,12 +2839,13 @@
if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
switch_channel_mark_pre_answered(channel);
- if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+ if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK) &&
+ (uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
other_channel = switch_core_session_get_channel(other_session);
if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) {
switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, (char *)r_sdp);
}
-
+
switch_channel_pre_answer(other_channel);
switch_core_session_rwunlock(other_session);
}
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Tue Feb 13 09:58:06 2007
@@ -1063,10 +1063,10 @@
return status;
}
-SWITCH_DECLARE(switch_status_t) switch_channel_perform_ringback(switch_channel_t *channel,
- const char *file,
- const char *func,
- int line)
+SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel_t *channel,
+ const char *file,
+ const char *func,
+ int line)
{
switch_core_session_message_t msg;
char *uuid = switch_core_session_get_uuid(channel->session);
@@ -1091,7 +1091,7 @@
status = switch_core_session_message_send(uuid, &msg);
if (status == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Ringback %s!\n", channel->name);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Ring Ready %s!\n", channel->name);
}
return status;
Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c (original)
+++ freeswitch/trunk/src/switch_console.c Tue Feb 13 09:58:06 2007
@@ -120,7 +120,7 @@
SWITCH_STANDARD_STREAM(stream);
if (stream.data) {
if (switch_api_execute(cmd, arg, NULL, &stream) == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", stream.data);
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "API CALL [%s(%s)] output:\n%s\n", cmd, arg ? arg : "", (char *)stream.data);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Unknown Command: %s\n", cmd);
}
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Tue Feb 13 09:58:06 2007
@@ -2067,7 +2067,7 @@
} else {
if (!session->raw_read_buffer) {
switch_size_t bytes = session->read_codec->implementation->bytes_per_frame;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Engaging Read Buffer at %u bytes\n", bytes);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Engaging Read Buffer at %u bytes\n", (uint32_t)bytes);
switch_buffer_create_dynamic(&session->raw_read_buffer, bytes * SWITCH_BUFFER_BLOCK_FRAMES, bytes * SWITCH_BUFFER_START_FRAMES, 0);
}
if (!switch_buffer_write(session->raw_read_buffer, read_frame->data, read_frame->datalen)) {
@@ -2321,9 +2321,9 @@
if (!session->raw_write_buffer) {
switch_size_t bytes = session->write_codec->implementation->bytes_per_frame;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "Engaging Write Buffer at %u bytes to accomodate %u->%u\n",
- bytes,
- write_frame->datalen, session->write_codec->implementation->bytes_per_frame);
+ "Engaging Write Buffer at %u bytes to accomodate %u->%u\n",
+ (uint32_t)bytes,
+ write_frame->datalen, session->write_codec->implementation->bytes_per_frame);
if ((status =switch_buffer_create_dynamic(&session->raw_write_buffer,
bytes * SWITCH_BUFFER_BLOCK_FRAMES,
bytes * SWITCH_BUFFER_START_FRAMES,
@@ -4132,7 +4132,7 @@
switch_core_sql_thread_launch();
#endif
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocated memory pool. Sessions are %u bytes\n", sizeof(switch_core_session_t));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocated memory pool. Sessions are %u bytes\n", (uint32_t)sizeof(switch_core_session_t));
switch_event_init(runtime.memory_pool);
switch_rtp_init(runtime.memory_pool);
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Tue Feb 13 09:58:06 2007
@@ -1533,7 +1533,7 @@
args.buflen = digit_buffer_length;
//Play the file
status = switch_ivr_play_file(session, NULL, prompt_audio_file, &args);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "play gave up %s", digit_buffer);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "play gave up %s", (char *) digit_buffer);
//Make sure we made it out alive
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
@@ -1545,7 +1545,7 @@
if (max_digits == 1 && status == SWITCH_STATUS_BREAK) {
//Check the digit if we have a regex
if (digits_regex != NULL) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking regex [%s] on [%s]\n", digits_regex, digit_buffer);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking regex [%s] on [%s]\n", digits_regex, (char *) digit_buffer);
//Make sure the digit is allowed
if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) {
@@ -1586,7 +1586,7 @@
if (min_digits <= strlen(digit_buffer)) {
//See if we need to test a regex
if (digits_regex != NULL) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking regex [%s] on [%s]\n", digits_regex, digit_buffer);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking regex [%s] on [%s]\n", digits_regex, (char *) digit_buffer);
//Test the regex
if (switch_regex_match(digit_buffer, digits_regex) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Match found!\n");
@@ -2579,7 +2579,7 @@
or_argc = switch_separate_string(data, '|', pipe_names, (sizeof(pipe_names) / sizeof(pipe_names[0])));
if (caller_channel && or_argc > 1 && !ringback_data) {
- switch_channel_ringback(caller_channel);
+ switch_channel_ring_ready(caller_channel);
sent_ring = 1;
}
@@ -2606,7 +2606,7 @@
and_argc = switch_separate_string(pipe_names[r], ',', peer_names, (sizeof(peer_names) / sizeof(peer_names[0])));
if (caller_channel && !sent_ring && and_argc > 1 && !ringback_data) {
- switch_channel_ringback(caller_channel);
+ switch_channel_ring_ready(caller_channel);
sent_ring = 1;
}
@@ -2746,7 +2746,7 @@
if (caller_channel && !switch_channel_ready(caller_channel)) {
goto notready;
}
-
+
if ((time(NULL) - start) > (time_t)timelimit_sec) {
to++;
idx = IDX_CANCEL;
@@ -3839,11 +3839,11 @@
if (parser->terminator == '\0') {
if (len > parser->maxlen) {
parser->maxlen = len;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "max len %u\n",parser->maxlen);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "max len %u\n", (uint32_t) parser->maxlen);
}
if (parser->minlen == 0 || len < parser->minlen) {
parser->minlen = len;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "min len %u\n",parser->minlen);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "min len %u\n", (uint32_t) parser->minlen);
}
} else {
// since we have a terminator, reset min and max
More information about the Freeswitch-svn
mailing list