[Freeswitch-svn] [commit] r6311 - freeswitch/trunk/src/mod/endpoints/mod_iax

Freeswitch SVN mikej at freeswitch.org
Fri Nov 16 14:48:02 EST 2007


Author: mikej
Date: Fri Nov 16 14:48:02 2007
New Revision: 6311

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c

Log:
allow iax to receive in call messages.

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	Fri Nov 16 14:48:02 2007
@@ -850,6 +850,29 @@
 
 }
 
+static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event)
+{
+	switch_channel_t *channel;
+	struct private_object *tech_pvt;
+	char *body;
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	tech_pvt = switch_core_session_get_private(session);
+	assert(tech_pvt != NULL);
+
+
+	if (!(body = switch_event_get_body(event))) {
+		body = "";
+	}
+
+	iax_send_text(tech_pvt->iax_session, body);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
 switch_state_handler_table_t iax_state_handlers = {
 	/*.on_init */ channel_on_init,
 	/*.on_ring */ channel_on_ring,
@@ -867,7 +890,8 @@
 	/*.waitfor_read */ channel_waitfor_read,
 	/*.waitfor_write */ channel_waitfor_write,
 	/*.send_dtmf */ channel_send_dtmf,
-	/*.receive_message*/ channel_receive_message
+	/*.receive_message*/ channel_receive_message,
+	/*.receive_event */ channel_receive_event
 };
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load)



More information about the Freeswitch-svn mailing list