]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add justinu's patch for sofia
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 20 Sep 2006 20:26:21 +0000 (20:26 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 20 Sep 2006 20:26:21 +0000 (20:26 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2766 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 914e87e57edb83294bbb5f97b98bb4602cc4fc42..ad3dfdbf46dc0061aacc23c1aaf83cd813c5e684 100644 (file)
@@ -601,17 +601,20 @@ static switch_status_t sofia_on_hangup(switch_core_session_t *session)
 
        su_home_deinit(tech_pvt->home);
 
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s, SIP response: %d\n", 
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n", 
                          switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
 
        if (tech_pvt->nh) {
                if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
                        if (switch_test_flag(tech_pvt, TFLAG_ANS)) {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending BYE\n");
                                nua_bye(tech_pvt->nh, TAG_END());
                        } else {
                                if (switch_test_flag(tech_pvt, TFLAG_INBOUND)) {
+                                       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());
                                } else {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending CANCEL\n");
                                        nua_cancel(tech_pvt->nh, TAG_END());
                                }
                        }
@@ -1465,6 +1468,7 @@ static void sip_i_state(int status,
                                                        //SIPTAG_CONTACT(tech_pvt->contact), 
                                                        TAG_END());
                        } else if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
+                               switch_set_flag_locked(tech_pvt, TFLAG_ANS);
                                switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
                                switch_channel_answer(channel);
                                return;