[Freeswitch-svn] [commit] r7956 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia
Author: anthm Date: Mon Mar 24 20:24:23 2008 New Revision: 7956 Modified: freeswitch/trunk/src/include/switch_ivr.h freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/switch_ivr.c freeswitch/trunk/src/switch_ivr_bridge.c freeswitch/trunk/src/switch_xml.cpp Log: update Modified: freeswitch/trunk/src/include/switch_ivr.h ============================================================================== --- freeswitch/trunk/src/include/switch_ivr.h (original) +++ freeswitch/trunk/src/include/switch_ivr.h Mon Mar 24 20:24:23 2008 @@ -106,6 +106,7 @@ \return SWITCH_STATUS_SUCCESS if successful */ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session); +SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session); /*! \brief Wait for time to pass for a specified number of milliseconds 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 Mon Mar 24 20:24:23 2008 @@ -782,7 +782,6 @@ if (!tech_pvt->local_sdp_str) { sofia_glue_tech_absorb_sdp(tech_pvt); } - switch_channel_set_flag(tech_pvt->channel, CF_REQ_MEDIA); sofia_glue_do_invite(session); } break; @@ -828,7 +827,7 @@ sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 1); if (send_invite) { - switch_channel_set_flag(tech_pvt->channel, CF_REQ_MEDIA); + switch_channel_set_flag(channel, CF_REQ_MEDIA); sofia_glue_do_invite(session); } } Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Mon Mar 24 20:24:23 2008 @@ -399,15 +399,24 @@ return status; } -SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session) +SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session) { switch_event_t *event; - while (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) { + if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) { switch_ivr_parse_event(session, event); switch_event_fire(&event); + return SWITCH_STATUS_SUCCESS; } + return SWITCH_STATUS_FALSE; + +} + +SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session) +{ + + while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS); return SWITCH_STATUS_SUCCESS; } @@ -843,6 +852,8 @@ } else { switch_ivr_uuid_bridge(uuid, other_uuid); } + switch_channel_wait_for_flag(channel, CF_BRIDGED, SWITCH_TRUE, 1000); + switch_channel_wait_for_flag(other_channel, CF_BRIDGED, SWITCH_TRUE, 1000); } } @@ -871,14 +882,12 @@ if ((flags & SMF_FORCE) || !switch_channel_test_flag(channel, CF_PROXY_MODE)) { switch_core_session_receive_message(session, &msg); - switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000); - + if ((flags & SMF_REBRIDGE) && (other_uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(other_uuid))) { other_channel = switch_core_session_get_channel(other_session); switch_core_session_receive_message(other_session, &msg); - switch_channel_wait_for_flag(other_channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000); switch_channel_clear_state_handler(other_channel, NULL); } @@ -889,6 +898,8 @@ } else { switch_ivr_signal_bridge(session, other_session); } + switch_channel_wait_for_flag(channel, CF_BRIDGED, SWITCH_TRUE, 1000); + switch_channel_wait_for_flag(other_channel, CF_BRIDGED, SWITCH_TRUE, 1000); switch_core_session_rwunlock(other_session); } } Modified: freeswitch/trunk/src/switch_ivr_bridge.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_bridge.c (original) +++ freeswitch/trunk/src/switch_ivr_bridge.c Mon Mar 24 20:24:23 2008 @@ -153,7 +153,7 @@ msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; msg.from = __FILE__; switch_core_session_receive_message(session_a, &msg); - switch_ivr_parse_all_events(session_a); + switch_ivr_parse_next_event(session_a); msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE; switch_core_session_receive_message(session_a, &msg); switch_channel_clear_flag(chan_b, CF_SUSPEND); Modified: freeswitch/trunk/src/switch_xml.cpp ============================================================================== --- freeswitch/trunk/src/switch_xml.cpp (original) +++ freeswitch/trunk/src/switch_xml.cpp Mon Mar 24 20:24:23 2008 @@ -1410,7 +1410,7 @@ if (user_name) { - if (params && switch_event_get_header(params, "mailbox")) { + if (params && switch_event_get_header(params, (char *) "mailbox")) { if ((*user = switch_xml_find_child(*domain, "user", "mailbox", user_name))) { return SWITCH_STATUS_SUCCESS; }
participants (1)
-
Freeswitch SVN