pause media bugs while not in a bridge while inside mod_fifo
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11466 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
07b5dc11e7
commit
f60f17d391
|
@ -143,6 +143,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(_In_ switch_core_sessi
|
||||||
_In_ switch_media_bug_callback_t callback,
|
_In_ switch_media_bug_callback_t callback,
|
||||||
_In_opt_ void *user_data,
|
_In_opt_ void *user_data,
|
||||||
_In_ time_t stop_time, _In_ switch_media_bug_flag_t flags, _Out_ switch_media_bug_t **new_bug);
|
_In_ time_t stop_time, _In_ switch_media_bug_flag_t flags, _Out_ switch_media_bug_t **new_bug);
|
||||||
|
|
||||||
|
SWITCH_DECLARE(void) switch_core_media_bug_pause(switch_core_session_t *session);
|
||||||
|
SWITCH_DECLARE(void) switch_core_media_bug_resume(switch_core_session_t *session);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Obtain private data from a media bug
|
\brief Obtain private data from a media bug
|
||||||
\param bug the bug to get the data from
|
\param bug the bug to get the data from
|
||||||
|
|
|
@ -841,7 +841,7 @@ typedef enum {
|
||||||
CF_INNER_BRIDGE,
|
CF_INNER_BRIDGE,
|
||||||
CF_REQ_MEDIA,
|
CF_REQ_MEDIA,
|
||||||
CF_VERBOSE_EVENTS,
|
CF_VERBOSE_EVENTS,
|
||||||
|
CF_PAUSE_BUGS,
|
||||||
/* 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;
|
||||||
|
|
|
@ -767,6 +767,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
check_string(moh);
|
check_string(moh);
|
||||||
switch_assert(node);
|
switch_assert(node);
|
||||||
|
|
||||||
|
switch_core_media_bug_pause(session);
|
||||||
|
|
||||||
if (!consumer) {
|
if (!consumer) {
|
||||||
switch_core_session_t *other_session;
|
switch_core_session_t *other_session;
|
||||||
switch_channel_t *other_channel;
|
switch_channel_t *other_channel;
|
||||||
|
@ -926,7 +928,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
|
|
||||||
if (!aborted && switch_channel_ready(channel)) {
|
if (!aborted && switch_channel_ready(channel)) {
|
||||||
switch_channel_set_state(channel, CS_HIBERNATE);
|
switch_channel_set_state(channel, CS_HIBERNATE);
|
||||||
return;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
ts = switch_timestamp_now();
|
ts = switch_timestamp_now();
|
||||||
switch_time_exp_lt(&tm, ts);
|
switch_time_exp_lt(&tm, ts);
|
||||||
|
@ -956,7 +958,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
switch_ivr_session_transfer(session, cd.orbit_exten, NULL, NULL);
|
switch_ivr_session_transfer(session, cd.orbit_exten, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
goto done;
|
||||||
|
|
||||||
} else { /* consumer */
|
} else { /* consumer */
|
||||||
void *pop = NULL;
|
void *pop = NULL;
|
||||||
switch_frame_t *read_frame;
|
switch_frame_t *read_frame;
|
||||||
|
@ -987,7 +990,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
strat = STRAT_WAITING_LONGER;
|
strat = STRAT_WAITING_LONGER;
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid strategy\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid strategy\n");
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -996,7 +999,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
do_wait = 0;
|
do_wait = 0;
|
||||||
} else if (strcasecmp(argv[2], "wait")) {
|
} else if (strcasecmp(argv[2], "wait")) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "USAGE %s\n", FIFO_USAGE);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "USAGE %s\n", FIFO_USAGE);
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1235,7 +1238,11 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
switch_ivr_record_session(session, expanded, 0, NULL);
|
switch_ivr_record_session(session, expanded, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_core_media_bug_resume(session);
|
||||||
|
switch_core_media_bug_resume(other_session);
|
||||||
switch_ivr_multi_threaded_bridge(session, other_session, on_dtmf, other_session, session);
|
switch_ivr_multi_threaded_bridge(session, other_session, on_dtmf, other_session, session);
|
||||||
|
switch_core_media_bug_pause(session);
|
||||||
|
switch_core_media_bug_pause(other_session);
|
||||||
|
|
||||||
if (record_template) {
|
if (record_template) {
|
||||||
switch_ivr_stop_record_session(session, expanded);
|
switch_ivr_stop_record_session(session, expanded);
|
||||||
|
@ -1362,6 +1369,11 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
|
||||||
|
switch_core_media_bug_resume(session);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xml_helper {
|
struct xml_helper {
|
||||||
|
|
|
@ -46,6 +46,16 @@ static void switch_core_media_bug_destroy(switch_media_bug_t *bug)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(void) switch_core_media_bug_pause(switch_core_session_t *session)
|
||||||
|
{
|
||||||
|
switch_channel_set_flag(session->channel, CF_PAUSE_BUGS);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(void) switch_core_media_bug_resume(switch_core_session_t *session)
|
||||||
|
{
|
||||||
|
switch_channel_clear_flag(session->channel, CF_PAUSE_BUGS);
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(uint32_t) switch_core_media_bug_test_flag(switch_media_bug_t *bug, uint32_t flag)
|
SWITCH_DECLARE(uint32_t) switch_core_media_bug_test_flag(switch_media_bug_t *bug, uint32_t flag)
|
||||||
{
|
{
|
||||||
return switch_test_flag(bug, flag);
|
return switch_test_flag(bug, flag);
|
||||||
|
|
Loading…
Reference in New Issue