Author: anthm Date: Thu May 29 16:25:58 2008 New Revision: 8724 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Log: add presence events to proxy mode Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Thu May 29 16:25:58 2008 @@ -1923,6 +1923,18 @@ msg.from = __FILE__; msg.string_arg = (char *) r_sdp; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Passing SDP to other leg.\n%s\n", r_sdp); + + if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { + if (!switch_stristr("sendonly", r_sdp)) { + switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD); + switch_channel_presence(tech_pvt->channel, "unknown", "unhold"); + } + } else if (switch_stristr("sendonly", r_sdp)) { + switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD); + switch_channel_presence(tech_pvt->channel, "unknown", "hold"); + } + + if (switch_core_session_receive_message(other_session, &msg) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Other leg is not available\n"); nua_respond(tech_pvt->nh, 403, "Hangup in progress", TAG_END()); Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu May 29 16:25:58 2008 @@ -706,7 +706,7 @@ } } } - printf("WTF [%s] %d\n", new_uri, uri_only); + return new_uri; }