mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
add sync param to sleep so you can choose to sync audio or not on sleep (reswig to follow)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10693 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
0e60a19e77
commit
71054917ac
12 files changed
+31
-19
No files matched your search
@@ -1307,7 +1307,7 @@ SWITCH_STANDARD_APP(sleep_function)
|
||||
|
||||
switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
|
||||
|
||||
switch_ivr_sleep(session, ms, &args);
|
||||
switch_ivr_sleep(session, ms, SWITCH_TRUE, &args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ void process_fax(switch_core_session_t *session, const char *data, application_m
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch_ivr_sleep(session, 250, NULL);
|
||||
switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL);
|
||||
|
||||
while (switch_channel_ready(channel)) {
|
||||
int tx = 0;
|
||||
|
||||
@@ -1167,7 +1167,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
if (announce) {
|
||||
switch_ivr_play_file(session, NULL, announce, NULL);
|
||||
} else {
|
||||
switch_ivr_sleep(session, 500, NULL);
|
||||
switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL);
|
||||
}
|
||||
|
||||
switch_channel_set_variable(other_channel, "fifo_serviced_by", my_id);
|
||||
|
||||
@@ -1403,7 +1403,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
|
||||
forward_file_path = switch_core_session_sprintf(session, "%s%smsg_%s.wav", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, uuid_str);
|
||||
TRY_CODE(create_file(session, profile, VM_RECORD_MESSAGE_MACRO, forward_file_path, &message_len, SWITCH_TRUE, NULL, NULL));
|
||||
if ((new_path = vm_merge_file(session, profile, forward_file_path, cbt->file_path))) {
|
||||
switch_ivr_sleep(session, 1500, NULL);
|
||||
switch_ivr_sleep(session, 1500, SWITCH_TRUE, NULL);
|
||||
forward_file_path = new_path;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error merging files\n");
|
||||
@@ -1637,7 +1637,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
|
||||
*global_buf = '\0';
|
||||
|
||||
while (switch_channel_ready(channel)) {
|
||||
switch_ivr_sleep(session, 100, NULL);
|
||||
switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL);
|
||||
|
||||
switch (vm_check_state) {
|
||||
case VM_CHECK_START:
|
||||
|
||||
@@ -1723,7 +1723,8 @@ static JSBool session_sleep(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
||||
switch_input_args_t args = { 0 };
|
||||
int32 ms = 0;
|
||||
jsval ret = JS_TRUE;
|
||||
|
||||
int sync;
|
||||
|
||||
METHOD_SANITY_CHECK();
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
CHANNEL_SANITY_CHECK();
|
||||
@@ -1755,12 +1756,16 @@ static JSBool session_sleep(JSContext * cx, JSObject * obj, uintN argc, jsval *
|
||||
}
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
JS_ValueToInt32(cx, argv[2], &sync);
|
||||
}
|
||||
|
||||
cb_state.ret = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
cb_state.saveDepth = JS_SuspendRequest(cx);
|
||||
args.input_callback = dtmf_func;
|
||||
args.buf = bp;
|
||||
args.buflen = len;
|
||||
switch_ivr_sleep(jss->session, ms, &args);
|
||||
switch_ivr_sleep(jss->session, ms, sync, &args);
|
||||
JS_ResumeRequest(cx, cb_state.saveDepth);
|
||||
check_hangup_hook(jss, &ret);
|
||||
*rval = cb_state.ret;
|
||||
|
||||
Reference in new issue
Block a user