sprinkle digit_timeout into switch_ivr_read and switch_ivr_play_and_get_digits and the higher level variants

This commit is contained in:
Anthony Minessale 2010-09-23 18:37:45 -05:00
parent b4548a606e
commit cfa30468e8
12 changed files with 120 additions and 50 deletions

View File

@ -292,7 +292,8 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
SWITCH_DECLARE(int) transfer(char *extension, char *dialplan = NULL, char *context = NULL); SWITCH_DECLARE(int) transfer(char *extension, char *dialplan = NULL, char *context = NULL);
SWITCH_DECLARE(char *) read(int min_digits, int max_digits, const char *prompt_audio_file, int timeout, const char *valid_terminators); SWITCH_DECLARE(char *) read(int min_digits, int max_digits,
const char *prompt_audio_file, int timeout, const char *valid_terminators, int digit_timeout = 0);
/** \brief Play a file into channel and collect dtmfs /** \brief Play a file into channel and collect dtmfs
* *
@ -306,7 +307,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
int max_digits, int max_digits,
int max_tries, int max_tries,
int timeout, char *terminators, char *audio_files, char *bad_input_audio_files, int timeout, char *terminators, char *audio_files, char *bad_input_audio_files,
char *digits_regex, const char *var_name = NULL); char *digits_regex, const char *var_name = NULL, int digit_timeout = 0);
/** \brief Play a file that resides on disk into the channel /** \brief Play a file that resides on disk into the channel
* *

View File

@ -369,7 +369,8 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
const char *audio_file, const char *audio_file,
const char *bad_input_audio_file, const char *bad_input_audio_file,
const char *var_name, char *digit_buffer, uint32_t digit_buffer_length, const char *var_name, char *digit_buffer, uint32_t digit_buffer_length,
const char *digits_regex); const char *digits_regex,
uint32_t digit_timeout);
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session, SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session,
switch_speech_handle_t *sh, switch_speech_handle_t *sh,
@ -804,7 +805,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
uint32_t max_digits, uint32_t max_digits,
const char *prompt_audio_file, const char *prompt_audio_file,
const char *var_name, const char *var_name,
char *digit_buffer, switch_size_t digit_buffer_length, uint32_t timeout, const char *valid_terminators); char *digit_buffer,
switch_size_t digit_buffer_length,
uint32_t timeout,
const char *valid_terminators,
uint32_t digit_timeout);
SWITCH_DECLARE(switch_status_t) switch_ivr_block_dtmf_session(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_block_dtmf_session(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_unblock_dtmf_session(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_unblock_dtmf_session(switch_core_session_t *session);

View File

@ -649,25 +649,25 @@ static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_
if (zstr_buf(buf)) { if (zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%d", DIR_RESULT_ITEM, cbt->want + 1); switch_snprintf(macro, sizeof(macro), "phrase:%s:%d", DIR_RESULT_ITEM, cbt->want + 1);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key); switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
} }
if (!zstr_buf(recorded_name) && zstr_buf(buf)) { if (!zstr_buf(recorded_name) && zstr_buf(buf)) {
switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key); switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
} }
if (zstr_buf(recorded_name) && zstr_buf(buf)) { if (zstr_buf(recorded_name) && zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_SAY_NAME, cbt->fullname); switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_SAY_NAME, cbt->fullname);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key); switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
} }
if (cbt->exten_visible && zstr_buf(buf)) { if (cbt->exten_visible && zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_AT, cbt->extension); switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_AT, cbt->extension);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key); switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key, 0);
} }
if (zstr_buf(buf)) { if (zstr_buf(buf)) {
switch_snprintf(macro, sizeof(macro), "phrase:%s:%c,%c,%c,%c", DIR_RESULT_MENU, *profile->select_name_key, *profile->next_key, *profile->prev_key, switch_snprintf(macro, sizeof(macro), "phrase:%s:%c,%c,%c,%c", DIR_RESULT_MENU, *profile->select_name_key, *profile->next_key, *profile->prev_key,
*profile->new_search_key); *profile->new_search_key);
switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key); switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key, 0);
} }
if (!zstr_buf(buf)) { if (!zstr_buf(buf)) {

View File

@ -1712,10 +1712,11 @@ SWITCH_STANDARD_APP(att_xfer_function)
SWITCH_STANDARD_APP(read_function) SWITCH_STANDARD_APP(read_function)
{ {
char *mydata; char *mydata;
char *argv[6] = { 0 }; char *argv[7] = { 0 };
int argc; int argc;
int32_t min_digits = 0; int32_t min_digits = 0;
int32_t max_digits = 0; int32_t max_digits = 0;
uint32_t digit_timeout = 0;
int timeout = 1000; int timeout = 1000;
char digit_buffer[128] = ""; char digit_buffer[128] = "";
const char *prompt_audio_file = NULL; const char *prompt_audio_file = NULL;
@ -1751,6 +1752,13 @@ SWITCH_STANDARD_APP(read_function)
valid_terminators = argv[5]; valid_terminators = argv[5];
} }
if (argc > 6) {
digit_timeout = atoi(argv[6]);
if (digit_timeout < 0) {
digit_timeout = 0;
}
}
if (min_digits <= 1) { if (min_digits <= 1) {
min_digits = 1; min_digits = 1;
} }
@ -1767,17 +1775,19 @@ SWITCH_STANDARD_APP(read_function)
valid_terminators = "#"; valid_terminators = "#";
} }
switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, sizeof(digit_buffer), timeout, valid_terminators); switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, sizeof(digit_buffer), timeout, valid_terminators,
digit_timeout);
} }
SWITCH_STANDARD_APP(play_and_get_digits_function) SWITCH_STANDARD_APP(play_and_get_digits_function)
{ {
char *mydata; char *mydata;
char *argv[9] = { 0 }; char *argv[10] = { 0 };
int argc; int argc;
int32_t min_digits = 0; int32_t min_digits = 0;
int32_t max_digits = 0; int32_t max_digits = 0;
int32_t max_tries = 0; int32_t max_tries = 0;
uint32_t digit_timeout = 0;
int timeout = 1000; int timeout = 1000;
char digit_buffer[128] = ""; char digit_buffer[128] = "";
const char *prompt_audio_file = NULL; const char *prompt_audio_file = NULL;
@ -1827,6 +1837,14 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
digits_regex = argv[8]; digits_regex = argv[8];
} }
if (argc > 9) {
digit_timeout = atoi(argv[9]);
if (digit_timeout < 0) {
digit_timeout = 0;
}
}
if (min_digits <= 1) { if (min_digits <= 1) {
min_digits = 1; min_digits = 1;
} }
@ -1844,7 +1862,7 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
} }
switch_play_and_get_digits(session, min_digits, max_digits, max_tries, timeout, valid_terminators, switch_play_and_get_digits(session, min_digits, max_digits, max_tries, timeout, valid_terminators,
prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex); prompt_audio_file, bad_input_audio_file, var_name, digit_buffer, sizeof(digit_buffer), digits_regex, digit_timeout);
} }
#define SAY_SYNTAX "<module_name> <say_type> <say_method> [<say_gender>] <text>" #define SAY_SYNTAX "<module_name> <say_type> <say_method> [<say_gender>] <text>"
@ -3367,9 +3385,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "endless_playback", "Playback File Endlessly", "Endlessly Playback a file to the channel", SWITCH_ADD_APP(app_interface, "endless_playback", "Playback File Endlessly", "Endlessly Playback a file to the channel",
endless_playback_function, "<path>", SAF_NONE); endless_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, "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> <digit_timeout>", SAF_NONE);
SWITCH_ADD_APP(app_interface, "play_and_get_digits", "Play and get Digits", "Play and get Digits", 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> <var_name> <regexp>", SAF_NONE); play_and_get_digits_function,
"<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp> [<digit_timeout>]", 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, "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_MEDIA_TAP); SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_MEDIA_TAP);
SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function, SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function,

View File

@ -203,7 +203,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
} }
do { do {
status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, "#"); status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, "#", 0);
} while (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_FALSE); } while (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_FALSE);
if (status == SWITCH_STATUS_SUCCESS) { if (status == SWITCH_STATUS_SUCCESS) {

View File

@ -1524,7 +1524,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
vm_cc[0] = '\0'; vm_cc[0] = '\0';
TRY_CODE(switch_ivr_read TRY_CODE(switch_ivr_read
(session, 0, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key)); (session, 0, sizeof(vm_cc), macro_buf, NULL, vm_cc, sizeof(vm_cc), profile->digit_timeout, profile->terminator_key, 0));
cmd = switch_core_session_sprintf(session, "%s@%s %s %s '%s'", vm_cc, cbt->domain, new_file_path, cbt->cid_number, cbt->cid_name); cmd = switch_core_session_sprintf(session, "%s@%s %s %s '%s'", vm_cc, cbt->domain, new_file_path, cbt->cid_number, cbt->cid_name);
@ -1988,7 +1988,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p
switch_xml_t xx_user, xx_domain, xx_domain_root; switch_xml_t xx_user, xx_domain, xx_domain_root;
switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", VM_ENTER_PASS_MACRO, profile->terminator_key); switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", VM_ENTER_PASS_MACRO, profile->terminator_key);
TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key)); TRY_CODE(switch_ivr_read(session, 0, 255, macro, NULL, buf, sizeof(buf), 10000, profile->terminator_key, 0));
sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name); sql = switch_mprintf("update voicemail_prefs set password='%s' where username='%s' and domain='%s'", buf, myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex); vm_execute_sql(profile, sql, profile->mutex);
switch_safe_free(file_path); switch_safe_free(file_path);

View File

@ -12098,6 +12098,20 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_char_to_rfc2833(char jarg1) {
} }
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_default_ptime(char * jarg1, unsigned long jarg2) {
unsigned long jresult ;
char *arg1 = (char *) 0 ;
uint32_t arg2 ;
uint32_t result;
arg1 = (char *)jarg1;
arg2 = (uint32_t)jarg2;
result = (uint32_t)switch_default_ptime((char const *)arg1,arg2);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_sanitize_number(char * jarg1) { SWIGEXPORT char * SWIGSTDCALL CSharp_switch_sanitize_number(char * jarg1) {
char * jresult ; char * jresult ;
char *arg1 = (char *) 0 ; char *arg1 = (char *) 0 ;
@ -26802,7 +26816,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_record_file(void * jarg1, void * ja
} }
SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, unsigned long jarg11, char * jarg12) { SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsigned long jarg2, unsigned long jarg3, unsigned long jarg4, unsigned long jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, unsigned long jarg11, char * jarg12, unsigned long jarg13) {
int jresult ; int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
uint32_t arg2 ; uint32_t arg2 ;
@ -26816,6 +26830,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
char *arg10 = (char *) 0 ; char *arg10 = (char *) 0 ;
uint32_t arg11 ; uint32_t arg11 ;
char *arg12 = (char *) 0 ; char *arg12 = (char *) 0 ;
uint32_t arg13 ;
switch_status_t result; switch_status_t result;
arg1 = (switch_core_session_t *)jarg1; arg1 = (switch_core_session_t *)jarg1;
@ -26830,7 +26845,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
arg10 = (char *)jarg10; arg10 = (char *)jarg10;
arg11 = (uint32_t)jarg11; arg11 = (uint32_t)jarg11;
arg12 = (char *)jarg12; arg12 = (char *)jarg12;
result = (switch_status_t)switch_play_and_get_digits(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,arg10,arg11,(char const *)arg12); arg13 = (uint32_t)jarg13;
result = (switch_status_t)switch_play_and_get_digits(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,arg10,arg11,(char const *)arg12,arg13);
jresult = result; jresult = result;
return jresult; return jresult;
} }
@ -27604,7 +27620,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_wait_for_answer(void * jarg1, void
} }
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4, char * jarg5, char * jarg6, void * jarg7, unsigned long jarg8, char * jarg9) { SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4, char * jarg5, char * jarg6, void * jarg7, unsigned long jarg8, char * jarg9, unsigned long jarg10) {
int jresult ; int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
uint32_t arg2 ; uint32_t arg2 ;
@ -27615,6 +27631,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
switch_size_t arg7 ; switch_size_t arg7 ;
uint32_t arg8 ; uint32_t arg8 ;
char *arg9 = (char *) 0 ; char *arg9 = (char *) 0 ;
uint32_t arg10 ;
switch_status_t result; switch_status_t result;
switch_size_t *argp7 ; switch_size_t *argp7 ;
@ -27632,7 +27649,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
arg7 = *argp7; arg7 = *argp7;
arg8 = (uint32_t)jarg8; arg8 = (uint32_t)jarg8;
arg9 = (char *)jarg9; arg9 = (char *)jarg9;
result = (switch_status_t)switch_ivr_read(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7,arg8,(char const *)arg9); arg10 = (uint32_t)jarg10;
result = (switch_status_t)switch_ivr_read(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,arg6,arg7,arg8,(char const *)arg9,arg10);
jresult = result; jresult = result;
return jresult; return jresult;
} }
@ -33600,7 +33618,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_Transfer(void * jarg1, char * jarg
} }
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, int jarg3, char * jarg4, int jarg5, char * jarg6) { SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, int jarg3, char * jarg4, int jarg5, char * jarg6, int jarg7) {
char * jresult ; char * jresult ;
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ; int arg2 ;
@ -33608,6 +33626,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
char *arg4 = (char *) 0 ; char *arg4 = (char *) 0 ;
int arg5 ; int arg5 ;
char *arg6 = (char *) 0 ; char *arg6 = (char *) 0 ;
int arg7 = (int) 0 ;
char *result = 0 ; char *result = 0 ;
arg1 = (CoreSession *)jarg1; arg1 = (CoreSession *)jarg1;
@ -33616,13 +33635,14 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
arg4 = (char *)jarg4; arg4 = (char *)jarg4;
arg5 = (int)jarg5; arg5 = (int)jarg5;
arg6 = (char *)jarg6; arg6 = (char *)jarg6;
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6); arg7 = (int)jarg7;
result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
jresult = SWIG_csharp_string_callback((const char *)result); jresult = SWIG_csharp_string_callback((const char *)result);
return jresult; return jresult;
} }
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1, int jarg2, int jarg3, int jarg4, int jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10) { SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1, int jarg2, int jarg3, int jarg4, int jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9, char * jarg10, int jarg11) {
char * jresult ; char * jresult ;
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;
int arg2 ; int arg2 ;
@ -33634,6 +33654,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
char *arg8 = (char *) 0 ; char *arg8 = (char *) 0 ;
char *arg9 = (char *) 0 ; char *arg9 = (char *) 0 ;
char *arg10 = (char *) NULL ; char *arg10 = (char *) NULL ;
int arg11 = (int) 0 ;
char *result = 0 ; char *result = 0 ;
arg1 = (CoreSession *)jarg1; arg1 = (CoreSession *)jarg1;
@ -33646,7 +33667,8 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
arg8 = (char *)jarg8; arg8 = (char *)jarg8;
arg9 = (char *)jarg9; arg9 = (char *)jarg9;
arg10 = (char *)jarg10; arg10 = (char *)jarg10;
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10); arg11 = (int)jarg11;
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11);
jresult = SWIG_csharp_string_callback((const char *)result); jresult = SWIG_csharp_string_callback((const char *)result);
return jresult; return jresult;
} }

View File

@ -323,13 +323,13 @@ public class CoreSession : IDisposable {
return ret; return ret;
} }
public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators) { public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators); string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout);
return ret; return ret;
} }
public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name) { public string PlayAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, string terminators, string audio_files, string bad_input_audio_files, string digits_regex, string var_name, int digit_timeout) {
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name); string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout);
return ret; return ret;
} }
@ -2715,6 +2715,11 @@ public class freeswitch {
return ret; return ret;
} }
public static uint switch_default_ptime(string name, uint number) {
uint ret = freeswitchPINVOKE.switch_default_ptime(name, number);
return ret;
}
public static string switch_sanitize_number(string number) { public static string switch_sanitize_number(string number) {
string ret = freeswitchPINVOKE.switch_sanitize_number(number); string ret = freeswitchPINVOKE.switch_sanitize_number(number);
return ret; return ret;
@ -4009,8 +4014,8 @@ public class freeswitch {
return ret; return ret;
} }
public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex) { public static switch_status_t switch_play_and_get_digits(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, uint max_tries, uint timeout, string valid_terminators, string audio_file, string bad_input_audio_file, string var_name, string digit_buffer, uint digit_buffer_length, string digits_regex, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex); switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_play_and_get_digits(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, max_tries, timeout, valid_terminators, audio_file, bad_input_audio_file, var_name, digit_buffer, digit_buffer_length, digits_regex, digit_timeout);
return ret; return ret;
} }
@ -4239,8 +4244,8 @@ public class freeswitch {
return ret; return ret;
} }
public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators) { public static switch_status_t switch_ivr_read(SWIGTYPE_p_switch_core_session session, uint min_digits, uint max_digits, string prompt_audio_file, string var_name, string digit_buffer, SWIGTYPE_p_switch_size_t digit_buffer_length, uint timeout, string valid_terminators, uint digit_timeout) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators); switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_read(SWIGTYPE_p_switch_core_session.getCPtr(session), min_digits, max_digits, prompt_audio_file, var_name, digit_buffer, SWIGTYPE_p_switch_size_t.getCPtr(digit_buffer_length), timeout, valid_terminators, digit_timeout);
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
return ret; return ret;
} }
@ -8288,6 +8293,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_char_to_rfc2833")] [DllImport("mod_managed", EntryPoint="CSharp_switch_char_to_rfc2833")]
public static extern byte switch_char_to_rfc2833(char jarg1); public static extern byte switch_char_to_rfc2833(char jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_default_ptime")]
public static extern uint switch_default_ptime(string jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_sanitize_number")] [DllImport("mod_managed", EntryPoint="CSharp_switch_sanitize_number")]
public static extern string switch_sanitize_number(string jarg1); public static extern string switch_sanitize_number(string jarg1);
@ -11793,7 +11801,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_record_file(HandleRef jarg1, HandleRef jarg2, string jarg3, HandleRef jarg4, uint jarg5); public static extern int switch_ivr_record_file(HandleRef jarg1, HandleRef jarg2, string jarg3, HandleRef jarg4, uint jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_play_and_get_digits")] [DllImport("mod_managed", EntryPoint="CSharp_switch_play_and_get_digits")]
public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12); public static extern int switch_play_and_get_digits(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, uint jarg11, string jarg12, uint jarg13);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_speak_text_handle")] [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_speak_text_handle")]
public static extern int switch_ivr_speak_text_handle(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6); public static extern int switch_ivr_speak_text_handle(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, string jarg5, HandleRef jarg6);
@ -11931,7 +11939,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_wait_for_answer(HandleRef jarg1, HandleRef jarg2); public static extern int switch_ivr_wait_for_answer(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_read")] [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_read")]
public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9); public static extern int switch_ivr_read(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4, string jarg5, string jarg6, HandleRef jarg7, uint jarg8, string jarg9, uint jarg10);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_block_dtmf_session")] [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_block_dtmf_session")]
public static extern int switch_ivr_block_dtmf_session(HandleRef jarg1); public static extern int switch_ivr_block_dtmf_session(HandleRef jarg1);
@ -13338,10 +13346,10 @@ class freeswitchPINVOKE {
public static extern int CoreSession_Transfer(HandleRef jarg1, string jarg2, string jarg3, string jarg4); public static extern int CoreSession_Transfer(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_read")] [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_read")]
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6); public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6, int jarg7);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_PlayAndGetDigits")] [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_PlayAndGetDigits")]
public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10); public static extern string CoreSession_PlayAndGetDigits(HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7, string jarg8, string jarg9, string jarg10, int jarg11);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_StreamFile")] [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_StreamFile")]
public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3); public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3);

View File

@ -9708,17 +9708,17 @@ XS(SWIG_init) {
SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu"); SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu");
SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API"); SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API");
SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t"); SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t");
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP)));
SvREADONLY_on(sv); SvREADONLY_on(sv);
} while(0) /*@SWIG@*/; } while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE)));
SvREADONLY_on(sv); SvREADONLY_on(sv);
} while(0) /*@SWIG@*/; } while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK)));
SvREADONLY_on(sv); SvREADONLY_on(sv);

