From c7b311fdcd0089226e0c249086fc8ca24c4304c4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 23 Jan 2008 18:13:23 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7326 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 5bd0889a51..5ff305819b 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -326,8 +326,11 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) nua_bye(tech_pvt->nh, TAG_END()); } else { if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) { + switch_call_cause_t cause = switch_channel_get_cause(channel); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending CANCEL to %s\n", switch_channel_get_name(channel)); - nua_cancel(tech_pvt->nh, TAG_END()); + nua_cancel(tech_pvt->nh, TAG_IF(cause == SWITCH_CAUSE_PICKED_OFF, + SIPTAG_REASON_STR("SIP;cause=200;text=\"Call completed elsewhere\"")), TAG_END()); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding to INVITE with: %d\n", sip_cause); nua_respond(tech_pvt->nh, sip_cause, NULL, TAG_END());