]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sprinkle digit_timeout into switch_ivr_read and switch_ivr_play_and_get_digits and...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 23 Sep 2010 23:37:45 +0000 (18:37 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 23 Sep 2010 23:37:45 +0000 (18:37 -0500)
12 files changed:
src/include/switch_cpp.h
src/include/switch_ivr.h
src/mod/applications/mod_directory/mod_directory.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/applications/mod_valet_parking/mod_valet_parking.c
src/mod/applications/mod_voicemail/mod_voicemail.c
src/mod/languages/mod_managed/freeswitch_wrap.cxx
src/mod/languages/mod_managed/managed/swig.cs
src/mod/languages/mod_perl/mod_perl_wrap.cpp
src/switch_cpp.cpp
src/switch_ivr_originate.c
src/switch_ivr_play_say.c

index ed14f108c7fd9883a082564f1468c0f4a6e1ab1f..0ede8e638f8729c2b6c16a104d57c6b4cdbdcc9c 100644 (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(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
         * 
@@ -306,7 +307,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
                                                                                                 int max_digits,
                                                                                                 int max_tries,
                                                                                                 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
         *
index 40ba1dc16f07b1ca9da8f0596aa9f27d09f2b952..4c562a51d78b22c4ca22367e306f9e4a46ebcbfd 100644 (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 *bad_input_audio_file,
                                                                                                                   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_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,
                                                                                                const char *prompt_audio_file,
                                                                                                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_unblock_dtmf_session(switch_core_session_t *session);
index bfad1a68f608bca9869d48d23488667e0f105cbc..8464b1c0df18e475a94c4022eecca9faf22dbb84 100644 (file)
@@ -649,25 +649,25 @@ static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_
 
        if (zstr_buf(buf)) {
                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)) {
-               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)) {
                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)) {
                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)) {
                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);
-               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)) {
index 55429275dd3f88add9e8e379d81056e67fe135ad..dd63f8aae92c863ca8d1a10333b8641b3fa19b58 100755 (executable)
@@ -1712,10 +1712,11 @@ SWITCH_STANDARD_APP(att_xfer_function)
 SWITCH_STANDARD_APP(read_function)
 {
        char *mydata;
-       char *argv[6] = { 0 };
+       char *argv[7] = { 0 };
        int argc;
        int32_t min_digits = 0;
        int32_t max_digits = 0;
+       uint32_t digit_timeout = 0;
        int timeout = 1000;
        char digit_buffer[128] = "";
        const char *prompt_audio_file = NULL;
@@ -1751,6 +1752,13 @@ SWITCH_STANDARD_APP(read_function)
                valid_terminators = argv[5];
        }
 
+       if (argc > 6) {
+               digit_timeout = atoi(argv[6]);
+               if (digit_timeout < 0) {
+                       digit_timeout = 0;
+               }
+       }
+
        if (min_digits <= 1) {
                min_digits = 1;
        }
@@ -1767,17 +1775,19 @@ SWITCH_STANDARD_APP(read_function)
                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)
 {
        char *mydata;
-       char *argv[9] = { 0 };
+       char *argv[10] = { 0 };
        int argc;
        int32_t min_digits = 0;
        int32_t max_digits = 0;
        int32_t max_tries = 0;
+       uint32_t digit_timeout = 0;
        int timeout = 1000;
        char digit_buffer[128] = "";
        const char *prompt_audio_file = NULL;
@@ -1827,6 +1837,14 @@ SWITCH_STANDARD_APP(play_and_get_digits_function)
                digits_regex = argv[8];
        }
 
+       if (argc > 9) {
+               digit_timeout = atoi(argv[9]);
+               if (digit_timeout < 0) {
+                       digit_timeout = 0;
+               }
+       }
+
+
        if (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,
-                                                          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>"
@@ -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",
                                   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, "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",
-                                  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, "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,
index aee49c76e92b8dca9a44a13c9732815a5db88803..b75202189cb0923fd34af779200cf6b4d2ac43c9 100644 (file)
@@ -203,7 +203,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
                        }
 
                        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);
 
                        if (status == SWITCH_STATUS_SUCCESS) {
index 84e3ec43283af23a076a071ee4c5f2102c8b29e6..0b1d698b862251c17875163bcb675a8d9d8aae5e 100644 (file)
@@ -1524,7 +1524,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
                                vm_cc[0] = '\0';
 
                                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);
 
@@ -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_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);
                                        vm_execute_sql(profile, sql, profile->mutex);
                                        switch_safe_free(file_path);
