]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 23 Jan 2008 18:13:23 +0000 (18:13 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 23 Jan 2008 18:13:23 +0000 (18:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7326 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 5bd0889a51b398f6d2ed33579cb05d51a05e9a65..5ff305819b0d95b49ca66e537b56b9d37eb624da 100644 (file)
@@ -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());