FS-2008 --resolve

This commit is contained in:
Marc Olivier Chouinard committed 2011-12-15 14:44:25 -05:00
1 parent b9295fd5ab
commit d1506e07cb
2 files changed
+15 -9

No files matched your search

+14 -8
View File
@@ -3772,10 +3772,13 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
}
rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0;
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_TALK)) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_TALK) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(switch_core_session_get_channel(rtp_session->vad_data.session), event);
switch_event_fire(&event);
const char *val = switch_channel_get_variable(switch_core_session_get_channel(rtp_session->vad_data.session), "fire_talk_events");
if (val && switch_true(val)) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_TALK) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(switch_core_session_get_channel(rtp_session->vad_data.session), event);
switch_event_fire(&event);
}
}
}
}
@@ -3788,10 +3791,13 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
switch_clear_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING);
rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0;
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_NOTALK)) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_NOTALK) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(switch_core_session_get_channel(rtp_session->vad_data.session), event);
switch_event_fire(&event);
const char *val = switch_channel_get_variable(switch_core_session_get_channel(rtp_session->vad_data.session), "fire_notalk_events");
if (val && switch_true(val)) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_NOTALK) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(switch_core_session_get_channel(rtp_session->vad_data.session), event);
switch_event_fire(&event);
}
}
}
}