fix FSCORE-104

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7773 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-03-03 18:05:07 +00:00
parent cd5b059482
commit a58173d28d
1 changed files with 17 additions and 4 deletions

View File

@ -34,14 +34,27 @@
static const switch_state_handler_table_t originate_state_handlers; static const switch_state_handler_table_t originate_state_handlers;
static switch_status_t originate_on_hold(switch_core_session_t *session)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
while(switch_channel_get_state(channel) == CS_HOLD) {
switch_ivr_sleep(session, 10);
}
/* clear this handler so it only works once (next time (a.k.a. Transfer) we will do the real ring and hold states) */
switch_channel_clear_state_handler(channel, &originate_state_handlers);
return SWITCH_STATUS_FALSE;
}
static switch_status_t originate_on_ring(switch_core_session_t *session) static switch_status_t originate_on_ring(switch_core_session_t *session)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
/* put the channel in a passive state so we can loop audio to it */ /* put the channel in a passive state until it is answered */
/* clear this handler so it only works once (next time (a.k.a. Transfer) we will do the real ring state) */
switch_channel_clear_state_handler(channel, &originate_state_handlers);
switch_channel_set_state(channel, CS_HOLD); switch_channel_set_state(channel, CS_HOLD);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
@ -52,7 +65,7 @@ static const switch_state_handler_table_t originate_state_handlers = {
/*.on_hangup */ NULL, /*.on_hangup */ NULL,
/*.on_loopback */ NULL, /*.on_loopback */ NULL,
/*.on_transmit */ NULL, /*.on_transmit */ NULL,
/*.on_hold */ NULL /*.on_hold */ originate_on_hold
}; };
typedef enum { typedef enum {