]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
WIP
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 13 Dec 2006 22:58:32 +0000 (22:58 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 13 Dec 2006 22:58:32 +0000 (22:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3640 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index ba35444093e588a053566386765a1bb8a5b3e513..ca6228634681a6ec49f1b66d6fae93cf174e6384 100644 (file)
@@ -1468,6 +1468,9 @@ static switch_status_t activate_rtp(private_object_t *tech_pvt)
                if ((vad_in && inb) || (vad_out && !inb)) {
                        switch_rtp_enable_vad(tech_pvt->rtp_session, tech_pvt->session, &tech_pvt->read_codec, SWITCH_VAD_FLAG_TALKING);
                        switch_set_flag_locked(tech_pvt, TFLAG_VAD);
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP Engage VAD for %s ( %s %s )\n", 
+                              switch_channel_get_name(switch_core_session_get_channel(tech_pvt->session)),
+                              vad_in ? "in" : "", vad_out ? "out" : "");
                }
        } else {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
@@ -4367,7 +4370,7 @@ static void event_callback(nua_event_t event,
                }
        }
 
-       if (status == 401 || status == 407) {
+       if (sip && (status == 401 || status == 407)) {
                sip_r_challenge(status, phrase, nua, profile, nh, sofia_private, sip, tags);
                goto done;
        }
index 43b462e748c5bfeaf073744cf8ab12a489b23bb1..5d7691c68aa412b109252b69599532fb7739c182 100644 (file)
@@ -1160,7 +1160,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_GOOGLEHACK) && rtp_session->send_msg.header.pt == 97) {
                rtp_session->recv_msg.header.pt = 102;
        }
-       
+
        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD) && 
                rtp_session->recv_msg.header.pt == rtp_session->vad_data.read_codec->implementation->ianacode &&
                ((datalen == rtp_session->vad_data.read_codec->implementation->encoded_bytes_per_frame) || 
@@ -1171,7 +1171,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
                uint32_t len = sizeof(decoded);
                time_t now = time(NULL);
                send = 0;
-               
+
+        
                if (rtp_session->vad_data.scan_freq && rtp_session->vad_data.next_scan <= now) {
                        rtp_session->vad_data.bg_count = rtp_session->vad_data.bg_level = 0;
                        rtp_session->vad_data.next_scan = now + rtp_session->vad_data.scan_freq;
@@ -1191,7 +1192,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
                        uint32_t energy = 0;
                        uint32_t x, y = 0, z = len / sizeof(int16_t);
                        uint32_t score = 0;
-                       
+
                        if (z) {
                                for (x = 0; x < z; x++) {
                                        energy += abs(decoded[y]);