allow monitor_early_media and ignore_early_media to work for hmmhesays
This commit is contained in:
parent
52bda06b34
commit
4c20b020fc
|
@ -1006,6 +1006,7 @@ typedef enum {
|
||||||
CF_BROADCAST_DROP_MEDIA,
|
CF_BROADCAST_DROP_MEDIA,
|
||||||
CF_EARLY_HANGUP,
|
CF_EARLY_HANGUP,
|
||||||
CF_MEDIA_SET,
|
CF_MEDIA_SET,
|
||||||
|
CF_CONSUME_ON_ORIGINATE,
|
||||||
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
||||||
CF_FLAG_MAX
|
CF_FLAG_MAX
|
||||||
} switch_channel_flag_t;
|
} switch_channel_flag_t;
|
||||||
|
|
|
@ -39,10 +39,9 @@ static switch_status_t originate_on_consume_media_transmit(switch_core_session_t
|
||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
/* testing out not using this, we probably don't need it anymore now that we have audio sync */
|
if (!switch_channel_test_flag(channel, CF_PROXY_MODE) && switch_channel_test_flag(channel, CF_CONSUME_ON_ORIGINATE)) {
|
||||||
#if 0
|
while (switch_channel_test_flag(channel, CF_ORIGINATING) &&
|
||||||
if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) {
|
switch_channel_get_state(channel) == CS_CONSUME_MEDIA && !switch_channel_test_flag(channel, CF_TAGGED)) {
|
||||||
while (switch_channel_get_state(channel) == CS_CONSUME_MEDIA && !switch_channel_test_flag(channel, CF_TAGGED)) {
|
|
||||||
if (!switch_channel_media_ready(channel)) {
|
if (!switch_channel_media_ready(channel)) {
|
||||||
switch_yield(10000);
|
switch_yield(10000);
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,7 +49,6 @@ static switch_status_t originate_on_consume_media_transmit(switch_core_session_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
switch_channel_clear_state_handler(channel, &originate_state_handlers);
|
switch_channel_clear_state_handler(channel, &originate_state_handlers);
|
||||||
|
|
||||||
|
@ -2613,6 +2611,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
switch_channel_add_state_handler(originate_status[i].peer_channel, table);
|
switch_channel_add_state_handler(originate_status[i].peer_channel, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oglobals.monitor_early_media_ring || oglobals.monitor_early_media_fail) {
|
||||||
|
switch_channel_set_flag(originate_status[i].peer_channel, CF_CONSUME_ON_ORIGINATE);
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_add_state_handler(originate_status[i].peer_channel, &originate_state_handlers);
|
switch_channel_add_state_handler(originate_status[i].peer_channel, &originate_state_handlers);
|
||||||
|
|
||||||
if ((flags & SOF_NOBLOCK) && originate_status[i].peer_session) {
|
if ((flags & SOF_NOBLOCK) && originate_status[i].peer_session) {
|
||||||
|
|
Loading…
Reference in New Issue