From c23d205aee09b30278a01e519f4c87b8b50836e6 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 16 Nov 2007 19:48:02 +0000 Subject: [PATCH] allow iax to receive in call messages. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6311 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_iax/mod_iax.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_iax/mod_iax.c b/src/mod/endpoints/mod_iax/mod_iax.c index 536f3cf9af..85aea25c7f 100644 --- a/src/mod/endpoints/mod_iax/mod_iax.c +++ b/src/mod/endpoints/mod_iax/mod_iax.c @@ -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)