[Freeswitch-branches] [commit] r3636 - in freeswitch/branches/jkr888/trunk: scripts src/mod/languages/mod_python

Freeswitch SVN jkr888 at freeswitch.org
Wed Dec 13 14:59:25 EST 2006


Author: jkr888
Date: Wed Dec 13 14:59:24 2006
New Revision: 3636

Modified:
   freeswitch/branches/jkr888/trunk/scripts/mytest.py
   freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
   freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
   freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
   freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp

Log:


Modified: freeswitch/branches/jkr888/trunk/scripts/mytest.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/scripts/mytest.py	(original)
+++ freeswitch/branches/jkr888/trunk/scripts/mytest.py	Wed Dec 13 14:59:24 2006
@@ -27,6 +27,10 @@
 
 newSession.console_log("1","result from get digits is "+ input +"\n")
 
+phone_number = newSession.play_and_get_digits(5, 10, 3, 10000, "*#", "/var/lib/asterisk/sounds/callfwd-intro-us-only.gsm",
+            "/var/lib/asterisk/sounds/callfwd-invalid-entry.gsm", "", "");
+
+newSession.console_log("1","result from play_and_get_digits is "+ phone_number +"\n")
 newSession.transfer("1000", "XML", "default")
 
 #newSession.hangup("1")

Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py	(original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch.py	Wed Dec 13 14:59:24 2006
@@ -67,6 +67,7 @@
     def set_tts_parms(*args): return _freeswitch.SessionContainer_set_tts_parms(*args)
     def get_digits(*args): return _freeswitch.SessionContainer_get_digits(*args)
     def transfer(*args): return _freeswitch.SessionContainer_transfer(*args)
+    def play_and_get_digits(*args): return _freeswitch.SessionContainer_play_and_get_digits(*args)
 
 class SessionContainerPtr(SessionContainer):
     def __init__(self, this):

Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp	(original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.cpp	Wed Dec 13 14:59:24 2006
@@ -131,5 +131,10 @@
     switch_ivr_session_transfer(session, extension, dialplan, context);
 }
 
-
+void SessionContainer::play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators, 
+                char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex)
+{
+    switch_play_and_get_digits( session, (uint32_t) min_digits,(uint32_t) max_digits,(uint32_t) max_tries, (uint32_t) timeout, 
+            terminators, audio_files, bad_input_audio_files, dtmf_buf, 128, digits_regex);
+}
 

Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h	(original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/freeswitch_python.h	Wed Dec 13 14:59:24 2006
@@ -41,6 +41,8 @@
         void set_tts_parms(char *tts_name, char *voice_name);
         void get_digits(char *dtmf_buf, int len, char *terminators, int timeout);
         void transfer(char *extensions, char *dialplan, char *context);
+        void play_and_get_digits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators, 
+                char *audio_files, char *bad_input_audio_files, char *dtmf_buf, char *digits_regex);
     protected:
 };
 

Modified: freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp	(original)
+++ freeswitch/branches/jkr888/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp	Wed Dec 13 14:59:24 2006
@@ -2243,6 +2243,80 @@
 }
 
 
+static PyObject *_wrap_SessionContainer_play_and_get_digits(PyObject *, PyObject *args) {
+    PyObject *resultobj = NULL;
+    SessionContainer *arg1 = (SessionContainer *) 0 ;
+    int arg2 ;
+    int arg3 ;
+    int arg4 ;
+    int arg5 ;
+    char *arg6 = (char *) 0 ;
+    char *arg7 = (char *) 0 ;
+    char *arg8 = (char *) 0 ;
+    char *arg9 = (char *) 0 ;
+    char *arg10 = (char *) 0 ;
+    char temp9[128+1] ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    PyObject * obj2 = 0 ;
+    PyObject * obj3 = 0 ;
+    PyObject * obj4 = 0 ;
+    PyObject * obj5 = 0 ;
+    PyObject * obj6 = 0 ;
+    PyObject * obj7 = 0 ;
+    PyObject * obj8 = 0 ;
+    PyObject * obj9 = 0 ;
+    
+    if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:SessionContainer_play_and_get_digits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SessionContainer, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    {
+        arg2 = static_cast<int >(SWIG_As_int(obj1)); 
+        if (SWIG_arg_fail(2)) SWIG_fail;
+    }
+    {
+        arg3 = static_cast<int >(SWIG_As_int(obj2)); 
+        if (SWIG_arg_fail(3)) SWIG_fail;
+    }
+    {
+        arg4 = static_cast<int >(SWIG_As_int(obj3)); 
+        if (SWIG_arg_fail(4)) SWIG_fail;
+    }
+    {
+        arg5 = static_cast<int >(SWIG_As_int(obj4)); 
+        if (SWIG_arg_fail(5)) SWIG_fail;
+    }
+    if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
+        SWIG_arg_fail(6);SWIG_fail;
+    }
+    if (!SWIG_AsCharPtr(obj6, (char**)&arg7)) {
+        SWIG_arg_fail(7);SWIG_fail;
+    }
+    if (!SWIG_AsCharPtr(obj7, (char**)&arg8)) {
+        SWIG_arg_fail(8);SWIG_fail;
+    }
+    {
+        char *t = 0; size_t n;                                                   
+        SWIG_AsCharPtrAndSize(obj8, &t, &n);                                   
+        if (SWIG_arg_fail(9)) SWIG_fail;                                   
+        if ( n > (size_t)128 ) n = (size_t)128;                                  
+        memcpy(temp9, t, sizeof(char)*n);                                         
+        temp9[n] = 0;                                                             
+        arg9 = (char *) temp9;                                                    
+    }
+    if (!SWIG_AsCharPtr(obj9, (char**)&arg10)) {
+        SWIG_arg_fail(10);SWIG_fail;
+    }
+    (arg1)->play_and_get_digits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+    
+    Py_INCREF(Py_None); resultobj = Py_None;
+    arg9[128] = 0; resultobj = t_output_helper(resultobj, SWIG_FromCharPtr(arg9));
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject * SessionContainer_swigregister(PyObject *, PyObject *args) {
     PyObject *obj;
     if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@@ -2268,6 +2342,7 @@
 	 { (char *)"SessionContainer_set_tts_parms", _wrap_SessionContainer_set_tts_parms, METH_VARARGS, NULL},
 	 { (char *)"SessionContainer_get_digits", _wrap_SessionContainer_get_digits, METH_VARARGS, NULL},
 	 { (char *)"SessionContainer_transfer", _wrap_SessionContainer_transfer, METH_VARARGS, NULL},
+	 { (char *)"SessionContainer_play_and_get_digits", _wrap_SessionContainer_play_and_get_digits, METH_VARARGS, NULL},
 	 { (char *)"SessionContainer_swigregister", SessionContainer_swigregister, METH_VARARGS, NULL},
 	 { NULL, NULL, 0, NULL }
 };



More information about the Freeswitch-branches mailing list