]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow iax to receive in call messages.
authorMichael Jerris <mike@jerris.com>
Fri, 16 Nov 2007 19:48:02 +0000 (19:48 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 16 Nov 2007 19:48:02 +0000 (19:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6311 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_iax/mod_iax.c

index 536f3cf9afdaf2e302b8ba4f97407a72445fbba9..85aea25c7ffbbef7c1f4ee0f5a9101ed751c6277 100644 (file)
@@ -850,6 +850,29 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 
 }
 
+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 @@ switch_io_routines_t iax_io_routines = {
        /*.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)