View File

@ -775,7 +775,8 @@ SWITCH_DECLARE(char *) CoreSession::read(int min_digits,
int max_digits, int max_digits,
const char *prompt_audio_file, const char *prompt_audio_file,
int timeout, int timeout,
const char *valid_terminators) const char *valid_terminators,
int digit_timeout)
{ {
this_check((char *)""); this_check((char *)"");
sanity_check((char *)""); sanity_check((char *)"");
@ -792,7 +793,8 @@ SWITCH_DECLARE(char *) CoreSession::read(int min_digits,
} }
begin_allow_threads(); begin_allow_threads();
switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, NULL, dtmf_buf, sizeof(dtmf_buf), timeout, valid_terminators); switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, NULL, dtmf_buf,
sizeof(dtmf_buf), timeout, valid_terminators, (uint32_t)digit_timeout);
end_allow_threads(); end_allow_threads();
return dtmf_buf; return dtmf_buf;
@ -806,7 +808,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
char *audio_files, char *audio_files,
char *bad_input_audio_files, char *bad_input_audio_files,
char *digits_regex, char *digits_regex,
const char *var_name) const char *var_name,
int digit_timeout)
{ {
switch_status_t status; switch_status_t status;
sanity_check((char *)""); sanity_check((char *)"");
@ -824,7 +827,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
var_name, var_name,
dtmf_buf, dtmf_buf,
sizeof(dtmf_buf), sizeof(dtmf_buf),
digits_regex); digits_regex,
(uint32_t) digit_timeout);
end_allow_threads(); end_allow_threads();
return dtmf_buf; return dtmf_buf;

