From 62ef7f4756633163edfb02e83f24111f34d1f440 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 29 May 2008 20:25:58 +0000 Subject: [PATCH] add presence events to proxy mode git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8724 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia.c | 12 ++++++++++++ src/mod/endpoints/mod_sofia/sofia_glue.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 7f2f86f59f..e74e014d83 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1923,6 +1923,18 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, 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()); diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 354677fe43..8138665f2d 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -706,7 +706,7 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char } } } - printf("WTF [%s] %d\n", new_uri, uri_only); + return new_uri; }