]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9851: [freeswitch-core] Add abstimeout to CoreSession:getDigits in switch_cpp...
authorBrian West <brian@freeswitch.org>
Wed, 14 Dec 2016 20:02:04 +0000 (14:02 -0600)
committerBrian West <brian@freeswitch.org>
Wed, 14 Dec 2016 20:06:20 +0000 (14:06 -0600)
src/include/switch_cpp.h
src/mod/languages/mod_lua/mod_lua_wrap.cpp
src/switch_cpp.cpp

index 9a9adb83a1b973892cca666081122a05b1d34acf..ce068aed229fedec6df1a8c926230ae25a1b87de 100644 (file)
@@ -309,6 +309,7 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod
         */
                 SWITCH_DECLARE(char *) getDigits(int maxdigits, char *terminators, int timeout);
                 SWITCH_DECLARE(char *) getDigits(int maxdigits, char *terminators, int timeout, int interdigit);
+                SWITCH_DECLARE(char *) getDigits(int maxdigits, char *terminators, int timeout, int interdigit, int abstimeout);
                 SWITCH_DECLARE(int) transfer(char *extension, char *dialplan = NULL, char *context = NULL);
 
 
index fc6640809313d17d575d6494562d3ea090a7e35d..5dd9efdf3d986496d2922d277f0edc71928a74fd 100644 (file)
@@ -5745,10 +5745,49 @@ fail:
 }
 
 
+static int _wrap_CoreSession_getDigits__SWIG_2(lua_State* L) {
+  int SWIG_arg = 0;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  int arg5 ;
+  int arg6 ;
+  char *result = 0 ;
+  
+  SWIG_check_num_args("CoreSession::getDigits",6,6)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::getDigits",2,"int");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::getDigits",3,"char *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::getDigits",4,"int");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::getDigits",5,"int");
+  if(!lua_isnumber(L,6)) SWIG_fail_arg("CoreSession::getDigits",6,"int");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
+  }
+  
+  arg2 = (int)lua_tonumber(L, 2);
+  arg3 = (char *)lua_tostring(L, 3);
+  arg4 = (int)lua_tonumber(L, 4);
+  arg5 = (int)lua_tonumber(L, 5);
+  arg6 = (int)lua_tonumber(L, 6);
+  result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
 static int _wrap_CoreSession_getDigits(lua_State* L) {
   int argc;
-  int argv[6]={
-    1,2,3,4,5,6
+  int argv[7]={
+    1,2,3,4,5,6,7
   };
   
   argc = lua_gettop(L);
@@ -5815,11 +5854,51 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
       }
     }
   }
+  if (argc == 6) {
+    int _v;
+    {
+      void *ptr;
+      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+        _v = 0;
+      } else {
+        _v = 1;
+      }
+    }
+    if (_v) {
+      {
+        _v = lua_isnumber(L,argv[1]);
+      }
+      if (_v) {
+        {
+          _v = SWIG_lua_isnilstring(L,argv[2]);
+        }
+        if (_v) {
+          {
+            _v = lua_isnumber(L,argv[3]);
+          }
+          if (_v) {
+            {
+              _v = lua_isnumber(L,argv[4]);
+            }
+            if (_v) {
+              {
+                _v = lua_isnumber(L,argv[5]);
+              }
+              if (_v) {
+                return _wrap_CoreSession_getDigits__SWIG_2(L);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
   
   SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'CoreSession_getDigits'\n"
     "  Possible C/C++ prototypes are:\n"
     "    CoreSession::getDigits(int,char *,int)\n"
-    "    CoreSession::getDigits(int,char *,int,int)\n");
+    "    CoreSession::getDigits(int,char *,int,int)\n"
+    "    CoreSession::getDigits(int,char *,int,int,int)\n");
   lua_error(L);return 0;
 }
 
index 038a0df6519df27ab4c78592aacd13ea3fddc80c..648c70c81b1a77a61337b3b9592c83536c1323ef 100644 (file)
@@ -878,10 +878,16 @@ SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits, char *terminators,
     return getDigits(maxdigits, terminators, timeout, 0);
 }
 
+SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits, char *terminators, int timeout, int interdigit)
+{
+    return getDigits(maxdigits, terminators, timeout, interdigit, 0);
+}
+
 SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits, 
                                                                                          char *terminators, 
                                                                                          int timeout,
-                                                                                         int interdigit)
+                                                                                         int interdigit,
+                                                                                         int abstimeout)
 {
        this_check((char *)"");
        sanity_check((char *)"");
@@ -895,7 +901,7 @@ SWITCH_DECLARE(char *) CoreSession::getDigits(int maxdigits,
                                                                        maxdigits, 
                                                                        terminators, 
                                                                        &terminator, 
-                                                                       (uint32_t) timeout, (uint32_t)interdigit, 0);
+                                                                       (uint32_t) timeout, (uint32_t)interdigit, (uint32_t)abstimeout);
 
        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "getDigits dtmf_buf: %s\n", dtmf_buf);
        end_allow_threads();