View File

@ -212,7 +212,7 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void
status = switch_ivr_read(collect->session, status = switch_ivr_read(collect->session,
len, len,
len, len,
collect->file, NULL, buf, sizeof(buf), collect->confirm_timeout, NULL); collect->file, NULL, buf, sizeof(buf), collect->confirm_timeout, NULL, 0);
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK && status != SWITCH_STATUS_TOO_SMALL) { if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK && status != SWITCH_STATUS_TOO_SMALL) {

View File

@ -1645,7 +1645,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
uint32_t max_digits, uint32_t max_digits,
const char *prompt_audio_file, const char *prompt_audio_file,
const char *var_name, const char *var_name,
char *digit_buffer, switch_size_t digit_buffer_length, uint32_t timeout, const char *valid_terminators) char *digit_buffer,
switch_size_t digit_buffer_length,
uint32_t timeout,
const char *valid_terminators,
uint32_t digit_timeout)
{ {
switch_channel_t *channel; switch_channel_t *channel;
switch_input_args_t args = { 0 }; switch_input_args_t args = { 0 };
@ -1696,7 +1701,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
if ((min_digits && len < min_digits) || len < max_digits) { if ((min_digits && len < min_digits) || len < max_digits) {
args.buf = digit_buffer + len; args.buf = digit_buffer + len;
args.buflen = (uint32_t) (digit_buffer_length - len); args.buflen = (uint32_t) (digit_buffer_length - len);
status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &tb[0], timeout, 0, 0); status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &tb[0],
len ? digit_timeout : timeout, digit_timeout, 0);
} }
@ -1745,7 +1751,10 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
const char *prompt_audio_file, const char *prompt_audio_file,
const char *bad_input_audio_file, const char *bad_input_audio_file,
const char *var_name, const char *var_name,
char *digit_buffer, uint32_t digit_buffer_length, const char *digits_regex) char *digit_buffer,
uint32_t digit_buffer_length,
const char *digits_regex,
uint32_t digit_timeout)
{ {
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
@ -1755,7 +1764,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
memset(digit_buffer, 0, digit_buffer_length); memset(digit_buffer, 0, digit_buffer_length);
switch_channel_flush_dtmf(channel); switch_channel_flush_dtmf(channel);
status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name,
digit_buffer, digit_buffer_length, timeout, valid_terminators); digit_buffer, digit_buffer_length, timeout, valid_terminators, digit_timeout);
if (status == SWITCH_STATUS_TIMEOUT && strlen(digit_buffer) >= min_digits) { if (status == SWITCH_STATUS_TIMEOUT && strlen(digit_buffer) >= min_digits) {
status = SWITCH_STATUS_SUCCESS; status = SWITCH_STATUS_SUCCESS;
} }