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:
parent
b9ec9f8e04
commit
69f7357506
|
@ -302,7 +302,8 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
|
|||
SWITCH_DECLARE(char *) playAndGetDigits(int min_digits,
|
||||
int max_digits,
|
||||
int max_tries,
|
||||
int timeout, char *terminators, char *audio_files, char *bad_input_audio_files, char *digits_regex);
|
||||
int timeout, char *terminators, char *audio_files, char *bad_input_audio_files,
|
||||
char *var_name, char *digits_regex);
|
||||
|
||||
/** \brief Play a file that resides on disk into the channel
|
||||
*
|
||||
|
|
|
@ -343,6 +343,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(_In_ switch_core_session_
|
|||
\param valid_terminators for input that can include # or * (useful for variable length prompts)
|
||||
\param audio_file file to play
|
||||
\param bad_input_audio_file file to play if the input from the user was invalid
|
||||
\param var_name variable name to put results in
|
||||
\param digit_buffer variable digits captured will be put back into (empty if capture failed)
|
||||
\param digit_buffer_length length of the buffer for digits (should be the same or larger than max_digits)
|
||||
\param digits_regex the qualifying regex
|
||||
|
@ -356,7 +357,8 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
|
|||
uint32_t timeout,
|
||||
const char *valid_terminators,
|
||||
const char *audio_file,
|
||||
const char *bad_input_audio_file, char *digit_buffer, uint32_t digit_buffer_length,
|
||||
const char *bad_input_audio_file,
|
||||
const char *var_name, char *digit_buffer, uint32_t digit_buffer_length,
|
||||
const char *digits_regex);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -233,8 +233,8 @@ public class CoreSession {
|
|||
return freeswitchJNI.CoreSession_read(swigCPtr, this, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators);
|
||||
}
|
||||
|
||||
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) {
|
||||
return freeswitchJNI.CoreSession_playAndGetDigits(swigCPtr, this, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex);
|
||||
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 var_name, String digits_regex) {
|
||||
return freeswitchJNI.CoreSession_playAndGetDigits(swigCPtr, this, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, var_name, digits_regex);
|
||||
}
|
||||
|
||||
public int streamFile(String file, int starting_sample_count) {
|
||||
|
|
|
@ -133,7 +133,7 @@ class freeswitchJNI {
|
|||
public final static native int CoreSession_transfer__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
|
||||
public final static native int CoreSession_transfer__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2);
|
||||
public final static native String CoreSession_read(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, String jarg4, int jarg5, String jarg6);
|
||||
public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9);
|
||||
public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9, String jarg10);
|
||||
public final static native int CoreSession_streamFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
|
||||
public final static native int CoreSession_streamFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2);
|
||||
public final static native int CoreSession_sleep__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, int jarg3);
|
||||
|
|
|
@ -2577,7 +2577,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9) {
|
||||
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jstring jarg9, jstring jarg10) {
|
||||
jstring jresult = 0 ;
|
||||
CoreSession *arg1 = (CoreSession *) 0 ;
|
||||
int arg2 ;
|
||||
|
@ -2588,6 +2588,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
|
@ -2618,12 +2619,18 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
|
|||
arg9 = (char *)jenv->GetStringUTFChars(jarg9, 0);
|
||||
if (!arg9) return 0;
|
||||
}
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
||||
arg10 = 0;
|
||||
if (jarg10) {
|
||||
arg10 = (char *)jenv->GetStringUTFChars(jarg10, 0);
|
||||
if (!arg10) return 0;
|
||||
}
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
|
||||
if(result) jresult = jenv->NewStringUTF((const char *)result);
|
||||
if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6);
|
||||
if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7);
|
||||
if (arg8) jenv->ReleaseStringUTFChars(jarg8, (const char *)arg8);
|
||||
if (arg9) jenv->ReleaseStringUTFChars(jarg9, (const char *)arg9);
|
||||
if (arg10) jenv->ReleaseStringUTFChars(jarg10, (const char *)arg10);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
|
|
@ -5924,9 +5924,10 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("playAndGetDigits",9,9)
|
||||
SWIG_check_num_args("playAndGetDigits",10,10)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("playAndGetDigits",1,"CoreSession *");
|
||||
if(!lua_isnumber(L,2)) SWIG_fail_arg("playAndGetDigits",2,"int");
|
||||
if(!lua_isnumber(L,3)) SWIG_fail_arg("playAndGetDigits",3,"int");
|
||||
|
@ -5936,6 +5937,7 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
|
|||
if(!lua_isstring(L,7)) SWIG_fail_arg("playAndGetDigits",7,"char *");
|
||||
if(!lua_isstring(L,8)) SWIG_fail_arg("playAndGetDigits",8,"char *");
|
||||
if(!lua_isstring(L,9)) SWIG_fail_arg("playAndGetDigits",9,"char *");
|
||||
if(!lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
|
||||
SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession);
|
||||
|
@ -5949,7 +5951,8 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
|
|||
arg7 = (char *)lua_tostring(L, 7);
|
||||
arg8 = (char *)lua_tostring(L, 8);
|
||||
arg9 = (char *)lua_tostring(L, 9);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
||||
arg10 = (char *)lua_tostring(L, 10);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
|
||||
SWIG_arg=0;
|
||||
lua_pushstring(L,(const char*)result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
|
|
@ -21051,7 +21051,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, unsigned long jarg10, char * jarg11) {
|
||||
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) {
|
||||
int jresult ;
|
||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
|
@ -21062,8 +21062,9 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
uint32_t arg10 ;
|
||||
char *arg11 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
uint32_t arg11 ;
|
||||
char *arg12 = (char *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_core_session_t *)jarg1;
|
||||
|
@ -21075,9 +21076,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_play_and_get_digits(void * jarg1, unsig
|
|||
arg7 = (char *)jarg7;
|
||||
arg8 = (char *)jarg8;
|
||||
arg9 = (char *)jarg9;
|
||||
arg10 = (uint32_t)jarg10;
|
||||
arg11 = (char *)jarg11;
|
||||
result = (switch_status_t)switch_play_and_get_digits(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,(char const *)arg11);
|
||||
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);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
@ -27355,7 +27357,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_read(void * jarg1, int jarg2, i
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1, int jarg2, int jarg3, int jarg4, int jarg5, char * jarg6, char * jarg7, char * jarg8, char * jarg9) {
|
||||
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) {
|
||||
char * jresult ;
|
||||
CoreSession *arg1 = (CoreSession *) 0 ;
|
||||
int arg2 ;
|
||||
|
@ -27366,6 +27368,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (CoreSession *)jarg1;
|
||||
|
@ -27377,7 +27380,8 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_PlayAndGetDigits(void * jarg1,
|
|||
arg7 = (char *)jarg7;
|
||||
arg8 = (char *)jarg8;
|
||||
arg9 = (char *)jarg9;
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
||||
arg10 = (char *)jarg10;
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
|
|
@ -282,8 +282,8 @@ public class CoreSession : IDisposable {
|
|||
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 ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex);
|
||||
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 var_name, string digits_regex) {
|
||||
string ret = freeswitchPINVOKE.CoreSession_PlayAndGetDigits(swigCPtr, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, var_name, digits_regex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3054,8 +3054,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 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, 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) {
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -9342,7 +9342,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, uint jarg10, string jarg11);
|
||||
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);
|
||||
|
||||
[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);
|
||||
|
@ -10782,7 +10782,7 @@ class freeswitchPINVOKE {
|
|||
public static extern string CoreSession_read(HandleRef jarg1, int jarg2, int jarg3, string jarg4, int jarg5, string jarg6);
|
||||
|
||||
[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);
|
||||
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);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_StreamFile")]
|
||||
public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3);
|
||||
|
|
|
@ -7869,6 +7869,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
|
@ -7892,11 +7893,14 @@ XS(_wrap_CoreSession_playAndGetDigits) {
|
|||
int res9 ;
|
||||
char *buf9 = 0 ;
|
||||
int alloc9 = 0 ;
|
||||
int res10 ;
|
||||
char *buf10 = 0 ;
|
||||
int alloc10 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 9) || (items > 9)) {
|
||||
SWIG_croak("Usage: CoreSession_playAndGetDigits(self,min_digits,max_digits,max_tries,timeout,terminators,audio_files,bad_input_audio_files,digits_regex);");
|
||||
if ((items < 10) || (items > 10)) {
|
||||
SWIG_croak("Usage: CoreSession_playAndGetDigits(self,min_digits,max_digits,max_tries,timeout,terminators,audio_files,bad_input_audio_files,var_name,digits_regex);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
|
@ -7943,7 +7947,12 @@ XS(_wrap_CoreSession_playAndGetDigits) {
|
|||
SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *""'");
|
||||
}
|
||||
arg9 = reinterpret_cast< char * >(buf9);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
||||
res10 = SWIG_AsCharPtrAndSize(ST(9), &buf10, NULL, &alloc10);
|
||||
if (!SWIG_IsOK(res10)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
|
||||
}
|
||||
arg10 = reinterpret_cast< char * >(buf10);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
|
||||
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
|
||||
|
||||
|
||||
|
@ -7954,6 +7963,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
|
|||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
|
||||
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
|
||||
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
@ -7965,6 +7975,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
|
|||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
|
||||
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
|
||||
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7794,6 +7794,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
|
|||
char *arg7 = (char *) 0 ;
|
||||
char *arg8 = (char *) 0 ;
|
||||
char *arg9 = (char *) 0 ;
|
||||
char *arg10 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
|
@ -7817,6 +7818,9 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
|
|||
int res9 ;
|
||||
char *buf9 = 0 ;
|
||||
int alloc9 = 0 ;
|
||||
int res10 ;
|
||||
char *buf10 = 0 ;
|
||||
int alloc10 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
|
@ -7826,8 +7830,9 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
|
|||
PyObject * obj6 = 0 ;
|
||||
PyObject * obj7 = 0 ;
|
||||
PyObject * obj8 = 0 ;
|
||||
PyObject * obj9 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
|
||||
if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playAndGetDigits" "', argument " "1"" of type '" "CoreSession *""'");
|
||||
|
@ -7873,18 +7878,25 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
|
|||
SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *""'");
|
||||
}
|
||||
arg9 = reinterpret_cast< char * >(buf9);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
|
||||
res10 = SWIG_AsCharPtrAndSize(obj9, &buf10, NULL, &alloc10);
|
||||
if (!SWIG_IsOK(res10)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
|
||||
}
|
||||
arg10 = reinterpret_cast< char * >(buf10);
|
||||
result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
|
||||
resultobj = SWIG_FromCharPtr((const char *)result);
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
|
||||
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
|
||||
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
||||
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
|
||||
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
|
||||
if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
|
||||
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -748,7 +748,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
|
|||
int timeout,
|
||||
char *terminators,
|
||||
char *audio_files,
|
||||
char *bad_input_audio_files,
|
||||
char *bad_input_audio_files,
|
||||
char *var_name,
|
||||
char *digits_regex)
|
||||
{
|
||||
switch_status_t status;
|
||||
|
@ -763,7 +764,8 @@ SWITCH_DECLARE(char *) CoreSession::playAndGetDigits(int min_digits,
|
|||
(uint32_t) timeout,
|
||||
terminators,
|
||||
audio_files,
|
||||
bad_input_audio_files,
|
||||
bad_input_audio_files,
|
||||
var_name,
|
||||
dtmf_buf,
|
||||
sizeof(dtmf_buf),
|
||||
digits_regex);
|
||||
|
|
|
@ -1503,6 +1503,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
|
|||
const char *valid_terminators,
|
||||
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)
|
||||
|
@ -1514,7 +1515,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, NULL,
|
||||
status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name,
|
||||
digit_buffer, digit_buffer_length, timeout, valid_terminators);
|
||||
if (status == SWITCH_STATUS_TIMEOUT && strlen(digit_buffer) >= min_digits) {
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue