the same guy who added att xfer to asterisk was nice enough to add it to freeswitch too

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7885 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-03-13 01:08:42 +00:00
1 parent e76486968e
commit dc3a65388b
10 files changed
+277 -55

No files matched your search

+11 -14
View File
@@ -1143,8 +1143,18 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
switch_core_timer_sync(&rtp_session->timer);
} else {
check = (uint8_t) (switch_core_timer_check(&rtp_session->timer, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS);
if (check && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG) &&
rtp_session->timer.samplecount >= (rtp_session->last_write_samplecount + (rtp_session->samples_per_interval * 50))) {
uint8_t data[10] = { 0 };
switch_frame_flag_t frame_flags = SFF_NONE;
data[0] = 65;
rtp_session->cn++;
rtp_common_write(rtp_session, NULL, (void *) data, 2, rtp_session->cng_pt, 0, &frame_flags);
}
}
}
} else if (bytes) {
check++;
}
if (check) {
do_2833(rtp_session);
@@ -1295,19 +1305,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
goto end;
}
if (rtp_session->timer.interval) {
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG) &&
rtp_session->timer.samplecount >= (rtp_session->last_write_samplecount + (rtp_session->samples_per_interval * 50))) {
uint8_t data[10] = { 0 };
switch_frame_flag_t frame_flags = SFF_NONE;
data[0] = 65;
rtp_session->cn++;
switch_mutex_lock(rtp_session->flag_mutex);
rtp_common_write(rtp_session, NULL, (void *) data, 2, rtp_session->cng_pt, 0, &frame_flags);
switch_mutex_unlock(rtp_session->flag_mutex);
}
}
if (check || (bytes && !rtp_session->timer.interval)) {
if (!bytes && rtp_session->max_missed_packets) {
if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {