mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
Adding the ability to pass the var_name to store the results in.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11211 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1616,7 +1616,7 @@ SWITCH_STANDARD_APP(read_function)
|
||||
SWITCH_STANDARD_APP(play_and_get_digits_function)
|
||||
{
|
||||
char *mydata;
|
||||
char *argv[8] = { 0 };
|
||||
char *argv[9] = { 0 };
|
||||
int argc;
|
||||
int32_t min_digits = 0;
|
||||
int32_t max_digits = 0;
|
||||
@@ -1625,6 +1625,7 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
|
||||
char digit_buffer[128] = "";
|
||||
const char *prompt_audio_file = NULL;
|
||||
const char *bad_input_audio_file = NULL;
|
||||
const char *var_name = NULL;
|
||||
const char *valid_terminators = NULL;
|
||||
const char *digits_regex = NULL;
|
||||
|
||||
@@ -1662,7 +1663,23 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
|
||||
}
|
||||
|
||||
if (argc > 7) {
|
||||
digits_regex = argv[7];
|
||||
var_name = argv[7];
|
||||
}
|
||||
|
||||
if (argc > 8) {
|
||||
digits_regex = argv[8];
|
||||
}
|
||||
|
||||
if (min_digits <= 1) {
|
||||
min_digits = 1;
|
||||
}
|
||||
|
||||
if (max_digits < min_digits) {
|
||||
max_digits = min_digits;
|
||||
}
|
||||
|
||||
if (timeout <= 1000) {
|
||||
timeout = 1000;
|
||||
}
|
||||
|
||||
if (switch_strlen_zero(valid_terminators)) {
|
||||
@@ -1670,7 +1687,7 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
|
||||
}
|
||||
|
||||
switch_play_and_get_digits(session, min_digits, max_digits, max_tries, timeout, valid_terminators,
|
||||
prompt_audio_file, bad_input_audio_file, digit_buffer, sizeof(digit_buffer), digits_regex);
|
||||
prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex);
|
||||
}
|
||||
|
||||
#define SAY_SYNTAX "<module_name> <say_type> <say_method> <text>"
|
||||
@@ -2611,9 +2628,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
||||
SWITCH_ADD_APP(app_interface, "gentones", "Generate Tones", "Generate tones to the channel", gentones_function, "<tgml_script>[|<loops>]", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "playback", "Playback File", "Playback a file to the channel", playback_function, "<path>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "att_xfer", "Attended Transfer", "Attended Transfer", att_xfer_function, "<channel_url>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "read", "Read Digits", "Read Digits", read_function, "<min> <max> <file> <var name> <timeout> <terminators>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "read", "Read Digits", "Read Digits", read_function, "<min> <max> <file> <var_name> <timeout> <terminators>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "play_and_get_digits", "Play and get Digits", "Play and get Digits",
|
||||
play_and_get_digits_function, "<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <regexp>", SAF_NONE);
|
||||
play_and_get_digits_function, "<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "stop_record_session", "Stop Record Session", STOP_SESS_REC_DESC, stop_record_session_function, "<path>", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_NONE);
|
||||
SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function,
|
||||
|
Reference in New Issue
Block a user