]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix stupidness
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 28 Aug 2006 23:50:10 +0000 (23:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 28 Aug 2006 23:50:10 +0000 (23:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2419 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_ivr.c
src/switch_rtp.c

index 50516b78adfc29f2bce111ee3d520d91681d6ae6..6cdcead08394b0663f6c077ebf62b227262f4fea 100644 (file)
@@ -723,7 +723,6 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                set_local_sdp(tech_pvt);
                activate_rtp(tech_pvt);
                if (tech_pvt->nh) {
-                       tech_pvt->contact = sip_contact_create(tech_pvt->home, URL_STRING_MAKE("sip:1000@208.64.200.40"), NULL);
                        nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT(tech_pvt->contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), TAG_END());
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP:\n%s\n", tech_pvt->local_sdp_str);
                }
@@ -995,10 +994,12 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
            if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
                        switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
+
                        /* Transmit 183 Progress with SDP */
                        tech_choose_port(tech_pvt);
                        set_local_sdp(tech_pvt);
                        activate_rtp(tech_pvt);
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "183 SDP:\n%s\n", tech_pvt->local_sdp_str);
                        nua_respond(tech_pvt->nh, SIP_183_SESSION_PROGRESS, SIPTAG_CONTACT(tech_pvt->contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), TAG_END());
                        //nua_respond(tech_pvt->nh, SIP_200_OK, SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), TAG_END());
            }
@@ -1251,6 +1252,9 @@ static void sip_i_state(int status,
                        uint8_t match = 0;
                        
 
+                       tech_pvt->contact = sip_contact_create(tech_pvt->home, URL_STRING_MAKE("sip:1000@208.64.200.40"), NULL);
+                       
+
                        if (tech_pvt->num_codecs) {
                                if ((sdp = sdp_session(parser))) {
                                        match = negotiate_sdp(session, sdp);
@@ -1267,7 +1271,7 @@ static void sip_i_state(int status,
                                switch_channel_set_state(channel, CS_INIT);
                                switch_set_flag_locked(tech_pvt, TFLAG_READY);
                                switch_core_session_thread_launch(session);
-                               //nua_respond(nh, SIP_180_RINGING, TAG_END());
+                               //nua_respond(nh, SIP_100_TRYING, SIPTAG_CONTACT(tech_pvt->contact), TAG_END());
                                return;
                        }
                }
@@ -1531,10 +1535,15 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
                                                          event_callback, /* Callback for processing events */
                                                          profile, /* Additional data to pass to callback */
                                                          NUTAG_URL(profile->url),
-                                                         NUTAG_EARLY_MEDIA(1),
-                                                         SIPTAG_SUPPORTED_STR("100rel, precondition"),
                                                          TAG_END()); /* Last tag should always finish the sequence */
 
+       nua_set_params(profile->nua,
+                                  NUTAG_EARLY_MEDIA(1),
+                                  SIPTAG_SUPPORTED_STR("100rel, precondition"),
+                                  NUTAG_AUTOANSWER(0),
+                                  NUTAG_AUTOALERT(0));
+                                  
+
        for (node = profile->aliases; node; node = node->next) {
                node->nua = nua_create(profile->s_root, /* Event loop */
                                                           event_callback, /* Callback for processing events */
@@ -1542,8 +1551,16 @@ static void *SWITCH_THREAD_FUNC profile_thread_run(switch_thread_t *thread, void
                                                           NUTAG_URL(node->url),
                                                           NUTAG_EARLY_MEDIA(1),
                                                           SIPTAG_SUPPORTED_STR("100rel, precondition"),
+                                                          NUTAG_AUTOANSWER(0),
+                                                          NUTAG_AUTOALERT(0),
                                                           TAG_END()); /* Last tag should always finish the sequence */
 
+               nua_set_params(node->nua,
+                                          NUTAG_EARLY_MEDIA(1),
+                                          SIPTAG_SUPPORTED_STR("100rel, precondition"),
+                                          NUTAG_AUTOANSWER(0),
+                                          NUTAG_AUTOALERT(0));
+               
        }
 
        su_root_run(profile->s_root);
index 0704117d779bf71e9f02b0d1ef2cd09566b6babb..58b4f583f375f453545731e5e38c07c374175786 100644 (file)
@@ -1678,7 +1678,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
                        this_audio_thread->running = 2;
 
 
-                       if (!switch_channel_test_flag(peer_channel, CF_TRANSFER)) {
+                       if (!switch_channel_test_flag(peer_channel, CF_TRANSFER) && switch_channel_get_state(peer_channel) < CS_HANGUP) {
                                switch_core_session_kill_channel(peer_session, SWITCH_SIG_KILL);
                                switch_channel_hangup(peer_channel, SWITCH_CAUSE_NORMAL_CLEARING);
                        }
index 68f810ac291623b9fdf22ecd91ca6efea1e624e7..fb9f3d948bd38a1e8a406307c6c86ed027db8969 100644 (file)
@@ -547,7 +547,7 @@ SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session)
 
 SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session)
 {
-       return switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) ? 1 : 0;
+       return (rtp_session != NULL && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) ? 1 : 0;
 }
 
 SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)