index b4c7dddd27d9003014d22690c05d3ca54520ce43..bfb36abe4eec5f404fc3d19f704573a288b96a0d 100644 (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) {
   char * jresult ;
   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 ;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   uint32_t arg2 ;
@@ -26816,6 +26830,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
   char *arg10 = (char *) 0 ;
   uint32_t arg11 ;
   char *arg12 = (char *) 0 ;
+  uint32_t arg13 ;
   switch_status_t result;
   
   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; 
   arg11 = (uint32_t)jarg11; 
   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; 
   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 ;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   uint32_t arg2 ;
@@ -27615,6 +27631,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
   switch_size_t arg7 ;
   uint32_t arg8 ;
   char *arg9 = (char *) 0 ;
+  uint32_t arg10 ;
   switch_status_t result;
   switch_size_t *argp7 ;
   
@@ -27632,7 +27649,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_read(void * jarg1, unsigned long ja
   arg7 = *argp7; 
   arg8 = (uint32_t)jarg8; 
   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; 
   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 ;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
@@ -33608,6 +33626,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
   char *arg4 = (char *) 0 ;
   int arg5 ;
   char *arg6 = (char *) 0 ;
+  int arg7 = (int) 0 ;
   char *result = 0 ;
   
   arg1 = (CoreSession *)jarg1; 
@@ -33616,13 +33635,14 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
   arg4 = (char *)jarg4; 
   arg5 = (int)jarg5; 
   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); 
   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 ;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
@@ -33634,6 +33654,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
   char *arg8 = (char *) 0 ;
   char *arg9 = (char *) 0 ;
   char *arg10 = (char *) NULL ;
+  int arg11 = (int) 0 ;
   char *result = 0 ;
   
   arg1 = (CoreSession *)jarg1; 
@@ -33646,7 +33667,8 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
   arg8 = (char *)jarg8; 
   arg9 = (char *)jarg9; 
   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); 
   return jresult;
 }
index 5f412f414457f5165a89006937f35fdca8b2b776..59d278be808e96d9166e76438f9ce8e3bbc0189e 100644 (file)
@@ -323,13 +323,13 @@ public class CoreSession : IDisposable {
     return ret;
   }
 
-  public string read(int min_digits, int max_digits, string prompt_audio_file, int timeout, string valid_terminators) {
-    string ret = freeswitchPINVOKE.CoreSession_read(swigCPtr, min_digits, max_digits, prompt_audio_file, timeout, 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, digit_timeout);
     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) {
-    string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, 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, digit_timeout);
     return ret;
   }
 
@@ -2715,6 +2715,11 @@ public class freeswitch {
     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) {
     string ret = freeswitchPINVOKE.switch_sanitize_number(number);
     return ret;
@@ -4009,8 +4014,8 @@ public class freeswitch {
     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) {
-    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);
+  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, digit_timeout);
     return ret;
   }
 
@@ -4239,8 +4244,8 @@ public class freeswitch {
     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) {
-    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);
+  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, digit_timeout);
     if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
     return ret;
   }
@@ -8288,6 +8293,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_char_to_rfc2833")]
   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")]
   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);
 
   [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")]
   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);
 
   [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")]
   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);
 
   [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")]
-  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")]
   public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3);
index 5ba899fbf851208ca2c57eef76df3b07ac257341..b615b9d930b5177f4d6782e025645946ce4afe8a 100644 (file)
@@ -9708,17 +9708,17 @@ XS(SWIG_init) {
   SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu");
   SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API");
   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_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP)));
     SvREADONLY_on(sv);
   } 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_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE)));
     SvREADONLY_on(sv);
   } 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_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK)));
     SvREADONLY_on(sv);
index 5368cdddeb9eb95c4b3b3ab8fb4b8b565389a7b8..469ae18c4b8b018c41452b0b134f8a83d13fb0ae 100644 (file)
@@ -775,7 +775,8 @@ SWITCH_DECLARE(char *) CoreSession::read(int min_digits,
                                                                                 int max_digits,
                                                                                 const char *prompt_audio_file,
                                                                                 int timeout,
-                                                                                const char *valid_terminators)
+                                                                                const char *valid_terminators,
+                                                                                int digit_timeout)
 {
        this_check((char *)"");
        sanity_check((char *)"");
@@ -792,7 +793,8 @@ SWITCH_DECLARE(char *) CoreSession::read(int min_digits,
        }
 
     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();
 
        return dtmf_buf;
@@ -806,7 +808,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
                                                                                                         char *audio_files, 
                                                                                                         char *bad_input_audio_files,
                                                                                                         char *digits_regex,
-                                                                                                        const char *var_name)
+                                                                                                        const char *var_name,
+                                                                                                        int digit_timeout)
 {
     switch_status_t status;
        sanity_check((char *)"");
@@ -824,7 +827,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
                                                                                 var_name,
                                                                                 dtmf_buf, 
                                                                                 sizeof(dtmf_buf), 
-                                                                                digits_regex);
+                                                                                digits_regex,
+                                                                                (uint32_t) digit_timeout);
 
        end_allow_threads();
        return dtmf_buf;
index 22b26eb4e0e5de1e1fde6b6e6fcce96d3561eb32..b9c410253c3f486a58e1afe8d00299a57c04fd7a 100644 (file)
@@ -212,7 +212,7 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void
                status = switch_ivr_read(collect->session,
                                                                 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) {
index 75ed2d628386a2887977988294b0a9e1e6a92250..d75af10a5ec7fd1465ad301d8b136e4de076810c 100644 (file)
@@ -1645,7 +1645,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
                                                                                                uint32_t max_digits,
                                                                                                const char *prompt_audio_file,
                                                                                                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_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) {
                args.buf = digit_buffer + 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 *bad_input_audio_file,
                                                                                                                   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);
 
@@ -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);
                switch_channel_flush_dtmf(channel);
                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) {
                        status = SWITCH_STATUS_SUCCESS;
                }