[Freeswitch-svn] [commit] r4230 - in freeswitch/trunk/src: . include mod/endpoints/mod_dingaling mod/endpoints/mod_iax mod/endpoints/mod_portaudio mod/endpoints/mod_sofia mod/endpoints/mod_wanpipe mod/endpoints/mod_woomera
Freeswitch SVN
anthm at freeswitch.org
Tue Feb 13 10:47:15 EST 2007
Author: anthm
Date: Tue Feb 13 10:47:15 2007
New Revision: 4230
Modified:
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/trunk/src/switch_core.c
Log:
lord of the rings
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Tue Feb 13 10:47:15 2007
@@ -515,6 +515,14 @@
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message);
/*!
+ \brief Queue an indication message on a session
+ \param session the session to queue the message to
+ \param indication the indication message to queue
+ \return SWITCH_STATUS_SUCCESS if the message was queued
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core_session_t *session, switch_core_session_message_types_t indication);
+
+/*!
\brief DE-Queue an message on a given session
\param session the session to de-queue the message on
\param message the de-queued message
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Tue Feb 13 10:47:15 2007
@@ -950,6 +950,10 @@
started = switch_time_now();
+ /* jingle has no ringing indication so we will just pretend that we got one */
+ switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
+ switch_channel_mark_ring_ready(channel);
+
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
tech_pvt->next_cand = switch_time_now() + DL_CAND_WAIT;
tech_pvt->next_desc = switch_time_now();
Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c Tue Feb 13 10:47:15 2007
@@ -1043,6 +1043,10 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call accepted.\n");
break;
case IAX_EVENT_RINGA:
+ if (channel) {
+ switch_core_session_queue_indication(tech_pvt->session, SWITCH_MESSAGE_INDICATE_RINGING);
+ switch_channel_mark_ring_ready(channel);
+ }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ringing heard.\n");
break;
case IAX_EVENT_PONG:
Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Tue Feb 13 10:47:15 2007
@@ -240,6 +240,9 @@
}
}
+ switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
+ switch_channel_mark_ring_ready(channel);
+
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
if (switch_time_now() - last >= waitsec) {
char buf[512];
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 10:47:15 2007
@@ -2823,14 +2823,7 @@
}
} 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);
- }
+ switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
}
}
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c Tue Feb 13 10:47:15 2007
@@ -1160,15 +1160,8 @@
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
- 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);
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
- }
+ switch_core_session_queue_indication(tech_pvt->session, SWITCH_MESSAGE_INDICATE_RINGING);
+ switch_channel_mark_ring_ready(channel);
switch_core_session_rwunlock(session);
} else {
Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c Tue Feb 13 10:47:15 2007
@@ -1063,6 +1063,8 @@
} else if (!strcasecmp(wmsg.command, "PROCEED")) {
/* This packet has lots of info so well keep it */
tech_pvt->call_info = wmsg;
+ switch_core_session_queue_indication(tech_pvt->session, SWITCH_MESSAGE_INDICATE_RINGING);
+ switch_channel_mark_ring_ready(channel);
} else if (switch_test_flag(tech_pvt, TFLAG_PARSE_INCOMING) && !strcasecmp(wmsg.command, "INCOMING")) {
char *exten;
char cid_name[512];
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Tue Feb 13 10:47:15 2007
@@ -1732,6 +1732,22 @@
return status;
}
+SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core_session_t *session, switch_core_session_message_types_t indication)
+{
+ switch_core_session_message_t *msg;
+
+ if ((msg = malloc(sizeof(*msg)))) {
+ memset(msg, 0, sizeof(*msg));
+ msg->message_id = indication;
+ msg->from = __FILE__;
+ switch_core_session_queue_message(session, msg);
+ switch_set_flag(msg, SCSMF_DYNAMIC);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_FALSE;
+}
+
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message)
{
switch_status_t status = SWITCH_STATUS_FALSE;
More information about the Freeswitch-svn
mailing list