]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7670: re-swig
authorMichael Jerris <mike@jerris.com>
Wed, 17 Jun 2015 14:30:33 +0000 (09:30 -0500)
committerMichael Jerris <mike@jerris.com>
Wed, 17 Jun 2015 14:30:33 +0000 (09:30 -0500)
39 files changed:
src/mod/languages/mod_java/src/org/freeswitch/swig/API.java
src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
src/mod/languages/mod_java/src/org/freeswitch/swig/DTMF.java
src/mod/languages/mod_java/src/org/freeswitch/swig/Event.java
src/mod/languages/mod_java/src/org/freeswitch/swig/EventConsumer.java
src/mod/languages/mod_java/src/org/freeswitch/swig/IVRMenu.java
src/mod/languages/mod_java/src/org/freeswitch/swig/JavaSession.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_JavaVM.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_p_switch_event_node_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_call_cause_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_state_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_core_session_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_types_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_args_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_type_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_priority_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_queue_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_state_handler_table_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_status_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_stream_handle_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_uint32_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_void.java
src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java
src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java
src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
src/mod/languages/mod_java/src/org/freeswitch/swig/input_callback_state_t.java
src/mod/languages/mod_java/src/org/freeswitch/swig/session_flag_t.java
src/mod/languages/mod_java/switch_swig_wrap.cpp
src/mod/languages/mod_lua/mod_lua_wrap.cpp
src/mod/languages/mod_managed/freeswitch_wrap.cxx
src/mod/languages/mod_managed/managed/swig.cs
src/mod/languages/mod_perl/freeswitch.pm
src/mod/languages/mod_perl/mod_perl_wrap.cpp
src/mod/languages/mod_python/freeswitch.py
src/mod/languages/mod_python/mod_python_wrap.cpp
src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp

index 5fd3da9bb011467cf08f3261239f4d88e111f5c5..dd586367a2a0a240789ada55656143b44e120c3f 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class API {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_API(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_API(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public API(CoreSession s) {
index e8f8f35a6ed68f49d1ae3931182614468a07063a..e62fddf4fd480ea829e0dcc0ad728fd5656a8e97 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class CoreSession {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_CoreSession(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_CoreSession(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public void setSession(SWIGTYPE_p_switch_core_session_t value) {
index 81e949d28548469924205d9d1d52302bae008f95..efc6d5bd8e76f3a9afe4ab9f05171603b7a6b58b 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class DTMF {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_DTMF(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_DTMF(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public void setDigit(char value) {
index d1adc09dc6a66f8bb3f986904c4c2e8a3b95b7c4..ad389eef65a3d307a6a07e3e252b0eb8b3e33da5 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class Event {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_Event(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_Event(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public void setEvent(SWIGTYPE_p_switch_event_t value) {
index 5b2798c316058919e8bc12276a1a7f5d7eab0b92..b760a30ad6ec730a051b33f5582fe9928849dc97 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class EventConsumer {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_EventConsumer(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_EventConsumer(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public void setEvents(SWIGTYPE_p_switch_queue_t value) {
index f459a116d0709bed602ecc10917883871ea6607d..65f72b866ddc5e474ddc27c9de0155a510632964 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class IVRMenu {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_IVRMenu(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_IVRMenu(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public IVRMenu(IVRMenu main, String name, String greeting_sound, String short_greeting_sound, String invalid_sound, String exit_sound, String transfer_sound, String confirm_macro, String confirm_key, String tts_engine, String tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts) {
index b2bf611a4e319814107d0aaf0b6da046f459e130..6e0a1329fae669433f42b105dbfbae12906a95e1 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -12,7 +12,7 @@ public class JavaSession extends CoreSession {
   private long swigCPtr;
 
   protected JavaSession(long cPtr, boolean cMemoryOwn) {
-    super(freeswitchJNI.SWIGJavaSessionUpcast(cPtr), cMemoryOwn);
+    super(freeswitchJNI.JavaSession_SWIGUpcast(cPtr), cMemoryOwn);
     swigCPtr = cPtr;
   }
 
@@ -25,11 +25,13 @@ public class JavaSession extends CoreSession {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_JavaSession(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_JavaSession(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
     super.delete();
   }
 
index eef921b5b06290a200e1d3351d93e0d120591219..40a9d9b63c389ea221adb5ec6ff1446f05e3c0cf 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index bb712a806bebc4eb853cb2c37ba98eb9686333df..b5499dfff0f5868550140718c4fd0fe50cbed0f4 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 84a8d3eee6a0d294449b8c65fef08bfb7261cd1e..a0fe3f33dac1b872fa598ac9d37447f6e1d5ea56 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index e3c77ff9c46e7c082d0be0d54ea9fda8ac77e8c8..0bbb409e64528b1e6da1937d9415bb7092556c31 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 81950079e89eb5aede67f778547586c7a90cbcc7..f108393f607c2a4c9e9a16743ea3cc41f430f65f 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 6a2e1dbefc6a90f1c1a5926205d29c6a26bddef0..c954757f1f3dab045edb41faffd510c2682bd5ff 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 0bc849c275ca8d0849e3fdc7c6924ddd7bc8e240..9ea8e4a6c30c53f8d4743abd7a8c4b950f88a408 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index e122b7616d30009fe505b289a068344a0b8a1c25..771be0a5e42d19c7bf4e8988c1a88331a010537b 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 0c62ea3d40320db975e5a986663e2504cd0bf7aa..21bad207b5c0b510957c4000f288fa245185cbb7 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 200b43896bef70226ec69dfb25afca70dc488f4d..13135ee435ba5bf71b9fc157f6dfca37f227bb8a 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index dd1d9e8733093174c57735f8265c1f674aa3b9fa..f1b19df92fef5bc7965992f5ebcbec87d1f0b7a9 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 1c8ae112c3c452b1fd925c623d793a24d5ba4c35..c57931269970ac75e849557e10c8caa84ccaf2f2 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index c979de53a42f5f216c7c62d694170642cd358ec5..139534ed60123ea516abcdad7f07edd2318f8c26 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index bed7ddc4af64abea1e683b246845087c64ed3c08..73173ddaaf77da975f54361c9c85cee56dabe248 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index ffbbb719d50074b647e12fb9bf80a2ee674d5251..34808fbd7309329a4a3d78d54f5d641b8baaf68b 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 656bdcf7ecf2e568d791a8361e65149e35f97feb..c104f9c0809c2b1517dad6cb67765a8298d4213f 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 0396fde79336335437ab5693621f6e1a0b397e69..02a5a5be75132157271a6410e2f28ab303570716 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 9c2cda23d3ed66c4d6e36084b0be966f793d1a69..ec42dab404cdd7075fe6e6ec180797e8e26c2a10 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 30350b001ee97240e093b33c76c1cf1cb53c6fd6..d444988e250bc0a450307379751f5357c9d19c3f 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class Stream {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_Stream(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_Stream(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public Stream() {
index fe0a0d9bc73b8ec5692c173fe97d4e451e9da987..d3cd35304abeccc2babebc052307e9a1da9519fa 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index 359bd8b5bc1f2ab982b070797a1e16e1a7a1d411..32d4748df5de0e4ef6c0fc4436bb591b6f152030 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -8,7 +8,7 @@
 
 package org.freeswitch.swig;
 
-class freeswitchJNI {
+public class freeswitchJNI {
   public final static native void setGlobalVariable(String jarg1, String jarg2);
   public final static native String getGlobalVariable(String jarg1);
   public final static native void consoleLog(String jarg1, String jarg2);
@@ -183,5 +183,5 @@ class freeswitchJNI {
   public final static native void JavaSession_check_hangup_hook(long jarg1, JavaSession jarg1_);
   public final static native long JavaSession_run_dtmf_callback(long jarg1, JavaSession jarg1_, long jarg2, long jarg3);
   public final static native int JavaSession_originate(long jarg1, JavaSession jarg1_, long jarg2, JavaSession jarg2_, String jarg3, int jarg4);
-  public final static native long SWIGJavaSessionUpcast(long jarg1);
+  public final static native long JavaSession_SWIGUpcast(long jarg1);
 }
index 7ee03cda5322f7ae0b3f3e5e5648e2ebaeb197cc..d38560d2f400c0403da436fda8c161437298a750 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -26,11 +26,13 @@ public class input_callback_state_t {
   }
 
   public synchronized void delete() {
-    if(swigCPtr != 0 && swigCMemOwn) {
-      swigCMemOwn = false;
-      freeswitchJNI.delete_input_callback_state_t(swigCPtr);
+    if (swigCPtr != 0) {
+      if (swigCMemOwn) {
+        swigCMemOwn = false;
+        freeswitchJNI.delete_input_callback_state_t(swigCPtr);
+      }
+      swigCPtr = 0;
     }
-    swigCPtr = 0;
   }
 
   public void setFunction(SWIGTYPE_p_void value) {
index d897a6f14569d53a0ef04303d1d11465d6a98247..836f523bebef2adf377231ed6e36b758f2a36742 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 2.0.12
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
index a24b28ceaae89b72b795a15d7cfaf04cae849f49..697e535ac63ff40106eef49f042dcae1016d4d1b 100644 (file)
@@ -1,27 +1,32 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- * 
- * This file is not intended to be easily readable and contains a number of 
+ * Version 2.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+#define SWIGJAVA
+
 
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -60,14 +65,20 @@ template <typename T> T SwigValueInit() {
 #ifndef SWIGUNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#     define SWIGUNUSED __attribute__ ((__unused__))
 #   else
 #     define SWIGUNUSED
 #   endif
 # elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
+#   define SWIGUNUSED __attribute__ ((__unused__))
 # else
-#   define SWIGUNUSED 
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 # endif
 #endif
 
@@ -75,7 +86,7 @@ template <typename T> T SwigValueInit() {
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 # else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
 # endif
 #endif
 
@@ -118,7 +129,7 @@ template <typename T> T SwigValueInit() {
 #   define SWIGSTDCALL __stdcall
 # else
 #   define SWIGSTDCALL
-# endif 
+# endif
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -134,7 +145,7 @@ template <typename T> T SwigValueInit() {
 
 
 /* Fix for jlong on some versions of gcc on Windows */
-#if defined(__GNUC__) && !defined(__INTELC__)
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
   typedef long long __int64;
 #endif
 
@@ -181,7 +192,8 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
     { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
     { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
     { SWIG_JavaUnknownError,  "java/lang/UnknownError" },
-    { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" } };
+    { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" }
+  };
   const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
 
   while (except_ptr->code != code && except_ptr->code)
@@ -243,7 +255,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_getGlobalVaria
     if (!arg1) return 0;
   }
   result = (char *)getGlobalVariable(arg1);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1);
   free(result);
   return jresult;
@@ -502,7 +514,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1IVRMenu(J
   (void)jcls;
   arg1 = *(IVRMenu **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -581,7 +592,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1API(JNIEn
   (void)jcls;
   arg1 = *(API **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -607,7 +617,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_API_1execute(J
     if (!arg3) return 0;
   }
   result = (char *)(arg1)->execute((char const *)arg2,(char const *)arg3);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
   return jresult;
@@ -630,7 +640,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_API_1executeSt
     if (!arg2) return 0;
   }
   result = (char *)(arg1)->executeString((char const *)arg2);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   return jresult;
 }
@@ -646,34 +656,33 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_API_1getTime(J
   (void)jarg1_;
   arg1 = *(API **)&jarg1; 
   result = (char *)(arg1)->getTime();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
 
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1function_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) {
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   arg2 = *(void **)&jarg2; 
   if (arg1) (arg1)->function = arg2;
-  
 }
 
 
 SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1function_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
   jlong jresult = 0 ;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   result = (void *) ((arg1)->function);
   *(void **)&jresult = result; 
   return jresult;
@@ -681,28 +690,27 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_
 
 
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1threadState_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) {
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   arg2 = *(void **)&jarg2; 
   if (arg1) (arg1)->threadState = arg2;
-  
 }
 
 
 SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1threadState_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
   jlong jresult = 0 ;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   result = (void *) ((arg1)->threadState);
   *(void **)&jresult = result; 
   return jresult;
@@ -710,28 +718,27 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_
 
 
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1extra_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) {
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   arg2 = *(void **)&jarg2; 
   if (arg1) (arg1)->extra = arg2;
-  
 }
 
 
 SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1extra_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
   jlong jresult = 0 ;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   result = (void *) ((arg1)->extra);
   *(void **)&jresult = result; 
   return jresult;
@@ -739,20 +746,20 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_
 
 
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1funcargs_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *arg2 = (char *) 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   arg2 = 0;
   if (jarg2) {
     arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
     if (!arg2) return ;
   }
   {
-    if (arg1->funcargs) delete [] arg1->funcargs;
+    delete [] arg1->funcargs;
     if (arg2) {
       arg1->funcargs = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->funcargs, (const char *)arg2);
@@ -766,39 +773,38 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1
 
 SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_input_1callback_1state_1t_1funcargs_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
   jstring jresult = 0 ;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *result = 0 ;
   
   (void)jenv;
   (void)jcls;
   (void)jarg1_;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   result = (char *) ((arg1)->funcargs);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
 
 SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1input_1callback_1state_1t(JNIEnv *jenv, jclass jcls) {
   jlong jresult = 0 ;
-  input_callback_state_t *result = 0 ;
+  input_callback_state *result = 0 ;
   
   (void)jenv;
   (void)jcls;
-  result = (input_callback_state_t *)new input_callback_state_t();
-  *(input_callback_state_t **)&jresult = result; 
+  result = (input_callback_state *)new input_callback_state();
+  *(input_callback_state **)&jresult = result; 
   return jresult;
 }
 
 
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1input_1callback_1state_1t(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   
   (void)jenv;
   (void)jcls;
-  arg1 = *(input_callback_state_t **)&jarg1; 
+  arg1 = *(input_callback_state **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -848,7 +854,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_DTMF_1digit_1set(
   arg1 = *(DTMF **)&jarg1; 
   arg2 = (char)jarg2; 
   if (arg1) (arg1)->digit = arg2;
-  
 }
 
 
@@ -883,7 +888,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_DTMF_1duration_1s
   }
   arg2 = *argp2; 
   if (arg1) (arg1)->duration = arg2;
-  
 }
 
 
@@ -897,7 +901,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_DTMF_1duration_1
   (void)jarg1_;
   arg1 = *(DTMF **)&jarg1; 
   result =  ((arg1)->duration);
-  *(uint32_t **)&jresult = new uint32_t((uint32_t &)result); 
+  *(uint32_t **)&jresult = new uint32_t((const uint32_t &)result); 
   return jresult;
 }
 
@@ -906,8 +910,8 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1DTMF(JNIEnv
   jlong jresult = 0 ;
   char arg1 ;
   uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
-  DTMF *result = 0 ;
   uint32_t *argp2 ;
+  DTMF *result = 0 ;
   
   (void)jenv;
   (void)jcls;
@@ -931,7 +935,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1DTMF(JNIE
   (void)jcls;
   arg1 = *(DTMF **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -968,7 +971,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Stream(JN
   (void)jcls;
   arg1 = *(Stream **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -984,7 +986,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(J
   arg1 = *(Stream **)&jarg1; 
   arg2 = *(int **)&jarg2; 
   result = (char *)(arg1)->read(arg2);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1037,7 +1039,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1get_1d
   (void)jarg1_;
   arg1 = *(Stream **)&jarg1; 
   result = (char *)(arg1)->get_data();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1052,7 +1054,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1event_1set
   arg1 = *(Event **)&jarg1; 
   arg2 = *(switch_event_t **)&jarg2; 
   if (arg1) (arg1)->event = arg2;
-  
 }
 
 
@@ -1085,7 +1086,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1serialized
     if (!arg2) return ;
   }
   {
-    if (arg1->serialized_string) delete [] arg1->serialized_string;
+    delete [] arg1->serialized_string;
     if (arg2) {
       arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->serialized_string, (const char *)arg2);
@@ -1107,7 +1108,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1seriali
   (void)jarg1_;
   arg1 = *(Event **)&jarg1; 
   result = (char *) ((arg1)->serialized_string);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1122,7 +1123,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1mine_1set(
   arg1 = *(Event **)&jarg1; 
   arg2 = (int)jarg2; 
   if (arg1) (arg1)->mine = arg2;
-  
 }
 
 
@@ -1190,7 +1190,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Event(JNI
   (void)jcls;
   arg1 = *(Event **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -1261,7 +1260,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1seriali
     if (!arg2) return 0;
   }
   result = (char *)(arg1)->serialize((char const *)arg2);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   return jresult;
 }
@@ -1271,8 +1270,8 @@ SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1setPri
   jboolean jresult = 0 ;
   Event *arg1 = (Event *) 0 ;
   switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ;
-  bool result;
   switch_priority_t *argp2 ;
+  bool result;
   
   (void)jenv;
   (void)jcls;
@@ -1306,7 +1305,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1getHead
     if (!arg2) return 0;
   }
   result = (char *)(arg1)->getHeader((char const *)arg2);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   return jresult;
 }
@@ -1322,7 +1321,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1getBody
   (void)jarg1_;
   arg1 = *(Event **)&jarg1; 
   result = (char *)(arg1)->getBody();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1337,7 +1336,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1getType
   (void)jarg1_;
   arg1 = *(Event **)&jarg1; 
   result = (char *)(arg1)->getType();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1440,7 +1439,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1ev
   arg1 = *(EventConsumer **)&jarg1; 
   arg2 = *(switch_queue_t **)&jarg2; 
   if (arg1) (arg1)->events = arg2;
-  
 }
 
 
@@ -1475,7 +1473,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1e_
   }
   arg2 = *argp2; 
   if (arg1) (arg1)->e_event_id = arg2;
-  
 }
 
 
@@ -1489,7 +1486,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1e
   (void)jarg1_;
   arg1 = *(EventConsumer **)&jarg1; 
   result =  ((arg1)->e_event_id);
-  *(switch_event_types_t **)&jresult = new switch_event_types_t((switch_event_types_t &)result); 
+  *(switch_event_types_t **)&jresult = new switch_event_types_t((const switch_event_types_t &)result); 
   return jresult;
 }
 
@@ -1508,7 +1505,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1e_
     if (!arg2) return ;
   }
   {
-    if (arg1->e_callback) delete [] arg1->e_callback;
+    delete [] arg1->e_callback;
     if (arg2) {
       arg1->e_callback = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_callback, (const char *)arg2);
@@ -1530,7 +1527,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_
   (void)jarg1_;
   arg1 = *(EventConsumer **)&jarg1; 
   result = (char *) ((arg1)->e_callback);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1549,7 +1546,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1e_
     if (!arg2) return ;
   }
   {
-    if (arg1->e_subclass_name) delete [] arg1->e_subclass_name;
+    delete [] arg1->e_subclass_name;
     if (arg2) {
       arg1->e_subclass_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_subclass_name, (const char *)arg2);
@@ -1571,7 +1568,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_
   (void)jarg1_;
   arg1 = *(EventConsumer **)&jarg1; 
   result = (char *) ((arg1)->e_subclass_name);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1590,7 +1587,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1e_
     if (!arg2) return ;
   }
   {
-    if (arg1->e_cb_arg) delete [] arg1->e_cb_arg;
+    delete [] arg1->e_cb_arg;
     if (arg2) {
       arg1->e_cb_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_cb_arg, (const char *)arg2);
@@ -1612,7 +1609,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_
   (void)jarg1_;
   arg1 = *(EventConsumer **)&jarg1; 
   result = (char *) ((arg1)->e_cb_arg);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -1666,7 +1663,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1no
   }
   arg2 = *argp2; 
   if (arg1) (arg1)->node_index = arg2;
-  
 }
 
 
@@ -1680,7 +1676,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_EventConsumer_1n
   (void)jarg1_;
   arg1 = *(EventConsumer **)&jarg1; 
   result =  ((arg1)->node_index);
-  *(uint32_t **)&jresult = new uint32_t((uint32_t &)result); 
+  *(uint32_t **)&jresult = new uint32_t((const uint32_t &)result); 
   return jresult;
 }
 
@@ -1720,7 +1716,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1EventCons
   (void)jcls;
   arg1 = *(EventConsumer **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -1790,7 +1785,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1CoreSessi
   (void)jcls;
   arg1 = *(CoreSession **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -1804,7 +1798,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sess
   arg1 = *(CoreSession **)&jarg1; 
   arg2 = *(switch_core_session_t **)&jarg2; 
   if (arg1) (arg1)->session = arg2;
-  
 }
 
 
@@ -1833,7 +1826,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1chan
   arg1 = *(CoreSession **)&jarg1; 
   arg2 = *(switch_channel_t **)&jarg2; 
   if (arg1) (arg1)->channel = arg2;
-  
 }
 
 
@@ -1862,7 +1854,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1flag
   arg1 = *(CoreSession **)&jarg1; 
   arg2 = (unsigned int)jarg2; 
   if (arg1) (arg1)->flags = arg2;
-  
 }
 
 
@@ -1891,7 +1882,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1allo
   arg1 = *(CoreSession **)&jarg1; 
   arg2 = (int)jarg2; 
   if (arg1) (arg1)->allocated = arg2;
-  
 }
 
 
@@ -1921,7 +1911,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1cb_1
   arg1 = *(CoreSession **)&jarg1; 
   arg2 = *(input_callback_state **)&jarg2; 
   if (arg1) (arg1)->cb_state = *arg2;
-  
 }
 
 
@@ -1956,7 +1945,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hook
   }
   arg2 = *argp2; 
   if (arg1) (arg1)->hook_state = arg2;
-  
 }
 
 
@@ -1970,7 +1958,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hoo
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result =  ((arg1)->hook_state);
-  *(switch_channel_state_t **)&jresult = new switch_channel_state_t((switch_channel_state_t &)result); 
+  *(switch_channel_state_t **)&jresult = new switch_channel_state_t((const switch_channel_state_t &)result); 
   return jresult;
 }
 
@@ -1991,7 +1979,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1caus
   }
   arg2 = *argp2; 
   if (arg1) (arg1)->cause = arg2;
-  
 }
 
 
@@ -2005,7 +1992,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1cau
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result =  ((arg1)->cause);
-  *(switch_call_cause_t **)&jresult = new switch_call_cause_t((switch_call_cause_t &)result); 
+  *(switch_call_cause_t **)&jresult = new switch_call_cause_t((const switch_call_cause_t &)result); 
   return jresult;
 }
 
@@ -2024,7 +2011,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1uuid
     if (!arg2) return ;
   }
   {
-    if (arg1->uuid) delete [] arg1->uuid;
+    delete [] arg1->uuid;
     if (arg2) {
       arg1->uuid = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->uuid, (const char *)arg2);
@@ -2046,7 +2033,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1u
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *) ((arg1)->uuid);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -2065,7 +2052,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1tts_
     if (!arg2) return ;
   }
   {
-    if (arg1->tts_name) delete [] arg1->tts_name;
+    delete [] arg1->tts_name;
     if (arg2) {
       arg1->tts_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->tts_name, (const char *)arg2);
@@ -2087,7 +2074,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1t
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *) ((arg1)->tts_name);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -2106,7 +2093,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1voic
     if (!arg2) return ;
   }
   {
-    if (arg1->voice_name) delete [] arg1->voice_name;
+    delete [] arg1->voice_name;
     if (arg2) {
       arg1->voice_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->voice_name, (const char *)arg2);
@@ -2128,7 +2115,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1v
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *) ((arg1)->voice_name);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -2306,7 +2293,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
     if (!arg2) return 0;
   }
   result = (char *)(arg1)->getVariable(arg2);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   return jresult;
 }
@@ -2328,7 +2315,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1pro
     if (!arg2) return 0;
   }
   result = (arg1)->process_callback_result(arg2);
-  *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); 
+  *(switch_status_t **)&jresult = new switch_status_t((const switch_status_t &)result); 
   if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
   return jresult;
 }
@@ -2422,7 +2409,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1h
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *)(arg1)->hangupCause();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -2437,7 +2424,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *)(arg1)->getState();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -2658,7 +2645,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
   }
   arg4 = (int)jarg4; 
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
   return jresult;
 }
@@ -2686,7 +2673,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
   arg4 = (int)jarg4; 
   arg5 = (int)jarg5; 
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
   return jresult;
 }
@@ -2758,7 +2745,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1r
   }
   arg7 = (int)jarg7; 
   result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
   if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6);
   return jresult;
@@ -2821,7 +2808,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1p
     if (!arg12) return 0;
   }
   result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11,(char const *)arg12);
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  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);
@@ -3072,7 +3059,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *)(arg1)->getXMLCDR();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -3117,7 +3104,7 @@ SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1g
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
   result = (char *)((CoreSession const *)arg1)->get_uuid();
-  if(result) jresult = jenv->NewStringUTF((const char *)result);
+  if (result) jresult = jenv->NewStringUTF((const char *)result);
   return jresult;
 }
 
@@ -3131,10 +3118,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1get
   (void)jcls;
   (void)jarg1_;
   arg1 = *(CoreSession **)&jarg1; 
-  {
-    switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
-    result = (switch_input_args_t *) &_result_ref;
-  }
+  result = (switch_input_args_t *) &((CoreSession const *)arg1)->get_cb_args();
   *(switch_input_args_t **)&jresult = result; 
   return jresult;
 }
@@ -3156,8 +3140,8 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1run
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
   (void)jenv;
   (void)jcls;
@@ -3171,7 +3155,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1run
   }
   arg3 = *argp3; 
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); 
+  *(switch_status_t **)&jresult = new switch_status_t((const switch_status_t &)result); 
   return jresult;
 }
 
@@ -3336,12 +3320,12 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_bridge(JNIEnv *je
   (void)jarg1_;
   (void)jarg2_;
   arg1 = *(CoreSession **)&jarg1;
-  if(!arg1) {
+  if (!arg1) {
     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "CoreSession & reference is null");
     return ;
   } 
   arg2 = *(CoreSession **)&jarg2;
-  if(!arg2) {
+  if (!arg2) {
     SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "CoreSession & reference is null");
     return ;
   } 
@@ -3358,7 +3342,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_hanguphook(JNIEn
   (void)jcls;
   arg1 = *(switch_core_session_t **)&jarg1; 
   result = hanguphook(arg1);
-  *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); 
+  *(switch_status_t **)&jresult = new switch_status_t((const switch_status_t &)result); 
   return jresult;
 }
 
@@ -3370,8 +3354,8 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_dtmf_1callback(J
   switch_input_type_t arg3 ;
   void *arg4 = (void *) 0 ;
   unsigned int arg5 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
   (void)jenv;
   (void)jcls;
@@ -3386,7 +3370,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_dtmf_1callback(J
   arg4 = *(void **)&jarg4; 
   arg5 = (unsigned int)jarg5; 
   result = dtmf_callback(arg1,arg2,arg3,arg4,arg5);
-  *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); 
+  *(switch_status_t **)&jresult = new switch_status_t((const switch_status_t &)result); 
   return jresult;
 }
 
@@ -3398,7 +3382,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_javaVM_1set(JNIEn
   (void)jcls;
   arg1 = *(JavaVM **)&jarg1; 
   javaVM = arg1;
-  
 }
 
 
@@ -3476,7 +3459,6 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1JavaSessi
   (void)jcls;
   arg1 = *(JavaSession **)&jarg1; 
   delete arg1;
-  
 }
 
 
@@ -3559,8 +3541,8 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1run
   JavaSession *arg1 = (JavaSession *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
   (void)jenv;
   (void)jcls;
@@ -3574,7 +3556,7 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1run
   }
   arg3 = *argp3; 
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  *(switch_status_t **)&jresult = new switch_status_t((switch_status_t &)result); 
+  *(switch_status_t **)&jresult = new switch_status_t((const switch_status_t &)result); 
   return jresult;
 }
 
@@ -3606,7 +3588,7 @@ SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1orig
 }
 
 
-SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_SWIGJavaSessionUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_JavaSession_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
     jlong baseptr = 0;
     (void)jenv;
     (void)jcls;
index 256f86b98b19a7947a58c1a1b14878162e5cc2c6..e376eec6c8a297190137577b10b7e236211c2152 100644 (file)
@@ -1,27 +1,34 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- * 
- * This file is not intended to be easily readable and contains a number of 
+ * Version 2.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+#define SWIGLUA
+#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
+#define SWIG_LUA_MODULE_GLOBAL
+
 
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -60,14 +67,20 @@ template <typename T> T SwigValueInit() {
 #ifndef SWIGUNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#     define SWIGUNUSED __attribute__ ((__unused__))
 #   else
 #     define SWIGUNUSED
 #   endif
 # elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
+#   define SWIGUNUSED __attribute__ ((__unused__))
 # else
-#   define SWIGUNUSED 
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 # endif
 #endif
 
@@ -75,7 +88,7 @@ template <typename T> T SwigValueInit() {
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 # else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
 # endif
 #endif
 
@@ -118,7 +131,7 @@ template <typename T> T SwigValueInit() {
 #   define SWIGSTDCALL __stdcall
 # else
 #   define SWIGSTDCALL
-# endif 
+# endif
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -135,7 +148,7 @@ template <typename T> T SwigValueInit() {
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -154,11 +167,11 @@ template <typename T> T SwigValueInit() {
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -182,17 +195,17 @@ template <typename T> T SwigValueInit() {
 #define SWIG_POINTER_OWN           0x1
 
 
-/* 
+/*
    Flags/methods for returning states.
-   
-   The swig conversion methods, as ConvertPtr, return and integer 
+
+   The SWIG conversion methods, as ConvertPtr, return an integer
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
-   
+
    Use the following macros/flags to set or process the returning
    states.
-   
-   In old swig versions, you usually write code as:
+
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -200,7 +213,7 @@ template <typename T> T SwigValueInit() {
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -209,7 +222,7 @@ template <typename T> T SwigValueInit() {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -224,28 +237,28 @@ template <typename T> T SwigValueInit() {
     } else {
       // fail code
     }
-    
+
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {         
-        if (<obj is ok>) {                            
-          if (<need new object>) {                    
-            *ptr = <ptr to new allocated object>; 
-            return SWIG_NEWOBJ;                       
-          } else {                                    
-            *ptr = <ptr to old object>;               
-            return SWIG_OLDOBJ;                       
-          }                                   
-        } else {                                      
-          return SWIG_BADOBJ;                 
-        }                                             
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {
+        if (<obj is ok>) {
+          if (<need new object>) {
+            *ptr = <ptr to new allocated object>;
+            return SWIG_NEWOBJ;
+          } else {
+            *ptr = <ptr to old object>;
+            return SWIG_OLDOBJ;
+          }
+        } else {
+          return SWIG_BADOBJ;
+        }
       }
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -254,18 +267,17 @@ template <typename T> T SwigValueInit() {
        int fooi(int);
 
    and you call
+
       food(1)   // cast rank '1'  (1 -> 1.0)
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
-#define SWIG_OK                    (0) 
+#define SWIG_OK                    (0)
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
 
 /* The CastRankLimit says how many bits are used for the cast rank */
 #define SWIG_CASTRANKLIMIT         (1 << 8)
@@ -286,7 +298,6 @@ template <typename T> T SwigValueInit() {
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -297,20 +308,18 @@ template <typename T> T SwigValueInit() {
 #  endif
 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 }
-SWIGINTERNINLINE int SWIG_CheckState(int r) { 
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
 }
 #else /* no cast-rank mode */
-#  define SWIG_AddCast
+#  define SWIG_AddCast(r) (r)
 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -350,7 +359,7 @@ typedef struct swig_module_info {
   void                    *clientdata;         /* Language specific module data */
 } swig_module_info;
 
-/* 
+/*
   Compare two type names skipping the space characters, therefore
   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
@@ -370,18 +379,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 */
 SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
+SWIG_TypeCmp(const char *nb, const char *tb) {
+  int equiv = 1;
   const char* te = tb + strlen(tb);
   const char* ne = nb;
-  while (!equiv && *ne) {
+  while (equiv != 0 && *ne) {
     for (nb = ne; *ne; ++ne) {
       if (*ne == '|') break;
     }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
     if (*ne) ++ne;
   }
   return equiv;
@@ -389,58 +398,65 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+  Return 0 if not equal, 1 if equal
 */
 SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
 }
 
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/*
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -451,7 +467,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
-/* 
+/*
    Dynamic pointer casting. Down an inheritance hierarchy
 */
 SWIGRUNTIME swig_type_info *
@@ -495,7 +511,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
     return type->name;
 }
 
-/* 
+/*
    Set the clientdata field for a type
 */
 SWIGRUNTIME void
@@ -503,14 +519,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
   swig_cast_info *cast = ti->cast;
   /* if (ti->clientdata == clientdata) return; */
   ti->clientdata = clientdata;
-  
+
   while (cast) {
     if (!cast->converter) {
       swig_type_info *tc = cast->type;
       if (!tc->clientdata) {
        SWIG_TypeClientData(tc, clientdata);
       }
-    }    
+    }
     cast = cast->next;
   }
 }
@@ -519,18 +535,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
   SWIG_TypeClientData(ti, clientdata);
   ti->owndata = 1;
 }
-  
+
 /*
   Search for a swig_type_info structure only by mangled name
   Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+                            swig_module_info *end,
                            const char *name) {
   swig_module_info *iter = start;
   do {
@@ -539,11 +555,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
       register size_t r = iter->size - 1;
       do {
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
-       register size_t i = (l + r) >> 1; 
+       register size_t i = (l + r) >> 1;
        const char *iname = iter->types[i]->name;
        if (iname) {
          register int compare = strcmp(name, iname);
-         if (compare == 0) {       
+         if (compare == 0) {
            return iter->types[i];
          } else if (compare < 0) {
            if (i) {
@@ -568,14 +584,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
   Search for a swig_type_info structure for either a mangled name or a human readable name.
   It first searches the mangled names of the types, which is a O(log #types)
   If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
+SWIG_TypeQueryModule(swig_module_info *start,
+                     swig_module_info *end,
                     const char *name) {
   /* STEP 1: Search the name field using binary search */
   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -594,12 +610,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
       iter = iter->next;
     } while (iter != end);
   }
-  
+
   /* neither found a match */
   return 0;
 }
 
-/* 
+/*
    Pack binary data into a string
 */
 SWIGRUNTIME char *
@@ -615,7 +631,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
   return c;
 }
 
-/* 
+/*
    Unpack binary data from a string
 */
 SWIGRUNTIME const char *
@@ -629,21 +645,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
       uu = ((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
       uu = ((d - ('a'-10)) << 4);
-    else 
+    else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu |= (d - '0');
     else if ((d >= 'a') && (d <= 'f'))
       uu |= (d - ('a'-10));
-    else 
+    else
       return (char *) 0;
     *u = uu;
   }
   return c;
 }
 
-/* 
+/*
    Pack 'void *' into a string buffer.
 */
 SWIGRUNTIME char *
@@ -703,9 +719,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 #endif
 
 /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
  * luarun.swg
  *
  * This file contains the runtime support for Lua modules
@@ -722,6 +735,92 @@ extern "C" {
 #include <stdlib.h>  /* for malloc */
 #include <assert.h>  /* for a few sanity tests */
 
+/* -----------------------------------------------------------------------------
+ * Lua flavors
+ * ----------------------------------------------------------------------------- */
+
+#define SWIG_LUA_FLAVOR_LUA 1
+#define SWIG_LUA_FLAVOR_ELUA 2
+#define SWIG_LUA_FLAVOR_ELUAC 3
+
+#if !defined(SWIG_LUA_TARGET)
+# error SWIG_LUA_TARGET not defined
+#endif
+
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
+#  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
+#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
+#  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
+#  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
+#else /* SWIG_LUA_FLAVOR_LUA */
+#  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
+#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
+#  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
+#  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
+#endif
+
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
+#  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
+#  define LSTRVAL LRO_STRVAL
+#endif
+
+/* -----------------------------------------------------------------------------
+ * compatibility defines
+ * ----------------------------------------------------------------------------- */
+
+/* History of Lua C API length functions:  In Lua 5.0 (and before?)
+   there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
+   but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
+   this function was again renamed, to "lua_rawlen" (to emphasize that
+   it doesn't call the "__len" metamethod), and the compatibility
+   define of lua_strlen was removed.  All SWIG uses have been updated
+   to "lua_rawlen", and we add our own defines of that here for older
+   versions of Lua.  */
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
+# define lua_rawlen lua_strlen
+#elif LUA_VERSION_NUM == 501
+# define lua_rawlen lua_objlen
+#endif
+
+
+/* lua_pushglobaltable is the recommended "future-proof" way to get
+   the global table for Lua 5.2 and later.  Here we define
+   lua_pushglobaltable ourselves for Lua versions before 5.2.  */
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
+#endif
+
+
+/* --------------------------------------------------------------------------
+ * Helper functions for error handling
+ * -------------------------------------------------------------------------- */
+
+/* Push the string STR on the Lua stack, like lua_pushstring, but
+   prefixed with the the location of the innermost Lua call-point
+   (as formated by luaL_where).  */
+SWIGRUNTIME void
+SWIG_Lua_pusherrstring (lua_State *L, const char *str)
+{
+  luaL_where (L, 1);
+  lua_pushstring (L, str);
+  lua_concat (L, 2);
+}
+
+/* Push a formatted string generated from FMT and following args on
+   the Lua stack, like lua_pushfstring, but prefixed with the the
+   location of the innermost Lua call-point (as formated by luaL_where).  */
+SWIGRUNTIME void
+SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
+{
+  va_list argp;
+  va_start(argp, fmt);
+  luaL_where(L, 1);
+  lua_pushvfstring(L, fmt, argp);
+  va_end(argp);
+  lua_concat(L, 2);
+}
+
+
 /* -----------------------------------------------------------------------------
  * global swig types
  * ----------------------------------------------------------------------------- */
@@ -761,6 +860,15 @@ typedef struct {
   lua_CFunction   setmethod;
 } swig_lua_attribute;
 
+// Can be used to create namespaces. Currently used to
+// wrap class static methods/variables/constants
+typedef struct {
+  const char            *name;
+  swig_lua_method       *ns_methods;
+  swig_lua_attribute    *ns_attributes;
+  swig_lua_const_info   *ns_constants;
+} swig_lua_namespace;
+
 typedef struct swig_lua_class {
   const char    *name;
   swig_type_info   **type;
@@ -768,11 +876,12 @@ typedef struct swig_lua_class {
   void    (*destructor)(void *);
   swig_lua_method   *methods;
   swig_lua_attribute     *attributes;
+  swig_lua_namespace    cls_static;
   struct swig_lua_class **bases;
   const char **base_names;
 } swig_lua_class;
 
-/* this is the struct for wrappering all pointers in SwigLua
+/* this is the struct for wrapping all pointers in SwigLua
 */
 typedef struct {
   swig_type_info   *type;
@@ -780,10 +889,10 @@ typedef struct {
   void        *ptr;
 } swig_lua_userdata;
 
-/* this is the struct for wrapping arbitary packed binary data
+/* this is the struct for wrapping arbitrary packed binary data
 (currently it is only used for member function pointers)
 the data ordering is similar to swig_lua_userdata, but it is currently not possible
-to tell the two structures apart within Swig, other than by looking at the type
+to tell the two structures apart within SWIG, other than by looking at the type
 */
 typedef struct {
   swig_type_info   *type;
@@ -806,19 +915,20 @@ typedef struct {
 
 /* Contract support */
 #define SWIG_contract_assert(expr, msg)  \
-  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
+  if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
+
 
 /* helper #defines */
 #define SWIG_fail {goto fail;}
 #define SWIG_fail_arg(func_name,argnum,type) \
-  {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
+  {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
   func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
   goto fail;}
 #define SWIG_fail_ptr(func_name,argnum,type) \
   SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
 #define SWIG_check_num_args(func_name,a,b) \
   if (lua_gettop(L)<a || lua_gettop(L)>b) \
-  {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
+  {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
   goto fail;}
 
 
@@ -864,15 +974,14 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  * ----------------------------------------------------------------------------- */
 
 /* this function is called when trying to set an immutable.
-default value is to print an error.
+default action is to print an error.
 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
 {
 /*  there should be 1 param passed in: the new value */
 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
   lua_pop(L,1);  /* remove it */
-  lua_pushstring(L,"This variable is immutable");
-  lua_error(L);
+  luaL_error(L,"This variable is immutable");
 #endif
     return 0;   /* should not return anything */
 }
@@ -888,12 +997,24 @@ SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
    lua_tostring(L,2));
 */
   /* get the metatable */
-  assert(lua_istable(L,1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,1)); /* just in case */
+#else
+  assert(lua_istable(L,1)); /* default Lua action */
+#endif
   lua_getmetatable(L,1);  /* get the metatable */
-  assert(lua_istable(L,-1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,-1));  /* just in case */
+#else
+  assert(lua_istable(L,-1));
+#endif
   SWIG_Lua_get_table(L,".get");  /* get the .get table */
   lua_remove(L,3);  /* remove metatable */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  if (lua_isrotable(L,-1))
+#else
   if (lua_istable(L,-1))
+#endif
   {
     /* look for the key in the .get table */
     lua_pushvalue(L,2);  /* key */
@@ -908,7 +1029,7 @@ SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
   }
   lua_pop(L,1);  /* remove the .get */
   lua_pushnil(L);  /* return a nil */
-    return 1;
+  return 1;
 }
 
 /* the module.set method used for setting linked data */
@@ -920,12 +1041,24 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
   (3) any for the new value
 */
   /* get the metatable */
-  assert(lua_istable(L,1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,1));  /* just in case */
+#else
+  assert(lua_istable(L,1)); /* default Lua action */
+#endif
   lua_getmetatable(L,1);  /* get the metatable */
-  assert(lua_istable(L,-1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,-1));  /* just in case */
+#else
+  assert(lua_istable(L,-1));
+#endif
   SWIG_Lua_get_table(L,".set");  /* get the .set table */
   lua_remove(L,4);  /* remove metatable */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  if (lua_isrotable(L,-1))
+#else
   if (lua_istable(L,-1))
+#endif
   {
     /* look for the key in the .set table */
     lua_pushvalue(L,2);  /* key */
@@ -937,6 +1070,11 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
       lua_call(L,1,0);
       return 0;
     }
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) 
+    else {
+      return 0; // Exits stoically if an invalid key is initialized.
+    }
+#endif
   }
   lua_settop(L,3);  /* reset back to start */
   /* we now have the table, key & new value, so just set directly */
@@ -944,7 +1082,8 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
   return 0;
 }
 
-/* registering a module in lua */
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
+/* registering a module in lua. Pushes the module table on the stack. */
 SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
 {
   assert(lua_istable(L,-1));  /* just in case */
@@ -961,8 +1100,16 @@ SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
   lua_newtable(L);    /* the .set table */
   lua_rawset(L,-3);  /* add .set into metatable */
   lua_setmetatable(L,-2);  /* sets meta table in module */
+#ifdef SWIG_LUA_MODULE_GLOBAL
+  /* If requested, install the module directly into the global namespace. */
   lua_rawset(L,-3);        /* add module into parent */
   SWIG_Lua_get_table(L,name);   /* get the table back out */
+#else
+  /* Do not install the module table as global name. The stack top has
+     the module table with the name below. We pop the top and replace
+     the name with it. */
+  lua_replace(L,-2);
+#endif
 }
 
 /* ending the register */
@@ -990,6 +1137,7 @@ SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_C
   }
   lua_pop(L,1);       /* tidy stack (remove meta) */
 }
+#endif
 
 /* adding a function module */
 SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
@@ -997,6 +1145,138 @@ SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_
   SWIG_Lua_add_function(L,name,fn);
 }
 
+/* -----------------------------------------------------------------------------
+ * global variable support code: namespaces
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L)
+{
+/*  there should be 2 params passed in
+  (1) table (not the meta table)
+  (2) string name of the attribute
+*/
+  assert(lua_istable(L,-2));  /* just in case */
+  lua_getmetatable(L,-2);
+  assert(lua_istable(L,-1));
+  SWIG_Lua_get_table(L,".get"); /* find the .get table */
+  assert(lua_istable(L,-1));
+  /* look for the key in the .get table */
+  lua_pushvalue(L,2);  /* key */
+  lua_rawget(L,-2);
+  lua_remove(L,-2); /* stack tidy, remove .get table */
+  if (lua_iscfunction(L,-1))
+  {  /* found it so call the fn & return its value */
+    lua_call(L,0,1);  /* 1 value in (userdata),1 out (result) */
+    lua_remove(L,-2); /* stack tidy, remove metatable */
+    return 1;
+  }
+  lua_pop(L,1);  /* remove whatever was there */
+  /* ok, so try the .fn table */
+  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
+  assert(lua_istable(L,-1));  /* just in case */
+  lua_pushvalue(L,2);  /* key */
+  lua_rawget(L,-2);  /* look for the fn */
+  lua_remove(L,-2); /* stack tidy, remove .fn table */
+  if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
+  {  /* found it so return the fn & let lua call it */
+    lua_remove(L,-2); /* stack tidy, remove metatable */
+    return 1;
+  }
+  lua_pop(L,1);  /* remove whatever was there */
+  return 0;
+}
+
+SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L)
+{
+/*  there should be 3 params passed in
+  (1) table (not the meta table)
+  (2) string name of the attribute
+  (3) any for the new value
+*/
+
+  assert(lua_istable(L,1));
+  lua_getmetatable(L,1);    /* get the meta table */
+  assert(lua_istable(L,-1));
+
+  SWIG_Lua_get_table(L,".set"); /* find the .set table */
+  if (lua_istable(L,-1))
+  {
+    /* look for the key in the .set table */
+    lua_pushvalue(L,2);  /* key */
+    lua_rawget(L,-2);
+    if (lua_iscfunction(L,-1))
+    {  /* found it so call the fn & return its value */
+      lua_pushvalue(L,3);  /* value */
+      lua_call(L,1,0);
+      return 0;
+    }
+    lua_pop(L,1);  /* remove the value */
+  }
+  lua_pop(L,1);  /* remove the value .set table */
+  return 0;
+}
+
+SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration
+SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration
+
+/* helper function - register namespace methods and attributes into namespace */
+SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns)
+{
+  int i = 0;
+  assert(lua_istable(L,-1));
+  /* There must be table at the top of the stack */
+  SWIG_Lua_InstallConstants(L, ns->ns_constants);
+
+  lua_getmetatable(L,-1);
+
+  /* add fns */
+  for(i=0;ns->ns_attributes[i].name;i++){
+    SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
+  }
+
+  /* add methods to the metatable */
+  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
+  assert(lua_istable(L,-1));  /* just in case */
+  for(i=0;ns->ns_methods[i].name;i++){
+    SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method);
+  }
+  lua_pop(L,1);
+
+  /* clear stack - remove metatble */
+  lua_pop(L,1);
+  return 0;
+}
+
+/* helper function. creates namespace table and add it to module table */
+SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
+{
+  assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */
+  lua_checkstack(L,5);
+  lua_pushstring(L, ns->name);
+  lua_newtable(L); /* namespace itself */
+  lua_newtable(L); /* metatable for namespace */
+
+  /* add a table called ".get" */
+  lua_pushstring(L,".get");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+  /* add a table called ".set" */
+  lua_pushstring(L,".set");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+  /* add a table called ".fn" */
+  lua_pushstring(L,".fn");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+
+  /* add accessor fns for using the .get,.set&.fn */
+  SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
+  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
+
+  lua_setmetatable(L,-2); /* set metatable */
+  lua_rawset(L,-3); /* add namespace to module table */
+  return 0;
+}
 /* -----------------------------------------------------------------------------
  * global variable support code: classes
  * ----------------------------------------------------------------------------- */
@@ -1119,6 +1399,56 @@ SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
   return 0;
 }
 
+/* the class.__tostring method called by the interpreter and print */
+SWIGINTERN int  SWIG_Lua_class_tostring(lua_State* L)
+{
+/*  there should be 1 param passed in
+  (1) userdata (not the metatable) */
+  assert(lua_isuserdata(L,1));  /* just in case */
+  unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
+  lua_getmetatable(L,1);    /* get the meta table */
+  assert(lua_istable(L,-1));  /* just in case */
+  
+  lua_getfield(L, -1, ".type");
+  const char* className = lua_tostring(L, -1);
+  
+  char output[256];
+  sprintf(output, "<%s userdata: %lX>", className, userData);
+  
+  lua_pushstring(L, (const char*)output);
+  return 1;
+}
+
+/* to manually disown some userdata */
+SWIGINTERN int  SWIG_Lua_class_disown(lua_State* L)
+{
+/*  there should be 1 params passed in
+  (1) userdata (not the meta table) */
+  swig_lua_userdata* usr;
+  assert(lua_isuserdata(L,-1));  /* just in case */
+  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
+  
+  usr->own = 0; /* clear our ownership */
+  return 0;
+}
+
+/* Constructor proxy. Used when class name entry in module is not class constructor,
+but special table instead. */
+SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L)
+{
+  /* unlimited number of parameters
+     First one is our proxy table and we should remove it
+     Other we should pass to real constructor
+   */
+   assert(lua_istable(L,1));
+   lua_pushstring(L,".constructor");
+   lua_rawget(L,1);
+   assert(!lua_isnil(L,-1));
+   lua_replace(L,1); /* replace our table with real constructor */
+   lua_call(L,lua_gettop(L)-1,1);
+   return 1;
+}
+
 /* gets the swig class registry (or creates it) */
 SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
 {
@@ -1163,6 +1493,21 @@ SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_C
   }
 }
 
+/* helper to recursively add class static details (static attributes, operations and constants) */
+SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss)
+{
+  int i = 0;
+  /* The class namespace table must be on the top of the stack */
+  assert(lua_istable(L,-1));
+  /* call all the base classes first: we can then override these later: */
+  for(i=0;clss->bases[i];i++)
+  {
+    SWIG_Lua_add_class_static_details(L,clss->bases[i]);
+  }
+
+  SWIG_Lua_add_namespace_details(L, &clss->cls_static);
+}
+
 /* helper to recursively add class details (attributes & operations) */
 SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
 {
@@ -1213,18 +1558,45 @@ SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
       swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
       if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
     }
-  }    
+  }
 }
 
-/* performs the entire class registration process */
-SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+/* Register class static methods,attributes etc as well as constructor proxy */
+SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss)
 {
+  lua_checkstack(L,5); /* just in case */
+  assert(lua_istable(L,-1));  /* just in case */
+  assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */
+
+  SWIG_Lua_namespace_register(L,&clss->cls_static);
+
+  SWIG_Lua_get_table(L,clss->name); // Get namespace table back
+  assert(lua_istable(L,-1)); /* just in case */
+
   /*  add its constructor to module with the name of the class
   so you can do MyClass(...) as well as new_MyClass(...)
   BUT only if a constructor is defined
   (this overcomes the problem of pure virtual classes without constructors)*/
   if (clss->constructor)
-    SWIG_Lua_add_function(L,clss->name,clss->constructor);
+  {
+    SWIG_Lua_add_function(L,".constructor", clss->constructor);
+    lua_getmetatable(L,-1);
+    assert(lua_istable(L,-1)); /* just in case */
+    SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy);
+    lua_pop(L,1);
+  }
+
+  assert(lua_istable(L,-1)); /* just in case */
+  SWIG_Lua_add_class_static_details(L, clss);
+
+  /* clear stack */
+  lua_pop(L,1);
+}
+
+/* performs the entire class registration process */
+SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+{
+  SWIG_Lua_class_register_static(L,clss);
 
   SWIG_Lua_get_class_registry(L);  /* get the registry */
   lua_pushstring(L,clss->name);  /* get the name */
@@ -1244,11 +1616,15 @@ SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
   /* add a table called ".fn" */
   lua_pushstring(L,".fn");
   lua_newtable(L);
+  /* add manual disown method */
+  SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
   lua_rawset(L,-3);
   /* add accessor fns for using the .get,.set&.fn */
   SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
   SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
+  /* add tostring method for better output */
+  SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
   /* add it */
   lua_rawset(L,-3);  /* metatable into registry */
   lua_pop(L,1);      /* tidy stack (remove registry) */
@@ -1291,7 +1667,9 @@ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *t
   usr->ptr=ptr;  /* set the ptr */
   usr->type=type;
   usr->own=own;
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
   _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+#endif
 }
 
 /* takes a object from the lua stack & converts it into an object of the correct type
@@ -1329,9 +1707,8 @@ SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *typ
        int argnum,const char* func_name){
   void* result;
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
-    lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
-      func_name,(type && type->str)?type->str:"void*",argnum);
-    lua_error(L);
+    luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
+               func_name,(type && type->str)?type->str:"void*",argnum);
   }
   return result;
 }
@@ -1368,7 +1745,7 @@ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
   swig_lua_userdata* usr;
   if (lua_isuserdata(L,tp))
   {
-    usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
+    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
     if (usr && usr->type && usr->type->str)
       return usr->type->str;
     return "userdata (unknown type)";
@@ -1404,6 +1781,7 @@ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
  * global variable support code: class/struct typemap functions
  * ----------------------------------------------------------------------------- */
 
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
 /* Install Constants */
 SWIGINTERN void
 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
@@ -1445,6 +1823,7 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
     }
   }
 }
+#endif
 
 /* -----------------------------------------------------------------------------
  * executing lua code from within the wrapper
@@ -1453,8 +1832,8 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
 #endif
-/* Executes a C string in Lua a really simple way of calling lua from C
-Unfortunately lua keeps changing its API's, so we need a conditional compile
+/* Executes a C string in Lua which is a really simple way of calling lua from C
+Unfortunately lua keeps changing its APIs, so we need a conditional compile
 In lua 5.0.X its lua_dostring()
 In lua 5.1.X its luaL_dostring()
 */
@@ -1527,7 +1906,6 @@ static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0};
 
 #define SWIG_LUACODE   luaopen_freeswitch_luacode
 
-
 namespace swig {
 typedef struct{} LANGUAGE_OBJ;
 }
@@ -1540,13 +1918,13 @@ typedef struct{} LANGUAGE_OBJ;
 
 #ifdef __cplusplus     /* generic alloc/dealloc fns*/
 #define SWIG_ALLOC_ARRAY(TYPE,LEN)     new TYPE[LEN]
-#define SWIG_FREE_ARRAY(PTR)           delete[] PTR;
+#define SWIG_FREE_ARRAY(PTR)           delete[] PTR
 #else
 #define SWIG_ALLOC_ARRAY(TYPE,LEN)     (TYPE *)malloc(LEN*sizeof(TYPE))
-#define SWIG_FREE_ARRAY(PTR)           free(PTR);
+#define SWIG_FREE_ARRAY(PTR)           free(PTR)
 #endif
 /* counting the size of arrays:*/
-int SWIG_itable_size(lua_State* L, int index)
+SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
 {
        int n=0;
        while(1){
@@ -1559,7 +1937,7 @@ int SWIG_itable_size(lua_State* L, int index)
        return n;
 }
 
-int SWIG_table_size(lua_State* L, int index)
+SWIGINTERN int SWIG_table_size(lua_State* L, int index)
 {
        int n=0;
        lua_pushnil(L);  /* first key*/
@@ -1572,7 +1950,7 @@ int SWIG_table_size(lua_State* L, int index)
 
 /* super macro to declare array typemap helper fns */
 #define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
-       int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
+       SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
                int i;\
                for (i = 0; i < size; i++) {\
                        lua_rawgeti(L,index,i+1);\
@@ -1586,41 +1964,41 @@ int SWIG_table_size(lua_State* L, int index)
                }\
                return 1;\
        }\
-       static TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
+       SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
                TYPE *array;\
                if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
-                       lua_pushfstring(L,"expected a table of size %d",size);\
+                       SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\
                        return 0;\
                }\
                array=SWIG_ALLOC_ARRAY(TYPE,size);\
                if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
-                       lua_pushstring(L,"table must contain numbers");\
+                       SWIG_Lua_pusherrstring(L,"table must contain numbers");\
                        SWIG_FREE_ARRAY(array);\
                        return 0;\
                }\
                return array;\
        }\
-       static TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
+       SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
        {\
                TYPE *array;\
                if (!lua_istable(L,index)) {\
-                       lua_pushstring(L,"expected a table");\
+                       SWIG_Lua_pusherrstring(L,"expected a table");\
                        return 0;\
                }\
                *size=SWIG_itable_size(L,index);\
                if (*size<1){\
-                       lua_pushstring(L,"table appears to be empty");\
+                       SWIG_Lua_pusherrstring(L,"table appears to be empty");\
                        return 0;\
                }\
                array=SWIG_ALLOC_ARRAY(TYPE,*size);\
                if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
-                       lua_pushstring(L,"table must contain numbers");\
+                       SWIG_Lua_pusherrstring(L,"table must contain numbers");\
                        SWIG_FREE_ARRAY(array);\
                        return 0;\
                }\
                return array;\
        }\
-       void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
+       SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
                int i;\
                lua_newtable(L);\
                for (i = 0; i < size; i++){\
@@ -1629,6 +2007,8 @@ int SWIG_table_size(lua_State* L, int index)
                }\
        }
 
+SWIG_DECLARE_TYPEMAP_ARR_FN(schar,signed char);
+SWIG_DECLARE_TYPEMAP_ARR_FN(uchar,unsigned char);
 SWIG_DECLARE_TYPEMAP_ARR_FN(int,int);
 SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int);
 SWIG_DECLARE_TYPEMAP_ARR_FN(short,short);
@@ -1638,7 +2018,7 @@ SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long);
 SWIG_DECLARE_TYPEMAP_ARR_FN(float,float);
 SWIG_DECLARE_TYPEMAP_ARR_FN(double,double);
 
-int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
+SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
        int i;
        for (i = 0; i < size; i++) {
                lua_rawgeti(L,index,i+1);
@@ -1650,40 +2030,40 @@ int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_i
        }
        return 1;
 }
-static void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
+SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
        void **array;
        if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
-               lua_pushfstring(L,"expected a table of size %d",size);
+               SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);
                return 0;
        }
        array=SWIG_ALLOC_ARRAY(void*,size);
        if (!SWIG_read_ptr_array(L,index,array,size,type)){
-               lua_pushfstring(L,"table must contain pointers of type %s",type->name);
+               SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
                SWIG_FREE_ARRAY(array);
                return 0;
        }
        return array;
 }
-static void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
+SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
        void **array;
        if (!lua_istable(L,index)) {
-               lua_pushstring(L,"expected a table");
+               SWIG_Lua_pusherrstring(L,"expected a table");
                return 0;
        }
        *size=SWIG_itable_size(L,index);
        if (*size<1){
-               lua_pushstring(L,"table appears to be empty");
+               SWIG_Lua_pusherrstring(L,"table appears to be empty");
                return 0;
        }
        array=SWIG_ALLOC_ARRAY(void*,*size);
        if (!SWIG_read_ptr_array(L,index,array,*size,type)){
-               lua_pushfstring(L,"table must contain pointers of type %s",type->name);
+               SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
                SWIG_FREE_ARRAY(array);
                return 0;
        }
        return array;
 }
-void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
+SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
        int i;
        lua_newtable(L);
        for (i = 0; i < size; i++){
@@ -1692,21 +2072,28 @@ void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *typ
        }
 }
 
+
+SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
+  int ret = lua_isstring(L, idx);
+  if (!ret)
+   ret = lua_isnil(L, idx);
+  return ret;
+}
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 static int _wrap_setGlobalVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("setGlobalVariable",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("setGlobalVariable",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setGlobalVariable",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("setGlobalVariable",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("setGlobalVariable",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   setGlobalVariable(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1719,16 +2106,15 @@ fail:
 
 
 static int _wrap_getGlobalVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *result = 0 ;
   
   SWIG_check_num_args("getGlobalVariable",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("getGlobalVariable",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("getGlobalVariable",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (char *)getGlobalVariable(arg1);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -1741,17 +2127,16 @@ fail:
 
 
 static int _wrap_consoleLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("consoleLog",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   consoleLog(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1764,7 +2149,7 @@ fail:
 
 
 static int _wrap_consoleLog2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -1772,18 +2157,17 @@ static int _wrap_consoleLog2(lua_State* L) {
   char *arg5 = (char *) 0 ;
   
   SWIG_check_num_args("consoleLog2",5,5)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog2",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleLog2",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
   if(!lua_isnumber(L,4)) SWIG_fail_arg("consoleLog2",4,"int");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("consoleLog2",5,"char *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("consoleLog2",5,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (char *)lua_tostring(L, 5);
   consoleLog2(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1796,14 +2180,13 @@ fail:
 
 
 static int _wrap_consoleCleanLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   
   SWIG_check_num_args("consoleCleanLog",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   consoleCleanLog(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1816,13 +2199,12 @@ fail:
 
 
 static int _wrap_running(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   bool result;
   
   SWIG_check_num_args("running",0,0)
   result = (bool)running();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -1834,7 +2216,7 @@ fail:
 
 
 static int _wrap_email(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
@@ -1845,13 +2227,13 @@ static int _wrap_email(lua_State* L) {
   bool result;
   
   SWIG_check_num_args("email",2,7)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("email",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("email",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("email",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("email",4,"char *");
-  if(lua_gettop(L)>=5 && !lua_isstring(L,5)) SWIG_fail_arg("email",5,"char *");
-  if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("email",6,"char *");
-  if(lua_gettop(L)>=7 && !lua_isstring(L,7)) SWIG_fail_arg("email",7,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("email",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("email",2,"char *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("email",3,"char *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("email",4,"char *");
+  if(lua_gettop(L)>=5 && !SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("email",5,"char *");
+  if(lua_gettop(L)>=6 && !SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("email",6,"char *");
+  if(lua_gettop(L)>=7 && !SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("email",7,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   if(lua_gettop(L)>=3){
@@ -1870,8 +2252,7 @@ static int _wrap_email(lua_State* L) {
     arg7 = (char *)lua_tostring(L, 7);
   }
   result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -1883,7 +2264,7 @@ fail:
 
 
 static int _wrap_new_IVRMenu(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -1903,24 +2284,24 @@ static int _wrap_new_IVRMenu(lua_State* L) {
   int arg17 ;
   IVRMenu *result = 0 ;
   
-  SWIG_check_num_args("IVRMenu",17,17)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("IVRMenu",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("IVRMenu",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("IVRMenu",4,"char const *");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("IVRMenu",5,"char const *");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("IVRMenu",6,"char const *");
-  if(!lua_isstring(L,7)) SWIG_fail_arg("IVRMenu",7,"char const *");
-  if(!lua_isstring(L,8)) SWIG_fail_arg("IVRMenu",8,"char const *");
-  if(!lua_isstring(L,9)) SWIG_fail_arg("IVRMenu",9,"char const *");
-  if(!lua_isstring(L,10)) SWIG_fail_arg("IVRMenu",10,"char const *");
-  if(!lua_isstring(L,11)) SWIG_fail_arg("IVRMenu",11,"char const *");
-  if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu",12,"int");
-  if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu",13,"int");
-  if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu",14,"int");
-  if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu",15,"int");
-  if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu",16,"int");
-  if(!lua_isnumber(L,17)) SWIG_fail_arg("IVRMenu",17,"int");
+  SWIG_check_num_args("IVRMenu::IVRMenu",17,17)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::IVRMenu",1,"IVRMenu *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IVRMenu::IVRMenu",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::IVRMenu",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("IVRMenu::IVRMenu",4,"char const *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("IVRMenu::IVRMenu",5,"char const *");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("IVRMenu::IVRMenu",6,"char const *");
+  if(!SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("IVRMenu::IVRMenu",7,"char const *");
+  if(!SWIG_lua_isnilstring(L,8)) SWIG_fail_arg("IVRMenu::IVRMenu",8,"char const *");
+  if(!SWIG_lua_isnilstring(L,9)) SWIG_fail_arg("IVRMenu::IVRMenu",9,"char const *");
+  if(!SWIG_lua_isnilstring(L,10)) SWIG_fail_arg("IVRMenu::IVRMenu",10,"char const *");
+  if(!SWIG_lua_isnilstring(L,11)) SWIG_fail_arg("IVRMenu::IVRMenu",11,"char const *");
+  if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu::IVRMenu",12,"int");
+  if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu::IVRMenu",13,"int");
+  if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu::IVRMenu",14,"int");
+  if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu::IVRMenu",15,"int");
+  if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu::IVRMenu",16,"int");
+  if(!lua_isnumber(L,17)) SWIG_fail_arg("IVRMenu::IVRMenu",17,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("new_IVRMenu",1,SWIGTYPE_p_IVRMenu);
@@ -1943,7 +2324,6 @@ static int _wrap_new_IVRMenu(lua_State* L) {
   arg16 = (int)lua_tonumber(L, 16);
   arg17 = (int)lua_tonumber(L, 17);
   result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,(char const *)arg10,(char const *)arg11,arg12,arg13,arg14,arg15,arg16,arg17);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_IVRMenu,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -1955,43 +2335,18 @@ fail:
 }
 
 
-static int _wrap_delete_IVRMenu(lua_State* L) {
-  int SWIG_arg = -1;
-  IVRMenu *arg1 = (IVRMenu *) 0 ;
-  
-  SWIG_check_num_args("IVRMenu",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_IVRMenu",1,SWIGTYPE_p_IVRMenu);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_IVRMenu_bindAction(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   char *arg4 = (char *) 0 ;
   
-  SWIG_check_num_args("bindAction",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bindAction",1,"IVRMenu *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("bindAction",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("bindAction",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("bindAction",4,"char const *");
+  SWIG_check_num_args("IVRMenu::bindAction",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::bindAction",1,"IVRMenu *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IVRMenu::bindAction",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::bindAction",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("IVRMenu::bindAction",4,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("IVRMenu_bindAction",1,SWIGTYPE_p_IVRMenu);
@@ -2001,7 +2356,6 @@ static int _wrap_IVRMenu_bindAction(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (char *)lua_tostring(L, 4);
   (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2014,15 +2368,15 @@ fail:
 
 
 static int _wrap_IVRMenu_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("execute",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"IVRMenu *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("execute",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("IVRMenu::execute",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::execute",1,"IVRMenu *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("IVRMenu::execute",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("IVRMenu_execute",1,SWIGTYPE_p_IVRMenu);
@@ -2035,7 +2389,6 @@ static int _wrap_IVRMenu_execute(lua_State* L) {
   
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->execute(arg2,(char const *)arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2059,24 +2412,32 @@ static swig_lua_method swig_IVRMenu_methods[] = {
 static swig_lua_attribute swig_IVRMenu_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_IVRMenu_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_IVRMenu_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_IVRMenu_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_IVRMenu_bases[] = {0};
 static const char *swig_IVRMenu_base_names[] = {0};
-static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases, swig_IVRMenu_base_names };
+static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, { "IVRMenu", swig_IVRMenu_cls_methods, swig_IVRMenu_cls_attributes, swig_IVRMenu_cls_constants }, swig_IVRMenu_bases, swig_IVRMenu_base_names };
 
 static int _wrap_new_API(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) NULL ;
   API *result = 0 ;
   
-  SWIG_check_num_args("API",0,1)
-  if(lua_gettop(L)>=1 && !SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"CoreSession *");
+  SWIG_check_num_args("API::API",0,1)
+  if(lua_gettop(L)>=1 && !SWIG_isptrtype(L,1)) SWIG_fail_arg("API::API",1,"CoreSession *");
   if(lua_gettop(L)>=1){
     if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
       SWIG_fail_ptr("new_API",1,SWIGTYPE_p_CoreSession);
     }
   }
   result = (API *)new API(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_API,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2088,42 +2449,17 @@ fail:
 }
 
 
-static int _wrap_delete_API(lua_State* L) {
-  int SWIG_arg = -1;
-  API *arg1 = (API *) 0 ;
-  
-  SWIG_check_num_args("API",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"API *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_API",1,SWIGTYPE_p_API);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_API_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"API *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("API::execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::execute",1,"API *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("API::execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("API::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_execute",1,SWIGTYPE_p_API);
@@ -2134,8 +2470,7 @@ static int _wrap_API_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (char *)(arg1)->execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -2148,14 +2483,14 @@ fail:
 
 
 static int _wrap_API_executeString(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("executeString",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("executeString",1,"API *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("executeString",2,"char const *");
+  SWIG_check_num_args("API::executeString",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::executeString",1,"API *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("API::executeString",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_executeString",1,SWIGTYPE_p_API);
@@ -2163,8 +2498,7 @@ static int _wrap_API_executeString(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->executeString((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -2177,20 +2511,19 @@ fail:
 
 
 static int _wrap_API_getTime(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getTime",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getTime",1,"API *");
+  SWIG_check_num_args("API::getTime",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::getTime",1,"API *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_getTime",1,SWIGTYPE_p_API);
   }
   
   result = (char *)(arg1)->getTime();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2214,18 +2547,27 @@ static swig_lua_method swig_API_methods[] = {
 static swig_lua_attribute swig_API_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_API_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_API_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_API_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_API_bases[] = {0};
 static const char *swig_API_base_names[] = {0};
-static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases, swig_API_base_names };
+static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, { "API", swig_API_cls_methods, swig_API_cls_attributes, swig_API_cls_constants }, swig_API_bases, swig_API_base_names };
 
 static int _wrap_input_callback_state_t_function_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("function",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("function",2,"void *");
+  SWIG_check_num_args("input_callback_state::function",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::function",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::function",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_function_set",1,SWIGTYPE_p_input_callback_state);
@@ -2234,8 +2576,6 @@ static int _wrap_input_callback_state_t_function_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_function_set");
   if (arg1) (arg1)->function = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2247,19 +2587,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_function_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("function",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::function",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::function",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_function_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->function);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2272,13 +2611,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_threadState_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("threadState",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("threadState",2,"void *");
+  SWIG_check_num_args("input_callback_state::threadState",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::threadState",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::threadState",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_threadState_set",1,SWIGTYPE_p_input_callback_state);
@@ -2287,8 +2626,6 @@ static int _wrap_input_callback_state_t_threadState_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_threadState_set");
   if (arg1) (arg1)->threadState = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2300,19 +2637,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_threadState_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("threadState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::threadState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::threadState",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_threadState_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->threadState);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2325,13 +2661,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_extra_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("extra",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("extra",2,"void *");
+  SWIG_check_num_args("input_callback_state::extra",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::extra",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::extra",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_extra_set",1,SWIGTYPE_p_input_callback_state);
@@ -2340,8 +2676,6 @@ static int _wrap_input_callback_state_t_extra_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_extra_set");
   if (arg1) (arg1)->extra = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2353,19 +2687,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_extra_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("extra",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::extra",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::extra",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_extra_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->extra);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2378,13 +2711,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("funcargs",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("funcargs",2,"char *");
+  SWIG_check_num_args("input_callback_state::funcargs",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::funcargs",1,"input_callback_state *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("input_callback_state::funcargs",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_funcargs_set",1,SWIGTYPE_p_input_callback_state);
@@ -2392,7 +2725,7 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->funcargs) delete [] arg1->funcargs;
+    delete [] arg1->funcargs;
     if (arg2) {
       arg1->funcargs = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->funcargs, (const char *)arg2);
@@ -2400,7 +2733,6 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
       arg1->funcargs = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2413,20 +2745,19 @@ fail:
 
 
 static int _wrap_input_callback_state_t_funcargs_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("funcargs",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::funcargs",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::funcargs",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_funcargs_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (char *) ((arg1)->funcargs);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2438,12 +2769,11 @@ fail:
 
 
 static int _wrap_new_input_callback_state_t(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *result = 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *result = 0 ;
   
-  SWIG_check_num_args("input_callback_state_t::input_callback_state_t",0,0)
-  result = (input_callback_state_t *)new input_callback_state_t();
-  SWIG_arg=0;
+  SWIG_check_num_args("input_callback_state::input_callback_state",0,0)
+  result = (input_callback_state *)new input_callback_state();
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2455,57 +2785,41 @@ fail:
 }
 
 
-static int _wrap_delete_input_callback_state_t(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  
-  SWIG_check_num_args("input_callback_state_t::~input_callback_state_t",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state_t::~input_callback_state_t",1,"input_callback_state_t *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_input_callback_state_t",1,SWIGTYPE_p_input_callback_state);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static void swig_delete_input_callback_state_t(void *obj) {
-input_callback_state_t *arg1 = (input_callback_state_t *) obj;
+input_callback_state *arg1 = (input_callback_state *) obj;
 delete arg1;
 }
-static swig_lua_method swig_input_callback_state_t_methods[] = {
+static swig_lua_method swig_input_callback_state_methods[] = {
     {0,0}
 };
-static swig_lua_attribute swig_input_callback_state_t_attributes[] = {
+static swig_lua_attribute swig_input_callback_state_attributes[] = {
     { "function", _wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set},
     { "threadState", _wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set},
     { "extra", _wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set},
     { "funcargs", _wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set},
     {0,0,0}
 };
-static swig_lua_class *swig_input_callback_state_t_bases[] = {0};
-static const char *swig_input_callback_state_t_base_names[] = {0};
-static swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases, swig_input_callback_state_t_base_names };
+static swig_lua_attribute swig_input_callback_state_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_input_callback_state_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_input_callback_state_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
+static swig_lua_class *swig_input_callback_state_bases[] = {0};
+static const char *swig_input_callback_state_base_names[] = {0};
+static swig_lua_class _wrap_class_input_callback_state = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_methods, swig_input_callback_state_attributes, { "input_callback_state_t", swig_input_callback_state_cls_methods, swig_input_callback_state_cls_attributes, swig_input_callback_state_cls_constants }, swig_input_callback_state_bases, swig_input_callback_state_base_names };
 
 static int _wrap_DTMF_digit_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   char arg2 ;
   
-  SWIG_check_num_args("digit",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("digit",2,"char");
+  SWIG_check_num_args("DTMF::digit",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::digit",1,"DTMF *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("DTMF::digit",2,"char");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_digit_set",1,SWIGTYPE_p_DTMF);
@@ -2514,8 +2828,6 @@ static int _wrap_DTMF_digit_set(lua_State* L) {
   arg2 = (lua_tostring(L, 2))[0];
   if (arg1) (arg1)->digit = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2527,19 +2839,18 @@ fail:
 
 
 static int _wrap_DTMF_digit_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   char result;
   
-  SWIG_check_num_args("digit",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *");
+  SWIG_check_num_args("DTMF::digit",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::digit",1,"DTMF *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_digit_get",1,SWIGTYPE_p_DTMF);
   }
   
   result = (char) ((arg1)->digit);
-  SWIG_arg=0;
   lua_pushfstring(L,"%c",result); SWIG_arg++;
   return SWIG_arg;
   
@@ -2552,14 +2863,14 @@ fail:
 
 
 static int _wrap_DTMF_duration_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   uint32_t arg2 ;
   uint32_t *argp2 ;
   
-  SWIG_check_num_args("duration",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("duration",2,"uint32_t");
+  SWIG_check_num_args("DTMF::duration",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::duration",1,"DTMF *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("DTMF::duration",2,"uint32_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_duration_set",1,SWIGTYPE_p_DTMF);
@@ -2573,8 +2884,6 @@ static int _wrap_DTMF_duration_set(lua_State* L) {
   
   if (arg1) (arg1)->duration = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2586,21 +2895,20 @@ fail:
 
 
 static int _wrap_DTMF_duration_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   uint32_t result;
   
-  SWIG_check_num_args("duration",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *");
+  SWIG_check_num_args("DTMF::duration",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::duration",1,"DTMF *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_duration_get",1,SWIGTYPE_p_DTMF);
   }
   
   result =  ((arg1)->duration);
-  SWIG_arg=0;
   {
-    uint32_t * resultptr = new uint32_t((uint32_t &) result);
+    uint32_t * resultptr = new uint32_t((const uint32_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -2614,15 +2922,15 @@ fail:
 
 
 static int _wrap_new_DTMF(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char arg1 ;
   uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
-  DTMF *result = 0 ;
   uint32_t *argp2 ;
+  DTMF *result = 0 ;
   
-  SWIG_check_num_args("DTMF",1,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("DTMF",1,"char");
-  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF",2,"uint32_t");
+  SWIG_check_num_args("DTMF::DTMF",1,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("DTMF::DTMF",1,"char");
+  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF::DTMF",2,"uint32_t");
   arg1 = (lua_tostring(L, 1))[0];
   if(lua_gettop(L)>=2){
     if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){
@@ -2631,7 +2939,6 @@ static int _wrap_new_DTMF(lua_State* L) {
     arg2 = *argp2;
   }
   result = (DTMF *)new DTMF(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_DTMF,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2643,31 +2950,6 @@ fail:
 }
 
 
-static int _wrap_delete_DTMF(lua_State* L) {
-  int SWIG_arg = -1;
-  DTMF *arg1 = (DTMF *) 0 ;
-  
-  SWIG_check_num_args("DTMF",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF",1,"DTMF *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_DTMF",1,SWIGTYPE_p_DTMF);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static void swig_delete_DTMF(void *obj) {
 DTMF *arg1 = (DTMF *) obj;
 delete arg1;
@@ -2680,17 +2962,25 @@ static swig_lua_attribute swig_DTMF_attributes[] = {
     { "duration", _wrap_DTMF_duration_get, _wrap_DTMF_duration_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_DTMF_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_DTMF_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_DTMF_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_DTMF_bases[] = {0};
 static const char *swig_DTMF_base_names[] = {0};
-static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases, swig_DTMF_base_names };
+static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, { "DTMF", swig_DTMF_cls_methods, swig_DTMF_cls_attributes, swig_DTMF_cls_constants }, swig_DTMF_bases, swig_DTMF_base_names };
 
 static int _wrap_new_Stream__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *result = 0 ;
   
-  SWIG_check_num_args("Stream",0,0)
+  SWIG_check_num_args("Stream::Stream",0,0)
   result = (Stream *)new Stream();
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2703,19 +2993,18 @@ fail:
 
 
 static int _wrap_new_Stream__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
   Stream *result = 0 ;
   
-  SWIG_check_num_args("Stream",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"switch_stream_handle_t *");
+  SWIG_check_num_args("Stream::Stream",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::Stream",1,"switch_stream_handle_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_stream_handle_t,0))){
     SWIG_fail_ptr("new_Stream",1,SWIGTYPE_p_switch_stream_handle_t);
   }
   
   result = (Stream *)new Stream(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2752,54 +3041,31 @@ static int _wrap_new_Stream(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Stream'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Stream'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    Stream::Stream()\n"
+    "    Stream::Stream(switch_stream_handle_t *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Stream(lua_State* L) {
-  int SWIG_arg = -1;
-  Stream *arg1 = (Stream *) 0 ;
-  
-  SWIG_check_num_args("Stream",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"Stream *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Stream",1,SWIGTYPE_p_Stream);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Stream_read(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   int *arg2 = (int *) 0 ;
-  char *result = 0 ;
   int temp2 ;
+  char *result = 0 ;
   
   arg2 = &temp2; 
-  SWIG_check_num_args("read",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *");
+  SWIG_check_num_args("Stream::read",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::read",1,"Stream *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream);
   }
   
   result = (char *)(arg1)->read(arg2);
-  SWIG_arg=0;
-  lua_pushlstring(L,(const char*)result, (*arg2)); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
   return SWIG_arg;
   
@@ -2812,13 +3078,13 @@ fail:
 
 
 static int _wrap_Stream_write(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("write",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("write",1,"Stream *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("write",2,"char const *");
+  SWIG_check_num_args("Stream::write",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::write",1,"Stream *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Stream::write",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_write",1,SWIGTYPE_p_Stream);
@@ -2826,7 +3092,6 @@ static int _wrap_Stream_write(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->write((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2839,15 +3104,15 @@ fail:
 
 
 static int _wrap_Stream_raw_write(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 ;
   
-  SWIG_check_num_args("raw_write",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int");
+  SWIG_check_num_args("Stream::raw_write",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::raw_write",1,"Stream *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Stream::raw_write",2,"char const *");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("Stream::raw_write",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream);
@@ -2856,7 +3121,6 @@ static int _wrap_Stream_raw_write(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (int)lua_tonumber(L, 3);
   (arg1)->raw_write((char const *)arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2869,20 +3133,19 @@ fail:
 
 
 static int _wrap_Stream_get_data(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("get_data",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_data",1,"Stream *");
+  SWIG_check_num_args("Stream::get_data",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::get_data",1,"Stream *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_get_data",1,SWIGTYPE_p_Stream);
   }
   
   result = (char *)(arg1)->get_data();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2907,18 +3170,27 @@ static swig_lua_method swig_Stream_methods[] = {
 static swig_lua_attribute swig_Stream_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_Stream_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_Stream_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_Stream_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_Stream_bases[] = {0};
 static const char *swig_Stream_base_names[] = {0};
-static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases, swig_Stream_base_names };
+static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, { "Stream", swig_Stream_cls_methods, swig_Stream_cls_attributes, swig_Stream_cls_constants }, swig_Stream_bases, swig_Stream_base_names };
 
 static int _wrap_Event_event_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_event_t *arg2 = (switch_event_t *) 0 ;
   
-  SWIG_check_num_args("event",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"switch_event_t *");
+  SWIG_check_num_args("Event::event",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::event",1,"Event *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Event::event",2,"switch_event_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_event_set",1,SWIGTYPE_p_Event);
@@ -2931,8 +3203,6 @@ static int _wrap_Event_event_set(lua_State* L) {
   
   if (arg1) (arg1)->event = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2944,19 +3214,18 @@ fail:
 
 
 static int _wrap_Event_event_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_event_t *result = 0 ;
   
-  SWIG_check_num_args("event",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *");
+  SWIG_check_num_args("Event::event",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::event",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_event_get",1,SWIGTYPE_p_Event);
   }
   
   result = (switch_event_t *) ((arg1)->event);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_event_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2969,13 +3238,13 @@ fail:
 
 
 static int _wrap_Event_serialized_string_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("serialized_string",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *");
+  SWIG_check_num_args("Event::serialized_string",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialized_string",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::serialized_string",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialized_string_set",1,SWIGTYPE_p_Event);
@@ -2983,7 +3252,7 @@ static int _wrap_Event_serialized_string_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->serialized_string) delete [] arg1->serialized_string;
+    delete [] arg1->serialized_string;
     if (arg2) {
       arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->serialized_string, (const char *)arg2);
@@ -2991,7 +3260,6 @@ static int _wrap_Event_serialized_string_set(lua_State* L) {
       arg1->serialized_string = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3004,20 +3272,19 @@ fail:
 
 
 static int _wrap_Event_serialized_string_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("serialized_string",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *");
+  SWIG_check_num_args("Event::serialized_string",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialized_string",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialized_string_get",1,SWIGTYPE_p_Event);
   }
   
   result = (char *) ((arg1)->serialized_string);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3029,13 +3296,13 @@ fail:
 
 
 static int _wrap_Event_mine_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   int arg2 ;
   
-  SWIG_check_num_args("mine",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int");
+  SWIG_check_num_args("Event::mine",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::mine",1,"Event *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("Event::mine",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_mine_set",1,SWIGTYPE_p_Event);
@@ -3044,8 +3311,6 @@ static int _wrap_Event_mine_set(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   if (arg1) (arg1)->mine = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3057,19 +3322,18 @@ fail:
 
 
 static int _wrap_Event_mine_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   int result;
   
-  SWIG_check_num_args("mine",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *");
+  SWIG_check_num_args("Event::mine",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::mine",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_mine_get",1,SWIGTYPE_p_Event);
   }
   
   result = (int) ((arg1)->mine);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3082,20 +3346,19 @@ fail:
 
 
 static int _wrap_new_Event__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) NULL ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("Event",1,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("Event",1,"char const *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("Event",2,"char const *");
+  SWIG_check_num_args("Event::Event",1,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("Event::Event",1,"char const *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::Event",2,"char const *");
   arg1 = (char *)lua_tostring(L, 1);
   if(lua_gettop(L)>=2){
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (Event *)new Event((char const *)arg1,(char const *)arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3108,14 +3371,14 @@ fail:
 
 
 static int _wrap_new_Event__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_event_t *arg1 = (switch_event_t *) 0 ;
   int arg2 = (int) 0 ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("Event",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"switch_event_t *");
-  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event",2,"int");
+  SWIG_check_num_args("Event::Event",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::Event",1,"switch_event_t *");
+  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event::Event",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_event_t,0))){
     SWIG_fail_ptr("new_Event",1,SWIGTYPE_p_switch_event_t);
@@ -3125,7 +3388,6 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) {
     arg2 = (int)lua_tonumber(L, 2);
   }
   result = (Event *)new Event(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3169,14 +3431,14 @@ static int _wrap_new_Event(lua_State* L) {
   if ((argc >= 1) && (argc <= 2)) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       if (argc <= 1) {
         return _wrap_new_Event__SWIG_0(L);
       }
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_new_Event__SWIG_0(L);
@@ -3184,47 +3446,25 @@ static int _wrap_new_Event(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Event'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Event'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    Event::Event(char const *,char const *)\n"
+    "    Event::Event(switch_event_t *,int)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Event(lua_State* L) {
-  int SWIG_arg = -1;
-  Event *arg1 = (Event *) 0 ;
-  
-  SWIG_check_num_args("Event",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"Event *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Event",1,SWIGTYPE_p_Event);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Event_chat_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("chat_execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_execute",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("chat_execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("chat_execute",3,"char const *");
+  SWIG_check_num_args("Event::chat_execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::chat_execute",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::chat_execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Event::chat_execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_chat_execute",1,SWIGTYPE_p_Event);
@@ -3235,7 +3475,6 @@ static int _wrap_Event_chat_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3248,14 +3487,14 @@ fail:
 
 
 static int _wrap_Event_chat_send(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("chat_send",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_send",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("chat_send",2,"char const *");
+  SWIG_check_num_args("Event::chat_send",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::chat_send",1,"Event *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::chat_send",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_chat_send",1,SWIGTYPE_p_Event);
@@ -3265,7 +3504,6 @@ static int _wrap_Event_chat_send(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (int)(arg1)->chat_send((char const *)arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3278,14 +3516,14 @@ fail:
 
 
 static int _wrap_Event_serialize(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("serialize",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
+  SWIG_check_num_args("Event::serialize",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialize",1,"Event *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::serialize",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialize",1,SWIGTYPE_p_Event);
@@ -3295,8 +3533,7 @@ static int _wrap_Event_serialize(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (char *)(arg1)->serialize((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3308,15 +3545,15 @@ fail:
 
 
 static int _wrap_Event_setPriority(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ;
-  bool result;
   switch_priority_t *argp2 ;
+  bool result;
   
-  SWIG_check_num_args("setPriority",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"switch_priority_t");
+  SWIG_check_num_args("Event::setPriority",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::setPriority",1,"Event *");
+  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("Event::setPriority",2,"switch_priority_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_setPriority",1,SWIGTYPE_p_Event);
@@ -3329,8 +3566,7 @@ static int _wrap_Event_setPriority(lua_State* L) {
     arg2 = *argp2;
   }
   result = (bool)(arg1)->setPriority(arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3342,14 +3578,14 @@ fail:
 
 
 static int _wrap_Event_getHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getHeader",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char const *");
+  SWIG_check_num_args("Event::getHeader",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::getHeader",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getHeader",1,SWIGTYPE_p_Event);
@@ -3357,8 +3593,7 @@ static int _wrap_Event_getHeader(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->getHeader((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3370,20 +3605,19 @@ fail:
 
 
 static int _wrap_Event_getBody(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getBody",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"Event *");
+  SWIG_check_num_args("Event::getBody",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getBody",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getBody",1,SWIGTYPE_p_Event);
   }
   
   result = (char *)(arg1)->getBody();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3395,20 +3629,19 @@ fail:
 
 
 static int _wrap_Event_getType(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getType",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"Event *");
+  SWIG_check_num_args("Event::getType",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getType",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getType",1,SWIGTYPE_p_Event);
   }
   
   result = (char *)(arg1)->getType();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3420,14 +3653,14 @@ fail:
 
 
 static int _wrap_Event_addBody(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("addBody",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *");
+  SWIG_check_num_args("Event::addBody",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::addBody",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::addBody",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_addBody",1,SWIGTYPE_p_Event);
@@ -3435,8 +3668,7 @@ static int _wrap_Event_addBody(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->addBody((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3448,16 +3680,16 @@ fail:
 
 
 static int _wrap_Event_addHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("addHeader",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *");
+  SWIG_check_num_args("Event::addHeader",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::addHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::addHeader",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Event::addHeader",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_addHeader",1,SWIGTYPE_p_Event);
@@ -3466,8 +3698,7 @@ static int _wrap_Event_addHeader(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3479,14 +3710,14 @@ fail:
 
 
 static int _wrap_Event_delHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("delHeader",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *");
+  SWIG_check_num_args("Event::delHeader",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::delHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::delHeader",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_delHeader",1,SWIGTYPE_p_Event);
@@ -3494,8 +3725,7 @@ static int _wrap_Event_delHeader(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->delHeader((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3507,20 +3737,19 @@ fail:
 
 
 static int _wrap_Event_fire(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   bool result;
   
-  SWIG_check_num_args("fire",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("fire",1,"Event *");
+  SWIG_check_num_args("Event::fire",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::fire",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_fire",1,SWIGTYPE_p_Event);
   }
   
   result = (bool)(arg1)->fire();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3555,18 +3784,27 @@ static swig_lua_attribute swig_Event_attributes[] = {
     { "mine", _wrap_Event_mine_get, _wrap_Event_mine_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_Event_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_Event_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_Event_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_Event_bases[] = {0};
 static const char *swig_Event_base_names[] = {0};
-static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases, swig_Event_base_names };
+static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, { "Event", swig_Event_cls_methods, swig_Event_cls_attributes, swig_Event_cls_constants }, swig_Event_bases, swig_Event_base_names };
 
 static int _wrap_EventConsumer_events_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_queue_t *arg2 = (switch_queue_t *) 0 ;
   
-  SWIG_check_num_args("events",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("events",2,"switch_queue_t *");
+  SWIG_check_num_args("EventConsumer::events",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::events",1,"EventConsumer *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("EventConsumer::events",2,"switch_queue_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_events_set",1,SWIGTYPE_p_EventConsumer);
@@ -3579,8 +3817,6 @@ static int _wrap_EventConsumer_events_set(lua_State* L) {
   
   if (arg1) (arg1)->events = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3592,19 +3828,18 @@ fail:
 
 
 static int _wrap_EventConsumer_events_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_queue_t *result = 0 ;
   
-  SWIG_check_num_args("events",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::events",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::events",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_events_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (switch_queue_t *) ((arg1)->events);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_queue_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3617,14 +3852,14 @@ fail:
 
 
 static int _wrap_EventConsumer_e_event_id_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_types_t arg2 ;
   switch_event_types_t *argp2 ;
   
-  SWIG_check_num_args("e_event_id",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("e_event_id",2,"switch_event_types_t");
+  SWIG_check_num_args("EventConsumer::e_event_id",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_event_id",1,"EventConsumer *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("EventConsumer::e_event_id",2,"switch_event_types_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_event_id_set",1,SWIGTYPE_p_EventConsumer);
@@ -3638,8 +3873,6 @@ static int _wrap_EventConsumer_e_event_id_set(lua_State* L) {
   
   if (arg1) (arg1)->e_event_id = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3651,21 +3884,20 @@ fail:
 
 
 static int _wrap_EventConsumer_e_event_id_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_types_t result;
   
-  SWIG_check_num_args("e_event_id",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_event_id",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_event_id",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_event_id_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result =  ((arg1)->e_event_id);
-  SWIG_arg=0;
   {
-    switch_event_types_t * resultptr = new switch_event_types_t((switch_event_types_t &) result);
+    switch_event_types_t * resultptr = new switch_event_types_t((const switch_event_types_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_event_types_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -3679,13 +3911,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_callback",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_callback",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_callback",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_callback",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_callback",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_callback_set",1,SWIGTYPE_p_EventConsumer);
@@ -3693,7 +3925,7 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_callback) delete [] arg1->e_callback;
+    delete [] arg1->e_callback;
     if (arg2) {
       arg1->e_callback = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_callback, (const char *)arg2);
@@ -3701,7 +3933,6 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
       arg1->e_callback = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3714,20 +3945,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_callback_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_callback",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_callback",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_callback",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_callback_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_callback);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3739,13 +3969,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_subclass_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_subclass_name",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_subclass_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_subclass_name",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_subclass_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_subclass_name_set",1,SWIGTYPE_p_EventConsumer);
@@ -3753,7 +3983,7 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_subclass_name) delete [] arg1->e_subclass_name;
+    delete [] arg1->e_subclass_name;
     if (arg2) {
       arg1->e_subclass_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_subclass_name, (const char *)arg2);
@@ -3761,7 +3991,6 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
       arg1->e_subclass_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3774,20 +4003,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_subclass_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_subclass_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_subclass_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_subclass_name",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_subclass_name_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_subclass_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3799,13 +4027,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_cb_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_cb_arg",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_cb_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_cb_arg",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_cb_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_cb_arg_set",1,SWIGTYPE_p_EventConsumer);
@@ -3813,7 +4041,7 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_cb_arg) delete [] arg1->e_cb_arg;
+    delete [] arg1->e_cb_arg;
     if (arg2) {
       arg1->e_cb_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_cb_arg, (const char *)arg2);
@@ -3821,7 +4049,6 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
       arg1->e_cb_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3834,20 +4061,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_cb_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_cb_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_cb_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_cb_arg",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_cb_arg_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_cb_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3859,13 +4085,13 @@ fail:
 
 
 static int _wrap_EventConsumer_enodes_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_node_t **arg2 ;
   
-  SWIG_check_num_args("enodes",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]");
+  SWIG_check_num_args("EventConsumer::enodes",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::enodes",1,"EventConsumer *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("EventConsumer::enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_enodes_set",1,SWIGTYPE_p_EventConsumer);
@@ -3881,7 +4107,6 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) {
     switch_event_node_t * *b = (switch_event_node_t * *) arg1->enodes;
     for (ii = 0; ii < (size_t)SWITCH_EVENT_ALL+1; ii++) b[ii] = *((switch_event_node_t * *) arg2 + ii);
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3894,19 +4119,18 @@ fail:
 
 
 static int _wrap_EventConsumer_enodes_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_node_t **result = 0 ;
   
-  SWIG_check_num_args("enodes",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::enodes",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::enodes",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_enodes_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (switch_event_node_t **)(switch_event_node_t **) ((arg1)->enodes);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_switch_event_node_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3919,14 +4143,14 @@ fail:
 
 
 static int _wrap_EventConsumer_node_index_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   uint32_t arg2 ;
   uint32_t *argp2 ;
   
-  SWIG_check_num_args("node_index",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("node_index",2,"uint32_t");
+  SWIG_check_num_args("EventConsumer::node_index",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::node_index",1,"EventConsumer *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("EventConsumer::node_index",2,"uint32_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_node_index_set",1,SWIGTYPE_p_EventConsumer);
@@ -3940,8 +4164,6 @@ static int _wrap_EventConsumer_node_index_set(lua_State* L) {
   
   if (arg1) (arg1)->node_index = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3953,21 +4175,20 @@ fail:
 
 
 static int _wrap_EventConsumer_node_index_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   uint32_t result;
   
-  SWIG_check_num_args("node_index",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::node_index",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::node_index",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_node_index_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result =  ((arg1)->node_index);
-  SWIG_arg=0;
   {
-    uint32_t * resultptr = new uint32_t((uint32_t &) result);
+    uint32_t * resultptr = new uint32_t((const uint32_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -3981,16 +4202,16 @@ fail:
 
 
 static int _wrap_new_EventConsumer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) NULL ;
   char *arg2 = (char *) "" ;
   int arg3 = (int) 5000 ;
   EventConsumer *result = 0 ;
   
-  SWIG_check_num_args("EventConsumer",0,3)
-  if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg("EventConsumer",1,"char const *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("EventConsumer",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer",3,"int");
+  SWIG_check_num_args("EventConsumer::EventConsumer",0,3)
+  if(lua_gettop(L)>=1 && !SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("EventConsumer::EventConsumer",1,"char const *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::EventConsumer",2,"char const *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer::EventConsumer",3,"int");
   if(lua_gettop(L)>=1){
     arg1 = (char *)lua_tostring(L, 1);
   }
@@ -4001,7 +4222,6 @@ static int _wrap_new_EventConsumer(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (EventConsumer *)new EventConsumer((char const *)arg1,(char const *)arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_EventConsumer,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4013,42 +4233,17 @@ fail:
 }
 
 
-static int _wrap_delete_EventConsumer(lua_State* L) {
-  int SWIG_arg = -1;
-  EventConsumer *arg1 = (EventConsumer *) 0 ;
-  
-  SWIG_check_num_args("EventConsumer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer",1,"EventConsumer *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_EventConsumer",1,SWIGTYPE_p_EventConsumer);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_EventConsumer_bind(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) "" ;
   int result;
   
-  SWIG_check_num_args("bind",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bind",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("bind",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("bind",3,"char const *");
+  SWIG_check_num_args("EventConsumer::bind",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::bind",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::bind",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("EventConsumer::bind",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_bind",1,SWIGTYPE_p_EventConsumer);
@@ -4059,7 +4254,6 @@ static int _wrap_EventConsumer_bind(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (int)(arg1)->bind((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4072,16 +4266,16 @@ fail:
 
 
 static int _wrap_EventConsumer_pop(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   int arg2 = (int) 0 ;
   int arg3 = (int) 0 ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("pop",1,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("pop",1,"EventConsumer *");
-  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("pop",2,"int");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("pop",3,"int");
+  SWIG_check_num_args("EventConsumer::pop",1,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::pop",1,"EventConsumer *");
+  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("EventConsumer::pop",2,"int");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer::pop",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_pop",1,SWIGTYPE_p_EventConsumer);
@@ -4094,7 +4288,6 @@ static int _wrap_EventConsumer_pop(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (Event *)(arg1)->pop(arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4107,18 +4300,17 @@ fail:
 
 
 static int _wrap_EventConsumer_cleanup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   
-  SWIG_check_num_args("cleanup",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cleanup",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::cleanup",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::cleanup",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_cleanup",1,SWIGTYPE_p_EventConsumer);
   }
   
   (arg1)->cleanup();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4150,43 +4342,27 @@ static swig_lua_attribute swig_EventConsumer_attributes[] = {
     { "node_index", _wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_EventConsumer_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_EventConsumer_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_EventConsumer_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_EventConsumer_bases[] = {0};
 static const char *swig_EventConsumer_base_names[] = {0};
-static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases, swig_EventConsumer_base_names };
-
-static int _wrap_delete_CoreSession(lua_State* L) {
-  int SWIG_arg = -1;
-  CoreSession *arg1 = (CoreSession *) 0 ;
-  
-  SWIG_check_num_args("CoreSession",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession",1,"CoreSession *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_CoreSession",1,SWIGTYPE_p_CoreSession);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
+static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, { "EventConsumer", swig_EventConsumer_cls_methods, swig_EventConsumer_cls_attributes, swig_EventConsumer_cls_constants }, swig_EventConsumer_bases, swig_EventConsumer_base_names };
 
 static int _wrap_CoreSession_session_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
   
-  SWIG_check_num_args("session",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("session",2,"switch_core_session_t *");
+  SWIG_check_num_args("CoreSession::session",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::session",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::session",2,"switch_core_session_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_session_set",1,SWIGTYPE_p_CoreSession);
@@ -4199,8 +4375,6 @@ static int _wrap_CoreSession_session_set(lua_State* L) {
   
   if (arg1) (arg1)->session = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4212,19 +4386,18 @@ fail:
 
 
 static int _wrap_CoreSession_session_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_core_session_t *result = 0 ;
   
-  SWIG_check_num_args("session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::session",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::session",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_session_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (switch_core_session_t *) ((arg1)->session);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_core_session_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4237,13 +4410,13 @@ fail:
 
 
 static int _wrap_CoreSession_channel_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_t *arg2 = (switch_channel_t *) 0 ;
   
-  SWIG_check_num_args("channel",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("channel",2,"switch_channel_t *");
+  SWIG_check_num_args("CoreSession::channel",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::channel",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::channel",2,"switch_channel_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_channel_set",1,SWIGTYPE_p_CoreSession);
@@ -4256,8 +4429,6 @@ static int _wrap_CoreSession_channel_set(lua_State* L) {
   
   if (arg1) (arg1)->channel = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4269,19 +4440,18 @@ fail:
 
 
 static int _wrap_CoreSession_channel_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_t *result = 0 ;
   
-  SWIG_check_num_args("channel",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::channel",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::channel",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_channel_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (switch_channel_t *) ((arg1)->channel);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_channel_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4294,23 +4464,22 @@ fail:
 
 
 static int _wrap_CoreSession_flags_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   unsigned int arg2 ;
   
-  SWIG_check_num_args("flags",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("flags",2,"unsigned int");
+  SWIG_check_num_args("CoreSession::flags",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flags",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::flags",2,"unsigned int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flags_set",1,SWIGTYPE_p_CoreSession);
   }
   
+  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
   arg2 = (unsigned int)lua_tonumber(L, 2);
   if (arg1) (arg1)->flags = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4322,19 +4491,18 @@ fail:
 
 
 static int _wrap_CoreSession_flags_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   unsigned int result;
   
-  SWIG_check_num_args("flags",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flags",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flags",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flags_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (unsigned int) ((arg1)->flags);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4347,13 +4515,13 @@ fail:
 
 
 static int _wrap_CoreSession_allocated_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   
-  SWIG_check_num_args("allocated",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("allocated",2,"int");
+  SWIG_check_num_args("CoreSession::allocated",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::allocated",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::allocated",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_allocated_set",1,SWIGTYPE_p_CoreSession);
@@ -4362,8 +4530,6 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   if (arg1) (arg1)->allocated = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4375,19 +4541,18 @@ fail:
 
 
 static int _wrap_CoreSession_allocated_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("allocated",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::allocated",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::allocated",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_allocated_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int) ((arg1)->allocated);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4400,13 +4565,13 @@ fail:
 
 
 static int _wrap_CoreSession_cb_state_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   input_callback_state *arg2 = (input_callback_state *) 0 ;
   
-  SWIG_check_num_args("cb_state",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("cb_state",2,"input_callback_state *");
+  SWIG_check_num_args("CoreSession::cb_state",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cb_state",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::cb_state",2,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cb_state_set",1,SWIGTYPE_p_CoreSession);
@@ -4419,8 +4584,6 @@ static int _wrap_CoreSession_cb_state_set(lua_State* L) {
   
   if (arg1) (arg1)->cb_state = *arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4432,19 +4595,18 @@ fail:
 
 
 static int _wrap_CoreSession_cb_state_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   input_callback_state *result = 0 ;
   
-  SWIG_check_num_args("cb_state",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::cb_state",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cb_state",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cb_state_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (input_callback_state *)& ((arg1)->cb_state);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4457,14 +4619,14 @@ fail:
 
 
 static int _wrap_CoreSession_hook_state_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_state_t arg2 ;
   switch_channel_state_t *argp2 ;
   
-  SWIG_check_num_args("hook_state",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("hook_state",2,"switch_channel_state_t");
+  SWIG_check_num_args("CoreSession::hook_state",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hook_state",1,"CoreSession *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("CoreSession::hook_state",2,"switch_channel_state_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hook_state_set",1,SWIGTYPE_p_CoreSession);
@@ -4478,8 +4640,6 @@ static int _wrap_CoreSession_hook_state_set(lua_State* L) {
   
   if (arg1) (arg1)->hook_state = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4491,21 +4651,20 @@ fail:
 
 
 static int _wrap_CoreSession_hook_state_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_state_t result;
   
-  SWIG_check_num_args("hook_state",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hook_state",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hook_state",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hook_state_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result =  ((arg1)->hook_state);
-  SWIG_arg=0;
   {
-    switch_channel_state_t * resultptr = new switch_channel_state_t((switch_channel_state_t &) result);
+    switch_channel_state_t * resultptr = new switch_channel_state_t((const switch_channel_state_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_channel_state_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -4519,14 +4678,14 @@ fail:
 
 
 static int _wrap_CoreSession_cause_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_call_cause_t arg2 ;
   switch_call_cause_t *argp2 ;
   
-  SWIG_check_num_args("cause",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("cause",2,"switch_call_cause_t");
+  SWIG_check_num_args("CoreSession::cause",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cause",1,"CoreSession *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("CoreSession::cause",2,"switch_call_cause_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cause_set",1,SWIGTYPE_p_CoreSession);
@@ -4540,8 +4699,6 @@ static int _wrap_CoreSession_cause_set(lua_State* L) {
   
   if (arg1) (arg1)->cause = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4553,21 +4710,20 @@ fail:
 
 
 static int _wrap_CoreSession_cause_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_call_cause_t result;
   
-  SWIG_check_num_args("cause",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::cause",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cause",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cause_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result =  ((arg1)->cause);
-  SWIG_arg=0;
   {
-    switch_call_cause_t * resultptr = new switch_call_cause_t((switch_call_cause_t &) result);
+    switch_call_cause_t * resultptr = new switch_call_cause_t((const switch_call_cause_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_call_cause_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -4581,13 +4737,13 @@ fail:
 
 
 static int _wrap_CoreSession_uuid_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("uuid",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("uuid",2,"char *");
+  SWIG_check_num_args("CoreSession::uuid",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::uuid",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::uuid",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_uuid_set",1,SWIGTYPE_p_CoreSession);
@@ -4595,7 +4751,7 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->uuid) delete [] arg1->uuid;
+    delete [] arg1->uuid;
     if (arg2) {
       arg1->uuid = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->uuid, (const char *)arg2);
@@ -4603,7 +4759,6 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) {
       arg1->uuid = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4616,20 +4771,19 @@ fail:
 
 
 static int _wrap_CoreSession_uuid_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("uuid",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::uuid",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::uuid",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_uuid_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->uuid);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4641,13 +4795,13 @@ fail:
 
 
 static int _wrap_CoreSession_tts_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("tts_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("tts_name",2,"char *");
+  SWIG_check_num_args("CoreSession::tts_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::tts_name",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::tts_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_tts_name_set",1,SWIGTYPE_p_CoreSession);
@@ -4655,7 +4809,7 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->tts_name) delete [] arg1->tts_name;
+    delete [] arg1->tts_name;
     if (arg2) {
       arg1->tts_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->tts_name, (const char *)arg2);
@@ -4663,7 +4817,6 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) {
       arg1->tts_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4676,20 +4829,19 @@ fail:
 
 
 static int _wrap_CoreSession_tts_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("tts_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::tts_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::tts_name",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_tts_name_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->tts_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4701,13 +4853,13 @@ fail:
 
 
 static int _wrap_CoreSession_voice_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("voice_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("voice_name",2,"char *");
+  SWIG_check_num_args("CoreSession::voice_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::voice_name",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::voice_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_voice_name_set",1,SWIGTYPE_p_CoreSession);
@@ -4715,7 +4867,7 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->voice_name) delete [] arg1->voice_name;
+    delete [] arg1->voice_name;
     if (arg2) {
       arg1->voice_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->voice_name, (const char *)arg2);
@@ -4723,7 +4875,6 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) {
       arg1->voice_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4736,20 +4887,19 @@ fail:
 
 
 static int _wrap_CoreSession_voice_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("voice_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::voice_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::voice_name",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_voice_name_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->voice_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4761,18 +4911,18 @@ fail:
 
 
 static int _wrap_CoreSession_insertFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   int result;
   
-  SWIG_check_num_args("insertFile",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("insertFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("insertFile",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("insertFile",3,"char const *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("insertFile",4,"int");
+  SWIG_check_num_args("CoreSession::insertFile",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::insertFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::insertFile",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::insertFile",3,"char const *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::insertFile",4,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_insertFile",1,SWIGTYPE_p_CoreSession);
@@ -4782,7 +4932,6 @@ static int _wrap_CoreSession_insertFile(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (int)(arg1)->insertFile((char const *)arg2,(char const *)arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4795,19 +4944,18 @@ fail:
 
 
 static int _wrap_CoreSession_answer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("answer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answer",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::answer",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::answer",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_answer",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->answer();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4820,19 +4968,18 @@ fail:
 
 
 static int _wrap_CoreSession_preAnswer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("preAnswer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("preAnswer",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::preAnswer",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::preAnswer",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_preAnswer",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->preAnswer();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4845,13 +4992,13 @@ fail:
 
 
 static int _wrap_CoreSession_hangup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) "normal_clearing" ;
   
-  SWIG_check_num_args("hangup",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup",1,"CoreSession *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char const *");
+  SWIG_check_num_args("CoreSession::hangup",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangup",1,"CoreSession *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::hangup",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangup",1,SWIGTYPE_p_CoreSession);
@@ -4861,7 +5008,6 @@ static int _wrap_CoreSession_hangup(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   (arg1)->hangup((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4874,18 +5020,17 @@ fail:
 
 
 static int _wrap_CoreSession_hangupState(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("hangupState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupState",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hangupState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangupState",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangupState",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->hangupState();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4898,15 +5043,15 @@ fail:
 
 
 static int _wrap_CoreSession_setVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setVariable",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVariable",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setVariable",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setVariable",3,"char *");
+  SWIG_check_num_args("CoreSession::setVariable",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setVariable",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::setVariable",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::setVariable",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setVariable",1,SWIGTYPE_p_CoreSession);
@@ -4915,7 +5060,6 @@ static int _wrap_CoreSession_setVariable(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setVariable(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4928,15 +5072,15 @@ fail:
 
 
 static int _wrap_CoreSession_setPrivate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   void *arg3 = (void *) 0 ;
   
-  SWIG_check_num_args("setPrivate",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPrivate",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setPrivate",2,"char *");
-  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setPrivate",3,"void *");
+  SWIG_check_num_args("CoreSession::setPrivate",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setPrivate",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::setPrivate",2,"char *");
+  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("CoreSession::setPrivate",3,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setPrivate",1,SWIGTYPE_p_CoreSession);
@@ -4945,7 +5089,6 @@ static int _wrap_CoreSession_setPrivate(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"CoreSession_setPrivate");
   (arg1)->setPrivate(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4958,14 +5101,14 @@ fail:
 
 
 static int _wrap_CoreSession_getPrivate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("getPrivate",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getPrivate",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getPrivate",2,"char *");
+  SWIG_check_num_args("CoreSession::getPrivate",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getPrivate",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::getPrivate",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getPrivate",1,SWIGTYPE_p_CoreSession);
@@ -4973,7 +5116,6 @@ static int _wrap_CoreSession_getPrivate(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (void *)(arg1)->getPrivate(arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4986,14 +5128,14 @@ fail:
 
 
 static int _wrap_CoreSession_getVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getVariable",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getVariable",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getVariable",2,"char *");
+  SWIG_check_num_args("CoreSession::getVariable",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getVariable",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::getVariable",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getVariable",1,SWIGTYPE_p_CoreSession);
@@ -5001,8 +5143,7 @@ static int _wrap_CoreSession_getVariable(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->getVariable(arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5014,14 +5155,14 @@ fail:
 
 
 static int _wrap_CoreSession_process_callback_result(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   switch_status_t result;
   
-  SWIG_check_num_args("process_callback_result",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("process_callback_result",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("process_callback_result",2,"char *");
+  SWIG_check_num_args("CoreSession::process_callback_result",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::process_callback_result",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::process_callback_result",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_process_callback_result",1,SWIGTYPE_p_CoreSession);
@@ -5029,9 +5170,8 @@ static int _wrap_CoreSession_process_callback_result(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (arg1)->process_callback_result(arg2);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -5045,7 +5185,7 @@ fail:
 
 
 static int _wrap_CoreSession_say(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -5053,13 +5193,13 @@ static int _wrap_CoreSession_say(lua_State* L) {
   char *arg5 = (char *) 0 ;
   char *arg6 = (char *) NULL ;
   
-  SWIG_check_num_args("say",5,6)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("say",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("say",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("say",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("say",4,"char const *");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("say",5,"char const *");
-  if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("say",6,"char const *");
+  SWIG_check_num_args("CoreSession::say",5,6)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::say",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::say",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::say",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::say",4,"char const *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("CoreSession::say",5,"char const *");
+  if(lua_gettop(L)>=6 && !SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::say",6,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_say",1,SWIGTYPE_p_CoreSession);
@@ -5073,7 +5213,6 @@ static int _wrap_CoreSession_say(lua_State* L) {
     arg6 = (char *)lua_tostring(L, 6);
   }
   (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5086,17 +5225,17 @@ fail:
 
 
 static int _wrap_CoreSession_sayPhrase(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) "" ;
   char *arg4 = (char *) NULL ;
   
-  SWIG_check_num_args("sayPhrase",2,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("sayPhrase",4,"char const *");
+  SWIG_check_num_args("CoreSession::sayPhrase",2,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sayPhrase",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::sayPhrase",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::sayPhrase",3,"char const *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::sayPhrase",4,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession);
@@ -5110,7 +5249,6 @@ static int _wrap_CoreSession_sayPhrase(lua_State* L) {
     arg4 = (char *)lua_tostring(L, 4);
   }
   (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5123,20 +5261,19 @@ fail:
 
 
 static int _wrap_CoreSession_hangupCause(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangupCause",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupCause",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hangupCause",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangupCause",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangupCause",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->hangupCause();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5148,20 +5285,19 @@ fail:
 
 
 static int _wrap_CoreSession_getState(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getState",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::getState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getState",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getState",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->getState();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5173,7 +5309,7 @@ fail:
 
 
 static int _wrap_CoreSession_recordFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 = (int) 0 ;
@@ -5181,12 +5317,12 @@ static int _wrap_CoreSession_recordFile(lua_State* L) {
   int arg5 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("recordFile",2,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recordFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("recordFile",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("recordFile",3,"int");
-  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("recordFile",4,"int");
-  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("recordFile",5,"int");
+  SWIG_check_num_args("CoreSession::recordFile",2,5)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::recordFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::recordFile",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::recordFile",3,"int");
+  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::recordFile",4,"int");
+  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::recordFile",5,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_recordFile",1,SWIGTYPE_p_CoreSession);
@@ -5203,7 +5339,6 @@ static int _wrap_CoreSession_recordFile(lua_State* L) {
     arg5 = (int)lua_tonumber(L, 5);
   }
   result = (int)(arg1)->recordFile(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5216,7 +5351,7 @@ fail:
 
 
 static int _wrap_CoreSession_originate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -5224,12 +5359,12 @@ static int _wrap_CoreSession_originate(lua_State* L) {
   switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ;
   int result;
   
-  SWIG_check_num_args("originate",3,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int");
-  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("originate",5,"switch_state_handler_table_t *");
+  SWIG_check_num_args("CoreSession::originate",3,5)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::originate",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::originate",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::originate",3,"char *");
+  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::originate",4,"int");
+  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("CoreSession::originate",5,"switch_state_handler_table_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_originate",1,SWIGTYPE_p_CoreSession);
@@ -5250,7 +5385,6 @@ static int _wrap_CoreSession_originate(lua_State* L) {
     }
   }
   result = (int)(arg1)->originate(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5263,18 +5397,17 @@ fail:
 
 
 static int _wrap_CoreSession_destroy(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("destroy",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::destroy",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::destroy",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_destroy",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->destroy();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5287,15 +5420,15 @@ fail:
 
 
 static int _wrap_CoreSession_setDTMFCallback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setDTMFCallback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setDTMFCallback",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setDTMFCallback",2,"void *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setDTMFCallback",3,"char *");
+  SWIG_check_num_args("CoreSession::setDTMFCallback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setDTMFCallback",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setDTMFCallback",2,"void *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::setDTMFCallback",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setDTMFCallback",1,SWIGTYPE_p_CoreSession);
@@ -5304,7 +5437,6 @@ static int _wrap_CoreSession_setDTMFCallback(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setDTMFCallback");
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setDTMFCallback(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5317,14 +5449,14 @@ fail:
 
 
 static int _wrap_CoreSession_speak(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int result;
   
-  SWIG_check_num_args("speak",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("speak",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("speak",2,"char *");
+  SWIG_check_num_args("CoreSession::speak",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::speak",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::speak",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_speak",1,SWIGTYPE_p_CoreSession);
@@ -5332,7 +5464,6 @@ static int _wrap_CoreSession_speak(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (int)(arg1)->speak(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5345,15 +5476,15 @@ fail:
 
 
 static int _wrap_CoreSession_set_tts_parms(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("set_tts_parms",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_parms",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_parms",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_parms",3,"char *");
+  SWIG_check_num_args("CoreSession::set_tts_parms",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::set_tts_parms",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::set_tts_parms",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::set_tts_parms",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_set_tts_parms",1,SWIGTYPE_p_CoreSession);
@@ -5362,7 +5493,6 @@ static int _wrap_CoreSession_set_tts_parms(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->set_tts_parms(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5375,15 +5505,15 @@ fail:
 
 
 static int _wrap_CoreSession_set_tts_params(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("set_tts_params",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_params",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_params",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_params",3,"char *");
+  SWIG_check_num_args("CoreSession::set_tts_params",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::set_tts_params",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::set_tts_params",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::set_tts_params",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_set_tts_params",1,SWIGTYPE_p_CoreSession);
@@ -5392,7 +5522,6 @@ static int _wrap_CoreSession_set_tts_params(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->set_tts_params(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5405,14 +5534,14 @@ fail:
 
 
 static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int result;
   
-  SWIG_check_num_args("collectDigits",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int");
+  SWIG_check_num_args("CoreSession::collectDigits",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::collectDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::collectDigits",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession);
@@ -5420,7 +5549,6 @@ static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) {
   
   arg2 = (int)lua_tonumber(L, 2);
   result = (int)(arg1)->collectDigits(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5433,16 +5561,16 @@ fail:
 
 
 static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
   int result;
   
-  SWIG_check_num_args("collectDigits",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("collectDigits",3,"int");
+  SWIG_check_num_args("CoreSession::collectDigits",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::collectDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::collectDigits",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::collectDigits",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession);
@@ -5451,7 +5579,6 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   arg3 = (int)lua_tonumber(L, 3);
   result = (int)(arg1)->collectDigits(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5514,24 +5641,27 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'CoreSession_collectDigits'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'CoreSession_collectDigits'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CoreSession::collectDigits(int)\n"
+    "    CoreSession::collectDigits(int,int)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getDigits",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int");
+  SWIG_check_num_args("CoreSession::getDigits",4,4)
+  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 (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
@@ -5541,8 +5671,7 @@ static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5554,7 +5683,7 @@ fail:
 
 
 static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   char *arg3 = (char *) 0 ;
@@ -5562,12 +5691,12 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
   int arg5 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getDigits",5,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("getDigits",5,"int");
+  SWIG_check_num_args("CoreSession::getDigits",5,5)
+  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 (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
@@ -5578,8 +5707,7 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (int)lua_tonumber(L, 5);
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5613,7 +5741,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
@@ -5642,7 +5770,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
@@ -5661,24 +5789,27 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'CoreSession_getDigits'");
+  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");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_CoreSession_transfer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   char *arg4 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("transfer",2,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("transfer",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("transfer",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("transfer",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("transfer",4,"char *");
+  SWIG_check_num_args("CoreSession::transfer",2,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::transfer",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::transfer",2,"char *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::transfer",3,"char *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::transfer",4,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_transfer",1,SWIGTYPE_p_CoreSession);
@@ -5692,7 +5823,6 @@ static int _wrap_CoreSession_transfer(lua_State* L) {
     arg4 = (char *)lua_tostring(L, 4);
   }
   result = (int)(arg1)->transfer(arg2,arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5705,7 +5835,7 @@ fail:
 
 
 static int _wrap_CoreSession_read(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
@@ -5715,14 +5845,14 @@ static int _wrap_CoreSession_read(lua_State* L) {
   int arg7 = (int) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("read",6,7)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("read",2,"int");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("read",3,"int");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("read",4,"char const *");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("read",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("read",6,"char const *");
-  if(lua_gettop(L)>=7 && !lua_isnumber(L,7)) SWIG_fail_arg("read",7,"int");
+  SWIG_check_num_args("CoreSession::read",6,7)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::read",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::read",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::read",3,"int");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::read",4,"char const *");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::read",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::read",6,"char const *");
+  if(lua_gettop(L)>=7 && !lua_isnumber(L,7)) SWIG_fail_arg("CoreSession::read",7,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_read",1,SWIGTYPE_p_CoreSession);
@@ -5737,8 +5867,7 @@ static int _wrap_CoreSession_read(lua_State* L) {
     arg7 = (int)lua_tonumber(L, 7);
   }
   result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5750,7 +5879,7 @@ fail:
 
 
 static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
@@ -5765,19 +5894,19 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
   char *arg12 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("playAndGetDigits",9,12)
-  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");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("playAndGetDigits",4,"int");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("playAndGetDigits",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("playAndGetDigits",6,"char *");
-  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_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char const *");
-  if(lua_gettop(L)>=11 && !lua_isnumber(L,11)) SWIG_fail_arg("playAndGetDigits",11,"int");
-  if(lua_gettop(L)>=12 && !lua_isstring(L,12)) SWIG_fail_arg("playAndGetDigits",12,"char const *");
+  SWIG_check_num_args("CoreSession::playAndGetDigits",9,12)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::playAndGetDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::playAndGetDigits",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::playAndGetDigits",3,"int");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::playAndGetDigits",4,"int");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::playAndGetDigits",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::playAndGetDigits",6,"char *");
+  if(!SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("CoreSession::playAndGetDigits",7,"char *");
+  if(!SWIG_lua_isnilstring(L,8)) SWIG_fail_arg("CoreSession::playAndGetDigits",8,"char *");
+  if(!SWIG_lua_isnilstring(L,9)) SWIG_fail_arg("CoreSession::playAndGetDigits",9,"char *");
+  if(lua_gettop(L)>=10 && !SWIG_lua_isnilstring(L,10)) SWIG_fail_arg("CoreSession::playAndGetDigits",10,"char const *");
+  if(lua_gettop(L)>=11 && !lua_isnumber(L,11)) SWIG_fail_arg("CoreSession::playAndGetDigits",11,"int");
+  if(lua_gettop(L)>=12 && !SWIG_lua_isnilstring(L,12)) SWIG_fail_arg("CoreSession::playAndGetDigits",12,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession);
@@ -5801,8 +5930,7 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
     arg12 = (char *)lua_tostring(L, 12);
   }
   result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11,(char const *)arg12);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5814,16 +5942,16 @@ fail:
 
 
 static int _wrap_CoreSession_streamFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("streamFile",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("streamFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("streamFile",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("streamFile",3,"int");
+  SWIG_check_num_args("CoreSession::streamFile",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::streamFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::streamFile",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::streamFile",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_streamFile",1,SWIGTYPE_p_CoreSession);
@@ -5834,7 +5962,6 @@ static int _wrap_CoreSession_streamFile(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (int)(arg1)->streamFile(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5847,16 +5974,16 @@ fail:
 
 
 static int _wrap_CoreSession_sleep(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("sleep",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int");
+  SWIG_check_num_args("CoreSession::sleep",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sleep",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::sleep",2,"int");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::sleep",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession);
@@ -5867,7 +5994,6 @@ static int _wrap_CoreSession_sleep(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (int)(arg1)->sleep(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5880,19 +6006,18 @@ fail:
 
 
 static int _wrap_CoreSession_flushEvents(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("flushEvents",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushEvents",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flushEvents",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flushEvents",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flushEvents",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->flushEvents();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5905,19 +6030,18 @@ fail:
 
 
 static int _wrap_CoreSession_flushDigits(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("flushDigits",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushDigits",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flushDigits",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flushDigits",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flushDigits",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->flushDigits();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5930,14 +6054,14 @@ fail:
 
 
 static int _wrap_CoreSession_setAutoHangup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool arg2 ;
   int result;
   
-  SWIG_check_num_args("setAutoHangup",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setAutoHangup",1,"CoreSession *");
-  if(!lua_isboolean(L,2)) SWIG_fail_arg("setAutoHangup",2,"bool");
+  SWIG_check_num_args("CoreSession::setAutoHangup",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setAutoHangup",1,"CoreSession *");
+  if(!lua_isboolean(L,2)) SWIG_fail_arg("CoreSession::setAutoHangup",2,"bool");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setAutoHangup",1,SWIGTYPE_p_CoreSession);
@@ -5945,7 +6069,6 @@ static int _wrap_CoreSession_setAutoHangup(lua_State* L) {
   
   arg2 = (lua_toboolean(L, 2)!=0);
   result = (int)(arg1)->setAutoHangup(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5958,13 +6081,13 @@ fail:
 
 
 static int _wrap_CoreSession_setHangupHook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setHangupHook",2,"void *");
+  SWIG_check_num_args("CoreSession::setHangupHook",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setHangupHook",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setHangupHook",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setHangupHook",1,SWIGTYPE_p_CoreSession);
@@ -5972,7 +6095,6 @@ static int _wrap_CoreSession_setHangupHook(lua_State* L) {
   
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setHangupHook");
   (arg1)->setHangupHook(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5985,20 +6107,19 @@ fail:
 
 
 static int _wrap_CoreSession_ready(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("ready",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::ready",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::ready",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_ready",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->ready();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6010,20 +6131,19 @@ fail:
 
 
 static int _wrap_CoreSession_bridged(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("bridged",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bridged",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::bridged",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::bridged",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_bridged",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->bridged();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6035,20 +6155,19 @@ fail:
 
 
 static int _wrap_CoreSession_answered(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("answered",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answered",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::answered",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::answered",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_answered",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->answered();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6060,20 +6179,19 @@ fail:
 
 
 static int _wrap_CoreSession_mediaReady(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("mediaReady",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mediaReady",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::mediaReady",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::mediaReady",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_mediaReady",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->mediaReady();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6085,13 +6203,13 @@ fail:
 
 
 static int _wrap_CoreSession_waitForAnswer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("waitForAnswer",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("waitForAnswer",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("waitForAnswer",2,"CoreSession *");
+  SWIG_check_num_args("CoreSession::waitForAnswer",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::waitForAnswer",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::waitForAnswer",2,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_waitForAnswer",1,SWIGTYPE_p_CoreSession);
@@ -6103,7 +6221,6 @@ static int _wrap_CoreSession_waitForAnswer(lua_State* L) {
   }
   
   (arg1)->waitForAnswer(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6116,15 +6233,15 @@ fail:
 
 
 static int _wrap_CoreSession_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   
-  SWIG_check_num_args("execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("CoreSession::execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::execute",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_execute",1,SWIGTYPE_p_CoreSession);
@@ -6135,7 +6252,6 @@ static int _wrap_CoreSession_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   (arg1)->execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6148,13 +6264,13 @@ fail:
 
 
 static int _wrap_CoreSession_sendEvent(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   Event *arg2 = (Event *) 0 ;
   
-  SWIG_check_num_args("sendEvent",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"Event *");
+  SWIG_check_num_args("CoreSession::sendEvent",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sendEvent",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::sendEvent",2,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sendEvent",1,SWIGTYPE_p_CoreSession);
@@ -6166,7 +6282,6 @@ static int _wrap_CoreSession_sendEvent(lua_State* L) {
   }
   
   (arg1)->sendEvent(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6179,13 +6294,13 @@ fail:
 
 
 static int _wrap_CoreSession_setEventData(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   Event *arg2 = (Event *) 0 ;
   
-  SWIG_check_num_args("setEventData",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventData",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setEventData",2,"Event *");
+  SWIG_check_num_args("CoreSession::setEventData",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setEventData",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setEventData",2,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setEventData",1,SWIGTYPE_p_CoreSession);
@@ -6197,7 +6312,6 @@ static int _wrap_CoreSession_setEventData(lua_State* L) {
   }
   
   (arg1)->setEventData(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6210,20 +6324,19 @@ fail:
 
 
 static int _wrap_CoreSession_getXMLCDR(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getXMLCDR",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getXMLCDR",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::getXMLCDR",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getXMLCDR",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getXMLCDR",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->getXMLCDR();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6235,20 +6348,19 @@ fail:
 
 
 static int _wrap_CoreSession_begin_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("begin_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::begin_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::begin_allow_threads",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_begin_allow_threads",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->begin_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6260,20 +6372,19 @@ fail:
 
 
 static int _wrap_CoreSession_end_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("end_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::end_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::end_allow_threads",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_end_allow_threads",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->end_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6285,20 +6396,19 @@ fail:
 
 
 static int _wrap_CoreSession_get_uuid(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("get_uuid",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_uuid",1,"CoreSession const *");
+  SWIG_check_num_args("CoreSession::get_uuid",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::get_uuid",1,"CoreSession const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_get_uuid",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)((CoreSession const *)arg1)->get_uuid();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6310,22 +6420,18 @@ fail:
 
 
 static int _wrap_CoreSession_get_cb_args(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_input_args_t *result = 0 ;
   
-  SWIG_check_num_args("get_cb_args",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_cb_args",1,"CoreSession const *");
+  SWIG_check_num_args("CoreSession::get_cb_args",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::get_cb_args",1,"CoreSession const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_get_cb_args",1,SWIGTYPE_p_CoreSession);
   }
   
-  {
-    switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
-    result = (switch_input_args_t *) &_result_ref;
-  }
-  SWIG_arg=0;
+  result = (switch_input_args_t *) &((CoreSession const *)arg1)->get_cb_args();
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_input_args_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -6338,18 +6444,17 @@ fail:
 
 
 static int _wrap_CoreSession_check_hangup_hook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("check_hangup_hook",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::check_hangup_hook",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::check_hangup_hook",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_check_hangup_hook",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->check_hangup_hook();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6362,17 +6467,17 @@ fail:
 
 
 static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
-  SWIG_check_num_args("run_dtmf_callback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *");
-  if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t");
+  SWIG_check_num_args("CoreSession::run_dtmf_callback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::run_dtmf_callback",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::run_dtmf_callback",2,"void *");
+  if(!lua_isuserdata(L,3)) SWIG_fail_arg("CoreSession::run_dtmf_callback",3,"switch_input_type_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_run_dtmf_callback",1,SWIGTYPE_p_CoreSession);
@@ -6386,9 +6491,8 @@ static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6402,15 +6506,15 @@ fail:
 
 
 static int _wrap_CoreSession_consoleLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("consoleLog",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("consoleLog",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog",3,"char *");
+  SWIG_check_num_args("CoreSession::consoleLog",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::consoleLog",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::consoleLog",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::consoleLog",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_consoleLog",1,SWIGTYPE_p_CoreSession);
@@ -6419,7 +6523,6 @@ static int _wrap_CoreSession_consoleLog(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->consoleLog(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6432,7 +6535,7 @@ fail:
 
 
 static int _wrap_CoreSession_consoleLog2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -6440,13 +6543,13 @@ static int _wrap_CoreSession_consoleLog2(lua_State* L) {
   int arg5 ;
   char *arg6 = (char *) 0 ;
   
-  SWIG_check_num_args("consoleLog2",6,6)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("consoleLog2",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("consoleLog2",4,"char *");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("consoleLog2",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("consoleLog2",6,"char *");
+  SWIG_check_num_args("CoreSession::consoleLog2",6,6)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::consoleLog2",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::consoleLog2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::consoleLog2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::consoleLog2",4,"char *");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::consoleLog2",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::consoleLog2",6,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_consoleLog2",1,SWIGTYPE_p_CoreSession);
@@ -6458,7 +6561,6 @@ static int _wrap_CoreSession_consoleLog2(lua_State* L) {
   arg5 = (int)lua_tonumber(L, 5);
   arg6 = (char *)lua_tostring(L, 6);
   (arg1)->consoleLog2(arg2,arg3,arg4,arg5,arg6);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6539,22 +6641,30 @@ static swig_lua_attribute swig_CoreSession_attributes[] = {
     { "voice_name", _wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_CoreSession_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_CoreSession_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_CoreSession_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_CoreSession_bases[] = {0};
 static const char *swig_CoreSession_base_names[] = {0};
-static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases, swig_CoreSession_base_names };
+static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, { "CoreSession", swig_CoreSession_cls_methods, swig_CoreSession_cls_attributes, swig_CoreSession_cls_constants }, swig_CoreSession_bases, swig_CoreSession_base_names };
 
 static int _wrap_console_log(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("console_log",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_log",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("console_log",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_log",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("console_log",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   console_log(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6567,7 +6677,7 @@ fail:
 
 
 static int _wrap_console_log2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -6575,18 +6685,17 @@ static int _wrap_console_log2(lua_State* L) {
   char *arg5 = (char *) 0 ;
   
   SWIG_check_num_args("console_log2",5,5)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_log2",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("console_log2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("console_log2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_log2",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("console_log2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("console_log2",3,"char *");
   if(!lua_isnumber(L,4)) SWIG_fail_arg("console_log2",4,"int");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("console_log2",5,"char *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("console_log2",5,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (char *)lua_tostring(L, 5);
   console_log2(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6599,14 +6708,13 @@ fail:
 
 
 static int _wrap_console_clean_log(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   
   SWIG_check_num_args("console_clean_log",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   console_clean_log(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6619,14 +6727,14 @@ fail:
 
 
 static int _wrap_msleep(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   unsigned int arg1 ;
   
   SWIG_check_num_args("switch_msleep",1,1)
   if(!lua_isnumber(L,1)) SWIG_fail_arg("switch_msleep",1,"unsigned int");
+  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
   arg1 = (unsigned int)lua_tonumber(L, 1);
   switch_msleep(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6639,7 +6747,7 @@ fail:
 
 
 static int _wrap_bridge(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = 0 ;
   CoreSession *arg2 = 0 ;
   
@@ -6657,7 +6765,6 @@ static int _wrap_bridge(lua_State* L) {
   }
   
   bridge(*arg1,*arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6670,7 +6777,7 @@ fail:
 
 
 static int _wrap_hanguphook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   switch_status_t result;
   
@@ -6682,9 +6789,8 @@ static int _wrap_hanguphook(lua_State* L) {
   }
   
   result = hanguphook(arg1);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6698,14 +6804,14 @@ fail:
 
 
 static int _wrap_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
   void *arg4 = (void *) 0 ;
   unsigned int arg5 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
   SWIG_check_num_args("dtmf_callback",5,5)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("dtmf_callback",1,"switch_core_session_t *");
@@ -6726,11 +6832,11 @@ static int _wrap_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"dtmf_callback");
+  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
   arg5 = (unsigned int)lua_tonumber(L, 5);
   result = dtmf_callback(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6744,13 +6850,12 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",0,0)
+  SWIG_check_num_args("LUA::Session::Session",0,0)
   result = (LUA::Session *)new LUA::Session();
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6762,14 +6867,14 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session",2,"CoreSession *");
+  SWIG_check_num_args("LUA::Session::Session",2,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::Session",2,"CoreSession *");
   arg1 = (char *)lua_tostring(L, 1);
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){
@@ -6777,8 +6882,7 @@ static int _wrap_new_Session__SWIG_1(lua_State* L) {
   }
   
   result = (LUA::Session *)new LUA::Session(arg1,arg2);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6790,16 +6894,15 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *");
+  SWIG_check_num_args("LUA::Session::Session",1,1)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (LUA::Session *)new LUA::Session(arg1);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6811,20 +6914,19 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_3(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session",1,"switch_core_session_t *");
+  SWIG_check_num_args("LUA::Session::Session",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"switch_core_session_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){
     SWIG_fail_ptr("new_Session",1,SWIGTYPE_p_switch_core_session_t);
   }
   
   result = (LUA::Session *)new LUA::Session(arg1);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6862,7 +6964,7 @@ static int _wrap_new_Session(lua_State* L) {
   if (argc == 1) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       return _wrap_new_Session__SWIG_2(L);
@@ -6871,7 +6973,7 @@ static int _wrap_new_Session(lua_State* L) {
   if (argc == 2) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
@@ -6888,44 +6990,24 @@ static int _wrap_new_Session(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Session'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Session'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::Session()\n"
+    "    LUA::Session::Session(char *,CoreSession *)\n"
+    "    LUA::Session::Session(char *)\n"
+    "    LUA::Session::Session(switch_core_session_t *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Session(lua_State* L) {
-  int SWIG_arg = -1;
-  LUA::Session *arg1 = (LUA::Session *) 0 ;
-  
-  SWIG_check_num_args("LUA::~Session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Session",1,"LUA::Session *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_LUA__Session);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Session_destroy__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("destroy",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("destroy",2,"char const *");
+  SWIG_check_num_args("LUA::Session::destroy",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::destroy",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::destroy",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session);
@@ -6933,7 +7015,6 @@ static int _wrap_Session_destroy__SWIG_0(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->destroy((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6946,18 +7027,17 @@ fail:
 
 
 static int _wrap_Session_destroy__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("destroy",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::destroy",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::destroy",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->destroy();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7002,7 +7082,7 @@ static int _wrap_Session_destroy(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_destroy__SWIG_0(L);
@@ -7010,26 +7090,28 @@ static int _wrap_Session_destroy(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_destroy'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_destroy'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::destroy(char const *)\n"
+    "    LUA::Session::destroy()\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_begin_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("begin_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::begin_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::begin_allow_threads",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->begin_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7041,20 +7123,19 @@ fail:
 
 
 static int _wrap_Session_end_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("end_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::end_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::end_allow_threads",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->end_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7066,18 +7147,17 @@ fail:
 
 
 static int _wrap_Session_check_hangup_hook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("check_hangup_hook",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::check_hangup_hook",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::check_hangup_hook",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->check_hangup_hook();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7090,17 +7170,17 @@ fail:
 
 
 static int _wrap_Session_run_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
-  SWIG_check_num_args("run_dtmf_callback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"LUA::Session *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *");
-  if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t");
+  SWIG_check_num_args("LUA::Session::run_dtmf_callback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",1,"LUA::Session *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",2,"void *");
+  if(!lua_isuserdata(L,3)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",3,"switch_input_type_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_LUA__Session);
@@ -7114,9 +7194,8 @@ static int _wrap_Session_run_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -7130,18 +7209,17 @@ fail:
 
 
 static int _wrap_Session_unsetInputCallback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("unsetInputCallback",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("unsetInputCallback",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::unsetInputCallback",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::unsetInputCallback",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_unsetInputCallback",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->unsetInputCallback();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7154,15 +7232,15 @@ fail:
 
 
 static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setInputCallback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setInputCallback",3,"char *");
+  SWIG_check_num_args("LUA::Session::setInputCallback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setInputCallback",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setInputCallback",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::setInputCallback",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session);
@@ -7171,7 +7249,6 @@ static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setInputCallback(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7184,13 +7261,13 @@ fail:
 
 
 static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("setInputCallback",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *");
+  SWIG_check_num_args("LUA::Session::setInputCallback",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setInputCallback",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setInputCallback",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session);
@@ -7198,7 +7275,6 @@ static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->setInputCallback(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7229,7 +7305,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_setInputCallback__SWIG_1(L);
@@ -7248,11 +7324,11 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Session_setInputCallback__SWIG_0(L);
@@ -7261,21 +7337,24 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_setInputCallback'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_setInputCallback'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::setInputCallback(char *,char *)\n"
+    "    LUA::Session::setInputCallback(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setHangupHook",3,"char *");
+  SWIG_check_num_args("LUA::Session::setHangupHook",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setHangupHook",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setHangupHook",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::setHangupHook",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
@@ -7284,7 +7363,6 @@ static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setHangupHook(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7297,13 +7375,13 @@ fail:
 
 
 static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
+  SWIG_check_num_args("LUA::Session::setHangupHook",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setHangupHook",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setHangupHook",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
@@ -7311,7 +7389,6 @@ static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->setHangupHook(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7342,7 +7419,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_setHangupHook__SWIG_1(L);
@@ -7361,11 +7438,11 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Session_setHangupHook__SWIG_0(L);
@@ -7374,26 +7451,28 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_setHangupHook'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_setHangupHook'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::setHangupHook(char *,char *)\n"
+    "    LUA::Session::setHangupHook(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_ready(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("ready",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::ready",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::ready",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->ready();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7405,18 +7484,18 @@ fail:
 
 
 static int _wrap_Session_originate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   int result;
   
-  SWIG_check_num_args("originate",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int");
+  SWIG_check_num_args("LUA::Session::originate",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::originate",1,"LUA::Session *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::originate",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::originate",3,"char *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("LUA::Session::originate",4,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_originate",1,SWIGTYPE_p_LUA__Session);
@@ -7430,7 +7509,6 @@ static int _wrap_Session_originate(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (int)(arg1)->originate(arg2,arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -7443,13 +7521,13 @@ fail:
 
 
 static int _wrap_Session_cb_function_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("cb_function",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("cb_function",2,"char *");
+  SWIG_check_num_args("LUA::Session::cb_function",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_function",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::cb_function",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_LUA__Session);
@@ -7457,7 +7535,7 @@ static int _wrap_Session_cb_function_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->cb_function) delete [] arg1->cb_function;
+    delete [] arg1->cb_function;
     if (arg2) {
       arg1->cb_function = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->cb_function, (const char *)arg2);
@@ -7465,7 +7543,6 @@ static int _wrap_Session_cb_function_set(lua_State* L) {
       arg1->cb_function = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7478,20 +7555,19 @@ fail:
 
 
 static int _wrap_Session_cb_function_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("cb_function",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::cb_function",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_function",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->cb_function);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7503,13 +7579,13 @@ fail:
 
 
 static int _wrap_Session_cb_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("cb_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("cb_arg",2,"char *");
+  SWIG_check_num_args("LUA::Session::cb_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_arg",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::cb_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_LUA__Session);
@@ -7517,7 +7593,7 @@ static int _wrap_Session_cb_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->cb_arg) delete [] arg1->cb_arg;
+    delete [] arg1->cb_arg;
     if (arg2) {
       arg1->cb_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->cb_arg, (const char *)arg2);
@@ -7525,7 +7601,6 @@ static int _wrap_Session_cb_arg_set(lua_State* L) {
       arg1->cb_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7538,20 +7613,19 @@ fail:
 
 
 static int _wrap_Session_cb_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("cb_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::cb_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_arg",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->cb_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7563,13 +7637,13 @@ fail:
 
 
 static int _wrap_Session_hangup_func_str_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("hangup_func_str",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_str",2,"char *");
+  SWIG_check_num_args("LUA::Session::hangup_func_str",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_str",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::hangup_func_str",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_LUA__Session);
@@ -7577,7 +7651,7 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->hangup_func_str) delete [] arg1->hangup_func_str;
+    delete [] arg1->hangup_func_str;
     if (arg2) {
       arg1->hangup_func_str = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->hangup_func_str, (const char *)arg2);
@@ -7585,7 +7659,6 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) {
       arg1->hangup_func_str = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7598,20 +7671,19 @@ fail:
 
 
 static int _wrap_Session_hangup_func_str_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangup_func_str",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::hangup_func_str",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_str",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->hangup_func_str);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7623,13 +7695,13 @@ fail:
 
 
 static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("hangup_func_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_arg",2,"char *");
+  SWIG_check_num_args("LUA::Session::hangup_func_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_arg",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::hangup_func_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_LUA__Session);
@@ -7637,7 +7709,7 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->hangup_func_arg) delete [] arg1->hangup_func_arg;
+    delete [] arg1->hangup_func_arg;
     if (arg2) {
       arg1->hangup_func_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->hangup_func_arg, (const char *)arg2);
@@ -7645,7 +7717,6 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
       arg1->hangup_func_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7658,20 +7729,19 @@ fail:
 
 
 static int _wrap_Session_hangup_func_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangup_func_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::hangup_func_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_arg",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->hangup_func_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7683,20 +7753,19 @@ fail:
 
 
 static int _wrap_Session_setLUA(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   lua_State *arg2 = (lua_State *) 0 ;
   
   arg2 = L;
-  SWIG_check_num_args("setLUA",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::setLUA",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setLUA",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->setLUA(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7733,26 +7802,34 @@ static swig_lua_attribute swig_LUA_Session_attributes[] = {
     { "hangup_func_arg", _wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_LUA_Session_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_LUA_Session_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_LUA_Session_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_LUA_Session_bases[] = {0,0};
 static const char *swig_LUA_Session_base_names[] = {"CoreSession *",0};
-static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases, swig_LUA_Session_base_names };
+static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, { "Session", swig_LUA_Session_cls_methods, swig_LUA_Session_cls_attributes, swig_LUA_Session_cls_constants }, swig_LUA_Session_bases, swig_LUA_Session_base_names };
 
 static int _wrap_new_Dbh__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",3,3)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("LUA::Dbh",3,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",3,3)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::Dbh",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::Dbh",3,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7765,18 +7842,17 @@ fail:
 
 
 static int _wrap_new_Dbh__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",2,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::Dbh",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7789,15 +7865,14 @@ fail:
 
 
 static int _wrap_new_Dbh__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",1,1)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (LUA::Dbh *)new LUA::Dbh(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7819,7 +7894,7 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 1) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       return _wrap_new_Dbh__SWIG_2(L);
@@ -7828,11 +7903,11 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 2) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_new_Dbh__SWIG_1(L);
@@ -7842,15 +7917,15 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 3) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_new_Dbh__SWIG_0(L);
@@ -7859,51 +7934,29 @@ static int _wrap_new_Dbh(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Dbh'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Dbh'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Dbh::Dbh(char *,char *,char *)\n"
+    "    LUA::Dbh::Dbh(char *,char *)\n"
+    "    LUA::Dbh::Dbh(char *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Dbh(lua_State* L) {
-  int SWIG_arg = -1;
-  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
-  
-  SWIG_check_num_args("LUA::~Dbh",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Dbh",1,"LUA::Dbh *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Dbh",1,SWIGTYPE_p_LUA__Dbh);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Dbh_release(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   bool result;
   
-  SWIG_check_num_args("release",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("release",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::release",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::release",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_release",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (bool)(arg1)->release();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7915,20 +7968,19 @@ fail:
 
 
 static int _wrap_Dbh_connected(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   bool result;
   
-  SWIG_check_num_args("connected",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("connected",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::connected",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::connected",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_connected",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (bool)(arg1)->connected();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7940,18 +7992,18 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   char *arg4 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("test_reactive",4,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::test_reactive",3,"char *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("LUA::Dbh::test_reactive",4,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -7961,8 +8013,7 @@ static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (char *)lua_tostring(L, 4);
   result = (bool)(arg1)->test_reactive(arg2,arg3,arg4);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7974,16 +8025,16 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::test_reactive",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -7992,8 +8043,7 @@ static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (bool)(arg1)->test_reactive(arg2,arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -8005,14 +8055,14 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -8020,8 +8070,7 @@ static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->test_reactive(arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -8051,7 +8100,7 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Dbh_test_reactive__SWIG_2(L);
@@ -8070,11 +8119,11 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Dbh_test_reactive__SWIG_1(L);
@@ -8094,15 +8143,15 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
-            _v = lua_isstring(L,argv[3]);
+            _v = SWIG_lua_isnilstring(L,argv[3]);
           }
           if (_v) {
             return _wrap_Dbh_test_reactive__SWIG_0(L);
@@ -8112,13 +8161,17 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Dbh_test_reactive'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Dbh_test_reactive'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Dbh::test_reactive(char *,char *,char *)\n"
+    "    LUA::Dbh::test_reactive(char *,char *)\n"
+    "    LUA::Dbh::test_reactive(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Dbh_query(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   SWIGLUA_FN arg3 ;
@@ -8130,10 +8183,10 @@ static int _wrap_Dbh_query(lua_State* L) {
     };
     arg3 = default_swiglua_fn;
   }
-  SWIG_check_num_args("query",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("query",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("query",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg("query",3,"SWIGLUA_FN");
+  SWIG_check_num_args("LUA::Dbh::query",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::query",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::query",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg("LUA::Dbh::query",3,"SWIGLUA_FN");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_query",1,SWIGTYPE_p_LUA__Dbh);
@@ -8147,8 +8200,7 @@ static int _wrap_Dbh_query(lua_State* L) {
     }
   }
   result = (bool)(arg1)->query(arg2,arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -8160,19 +8212,18 @@ fail:
 
 
 static int _wrap_Dbh_affected_rows(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   int result;
   
-  SWIG_check_num_args("affected_rows",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("affected_rows",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::affected_rows",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::affected_rows",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_affected_rows",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (int)(arg1)->affected_rows();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -8185,14 +8236,14 @@ fail:
 
 
 static int _wrap_Dbh_load_extension(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   int result;
   
-  SWIG_check_num_args("load_extension",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("load_extension",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("load_extension",2,"char const *");
+  SWIG_check_num_args("LUA::Dbh::load_extension",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::load_extension",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::load_extension",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_load_extension",1,SWIGTYPE_p_LUA__Dbh);
@@ -8200,7 +8251,6 @@ static int _wrap_Dbh_load_extension(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (int)(arg1)->load_extension((char const *)arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -8228,9 +8278,18 @@ static swig_lua_method swig_LUA_Dbh_methods[] = {
 static swig_lua_attribute swig_LUA_Dbh_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_LUA_Dbh_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_LUA_Dbh_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_LUA_Dbh_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_LUA_Dbh_bases[] = {0};
 static const char *swig_LUA_Dbh_base_names[] = {0};
-static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names };
+static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, { "Dbh", swig_LUA_Dbh_cls_methods, swig_LUA_Dbh_cls_attributes, swig_LUA_Dbh_cls_constants }, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names };
 
 #ifdef __cplusplus
 }
@@ -8259,15 +8318,15 @@ static swig_lua_var_info swig_variables[] = {
 };
 
 static swig_lua_const_info swig_constants[] = {
-{ SWIG_LUA_INT,     (char *)"S_HUP", (long) S_HUP, 0, 0, 0},
-{ SWIG_LUA_INT,     (char *)"S_FREE", (long) S_FREE, 0, 0, 0},
-{ SWIG_LUA_INT,     (char *)"S_RDLOCK", (long) S_RDLOCK, 0, 0, 0},
+    {SWIG_LUA_CONSTTAB_INT("S_HUP", S_HUP)},
+    {SWIG_LUA_CONSTTAB_INT("S_FREE", S_FREE)},
+    {SWIG_LUA_CONSTTAB_INT("S_RDLOCK", S_RDLOCK)},
     {0,0,0,0,0,0}
 };
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *newmemory) {
+static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CoreSession *)  ((LUA::Session *) x));
 }
 static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0};
@@ -8280,7 +8339,7 @@ static swig_type_info _swigt__p_LUA__Dbh = {"_p_LUA__Dbh", "LUA::Dbh *", 0, 0, (
 static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session *", 0, 0, (void*)&_wrap_class_LUA_Session, 0};
 static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0};
-static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0};
+static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state, 0};
 static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0};
@@ -8403,18 +8462,18 @@ static swig_cast_info *swig_cast_initial[] = {
 
 /* -----------------------------------------------------------------------------
  * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
  * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
  * swig_module, and does all the lookup, filling in the swig_module.types
  * array with the correct data and linking the correct swig_cast_info
  * structures together.
  *
- * The generated swig_type_info structures are assigned staticly to an initial 
+ * The generated swig_type_info structures are assigned staticly to an initial
  * array. We just loop through that array, and handle each type individually.
  * First we lookup if this type has been already loaded, and if so, use the
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -8424,17 +8483,17 @@ static swig_cast_info *swig_cast_initial[] = {
  * a column is one of the swig_cast_info structures for that type.
  * The cast_initial array is actually an array of arrays, because each row has
  * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
+ * we find the array of casts associated with the type, and loop through it
  * adding the casts to the list. The one last trick we need to do is making
  * sure the type pointer in the swig_cast_info struct is correct.
  *
- * First off, we lookup the cast->type name to see if it is already loaded. 
+ * First off, we lookup the cast->type name to see if it is already loaded.
  * There are three cases to handle:
  *  1) If the cast->type has already been loaded AND the type we are adding
  *     casting info to has not been loaded (it is in this module), THEN we
  *     replace the cast->type pointer with the type pointer that has already
  *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
+ *  2) If BOTH types (the one we are adding casting info to, and the
  *     cast->type) are loaded, THEN the cast info has already been loaded by
  *     the previous module so we just ignore it.
  *  3) Finally, if cast->type has not already been loaded, then we add that
@@ -8460,8 +8519,6 @@ SWIG_InitializeModule(void *clientdata) {
   swig_module_info *module_head, *iter;
   int found, init;
 
-  clientdata = clientdata;
-
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
     /* Initialize the swig_module */
@@ -8499,7 +8556,7 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
 
-  /* When multiple interpeters are used, a module could have already been initialized in
+  /* When multiple interpreters are used, a module could have already been initialized in
      a different interpreter, but not yet have a pointer in this interpreter.
      In this case, we do not want to continue adding types... everything should be
      set up already */
@@ -8513,7 +8570,7 @@ SWIG_InitializeModule(void *clientdata) {
     swig_type_info *type = 0;
     swig_type_info *ret;
     swig_cast_info *cast;
-  
+
 #ifdef SWIGRUNTIME_DEBUG
     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
 #endif
@@ -8540,7 +8597,7 @@ SWIG_InitializeModule(void *clientdata) {
     /* Insert casting types */
     cast = swig_module.cast_initial[i];
     while (cast->type) {
-    
+
       /* Don't need to add information already in the list */
       ret = 0;
 #ifdef SWIGRUNTIME_DEBUG
@@ -8648,16 +8705,24 @@ extern "C" {
 #endif
 /* this is the initialization function
   added at the very end of the code
-  the function is always called SWIG_init, but an eariler #define will rename it
+  the function is always called SWIG_init, but an earlier #define will rename it
 */
-SWIGEXPORT int SWIG_init(lua_State* L)
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+LUALIB_API int SWIG_init(lua_State* L)
+#else
+SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
+#endif
 {
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
   int i;
   /* start with global table */
-  lua_pushglobaltable(L);
+  lua_pushglobaltable (L);
   /* SWIG's internal initalisation */
   SWIG_InitializeModule((void*)L);
   SWIG_PropagateClientData();
+#endif
+
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
   /* add a global fn */
   SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
   SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
@@ -8671,7 +8736,10 @@ SWIGEXPORT int SWIG_init(lua_State* L)
   for (i = 0; swig_variables[i].name; i++){
     SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
   }
-  /* set up base class pointers (the hierachy) */
+#endif
+
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
+  /* set up base class pointers (the hierarchy) */
   for (i = 0; swig_types[i]; i++){
     if (swig_types[i]->clientdata){
       SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
@@ -8683,14 +8751,24 @@ SWIGEXPORT int SWIG_init(lua_State* L)
       SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
     }
   }
+#endif
+
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
   /* constants */
   SWIG_Lua_InstallConstants(L,swig_constants);
+#endif
+
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
   /* invoke user-specific initialization */
   SWIG_init_user(L);
   /* end module */
-  lua_pop(L,1);  /* tidy stack (remove module table)*/
-  lua_pop(L,1);  /* tidy stack (remove global table)*/
+  /* Note: We do not clean up the stack here (Lua will do this for us). At this
+     point, we have the globals table and out module table on the stack. Returning
+     one value makes the module table the result of the require command. */
   return 1;
+#else
+  return 0;
+#endif
 }
 
 #ifdef __cplusplus
index 2bc1b2e86854031061922c88bdef9c413294ed5b..d1c768246207b3cd27e45a704df10e2729b5d1a4 100644 (file)
@@ -14160,6 +14160,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_mime_ext2type(char * jarg1) {
 }
 
 
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_core_mime_type2ext(char * jarg1) {
+  char * jresult ;
+  char *arg1 = (char *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  result = (char *)switch_core_mime_type2ext((char const *)arg1);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_mime_add_type(char * jarg1, char * jarg2) {
   int jresult ;
   char *arg1 = (char *) 0 ;
@@ -18618,6 +18630,24 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_needs_url_encode(char * jarg1) {
 }
 
 
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_url_encode_opt(char * jarg1, char * jarg2, unsigned long jarg3, int jarg4) {
+  char * jresult ;
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) 0 ;
+  size_t arg3 ;
+  switch_bool_t arg4 ;
+  char *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (size_t)jarg3; 
+  arg4 = (switch_bool_t)jarg4; 
+  result = (char *)switch_url_encode_opt((char const *)arg1,arg2,arg3,arg4);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
 SWIGEXPORT char * SWIGSTDCALL CSharp_switch_url_encode(char * jarg1, char * jarg2, unsigned long jarg3) {
   char * jresult ;
   char *arg1 = (char *) 0 ;
@@ -35067,37 +35097,41 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_change_sln_volume_granular(void * jarg
 }
 
 
-SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) {
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_merge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4, int jarg5) {
   unsigned long jresult ;
   int16_t *arg1 = (int16_t *) 0 ;
   uint32_t arg2 ;
   int16_t *arg3 = (int16_t *) 0 ;
   uint32_t arg4 ;
+  int arg5 ;
   uint32_t result;
   
   arg1 = (int16_t *)jarg1; 
   arg2 = (uint32_t)jarg2; 
   arg3 = (int16_t *)jarg3; 
   arg4 = (uint32_t)jarg4; 
-  result = (uint32_t)switch_merge_sln(arg1,arg2,arg3,arg4);
+  arg5 = (int)jarg5; 
+  result = (uint32_t)switch_merge_sln(arg1,arg2,arg3,arg4,arg5);
   jresult = (unsigned long)result; 
   return jresult;
 }
 
 
-SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_unmerge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4) {
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_unmerge_sln(void * jarg1, unsigned long jarg2, void * jarg3, unsigned long jarg4, int jarg5) {
   unsigned long jresult ;
   int16_t *arg1 = (int16_t *) 0 ;
   uint32_t arg2 ;
   int16_t *arg3 = (int16_t *) 0 ;
   uint32_t arg4 ;
+  int arg5 ;
   uint32_t result;
   
   arg1 = (int16_t *)jarg1; 
   arg2 = (uint32_t)jarg2; 
   arg3 = (int16_t *)jarg3; 
   arg4 = (uint32_t)jarg4; 
-  result = (uint32_t)switch_unmerge_sln(arg1,arg2,arg3,arg4);
+  arg5 = (int)jarg5; 
+  result = (uint32_t)switch_unmerge_sln(arg1,arg2,arg3,arg4,arg5);
   jresult = (unsigned long)result; 
   return jresult;
 }
@@ -35495,6 +35529,28 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_unicast_conninfo_stream_id_get(void * j
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_unicast_conninfo_thread_set(void * jarg1, void * jarg2) {
+  switch_unicast_conninfo *arg1 = (switch_unicast_conninfo *) 0 ;
+  switch_thread_t *arg2 = (switch_thread_t *) 0 ;
+  
+  arg1 = (switch_unicast_conninfo *)jarg1; 
+  arg2 = (switch_thread_t *)jarg2; 
+  if (arg1) (arg1)->thread = arg2;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_unicast_conninfo_thread_get(void * jarg1) {
+  void * jresult ;
+  switch_unicast_conninfo *arg1 = (switch_unicast_conninfo *) 0 ;
+  switch_thread_t *result = 0 ;
+  
+  arg1 = (switch_unicast_conninfo *)jarg1; 
+  result = (switch_thread_t *) ((arg1)->thread);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_unicast_conninfo() {
   void * jresult ;
   switch_unicast_conninfo *result = 0 ;
index b9338434cf24ec493b38a3922e9fb8f5894f4ddf..870abcaf07c66e0c049b3aafd7480a02250a7a6c 100644 (file)
@@ -2665,6 +2665,11 @@ public class freeswitch {
     return ret;
   }
 
+  public static string switch_core_mime_type2ext(string type) {
+    string ret = freeswitchPINVOKE.switch_core_mime_type2ext(type);
+    return ret;
+  }
+
   public static switch_status_t switch_core_mime_add_type(string type, string ext) {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_mime_add_type(type, ext);
     return ret;
@@ -3948,6 +3953,11 @@ public class freeswitch {
     return ret;
   }
 
+  public static string switch_url_encode_opt(string url, string buf, uint len, switch_bool_t double_encode) {
+    string ret = freeswitchPINVOKE.switch_url_encode_opt(url, buf, len, (int)double_encode);
+    return ret;
+  }
+
   public static string switch_url_encode(string url, string buf, uint len) {
     string ret = freeswitchPINVOKE.switch_url_encode(url, buf, len);
     return ret;
@@ -5344,13 +5354,13 @@ public class freeswitch {
     freeswitchPINVOKE.switch_change_sln_volume_granular(SWIGTYPE_p_short.getCPtr(data), samples, vol);
   }
 
-  public static uint switch_merge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) {
-    uint ret = freeswitchPINVOKE.switch_merge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples);
+  public static uint switch_merge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples, int channels) {
+    uint ret = freeswitchPINVOKE.switch_merge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples, channels);
     return ret;
   }
 
-  public static uint switch_unmerge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples) {
-    uint ret = freeswitchPINVOKE.switch_unmerge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples);
+  public static uint switch_unmerge_sln(SWIGTYPE_p_short data, uint samples, SWIGTYPE_p_short other_data, uint other_samples, int channels) {
+    uint ret = freeswitchPINVOKE.switch_unmerge_sln(SWIGTYPE_p_short.getCPtr(data), samples, SWIGTYPE_p_short.getCPtr(other_data), other_samples, channels);
     return ret;
   }
 
@@ -10886,6 +10896,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_mime_ext2type")]
   public static extern string switch_core_mime_ext2type(string jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_core_mime_type2ext")]
+  public static extern string switch_core_mime_type2ext(string jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_core_mime_add_type")]
   public static extern int switch_core_mime_add_type(string jarg1, string jarg2);
 
@@ -11918,6 +11931,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_needs_url_encode")]
   public static extern int switch_needs_url_encode(string jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_url_encode_opt")]
+  public static extern string switch_url_encode_opt(string jarg1, string jarg2, uint jarg3, int jarg4);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_url_encode")]
   public static extern string switch_url_encode(string jarg1, string jarg2, uint jarg3);
 
@@ -15981,10 +15997,10 @@ class freeswitchPINVOKE {
   public static extern void switch_change_sln_volume_granular(HandleRef jarg1, uint jarg2, int jarg3);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_merge_sln")]
-  public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4);
+  public static extern uint switch_merge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4, int jarg5);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_unmerge_sln")]
-  public static extern uint switch_unmerge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4);
+  public static extern uint switch_unmerge_sln(HandleRef jarg1, uint jarg2, HandleRef jarg3, uint jarg4, int jarg5);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_mux_channels")]
   public static extern void switch_mux_channels(HandleRef jarg1, HandleRef jarg2, uint jarg3, uint jarg4);
@@ -16085,6 +16101,12 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_unicast_conninfo_stream_id_get")]
   public static extern int switch_unicast_conninfo_stream_id_get(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_unicast_conninfo_thread_set")]
+  public static extern void switch_unicast_conninfo_thread_set(HandleRef jarg1, HandleRef jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_unicast_conninfo_thread_get")]
+  public static extern IntPtr switch_unicast_conninfo_thread_get(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_new_switch_unicast_conninfo")]
   public static extern IntPtr new_switch_unicast_conninfo();
 
@@ -24893,6 +24915,36 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class SWIGTYPE_p_switch_thread_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class SWIGTYPE_p_switch_time_exp_t {
   private HandleRef swigCPtr;
 
@@ -40476,6 +40528,17 @@ public class switch_unicast_conninfo : IDisposable {
     } 
   }
 
+  public SWIGTYPE_p_switch_thread_t thread {
+    set {
+      freeswitchPINVOKE.switch_unicast_conninfo_thread_set(swigCPtr, SWIGTYPE_p_switch_thread_t.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_unicast_conninfo_thread_get(swigCPtr);
+      SWIGTYPE_p_switch_thread_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_thread_t(cPtr, false);
+      return ret;
+    } 
+  }
+
   public switch_unicast_conninfo() : this(freeswitchPINVOKE.new_switch_unicast_conninfo(), true) {
   }
 
index f8b56f02bc22ab007910f2cc4e7e34d99888860c..6111f48f716734551a1cb75ea64dbc7caa00ca6d 100644 (file)
@@ -1,15 +1,16 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.35
+# Version 2.0.12
 #
-# Don't modify this file, modify the SWIG interface instead.
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
 
 package freeswitch;
-require Exporter;
-@ISA = qw(Exporter);
+use base qw(Exporter);
+package freeswitchc;
 package freeswitchc;
 boot_freeswitch();
 package freeswitch;
-@EXPORT = qw( );
+@EXPORT = qw();
 
 # ---------- BASE METHODS -------------
 
index e581200ba4a130a3a2da94335e8e3b5b64a53650..e7d790e9d995b655b745d820497301892456632e 100644 (file)
@@ -1,29 +1,33 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- * 
- * This file is not intended to be easily readable and contains a number of 
+ * Version 2.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
  * ----------------------------------------------------------------------------- */
 
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
 
+
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -62,14 +66,20 @@ template <typename T> T SwigValueInit() {
 #ifndef SWIGUNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#     define SWIGUNUSED __attribute__ ((__unused__))
 #   else
 #     define SWIGUNUSED
 #   endif
 # elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
+#   define SWIGUNUSED __attribute__ ((__unused__))
 # else
-#   define SWIGUNUSED 
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 # endif
 #endif
 
@@ -77,7 +87,7 @@ template <typename T> T SwigValueInit() {
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 # else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
 # endif
 #endif
 
@@ -120,7 +130,7 @@ template <typename T> T SwigValueInit() {
 #   define SWIGSTDCALL __stdcall
 # else
 #   define SWIGSTDCALL
-# endif 
+# endif
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -137,7 +147,7 @@ template <typename T> T SwigValueInit() {
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -156,11 +166,11 @@ template <typename T> T SwigValueInit() {
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -184,17 +194,17 @@ template <typename T> T SwigValueInit() {
 #define SWIG_POINTER_OWN           0x1
 
 
-/* 
+/*
    Flags/methods for returning states.
-   
-   The swig conversion methods, as ConvertPtr, return and integer 
+
+   The SWIG conversion methods, as ConvertPtr, return an integer
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
-   
+
    Use the following macros/flags to set or process the returning
    states.
-   
-   In old swig versions, you usually write code as:
+
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -202,7 +212,7 @@ template <typename T> T SwigValueInit() {
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -211,7 +221,7 @@ template <typename T> T SwigValueInit() {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -226,28 +236,28 @@ template <typename T> T SwigValueInit() {
     } else {
       // fail code
     }
-    
+
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {         
-        if (<obj is ok>) {                            
-          if (<need new object>) {                    
-            *ptr = <ptr to new allocated object>; 
-            return SWIG_NEWOBJ;                       
-          } else {                                    
-            *ptr = <ptr to old object>;               
-            return SWIG_OLDOBJ;                       
-          }                                   
-        } else {                                      
-          return SWIG_BADOBJ;                 
-        }                                             
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {
+        if (<obj is ok>) {
+          if (<need new object>) {
+            *ptr = <ptr to new allocated object>;
+            return SWIG_NEWOBJ;
+          } else {
+            *ptr = <ptr to old object>;
+            return SWIG_OLDOBJ;
+          }
+        } else {
+          return SWIG_BADOBJ;
+        }
       }
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -256,18 +266,17 @@ template <typename T> T SwigValueInit() {
        int fooi(int);
 
    and you call
+
       food(1)   // cast rank '1'  (1 -> 1.0)
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
-#define SWIG_OK                    (0) 
+#define SWIG_OK                    (0)
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
 
 /* The CastRankLimit says how many bits are used for the cast rank */
 #define SWIG_CASTRANKLIMIT         (1 << 8)
@@ -288,7 +297,6 @@ template <typename T> T SwigValueInit() {
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -299,20 +307,18 @@ template <typename T> T SwigValueInit() {
 #  endif
 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 }
-SWIGINTERNINLINE int SWIG_CheckState(int r) { 
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
 }
 #else /* no cast-rank mode */
-#  define SWIG_AddCast
+#  define SWIG_AddCast(r) (r)
 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -352,7 +358,7 @@ typedef struct swig_module_info {
   void                    *clientdata;         /* Language specific module data */
 } swig_module_info;
 
-/* 
+/*
   Compare two type names skipping the space characters, therefore
   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
@@ -372,18 +378,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 */
 SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
+SWIG_TypeCmp(const char *nb, const char *tb) {
+  int equiv = 1;
   const char* te = tb + strlen(tb);
   const char* ne = nb;
-  while (!equiv && *ne) {
+  while (equiv != 0 && *ne) {
     for (nb = ne; *ne; ++ne) {
       if (*ne == '|') break;
     }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
     if (*ne) ++ne;
   }
   return equiv;
@@ -391,58 +397,65 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+  Return 0 if not equal, 1 if equal
 */
 SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
 }
 
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/*
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -453,7 +466,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
-/* 
+/*
    Dynamic pointer casting. Down an inheritance hierarchy
 */
 SWIGRUNTIME swig_type_info *
@@ -497,7 +510,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
     return type->name;
 }
 
-/* 
+/*
    Set the clientdata field for a type
 */
 SWIGRUNTIME void
@@ -505,14 +518,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
   swig_cast_info *cast = ti->cast;
   /* if (ti->clientdata == clientdata) return; */
   ti->clientdata = clientdata;
-  
+
   while (cast) {
     if (!cast->converter) {
       swig_type_info *tc = cast->type;
       if (!tc->clientdata) {
        SWIG_TypeClientData(tc, clientdata);
       }
-    }    
+    }
     cast = cast->next;
   }
 }
@@ -521,18 +534,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
   SWIG_TypeClientData(ti, clientdata);
   ti->owndata = 1;
 }
-  
+
 /*
   Search for a swig_type_info structure only by mangled name
   Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+                            swig_module_info *end,
                            const char *name) {
   swig_module_info *iter = start;
   do {
@@ -541,11 +554,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
       register size_t r = iter->size - 1;
       do {
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
-       register size_t i = (l + r) >> 1; 
+       register size_t i = (l + r) >> 1;
        const char *iname = iter->types[i]->name;
        if (iname) {
          register int compare = strcmp(name, iname);
-         if (compare == 0) {       
+         if (compare == 0) {
            return iter->types[i];
          } else if (compare < 0) {
            if (i) {
@@ -570,14 +583,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
   Search for a swig_type_info structure for either a mangled name or a human readable name.
   It first searches the mangled names of the types, which is a O(log #types)
   If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
+SWIG_TypeQueryModule(swig_module_info *start,
+                     swig_module_info *end,
                     const char *name) {
   /* STEP 1: Search the name field using binary search */
   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -596,12 +609,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
       iter = iter->next;
     } while (iter != end);
   }
-  
+
   /* neither found a match */
   return 0;
 }
 
-/* 
+/*
    Pack binary data into a string
 */
 SWIGRUNTIME char *
@@ -617,7 +630,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
   return c;
 }
 
-/* 
+/*
    Unpack binary data from a string
 */
 SWIGRUNTIME const char *
@@ -631,21 +644,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
       uu = ((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
       uu = ((d - ('a'-10)) << 4);
-    else 
+    else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu |= (d - '0');
     else if ((d >= 'a') && (d <= 'f'))
       uu |= (d - ('a'-10));
-    else 
+    else
       return (char *) 0;
     *u = uu;
   }
   return c;
 }
 
-/* 
+/*
    Pack 'void *' into a string buffer.
 */
 SWIGRUNTIME char *
@@ -705,18 +718,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 #endif
 
 /*  Errors in SWIG */
-#define  SWIG_UnknownError        -1 
-#define  SWIG_IOError             -2 
-#define  SWIG_RuntimeError        -3 
-#define  SWIG_IndexError          -4 
-#define  SWIG_TypeError           -5 
-#define  SWIG_DivisionByZero      -6 
-#define  SWIG_OverflowError       -7 
-#define  SWIG_SyntaxError         -8 
-#define  SWIG_ValueError          -9 
+#define  SWIG_UnknownError        -1
+#define  SWIG_IOError             -2
+#define  SWIG_RuntimeError        -3
+#define  SWIG_IndexError          -4
+#define  SWIG_TypeError           -5
+#define  SWIG_DivisionByZero      -6
+#define  SWIG_OverflowError       -7
+#define  SWIG_SyntaxError         -8
+#define  SWIG_ValueError          -9
 #define  SWIG_SystemError         -10
 #define  SWIG_AttributeError      -11
-#define  SWIG_MemoryError         -12 
+#define  SWIG_MemoryError         -12
 #define  SWIG_NullReferenceError   -13
 
 
@@ -830,50 +843,35 @@ extern "C" {
 
 SWIGINTERN const char*
 SWIG_Perl_ErrorType(int code) {
-  const char* type = 0;
   switch(code) {
   case SWIG_MemoryError:
-    type = "MemoryError";
-    break;
+    return "MemoryError";
   case SWIG_IOError:
-    type = "IOError";
-    break;
+    return "IOError";
   case SWIG_RuntimeError:
-    type = "RuntimeError";
-    break;
+    return "RuntimeError";
   case SWIG_IndexError:
-    type = "IndexError";
-    break;
+    return "IndexError";
   case SWIG_TypeError:
-    type = "TypeError";
-    break;
+    return "TypeError";
   case SWIG_DivisionByZero:
-    type = "ZeroDivisionError";
-    break;
+    return "ZeroDivisionError";
   case SWIG_OverflowError:
-    type = "OverflowError";
-    break;
+    return "OverflowError";
   case SWIG_SyntaxError:
-    type = "SyntaxError";
-    break;
+    return "SyntaxError";
   case SWIG_ValueError:
-    type = "ValueError";
-    break;
+    return "ValueError";
   case SWIG_SystemError:
-    type = "SystemError";
-    break;
+    return "SystemError";
   case SWIG_AttributeError:
-    type = "AttributeError";
-    break;
+    return "AttributeError";
   default:
-    type = "RuntimeError";
+    return "RuntimeError";
   }
-  return type;
 }
 
 
-
-
 /* -----------------------------------------------------------------------------
  * perlrun.swg
  *
@@ -894,6 +892,7 @@ SWIG_Perl_ErrorType(int code) {
 
 /* for raw pointers */
 #define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
 #define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
 
 /* for raw packed data */
@@ -915,14 +914,14 @@ SWIG_Perl_ErrorType(int code) {
 
 /* Runtime API */
 
-#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule(clientdata)
 #define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
 
 
 /* Error manipulation */
 
 #define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
-#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_Error(code, msg)                          sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
 #define SWIG_fail                                      goto fail                                                   
 
 /* Perl-specific SWIG API */
@@ -1016,8 +1015,6 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
 #endif /* MULTIPLICITY */
 #endif /* PERL_OBJECT */
 
-/* Workaround for bug in perl 5.6.x croak and earlier */
-#if (PERL_VERSION < 8)
 #  ifdef PERL_OBJECT
 #    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
 static void SWIG_Perl_croak_null(CPerlObj *pPerl)
@@ -1025,17 +1022,16 @@ static void SWIG_Perl_croak_null(CPerlObj *pPerl)
 static void SWIG_croak_null()
 #  endif
 {
-  SV *err=ERRSV;
+  SV *err = get_sv("@", GV_ADD);
 #  if (PERL_VERSION < 6)
   croak("%_", err);
 #  else
-  if (SvOK(err) && !SvROK(err)) croak("%_", err);
-  croak(Nullch);
+  if (sv_isobject(err))
+    croak(0);
+  else
+    croak("%s", SvPV_nolen(err));
 #  endif
 }
-#else
-#  define SWIG_croak_null() croak(Nullch)
-#endif
 
 
 /* 
@@ -1081,20 +1077,42 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) {
   }
 }
 
+/* Identical to SWIG_TypeCheck, except for strcmp comparison */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) 
-                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-
 /* Function for getting a pointer value */
 
 SWIGRUNTIME int
-SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
   swig_cast_info *tc;
   void *voidptr = (void *)0;
   SV *tsv = 0;
+
+  if (own)
+    *own = 0;
+
   /* If magical, apply more magic */
   if (SvGMAGICAL(sv))
     mg_get(sv);
@@ -1126,8 +1144,14 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
     return SWIG_OK;
   } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
     if (!SvROK(sv)) {
-      *(ptr) = (void *) 0;
-      return SWIG_OK;
+      /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value.  */
+      if (SvIOK(sv)) {
+        return SWIG_ERROR;
+      } else {
+        /* NULL pointer (reference to undef). */
+        *(ptr) = (void *) 0;
+        return SWIG_OK;
+      }
     } else {
       return SWIG_ERROR;
     }
@@ -1144,7 +1168,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
     {
       int newmemory = 0;
       *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
-      assert(!newmemory); /* newmemory handling not yet implemented */
+      if (newmemory == SWIG_CAST_NEW_MEMORY) {
+        assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
+        if (own)
+          *own = *own | SWIG_CAST_NEW_MEMORY;
+      }
     }
   } else {
     *ptr = voidptr;
@@ -1159,7 +1187,7 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
      */
     SV *obj = sv;
     HV *stash = SvSTASH(SvRV(obj));
-    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
     if (isGV(gv)) {
       HV *hv = GvHVn(gv);
       /*
@@ -1174,18 +1202,23 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
   return SWIG_OK;
 }
 
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
+}
+
 SWIGRUNTIME void
 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
-  if (ptr && (flags & SWIG_SHADOW)) {
+  if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
     SV *self;
     SV *obj=newSV(0);
     HV *hash=newHV();
     HV *stash;
-    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
     stash=SvSTASH(SvRV(obj));
     if (flags & SWIG_POINTER_OWN) {
       HV *hv;
-      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
       if (!isGV(gv))
         gv_init(gv, stash, "OWNER", 5, FALSE);
       hv=GvHVn(gv);
@@ -1199,7 +1232,7 @@ SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, i
     sv_bless(sv, stash);
   }
   else {
-    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
   }
 }
 
@@ -1290,19 +1323,23 @@ typedef struct {
 
 /* Magic variable code */
 #ifndef PERL_OBJECT
-#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
-  #ifndef MULTIPLICITY
-     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
-  #else
-     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
-  #endif
+# ifdef __cplusplus
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
+# else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
+# endif
+# ifndef MULTIPLICITY
+SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+# else
+SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+# endif
 #else
 #  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
 #endif
 {
   MAGIC *mg;
-  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  sv_magic(sv,sv,'U',name,strlen(name));
   mg = mg_find(sv,'U');
   mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
@@ -1314,7 +1351,7 @@ SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, i
 
 
 SWIGRUNTIME swig_module_info *
-SWIG_Perl_GetModule(void) {
+SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
   static void *type_pointer = (void *)0;
   SV *pointer;
 
@@ -1351,6 +1388,9 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef do_close
   #undef do_close
 #endif
+#ifdef do_exec
+  #undef do_exec
+#endif
 #ifdef scalar
   #undef scalar
 #endif
@@ -1405,9 +1445,6 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef eof
   #undef eof
 #endif
-#ifdef bool
-  #undef bool
-#endif
 #ifdef close
   #undef close
 #endif
@@ -1435,6 +1472,26 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef open
   #undef open
 #endif
+#ifdef readdir
+  #undef readdir
+#endif
+#ifdef bind
+  #undef bind
+#endif
+#ifdef access
+  #undef access
+#endif
+#ifdef stat
+  #undef stat
+#endif
+
+#ifdef bool
+  /* Leave if macro is from C99 stdbool.h */
+  #ifndef __bool_true_false_are_defined
+    #undef bool
+  #endif
+#endif
+
 
 
 
@@ -1487,7 +1544,7 @@ static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0};
 #define SWIG_name   "freeswitchc::boot_freeswitch"
 #define SWIG_prefix "freeswitchc::"
 
-#define SWIGVERSION 0x010335 
+#define SWIGVERSION 0x020012 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -1532,6 +1589,11 @@ SWIG_pchar_descriptor(void)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 {
+  if (SvMAGICAL(obj)) {
+     SV *tmp = sv_newmortal();
+     SvSetSV(tmp, obj);
+     obj = tmp;
+  }
   if (SvPOK(obj)) {
     STRLEN len = 0;
     char *cstr = SvPV(obj, len); 
@@ -1610,7 +1672,9 @@ SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
     const char *nptr = SvPV_nolen(obj);
     if (nptr) {
       char *endptr;
-      double v = strtod(nptr, &endptr);
+      double v;
+      errno = 0;
+      v = strtod(nptr, &endptr);
       if (errno == ERANGE) {
        errno = 0;
        return SWIG_OverflowError;
@@ -1665,9 +1729,20 @@ SWIG_CanCastAsInteger(double *d, double min, double max) {
 SWIGINTERN int
 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
 {
-  if (SvIOK(obj)) {
-    if (val) *val = SvIV(obj);
-    return SWIG_OK;
+  if (SvUOK(obj)) {
+    UV v = SvUV(obj);
+    if (v <= LONG_MAX) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+    return SWIG_OverflowError;
+  } else if (SvIOK(obj)) {
+    IV v = SvIV(obj);
+    if (v >= LONG_MIN && v <= LONG_MAX) {
+      if(val) *val = v;
+      return SWIG_OK;
+    }
+    return SWIG_OverflowError;
   } else {
     int dispatch = 0;
     const char *nptr = SvPV_nolen(obj);
@@ -1717,23 +1792,20 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
 
 SWIGINTERNINLINE SV *
 SWIG_From_bool  SWIG_PERL_DECL_ARGS_1(bool value)
-{    
-  SV *obj = sv_newmortal();
-  if (value) {
-    sv_setsv(obj, &PL_sv_yes);
-  } else {
-    sv_setsv(obj, &PL_sv_no); 
-  }
-  return obj;
+{
+  return boolSV(value);
 }
 
 
 SWIGINTERNINLINE SV *
 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
-{    
-  SV *obj = sv_newmortal();
-  sv_setiv(obj, (IV) value);
-  return obj;
+{
+  SV *sv;
+  if (value >= IV_MIN && value <= IV_MAX)
+    sv = newSViv(value);
+  else
+    sv = newSVpvf("%ld", value);
+  return sv_2mortal(sv);
 }
 
 
@@ -1798,16 +1870,19 @@ SWIGINTERN int
 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
 {
   if (SvUOK(obj)) {
-    if (val) *val = SvUV(obj);
-    return SWIG_OK;
-  } else  if (SvIOK(obj)) {
-    long v = SvIV(obj);
-    if (v >= 0) {
+    UV v = SvUV(obj);
+    if (v <= ULONG_MAX) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+    return SWIG_OverflowError;
+  } else if (SvIOK(obj)) {
+    IV v = SvIV(obj);
+    if (v >= 0 && v <= ULONG_MAX) {
       if (val) *val = v;
       return SWIG_OK;
-    } else {
-      return SWIG_OverflowError;
     }
+    return SWIG_OverflowError;
   } else {
     int dispatch = 0;
     const char *nptr = SvPV_nolen(obj);
@@ -1857,10 +1932,13 @@ SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val)
 
 SWIGINTERNINLINE SV *
 SWIG_From_unsigned_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long value)
-{    
-  SV *obj = sv_newmortal();
-  sv_setuv(obj, (UV) value);
-  return obj;
+{
+  SV *sv;
+  if (value <= UV_MAX)
+    sv = newSVuv(value);
+  else
+    sv = newSVpvf("%lu", value);
+  return sv_2mortal(sv);
 }
 
 
@@ -1881,10 +1959,9 @@ SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val)
     if (val) *val = false;
     return SWIG_OK;
   } else {
-    if (val) *val = SvTRUE(obj) ? true: false;
+    if (val) *val = SvTRUE(obj) ? true : false;
     return SWIG_AddCast(SWIG_OK);    
   }
-  return SWIG_TypeError;
 }
 
 #ifdef __cplusplus
@@ -1943,7 +2020,7 @@ XS(_wrap_setGlobalVariable) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     setGlobalVariable(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -1958,11 +2035,11 @@ XS(_wrap_setGlobalVariable) {
 XS(_wrap_getGlobalVariable) {
   {
     char *arg1 = (char *) 0 ;
-    char *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -2012,7 +2089,7 @@ XS(_wrap_consoleLog) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     consoleLog(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -2077,7 +2154,7 @@ XS(_wrap_consoleLog2) {
     }
     arg5 = reinterpret_cast< char * >(buf5);
     consoleLog2(arg1,arg2,arg3,arg4,arg5);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -2113,7 +2190,7 @@ XS(_wrap_consoleCleanLog) {
     }
     arg1 = reinterpret_cast< char * >(buf1);
     consoleCleanLog(arg1);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     XSRETURN(argvi);
   fail:
@@ -2125,8 +2202,8 @@ XS(_wrap_consoleCleanLog) {
 
 XS(_wrap_running) {
   {
-    bool result;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 0) || (items > 0)) {
@@ -2150,7 +2227,6 @@ XS(_wrap_email) {
     char *arg5 = (char *) NULL ;
     char *arg6 = (char *) NULL ;
     char *arg7 = (char *) NULL ;
-    bool result;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -2173,6 +2249,7 @@ XS(_wrap_email) {
     char *buf7 = 0 ;
     int alloc7 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 2) || (items > 7)) {
@@ -2265,7 +2342,6 @@ XS(_wrap_new_IVRMenu) {
     int arg15 ;
     int arg16 ;
     int arg17 ;
-    IVRMenu *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -2311,6 +2387,7 @@ XS(_wrap_new_IVRMenu) {
     int val17 ;
     int ecode17 = 0 ;
     int argvi = 0;
+    IVRMenu *result = 0 ;
     dXSARGS;
     
     if ((items < 17) || (items > 17)) {
@@ -2461,8 +2538,7 @@ XS(_wrap_delete_IVRMenu) {
     }
     arg1 = reinterpret_cast< IVRMenu * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -2516,7 +2592,7 @@ XS(_wrap_IVRMenu_bindAction) {
     }
     arg4 = reinterpret_cast< char * >(buf4);
     (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -2566,7 +2642,7 @@ XS(_wrap_IVRMenu_execute) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->execute(arg2,(char const *)arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -2583,10 +2659,10 @@ XS(_wrap_IVRMenu_execute) {
 XS(_wrap_new_API) {
   {
     CoreSession *arg1 = (CoreSession *) NULL ;
-    API *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    API *result = 0 ;
     dXSARGS;
     
     if ((items < 0) || (items > 1)) {
@@ -2627,8 +2703,7 @@ XS(_wrap_delete_API) {
     }
     arg1 = reinterpret_cast< API * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -2643,7 +2718,6 @@ XS(_wrap_API_execute) {
     API *arg1 = (API *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) NULL ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -2653,6 +2727,7 @@ XS(_wrap_API_execute) {
     char *buf3 = 0 ;
     int alloc3 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 3)) {
@@ -2695,13 +2770,13 @@ XS(_wrap_API_executeString) {
   {
     API *arg1 = (API *) 0 ;
     char *arg2 = (char *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -2734,10 +2809,10 @@ XS(_wrap_API_executeString) {
 XS(_wrap_API_getTime) {
   {
     API *arg1 = (API *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -2761,7 +2836,7 @@ XS(_wrap_API_getTime) {
 
 XS(_wrap_input_callback_state_t_function_set) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *arg2 = (void *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2774,16 +2849,15 @@ XS(_wrap_input_callback_state_t_function_set) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_function_set" "', argument " "2"" of type '" "void *""'"); 
     }
     if (arg1) (arg1)->function = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -2797,11 +2871,11 @@ XS(_wrap_input_callback_state_t_function_set) {
 
 XS(_wrap_input_callback_state_t_function_get) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-    void *result = 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    void *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -2809,9 +2883,9 @@ XS(_wrap_input_callback_state_t_function_get) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     result = (void *) ((arg1)->function);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
     
@@ -2825,7 +2899,7 @@ XS(_wrap_input_callback_state_t_function_get) {
 
 XS(_wrap_input_callback_state_t_threadState_set) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *arg2 = (void *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2838,16 +2912,15 @@ XS(_wrap_input_callback_state_t_threadState_set) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_threadState_set" "', argument " "2"" of type '" "void *""'"); 
     }
     if (arg1) (arg1)->threadState = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -2861,11 +2934,11 @@ XS(_wrap_input_callback_state_t_threadState_set) {
 
 XS(_wrap_input_callback_state_t_threadState_get) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-    void *result = 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    void *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -2873,9 +2946,9 @@ XS(_wrap_input_callback_state_t_threadState_get) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     result = (void *) ((arg1)->threadState);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
     
@@ -2889,7 +2962,7 @@ XS(_wrap_input_callback_state_t_threadState_get) {
 
 XS(_wrap_input_callback_state_t_extra_set) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *arg2 = (void *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2902,16 +2975,15 @@ XS(_wrap_input_callback_state_t_extra_set) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_extra_set" "', argument " "2"" of type '" "void *""'"); 
     }
     if (arg1) (arg1)->extra = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -2925,11 +2997,11 @@ XS(_wrap_input_callback_state_t_extra_set) {
 
 XS(_wrap_input_callback_state_t_extra_get) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-    void *result = 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    void *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -2937,9 +3009,9 @@ XS(_wrap_input_callback_state_t_extra_get) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     result = (void *) ((arg1)->extra);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
     
@@ -2953,7 +3025,7 @@ XS(_wrap_input_callback_state_t_extra_get) {
 
 XS(_wrap_input_callback_state_t_funcargs_set) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     char *arg2 = (char *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
@@ -2968,9 +3040,9 @@ XS(_wrap_input_callback_state_t_funcargs_set) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_funcargs_set" "', argument " "2"" of type '" "char *""'");
@@ -2983,7 +3055,7 @@ XS(_wrap_input_callback_state_t_funcargs_set) {
     } else {
       arg1->funcargs = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -2997,11 +3069,11 @@ XS(_wrap_input_callback_state_t_funcargs_set) {
 
 XS(_wrap_input_callback_state_t_funcargs_get) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-    char *result = 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3009,9 +3081,9 @@ XS(_wrap_input_callback_state_t_funcargs_get) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     result = (char *) ((arg1)->funcargs);
     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
     
@@ -3025,14 +3097,14 @@ XS(_wrap_input_callback_state_t_funcargs_get) {
 
 XS(_wrap_new_input_callback_state_t) {
   {
-    input_callback_state_t *result = 0 ;
     int argvi = 0;
+    input_callback_state *result = 0 ;
     dXSARGS;
     
     if ((items < 0) || (items > 0)) {
       SWIG_croak("Usage: new_input_callback_state_t();");
     }
-    result = (input_callback_state_t *)new input_callback_state_t();
+    result = (input_callback_state *)new input_callback_state();
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_input_callback_state, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     XSRETURN(argvi);
   fail:
@@ -3043,7 +3115,7 @@ XS(_wrap_new_input_callback_state_t) {
 
 XS(_wrap_delete_input_callback_state_t) {
   {
-    input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+    input_callback_state *arg1 = (input_callback_state *) 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
@@ -3054,12 +3126,11 @@ XS(_wrap_delete_input_callback_state_t) {
     }
     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_input_callback_state, SWIG_POINTER_DISOWN |  0 );
     if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state_t" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state_t" "', argument " "1"" of type '" "input_callback_state *""'"); 
     }
-    arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+    arg1 = reinterpret_cast< input_callback_state * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -3094,8 +3165,7 @@ XS(_wrap_DTMF_digit_set) {
     } 
     arg2 = static_cast< char >(val2);
     if (arg1) (arg1)->digit = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -3110,10 +3180,10 @@ XS(_wrap_DTMF_digit_set) {
 XS(_wrap_DTMF_digit_get) {
   {
     DTMF *arg1 = (DTMF *) 0 ;
-    char result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3166,8 +3236,7 @@ XS(_wrap_DTMF_duration_set) {
       }
     }
     if (arg1) (arg1)->duration = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -3180,10 +3249,10 @@ XS(_wrap_DTMF_duration_set) {
 XS(_wrap_DTMF_duration_get) {
   {
     DTMF *arg1 = (DTMF *) 0 ;
-    uint32_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    uint32_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3209,12 +3278,12 @@ XS(_wrap_new_DTMF) {
   {
     char arg1 ;
     uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
-    DTMF *result = 0 ;
     char val1 ;
     int ecode1 = 0 ;
     void *argp2 ;
     int res2 = 0 ;
     int argvi = 0;
+    DTMF *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -3266,8 +3335,7 @@ XS(_wrap_delete_DTMF) {
     }
     arg1 = reinterpret_cast< DTMF * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -3279,8 +3347,8 @@ XS(_wrap_delete_DTMF) {
 
 XS(_wrap_new_Stream__SWIG_0) {
   {
-    Stream *result = 0 ;
     int argvi = 0;
+    Stream *result = 0 ;
     dXSARGS;
     
     if ((items < 0) || (items > 0)) {
@@ -3298,10 +3366,10 @@ XS(_wrap_new_Stream__SWIG_0) {
 XS(_wrap_new_Stream__SWIG_1) {
   {
     switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
-    Stream *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    Stream *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3361,9 +3429,9 @@ XS(_wrap_new_Stream) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Stream__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Stream__SWIG_0); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Stream__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Stream__SWIG_1); return;
     }
   }
   
@@ -3389,8 +3457,7 @@ XS(_wrap_delete_Stream) {
     }
     arg1 = reinterpret_cast< Stream * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -3404,12 +3471,12 @@ XS(_wrap_Stream_read) {
   {
     Stream *arg1 = (Stream *) 0 ;
     int *arg2 = (int *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     void *argp2 = 0 ;
     int res2 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -3464,7 +3531,7 @@ XS(_wrap_Stream_write) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     (arg1)->write((char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -3510,7 +3577,7 @@ XS(_wrap_Stream_raw_write) {
     } 
     arg3 = static_cast< int >(val3);
     (arg1)->raw_write((char const *)arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     
@@ -3527,10 +3594,10 @@ XS(_wrap_Stream_raw_write) {
 XS(_wrap_Stream_get_data) {
   {
     Stream *arg1 = (Stream *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3577,8 +3644,7 @@ XS(_wrap_Event_event_set) {
     }
     arg2 = reinterpret_cast< switch_event_t * >(argp2);
     if (arg1) (arg1)->event = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -3593,10 +3659,10 @@ XS(_wrap_Event_event_set) {
 XS(_wrap_Event_event_get) {
   {
     Event *arg1 = (Event *) 0 ;
-    switch_event_t *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_event_t *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3650,7 +3716,7 @@ XS(_wrap_Event_serialized_string_set) {
     } else {
       arg1->serialized_string = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -3665,10 +3731,10 @@ XS(_wrap_Event_serialized_string_set) {
 XS(_wrap_Event_serialized_string_get) {
   {
     Event *arg1 = (Event *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3715,8 +3781,7 @@ XS(_wrap_Event_mine_set) {
     } 
     arg2 = static_cast< int >(val2);
     if (arg1) (arg1)->mine = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -3731,10 +3796,10 @@ XS(_wrap_Event_mine_set) {
 XS(_wrap_Event_mine_get) {
   {
     Event *arg1 = (Event *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -3760,7 +3825,6 @@ XS(_wrap_new_Event__SWIG_0) {
   {
     char *arg1 = (char *) 0 ;
     char *arg2 = (char *) NULL ;
-    Event *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -3768,6 +3832,7 @@ XS(_wrap_new_Event__SWIG_0) {
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    Event *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -3802,12 +3867,12 @@ XS(_wrap_new_Event__SWIG_1) {
   {
     switch_event_t *arg1 = (switch_event_t *) 0 ;
     int arg2 = (int) 0 ;
-    Event *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
     int ecode2 = 0 ;
     int argvi = 0;
+    Event *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -3910,9 +3975,9 @@ XS(_wrap_new_Event) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Event__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Event__SWIG_1); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Event__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Event__SWIG_0); return;
     }
   }
   
@@ -3938,8 +4003,7 @@ XS(_wrap_delete_Event) {
     }
     arg1 = reinterpret_cast< Event * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -3954,7 +4018,6 @@ XS(_wrap_Event_chat_execute) {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) NULL ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -3964,6 +4027,7 @@ XS(_wrap_Event_chat_execute) {
     char *buf3 = 0 ;
     int alloc3 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 3)) {
@@ -4005,13 +4069,13 @@ XS(_wrap_Event_chat_send) {
   {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) NULL ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -4046,13 +4110,13 @@ XS(_wrap_Event_serialize) {
   {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) NULL ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -4087,12 +4151,12 @@ XS(_wrap_Event_setPriority) {
   {
     Event *arg1 = (Event *) 0 ;
     switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     void *argp2 ;
     int res2 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 2)) {
@@ -4131,13 +4195,13 @@ XS(_wrap_Event_getHeader) {
   {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -4169,10 +4233,10 @@ XS(_wrap_Event_getHeader) {
 XS(_wrap_Event_getBody) {
   {
     Event *arg1 = (Event *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4197,10 +4261,10 @@ XS(_wrap_Event_getBody) {
 XS(_wrap_Event_getType) {
   {
     Event *arg1 = (Event *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4226,13 +4290,13 @@ XS(_wrap_Event_addBody) {
   {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -4266,7 +4330,6 @@ XS(_wrap_Event_addHeader) {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -4276,6 +4339,7 @@ XS(_wrap_Event_addHeader) {
     char *buf3 = 0 ;
     int alloc3 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 3) || (items > 3)) {
@@ -4315,13 +4379,13 @@ XS(_wrap_Event_delHeader) {
   {
     Event *arg1 = (Event *) 0 ;
     char *arg2 = (char *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -4353,10 +4417,10 @@ XS(_wrap_Event_delHeader) {
 XS(_wrap_Event_fire) {
   {
     Event *arg1 = (Event *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4403,8 +4467,7 @@ XS(_wrap_EventConsumer_events_set) {
     }
     arg2 = reinterpret_cast< switch_queue_t * >(argp2);
     if (arg1) (arg1)->events = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -4419,10 +4482,10 @@ XS(_wrap_EventConsumer_events_set) {
 XS(_wrap_EventConsumer_events_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    switch_queue_t *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_queue_t *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4475,8 +4538,7 @@ XS(_wrap_EventConsumer_e_event_id_set) {
       }
     }
     if (arg1) (arg1)->e_event_id = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -4489,10 +4551,10 @@ XS(_wrap_EventConsumer_e_event_id_set) {
 XS(_wrap_EventConsumer_e_event_id_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    switch_event_types_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_event_types_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4546,7 +4608,7 @@ XS(_wrap_EventConsumer_e_callback_set) {
     } else {
       arg1->e_callback = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -4561,10 +4623,10 @@ XS(_wrap_EventConsumer_e_callback_set) {
 XS(_wrap_EventConsumer_e_callback_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4618,7 +4680,7 @@ XS(_wrap_EventConsumer_e_subclass_name_set) {
     } else {
       arg1->e_subclass_name = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -4633,10 +4695,10 @@ XS(_wrap_EventConsumer_e_subclass_name_set) {
 XS(_wrap_EventConsumer_e_subclass_name_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4690,7 +4752,7 @@ XS(_wrap_EventConsumer_e_cb_arg_set) {
     } else {
       arg1->e_cb_arg = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -4705,10 +4767,10 @@ XS(_wrap_EventConsumer_e_cb_arg_set) {
 XS(_wrap_EventConsumer_e_cb_arg_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4762,7 +4824,7 @@ XS(_wrap_EventConsumer_enodes_set) {
         SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""enodes""' of type '""switch_event_node_t *[SWITCH_EVENT_ALL+1]""'");
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -4777,10 +4839,10 @@ XS(_wrap_EventConsumer_enodes_set) {
 XS(_wrap_EventConsumer_enodes_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    switch_event_node_t **result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_event_node_t **result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4833,8 +4895,7 @@ XS(_wrap_EventConsumer_node_index_set) {
       }
     }
     if (arg1) (arg1)->node_index = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -4847,10 +4908,10 @@ XS(_wrap_EventConsumer_node_index_set) {
 XS(_wrap_EventConsumer_node_index_get) {
   {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
-    uint32_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    uint32_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -4877,7 +4938,6 @@ XS(_wrap_new_EventConsumer) {
     char *arg1 = (char *) NULL ;
     char *arg2 = (char *) "" ;
     int arg3 = (int) 5000 ;
-    EventConsumer *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -4887,6 +4947,7 @@ XS(_wrap_new_EventConsumer) {
     int val3 ;
     int ecode3 = 0 ;
     int argvi = 0;
+    EventConsumer *result = 0 ;
     dXSARGS;
     
     if ((items < 0) || (items > 3)) {
@@ -4945,8 +5006,7 @@ XS(_wrap_delete_EventConsumer) {
     }
     arg1 = reinterpret_cast< EventConsumer * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -4961,7 +5021,6 @@ XS(_wrap_EventConsumer_bind) {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) "" ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -4971,6 +5030,7 @@ XS(_wrap_EventConsumer_bind) {
     char *buf3 = 0 ;
     int alloc3 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 3)) {
@@ -5013,7 +5073,6 @@ XS(_wrap_EventConsumer_pop) {
     EventConsumer *arg1 = (EventConsumer *) 0 ;
     int arg2 = (int) 0 ;
     int arg3 = (int) 0 ;
-    Event *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -5021,6 +5080,7 @@ XS(_wrap_EventConsumer_pop) {
     int val3 ;
     int ecode3 = 0 ;
     int argvi = 0;
+    Event *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 3)) {
@@ -5077,7 +5137,7 @@ XS(_wrap_EventConsumer_cleanup) {
     }
     arg1 = reinterpret_cast< EventConsumer * >(argp1);
     (arg1)->cleanup();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5104,8 +5164,7 @@ XS(_wrap_delete_CoreSession) {
     }
     arg1 = reinterpret_cast< CoreSession * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5140,8 +5199,7 @@ XS(_wrap_CoreSession_session_set) {
     }
     arg2 = reinterpret_cast< switch_core_session_t * >(argp2);
     if (arg1) (arg1)->session = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5156,10 +5214,10 @@ XS(_wrap_CoreSession_session_set) {
 XS(_wrap_CoreSession_session_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    switch_core_session_t *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_core_session_t *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5206,8 +5264,7 @@ XS(_wrap_CoreSession_channel_set) {
     }
     arg2 = reinterpret_cast< switch_channel_t * >(argp2);
     if (arg1) (arg1)->channel = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5222,10 +5279,10 @@ XS(_wrap_CoreSession_channel_set) {
 XS(_wrap_CoreSession_channel_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    switch_channel_t *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_channel_t *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5272,8 +5329,7 @@ XS(_wrap_CoreSession_flags_set) {
     } 
     arg2 = static_cast< unsigned int >(val2);
     if (arg1) (arg1)->flags = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5288,10 +5344,10 @@ XS(_wrap_CoreSession_flags_set) {
 XS(_wrap_CoreSession_flags_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    unsigned int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    unsigned int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5338,8 +5394,7 @@ XS(_wrap_CoreSession_allocated_set) {
     } 
     arg2 = static_cast< int >(val2);
     if (arg1) (arg1)->allocated = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5354,10 +5409,10 @@ XS(_wrap_CoreSession_allocated_set) {
 XS(_wrap_CoreSession_allocated_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5404,8 +5459,7 @@ XS(_wrap_CoreSession_cb_state_set) {
     }
     arg2 = reinterpret_cast< input_callback_state * >(argp2);
     if (arg1) (arg1)->cb_state = *arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5420,10 +5474,10 @@ XS(_wrap_CoreSession_cb_state_set) {
 XS(_wrap_CoreSession_cb_state_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    input_callback_state *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    input_callback_state *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5476,8 +5530,7 @@ XS(_wrap_CoreSession_hook_state_set) {
       }
     }
     if (arg1) (arg1)->hook_state = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5490,10 +5543,10 @@ XS(_wrap_CoreSession_hook_state_set) {
 XS(_wrap_CoreSession_hook_state_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    switch_channel_state_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_channel_state_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5546,8 +5599,7 @@ XS(_wrap_CoreSession_cause_set) {
       }
     }
     if (arg1) (arg1)->cause = arg2;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5560,10 +5612,10 @@ XS(_wrap_CoreSession_cause_set) {
 XS(_wrap_CoreSession_cause_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    switch_call_cause_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_call_cause_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5617,7 +5669,7 @@ XS(_wrap_CoreSession_uuid_set) {
     } else {
       arg1->uuid = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -5632,10 +5684,10 @@ XS(_wrap_CoreSession_uuid_set) {
 XS(_wrap_CoreSession_uuid_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5689,7 +5741,7 @@ XS(_wrap_CoreSession_tts_name_set) {
     } else {
       arg1->tts_name = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -5704,10 +5756,10 @@ XS(_wrap_CoreSession_tts_name_set) {
 XS(_wrap_CoreSession_tts_name_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5761,7 +5813,7 @@ XS(_wrap_CoreSession_voice_name_set) {
     } else {
       arg1->voice_name = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -5776,10 +5828,10 @@ XS(_wrap_CoreSession_voice_name_set) {
 XS(_wrap_CoreSession_voice_name_get) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5807,7 +5859,6 @@ XS(_wrap_CoreSession_insertFile) {
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) 0 ;
     int arg4 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -5819,6 +5870,7 @@ XS(_wrap_CoreSession_insertFile) {
     int val4 ;
     int ecode4 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 4) || (items > 4)) {
@@ -5864,10 +5916,10 @@ XS(_wrap_CoreSession_insertFile) {
 XS(_wrap_CoreSession_answer) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5892,10 +5944,10 @@ XS(_wrap_CoreSession_answer) {
 XS(_wrap_CoreSession_preAnswer) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -5945,7 +5997,7 @@ XS(_wrap_CoreSession_hangup) {
       arg2 = reinterpret_cast< char * >(buf2);
     }
     (arg1)->hangup((char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -5974,7 +6026,7 @@ XS(_wrap_CoreSession_hangupState) {
     }
     arg1 = reinterpret_cast< CoreSession * >(argp1);
     (arg1)->hangupState();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -6019,7 +6071,7 @@ XS(_wrap_CoreSession_setVariable) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->setVariable(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6065,7 +6117,7 @@ XS(_wrap_CoreSession_setPrivate) {
       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setPrivate" "', argument " "3"" of type '" "void *""'"); 
     }
     (arg1)->setPrivate(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     
@@ -6083,13 +6135,13 @@ XS(_wrap_CoreSession_getPrivate) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     char *arg2 = (char *) 0 ;
-    void *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    void *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -6122,13 +6174,13 @@ XS(_wrap_CoreSession_getVariable) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     char *arg2 = (char *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -6161,13 +6213,13 @@ XS(_wrap_CoreSession_process_callback_result) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     char *arg2 = (char *) 0 ;
-    switch_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    switch_status_t result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -6260,7 +6312,7 @@ XS(_wrap_CoreSession_say) {
       arg6 = reinterpret_cast< char * >(buf6);
     }
     (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6328,7 +6380,7 @@ XS(_wrap_CoreSession_sayPhrase) {
       arg4 = reinterpret_cast< char * >(buf4);
     }
     (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6347,10 +6399,10 @@ XS(_wrap_CoreSession_sayPhrase) {
 XS(_wrap_CoreSession_hangupCause) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -6375,10 +6427,10 @@ XS(_wrap_CoreSession_hangupCause) {
 XS(_wrap_CoreSession_getState) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -6407,7 +6459,6 @@ XS(_wrap_CoreSession_recordFile) {
     int arg3 = (int) 0 ;
     int arg4 = (int) 0 ;
     int arg5 = (int) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -6420,6 +6471,7 @@ XS(_wrap_CoreSession_recordFile) {
     int val5 ;
     int ecode5 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 5)) {
@@ -6482,7 +6534,6 @@ XS(_wrap_CoreSession_originate) {
     char *arg3 = (char *) 0 ;
     int arg4 = (int) 60 ;
     switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     void *argp2 = 0 ;
@@ -6495,6 +6546,7 @@ XS(_wrap_CoreSession_originate) {
     void *argp5 = 0 ;
     int res5 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 3) || (items > 5)) {
@@ -6565,7 +6617,7 @@ XS(_wrap_CoreSession_destroy) {
     }
     arg1 = reinterpret_cast< CoreSession * >(argp1);
     (arg1)->destroy();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -6607,7 +6659,7 @@ XS(_wrap_CoreSession_setDTMFCallback) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->setDTMFCallback(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6625,13 +6677,13 @@ XS(_wrap_CoreSession_speak) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     char *arg2 = (char *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     char *buf2 = 0 ;
     int alloc2 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -6695,7 +6747,7 @@ XS(_wrap_CoreSession_set_tts_parms) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->set_tts_parms(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6744,7 +6796,7 @@ XS(_wrap_CoreSession_set_tts_params) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->set_tts_params(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -6762,12 +6814,12 @@ XS(_wrap_CoreSession_collectDigits__SWIG_0) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     int arg2 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
     int ecode2 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -6801,7 +6853,6 @@ XS(_wrap_CoreSession_collectDigits__SWIG_1) {
     CoreSession *arg1 = (CoreSession *) 0 ;
     int arg2 ;
     int arg3 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -6809,6 +6860,7 @@ XS(_wrap_CoreSession_collectDigits__SWIG_1) {
     int val3 ;
     int ecode3 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 3) || (items > 3)) {
@@ -6925,9 +6977,9 @@ XS(_wrap_CoreSession_collectDigits) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_0); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_1); return;
     }
   }
   
@@ -6942,7 +6994,6 @@ XS(_wrap_CoreSession_getDigits__SWIG_0) {
     int arg2 ;
     char *arg3 = (char *) 0 ;
     int arg4 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -6953,6 +7004,7 @@ XS(_wrap_CoreSession_getDigits__SWIG_0) {
     int val4 ;
     int ecode4 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 4) || (items > 4)) {
@@ -7002,7 +7054,6 @@ XS(_wrap_CoreSession_getDigits__SWIG_1) {
     char *arg3 = (char *) 0 ;
     int arg4 ;
     int arg5 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -7015,6 +7066,7 @@ XS(_wrap_CoreSession_getDigits__SWIG_1) {
     int val5 ;
     int ecode5 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 5) || (items > 5)) {
@@ -7181,9 +7233,9 @@ XS(_wrap_CoreSession_getDigits) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_getDigits__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_CoreSession_getDigits__SWIG_0); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_getDigits__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_CoreSession_getDigits__SWIG_1); return;
     }
   }
   
@@ -7198,7 +7250,6 @@ XS(_wrap_CoreSession_transfer) {
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) NULL ;
     char *arg4 = (char *) NULL ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -7211,6 +7262,7 @@ XS(_wrap_CoreSession_transfer) {
     char *buf4 = 0 ;
     int alloc4 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 4)) {
@@ -7266,7 +7318,6 @@ XS(_wrap_CoreSession_read) {
     int arg5 ;
     char *arg6 = (char *) 0 ;
     int arg7 = (int) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -7284,6 +7335,7 @@ XS(_wrap_CoreSession_read) {
     int val7 ;
     int ecode7 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 6) || (items > 7)) {
@@ -7363,7 +7415,6 @@ XS(_wrap_CoreSession_playAndGetDigits) {
     char *arg10 = (char *) NULL ;
     int arg11 = (int) 0 ;
     char *arg12 = (char *) NULL ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -7395,6 +7446,7 @@ XS(_wrap_CoreSession_playAndGetDigits) {
     char *buf12 = 0 ;
     int alloc12 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 9) || (items > 12)) {
@@ -7504,7 +7556,6 @@ XS(_wrap_CoreSession_streamFile) {
     CoreSession *arg1 = (CoreSession *) 0 ;
     char *arg2 = (char *) 0 ;
     int arg3 = (int) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -7513,6 +7564,7 @@ XS(_wrap_CoreSession_streamFile) {
     int val3 ;
     int ecode3 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 3)) {
@@ -7555,7 +7607,6 @@ XS(_wrap_CoreSession_sleep) {
     CoreSession *arg1 = (CoreSession *) 0 ;
     int arg2 ;
     int arg3 = (int) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int val2 ;
@@ -7563,6 +7614,7 @@ XS(_wrap_CoreSession_sleep) {
     int val3 ;
     int ecode3 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 3)) {
@@ -7603,10 +7655,10 @@ XS(_wrap_CoreSession_sleep) {
 XS(_wrap_CoreSession_flushEvents) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7631,10 +7683,10 @@ XS(_wrap_CoreSession_flushEvents) {
 XS(_wrap_CoreSession_flushDigits) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7660,12 +7712,12 @@ XS(_wrap_CoreSession_setAutoHangup) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
     bool arg2 ;
-    int result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     bool val2 ;
     int ecode2 = 0 ;
     int argvi = 0;
+    int result;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -7717,7 +7769,7 @@ XS(_wrap_CoreSession_setHangupHook) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setHangupHook" "', argument " "2"" of type '" "void *""'"); 
     }
     (arg1)->setHangupHook(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7732,10 +7784,10 @@ XS(_wrap_CoreSession_setHangupHook) {
 XS(_wrap_CoreSession_ready) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7760,10 +7812,10 @@ XS(_wrap_CoreSession_ready) {
 XS(_wrap_CoreSession_bridged) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7788,10 +7840,10 @@ XS(_wrap_CoreSession_bridged) {
 XS(_wrap_CoreSession_answered) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7816,10 +7868,10 @@ XS(_wrap_CoreSession_answered) {
 XS(_wrap_CoreSession_mediaReady) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -7866,7 +7918,7 @@ XS(_wrap_CoreSession_waitForAnswer) {
     }
     arg2 = reinterpret_cast< CoreSession * >(argp2);
     (arg1)->waitForAnswer(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7915,7 +7967,7 @@ XS(_wrap_CoreSession_execute) {
       arg3 = reinterpret_cast< char * >(buf3);
     }
     (arg1)->execute((char const *)arg2,(char const *)arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -7954,7 +8006,7 @@ XS(_wrap_CoreSession_sendEvent) {
     }
     arg2 = reinterpret_cast< Event * >(argp2);
     (arg1)->sendEvent(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7991,7 +8043,7 @@ XS(_wrap_CoreSession_setEventData) {
     }
     arg2 = reinterpret_cast< Event * >(argp2);
     (arg1)->setEventData(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8006,10 +8058,10 @@ XS(_wrap_CoreSession_setEventData) {
 XS(_wrap_CoreSession_getXMLCDR) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8034,10 +8086,10 @@ XS(_wrap_CoreSession_getXMLCDR) {
 XS(_wrap_CoreSession_begin_allow_threads) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8062,10 +8114,10 @@ XS(_wrap_CoreSession_begin_allow_threads) {
 XS(_wrap_CoreSession_end_allow_threads) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8090,10 +8142,10 @@ XS(_wrap_CoreSession_end_allow_threads) {
 XS(_wrap_CoreSession_get_uuid) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8118,10 +8170,10 @@ XS(_wrap_CoreSession_get_uuid) {
 XS(_wrap_CoreSession_get_cb_args) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
-    switch_input_args_t *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_input_args_t *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8132,10 +8184,7 @@ XS(_wrap_CoreSession_get_cb_args) {
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_get_cb_args" "', argument " "1"" of type '" "CoreSession const *""'"); 
     }
     arg1 = reinterpret_cast< CoreSession * >(argp1);
-    {
-      switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
-      result = (switch_input_args_t *) &_result_ref;
-    }
+    result = (switch_input_args_t *) &((CoreSession const *)arg1)->get_cb_args();
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_input_args_t, 0 | 0); argvi++ ;
     
     XSRETURN(argvi);
@@ -8163,7 +8212,7 @@ XS(_wrap_CoreSession_check_hangup_hook) {
     }
     arg1 = reinterpret_cast< CoreSession * >(argp1);
     (arg1)->check_hangup_hook();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -8178,13 +8227,13 @@ XS(_wrap_CoreSession_run_dtmf_callback) {
     CoreSession *arg1 = (CoreSession *) 0 ;
     void *arg2 = (void *) 0 ;
     switch_input_type_t arg3 ;
-    switch_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     void *argp3 ;
     int res3 = 0 ;
     int argvi = 0;
+    switch_status_t result;
     dXSARGS;
     
     if ((items < 3) || (items > 3)) {
@@ -8258,7 +8307,7 @@ XS(_wrap_CoreSession_consoleLog) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->consoleLog(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -8333,7 +8382,7 @@ XS(_wrap_CoreSession_consoleLog2) {
     }
     arg6 = reinterpret_cast< char * >(buf6);
     (arg1)->consoleLog2(arg2,arg3,arg4,arg5,arg6);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -8380,7 +8429,7 @@ XS(_wrap_console_log) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     console_log(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -8445,7 +8494,7 @@ XS(_wrap_console_log2) {
     }
     arg5 = reinterpret_cast< char * >(buf5);
     console_log2(arg1,arg2,arg3,arg4,arg5);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -8481,7 +8530,7 @@ XS(_wrap_console_clean_log) {
     }
     arg1 = reinterpret_cast< char * >(buf1);
     console_clean_log(arg1);
-    
+    ST(argvi) = sv_newmortal();
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
     XSRETURN(argvi);
   fail:
@@ -8508,7 +8557,7 @@ XS(_wrap_msleep) {
     } 
     arg1 = static_cast< unsigned int >(val1);
     switch_msleep(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -8527,6 +8576,7 @@ XS(_wrap_bridge) {
     void *argp2 = 0 ;
     int res2 = 0 ;
     int argvi = 0;
+       SV *foo;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -8549,7 +8599,7 @@ XS(_wrap_bridge) {
     }
     arg2 = reinterpret_cast< CoreSession * >(argp2);
     bridge(*arg1,*arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8564,10 +8614,10 @@ XS(_wrap_bridge) {
 XS(_wrap_hanguphook) {
   {
     switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    switch_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    switch_status_t result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8596,7 +8646,6 @@ XS(_wrap_dtmf_callback) {
     switch_input_type_t arg3 ;
     void *arg4 = (void *) 0 ;
     unsigned int arg5 ;
-    switch_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
@@ -8606,6 +8655,7 @@ XS(_wrap_dtmf_callback) {
     unsigned int val5 ;
     int ecode5 = 0 ;
     int argvi = 0;
+    switch_status_t result;
     dXSARGS;
     
     if ((items < 5) || (items > 5)) {
@@ -8659,20 +8709,15 @@ XS(_wrap_dtmf_callback) {
 
 XS(_wrap_new_Session__SWIG_0) {
   {
-    PERL::Session *result = 0 ;
     int argvi = 0;
-    SV *foo;
+    PERL::Session *result = 0 ;
     dXSARGS;
-
+    
     if ((items < 0) || (items > 0)) {
       SWIG_croak("Usage: new_Session();");
     }
-    result = (PERL::Session *)new PERL::Session(); 
-       result->setPERL(my_perl);
-       foo = sv_newmortal();
-       SWIG_MakePtr(foo, SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW);
-       result->setME(foo);     
-       ST(argvi) = foo; argvi++ ;
+    result = (PERL::Session *)new PERL::Session();
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -8684,14 +8729,13 @@ XS(_wrap_new_Session__SWIG_1) {
   {
     char *arg1 = (char *) 0 ;
     CoreSession *arg2 = (CoreSession *) 0 ;
-    PERL::Session *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
     void *argp2 = 0 ;
     int res2 = 0 ;
     int argvi = 0;
-       SV *foo;
+    PERL::Session *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -8732,12 +8776,11 @@ XS(_wrap_new_Session__SWIG_1) {
 XS(_wrap_new_Session__SWIG_2) {
   {
     char *arg1 = (char *) 0 ;
-    PERL::Session *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
     int argvi = 0;
-       SV *foo;
+    PERL::Session *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8748,19 +8791,9 @@ XS(_wrap_new_Session__SWIG_2) {
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'");
     }
     arg1 = reinterpret_cast< char * >(buf1);
-    result = (PERL::Session *)new PERL::Session(arg1); 
-       if (result->allocated) {
-               result->setPERL(my_perl);
-               foo = get_sv(result->suuid, TRUE);
-               SWIG_MakePtr(foo, SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW);
-               result->setME(foo);     
-       } else {
-               foo = sv_newmortal();
-               SWIG_MakePtr(foo, SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW);
-       }
-       ST(argvi) = foo; argvi++ ;
+    result = (PERL::Session *)new PERL::Session(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
-
     XSRETURN(argvi);
   fail:
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -8772,11 +8805,10 @@ XS(_wrap_new_Session__SWIG_2) {
 XS(_wrap_new_Session__SWIG_3) {
   {
     switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    PERL::Session *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
-    SV *foo;
+    PERL::Session *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8788,18 +8820,8 @@ XS(_wrap_new_Session__SWIG_3) {
     }
     arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
     result = (PERL::Session *)new PERL::Session(arg1);
-       if (result->allocated) {
-               result->setPERL(my_perl);
-               foo = get_sv(result->suuid, TRUE);
-               SWIG_MakePtr(foo, SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW);
-               result->setME(foo);     
-       } else {
-               foo = sv_newmortal();
-               SWIG_MakePtr(foo, SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW);
-       }
-
-       ST(argvi) = foo; argvi++ ;
-       
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    
     XSRETURN(argvi);
   fail:
     
@@ -8895,13 +8917,13 @@ XS(_wrap_new_Session) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Session__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Session__SWIG_0); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Session__SWIG_3); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Session__SWIG_3); return;
     case 3:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Session__SWIG_2); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Session__SWIG_2); return;
     case 4:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Session__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Session__SWIG_1); return;
     }
   }
   
@@ -8916,6 +8938,7 @@ XS(_wrap_delete_Session) {
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+       SV *foo;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8927,8 +8950,7 @@ XS(_wrap_delete_Session) {
     }
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     delete arg1;
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -8944,6 +8966,7 @@ XS(_wrap_Session_destroy) {
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    SV *foo;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8955,7 +8978,7 @@ XS(_wrap_Session_destroy) {
     }
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     (arg1)->destroy();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -8968,10 +8991,10 @@ XS(_wrap_Session_destroy) {
 XS(_wrap_Session_begin_allow_threads) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -8996,10 +9019,10 @@ XS(_wrap_Session_begin_allow_threads) {
 XS(_wrap_Session_end_allow_threads) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9038,7 +9061,7 @@ XS(_wrap_Session_check_hangup_hook) {
     }
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     (arg1)->check_hangup_hook();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -9053,13 +9076,13 @@ XS(_wrap_Session_run_dtmf_callback) {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
     void *arg2 = (void *) 0 ;
     switch_input_type_t arg3 ;
-    switch_status_t result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int res2 ;
     void *argp3 ;
     int res3 = 0 ;
     int argvi = 0;
+    switch_status_t result;
     dXSARGS;
     
     if ((items < 3) || (items > 3)) {
@@ -9117,7 +9140,7 @@ XS(_wrap_Session_setME) {
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     arg2 = ST(1);
     (arg1)->setME(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9164,7 +9187,7 @@ XS(_wrap_Session_setInputCallback__SWIG_0) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->setInputCallback(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -9204,7 +9227,7 @@ XS(_wrap_Session_setInputCallback__SWIG_1) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     (arg1)->setInputCallback(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9233,7 +9256,7 @@ XS(_wrap_Session_setInputCallback__SWIG_2) {
     }
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     (arg1)->setInputCallback();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -9339,11 +9362,11 @@ XS(_wrap_Session_setInputCallback) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_2); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_2); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_1); return;
     case 3:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_Session_setInputCallback__SWIG_0); return;
     }
   }
   
@@ -9369,7 +9392,7 @@ XS(_wrap_Session_unsetInputCallback) {
     }
     arg1 = reinterpret_cast< PERL::Session * >(argp1);
     (arg1)->unsetInputCallback();
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -9414,7 +9437,7 @@ XS(_wrap_Session_setHangupHook__SWIG_0) {
     }
     arg3 = reinterpret_cast< char * >(buf3);
     (arg1)->setHangupHook(arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -9454,7 +9477,7 @@ XS(_wrap_Session_setHangupHook__SWIG_1) {
     }
     arg2 = reinterpret_cast< char * >(buf2);
     (arg1)->setHangupHook(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9541,9 +9564,9 @@ XS(_wrap_Session_setHangupHook) {
   dispatch:
     switch(_index) {
     case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_1); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_1); return;
     case 2:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_0); return;
+      PUSHMARK(MARK); SWIG_CALLXS(_wrap_Session_setHangupHook__SWIG_0); return;
     }
   }
   
@@ -9555,10 +9578,10 @@ XS(_wrap_Session_setHangupHook) {
 XS(_wrap_Session_ready) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    bool result;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    bool result;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9612,7 +9635,7 @@ XS(_wrap_Session_suuid_set) {
     } else {
       arg1->suuid = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9627,10 +9650,10 @@ XS(_wrap_Session_suuid_set) {
 XS(_wrap_Session_suuid_get) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9684,7 +9707,7 @@ XS(_wrap_Session_cb_function_set) {
     } else {
       arg1->cb_function = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9699,10 +9722,10 @@ XS(_wrap_Session_cb_function_set) {
 XS(_wrap_Session_cb_function_get) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9756,7 +9779,7 @@ XS(_wrap_Session_cb_arg_set) {
     } else {
       arg1->cb_arg = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9771,10 +9794,10 @@ XS(_wrap_Session_cb_arg_set) {
 XS(_wrap_Session_cb_arg_get) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9828,7 +9851,7 @@ XS(_wrap_Session_hangup_func_str_set) {
     } else {
       arg1->hangup_func_str = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9843,10 +9866,10 @@ XS(_wrap_Session_hangup_func_str_set) {
 XS(_wrap_Session_hangup_func_str_get) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9900,7 +9923,7 @@ XS(_wrap_Session_hangup_func_arg_set) {
     } else {
       arg1->hangup_func_arg = 0;
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -9915,10 +9938,10 @@ XS(_wrap_Session_hangup_func_arg_set) {
 XS(_wrap_Session_hangup_func_arg_get) {
   {
     PERL::Session *arg1 = (PERL::Session *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -9965,7 +9988,7 @@ XS(_wrap_Session_setPERL) {
     }
     arg2 = reinterpret_cast< PerlInterpreter * >(argp2);
     (arg1)->setPERL(arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9980,7 +10003,7 @@ XS(_wrap_Session_setPERL) {
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static void *_p_PERL__SessionTo_p_CoreSession(void *x, int *newmemory) {
+static void *_p_PERL__SessionTo_p_CoreSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CoreSession *)  ((PERL::Session *) x));
 }
 static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)"freeswitch::API", 0};
@@ -10300,18 +10323,18 @@ static swig_command_info swig_commands[] = {
 };
 /* -----------------------------------------------------------------------------
  * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
  * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
  * swig_module, and does all the lookup, filling in the swig_module.types
  * array with the correct data and linking the correct swig_cast_info
  * structures together.
  *
- * The generated swig_type_info structures are assigned staticly to an initial 
+ * The generated swig_type_info structures are assigned staticly to an initial
  * array. We just loop through that array, and handle each type individually.
  * First we lookup if this type has been already loaded, and if so, use the
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -10321,17 +10344,17 @@ static swig_command_info swig_commands[] = {
  * a column is one of the swig_cast_info structures for that type.
  * The cast_initial array is actually an array of arrays, because each row has
  * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
+ * we find the array of casts associated with the type, and loop through it
  * adding the casts to the list. The one last trick we need to do is making
  * sure the type pointer in the swig_cast_info struct is correct.
  *
- * First off, we lookup the cast->type name to see if it is already loaded. 
+ * First off, we lookup the cast->type name to see if it is already loaded.
  * There are three cases to handle:
  *  1) If the cast->type has already been loaded AND the type we are adding
  *     casting info to has not been loaded (it is in this module), THEN we
  *     replace the cast->type pointer with the type pointer that has already
  *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
+ *  2) If BOTH types (the one we are adding casting info to, and the
  *     cast->type) are loaded, THEN the cast info has already been loaded by
  *     the previous module so we just ignore it.
  *  3) Finally, if cast->type has not already been loaded, then we add that
@@ -10357,8 +10380,6 @@ SWIG_InitializeModule(void *clientdata) {
   swig_module_info *module_head, *iter;
   int found, init;
   
-  clientdata = clientdata;
-  
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
     /* Initialize the swig_module */
@@ -10396,7 +10417,7 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
   
-  /* When multiple interpeters are used, a module could have already been initialized in
+  /* When multiple interpreters are used, a module could have already been initialized in
        a different interpreter, but not yet have a pointer in this interpreter.
        In this case, we do not want to continue adding types... everything should be
        set up already */
@@ -10549,25 +10570,30 @@ XS(SWIG_init) {
   
   /* Install commands */
   for (i = 0; swig_commands[i].name; i++) {
-    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+    /* Casts only needed for Perl < 5.10. */
+#ifdef __cplusplus
+    newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
+#else
+    newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
+#endif
   }
   
   /* Install variables */
   for (i = 0; swig_variables[i].name; i++) {
     SV *sv;
-    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
+    sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
     if (swig_variables[i].type) {
       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
     } else {
       sv_setiv(sv,(IV) 0);
     }
-    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+    swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
   }
   
   /* Install constant */
   for (i = 0; swig_constants[i].type; i++) {
     SV *sv;
-    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
+    sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
     switch(swig_constants[i].type) {
     case SWIG_INT:
       sv_setiv(sv, (IV) swig_constants[i].lvalue);
@@ -10576,7 +10602,7 @@ XS(SWIG_init) {
       sv_setnv(sv, (double) swig_constants[i].dvalue);
       break;
     case SWIG_STRING:
-      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      sv_setpv(sv, (const char *) swig_constants[i].pvalue);
       break;
     case SWIG_POINTER:
       SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
@@ -10593,17 +10619,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/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%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/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%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/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%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 e2831b47db4987953c03ab5bd79268523ef50a3e..967e3eb51ee0fcfe73f9f3cd5e268322726097cd 100644 (file)
@@ -1,12 +1,35 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.35
+# Version 2.0.12
 #
-# Don't modify this file, modify the SWIG interface instead.
-# This file is compatible with both classic and new-style classes.
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+
+
 
-import _freeswitch
-import new
-new_instancemethod = new.instancemethod
+
+
+from sys import version_info
+if version_info >= (2,6,0):
+    def swig_import_helper():
+        from os.path import dirname
+        import imp
+        fp = None
+        try:
+            fp, pathname, description = imp.find_module('_freeswitch', [dirname(__file__)])
+        except ImportError:
+            import _freeswitch
+            return _freeswitch
+        if fp is not None:
+            try:
+                _mod = imp.load_module('_freeswitch', fp, pathname, description)
+            finally:
+                fp.close()
+            return _mod
+    _freeswitch = swig_import_helper()
+    del swig_import_helper
+else:
+    import _freeswitch
+del version_info
 try:
     _swig_property = property
 except NameError:
@@ -14,12 +37,12 @@ except NameError:
 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
-        if type(value).__name__ == 'PySwigObject':
+        if type(value).__name__ == 'SwigPyObject':
             self.__dict__[name] = value
             return
     method = class_type.__swig_setmethods__.get(name,None)
     if method: return method(self,value)
-    if (not static) or hasattr(self,name):
+    if (not static):
         self.__dict__[name] = value
     else:
         raise AttributeError("You cannot add attributes to %s" % self)
@@ -31,29 +54,48 @@ def _swig_getattr(self,class_type,name):
     if (name == "thisown"): return self.this.own()
     method = class_type.__swig_getmethods__.get(name,None)
     if method: return method(self)
-    raise AttributeError,name
+    raise AttributeError(name)
 
 def _swig_repr(self):
     try: strthis = "proxy of " + self.this.__repr__()
     except: strthis = ""
     return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
 
-import types
 try:
-    _object = types.ObjectType
+    _object = object
     _newclass = 1
 except AttributeError:
     class _object : pass
     _newclass = 0
-del types
 
 
+
+def setGlobalVariable(*args):
+  return _freeswitch.setGlobalVariable(*args)
 setGlobalVariable = _freeswitch.setGlobalVariable
+
+def getGlobalVariable(*args):
+  return _freeswitch.getGlobalVariable(*args)
 getGlobalVariable = _freeswitch.getGlobalVariable
+
+def consoleLog(*args):
+  return _freeswitch.consoleLog(*args)
 consoleLog = _freeswitch.consoleLog
+
+def consoleLog2(*args):
+  return _freeswitch.consoleLog2(*args)
 consoleLog2 = _freeswitch.consoleLog2
+
+def consoleCleanLog(*args):
+  return _freeswitch.consoleCleanLog(*args)
 consoleCleanLog = _freeswitch.consoleCleanLog
+
+def running():
+  return _freeswitch.running()
 running = _freeswitch.running
+
+def email(*args):
+  return _freeswitch.email(*args)
 email = _freeswitch.email
 class IVRMenu(_object):
     __swig_setmethods__ = {}
@@ -67,8 +109,8 @@ class IVRMenu(_object):
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_IVRMenu
     __del__ = lambda self : None;
-    def bindAction(*args): return _freeswitch.IVRMenu_bindAction(*args)
-    def execute(*args): return _freeswitch.IVRMenu_execute(*args)
+    def bindAction(self, *args): return _freeswitch.IVRMenu_bindAction(self, *args)
+    def execute(self, *args): return _freeswitch.IVRMenu_execute(self, *args)
 IVRMenu_swigregister = _freeswitch.IVRMenu_swigregister
 IVRMenu_swigregister(IVRMenu)
 
@@ -78,15 +120,15 @@ class API(_object):
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, API, name)
     __repr__ = _swig_repr
-    def __init__(self, *args): 
-        this = _freeswitch.new_API(*args)
+    def __init__(self, s=None): 
+        this = _freeswitch.new_API(s)
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_API
     __del__ = lambda self : None;
-    def execute(*args): return _freeswitch.API_execute(*args)
-    def executeString(*args): return _freeswitch.API_executeString(*args)
-    def getTime(*args): return _freeswitch.API_getTime(*args)
+    def execute(self, *args): return _freeswitch.API_execute(self, *args)
+    def executeString(self, *args): return _freeswitch.API_executeString(self, *args)
+    def getTime(self): return _freeswitch.API_getTime(self)
 API_swigregister = _freeswitch.API_swigregister
 API_swigregister(API)
 
@@ -108,8 +150,8 @@ class input_callback_state_t(_object):
     __swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_set
     __swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_get
     if _newclass:funcargs = _swig_property(_freeswitch.input_callback_state_t_funcargs_get, _freeswitch.input_callback_state_t_funcargs_set)
-    def __init__(self, *args): 
-        this = _freeswitch.new_input_callback_state_t(*args)
+    def __init__(self): 
+        this = _freeswitch.new_input_callback_state_t()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_input_callback_state_t
@@ -153,10 +195,10 @@ class Stream(_object):
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_Stream
     __del__ = lambda self : None;
-    def read(*args): return _freeswitch.Stream_read(*args)
-    def write(*args): return _freeswitch.Stream_write(*args)
-    def raw_write(*args): return _freeswitch.Stream_raw_write(*args)
-    def get_data(*args): return _freeswitch.Stream_get_data(*args)
+    def read(self, *args): return _freeswitch.Stream_read(self, *args)
+    def write(self, *args): return _freeswitch.Stream_write(self, *args)
+    def raw_write(self, *args): return _freeswitch.Stream_raw_write(self, *args)
+    def get_data(self): return _freeswitch.Stream_get_data(self)
 Stream_swigregister = _freeswitch.Stream_swigregister
 Stream_swigregister(Stream)
 
@@ -181,17 +223,17 @@ class Event(_object):
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_Event
     __del__ = lambda self : None;
-    def chat_execute(*args): return _freeswitch.Event_chat_execute(*args)
-    def chat_send(*args): return _freeswitch.Event_chat_send(*args)
-    def serialize(*args): return _freeswitch.Event_serialize(*args)
-    def setPriority(*args): return _freeswitch.Event_setPriority(*args)
-    def getHeader(*args): return _freeswitch.Event_getHeader(*args)
-    def getBody(*args): return _freeswitch.Event_getBody(*args)
-    def getType(*args): return _freeswitch.Event_getType(*args)
-    def addBody(*args): return _freeswitch.Event_addBody(*args)
-    def addHeader(*args): return _freeswitch.Event_addHeader(*args)
-    def delHeader(*args): return _freeswitch.Event_delHeader(*args)
-    def fire(*args): return _freeswitch.Event_fire(*args)
+    def chat_execute(self, *args): return _freeswitch.Event_chat_execute(self, *args)
+    def chat_send(self, dest_proto=None): return _freeswitch.Event_chat_send(self, dest_proto)
+    def serialize(self, format=None): return _freeswitch.Event_serialize(self, format)
+    def setPriority(self, *args): return _freeswitch.Event_setPriority(self, *args)
+    def getHeader(self, *args): return _freeswitch.Event_getHeader(self, *args)
+    def getBody(self): return _freeswitch.Event_getBody(self)
+    def getType(self): return _freeswitch.Event_getType(self)
+    def addBody(self, *args): return _freeswitch.Event_addBody(self, *args)
+    def addHeader(self, *args): return _freeswitch.Event_addHeader(self, *args)
+    def delHeader(self, *args): return _freeswitch.Event_delHeader(self, *args)
+    def fire(self): return _freeswitch.Event_fire(self)
 Event_swigregister = _freeswitch.Event_swigregister
 Event_swigregister(Event)
 
@@ -222,15 +264,15 @@ class EventConsumer(_object):
     __swig_setmethods__["node_index"] = _freeswitch.EventConsumer_node_index_set
     __swig_getmethods__["node_index"] = _freeswitch.EventConsumer_node_index_get
     if _newclass:node_index = _swig_property(_freeswitch.EventConsumer_node_index_get, _freeswitch.EventConsumer_node_index_set)
-    def __init__(self, *args): 
-        this = _freeswitch.new_EventConsumer(*args)
+    def __init__(self, event_name=None, subclass_name="", len=5000): 
+        this = _freeswitch.new_EventConsumer(event_name, subclass_name, len)
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_EventConsumer
     __del__ = lambda self : None;
-    def bind(*args): return _freeswitch.EventConsumer_bind(*args)
-    def pop(*args): return _freeswitch.EventConsumer_pop(*args)
-    def cleanup(*args): return _freeswitch.EventConsumer_cleanup(*args)
+    def bind(self, *args): return _freeswitch.EventConsumer_bind(self, *args)
+    def pop(self, block=0, timeout=0): return _freeswitch.EventConsumer_pop(self, block, timeout)
+    def cleanup(self): return _freeswitch.EventConsumer_cleanup(self)
 EventConsumer_swigregister = _freeswitch.EventConsumer_swigregister
 EventConsumer_swigregister(EventConsumer)
 
@@ -239,7 +281,7 @@ class CoreSession(_object):
     __setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value)
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name)
-    def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
     __repr__ = _swig_repr
     __swig_destroy__ = _freeswitch.delete_CoreSession
     __del__ = lambda self : None;
@@ -273,64 +315,85 @@ class CoreSession(_object):
     __swig_setmethods__["voice_name"] = _freeswitch.CoreSession_voice_name_set
     __swig_getmethods__["voice_name"] = _freeswitch.CoreSession_voice_name_get
     if _newclass:voice_name = _swig_property(_freeswitch.CoreSession_voice_name_get, _freeswitch.CoreSession_voice_name_set)
-    def insertFile(*args): return _freeswitch.CoreSession_insertFile(*args)
-    def answer(*args): return _freeswitch.CoreSession_answer(*args)
-    def preAnswer(*args): return _freeswitch.CoreSession_preAnswer(*args)
-    def hangup(*args): return _freeswitch.CoreSession_hangup(*args)
-    def hangupState(*args): return _freeswitch.CoreSession_hangupState(*args)
-    def setVariable(*args): return _freeswitch.CoreSession_setVariable(*args)
-    def setPrivate(*args): return _freeswitch.CoreSession_setPrivate(*args)
-    def getPrivate(*args): return _freeswitch.CoreSession_getPrivate(*args)
-    def getVariable(*args): return _freeswitch.CoreSession_getVariable(*args)
-    def process_callback_result(*args): return _freeswitch.CoreSession_process_callback_result(*args)
-    def say(*args): return _freeswitch.CoreSession_say(*args)
-    def sayPhrase(*args): return _freeswitch.CoreSession_sayPhrase(*args)
-    def hangupCause(*args): return _freeswitch.CoreSession_hangupCause(*args)
-    def getState(*args): return _freeswitch.CoreSession_getState(*args)
-    def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
-    def originate(*args): return _freeswitch.CoreSession_originate(*args)
-    def destroy(*args): return _freeswitch.CoreSession_destroy(*args)
-    def setDTMFCallback(*args): return _freeswitch.CoreSession_setDTMFCallback(*args)
-    def speak(*args): return _freeswitch.CoreSession_speak(*args)
-    def set_tts_parms(*args): return _freeswitch.CoreSession_set_tts_parms(*args)
-    def set_tts_params(*args): return _freeswitch.CoreSession_set_tts_params(*args)
-    def collectDigits(*args): return _freeswitch.CoreSession_collectDigits(*args)
-    def getDigits(*args): return _freeswitch.CoreSession_getDigits(*args)
-    def transfer(*args): return _freeswitch.CoreSession_transfer(*args)
-    def read(*args): return _freeswitch.CoreSession_read(*args)
-    def playAndGetDigits(*args): return _freeswitch.CoreSession_playAndGetDigits(*args)
-    def streamFile(*args): return _freeswitch.CoreSession_streamFile(*args)
-    def sleep(*args): return _freeswitch.CoreSession_sleep(*args)
-    def flushEvents(*args): return _freeswitch.CoreSession_flushEvents(*args)
-    def flushDigits(*args): return _freeswitch.CoreSession_flushDigits(*args)
-    def setAutoHangup(*args): return _freeswitch.CoreSession_setAutoHangup(*args)
-    def setHangupHook(*args): return _freeswitch.CoreSession_setHangupHook(*args)
-    def ready(*args): return _freeswitch.CoreSession_ready(*args)
-    def bridged(*args): return _freeswitch.CoreSession_bridged(*args)
-    def answered(*args): return _freeswitch.CoreSession_answered(*args)
-    def mediaReady(*args): return _freeswitch.CoreSession_mediaReady(*args)
-    def waitForAnswer(*args): return _freeswitch.CoreSession_waitForAnswer(*args)
-    def execute(*args): return _freeswitch.CoreSession_execute(*args)
-    def sendEvent(*args): return _freeswitch.CoreSession_sendEvent(*args)
-    def setEventData(*args): return _freeswitch.CoreSession_setEventData(*args)
-    def getXMLCDR(*args): return _freeswitch.CoreSession_getXMLCDR(*args)
-    def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args)
-    def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args)
-    def get_uuid(*args): return _freeswitch.CoreSession_get_uuid(*args)
-    def get_cb_args(*args): return _freeswitch.CoreSession_get_cb_args(*args)
-    def check_hangup_hook(*args): return _freeswitch.CoreSession_check_hangup_hook(*args)
-    def run_dtmf_callback(*args): return _freeswitch.CoreSession_run_dtmf_callback(*args)
-    def consoleLog(*args): return _freeswitch.CoreSession_consoleLog(*args)
-    def consoleLog2(*args): return _freeswitch.CoreSession_consoleLog2(*args)
+    def insertFile(self, *args): return _freeswitch.CoreSession_insertFile(self, *args)
+    def answer(self): return _freeswitch.CoreSession_answer(self)
+    def preAnswer(self): return _freeswitch.CoreSession_preAnswer(self)
+    def hangup(self, cause="normal_clearing"): return _freeswitch.CoreSession_hangup(self, cause)
+    def hangupState(self): return _freeswitch.CoreSession_hangupState(self)
+    def setVariable(self, *args): return _freeswitch.CoreSession_setVariable(self, *args)
+    def setPrivate(self, *args): return _freeswitch.CoreSession_setPrivate(self, *args)
+    def getPrivate(self, *args): return _freeswitch.CoreSession_getPrivate(self, *args)
+    def getVariable(self, *args): return _freeswitch.CoreSession_getVariable(self, *args)
+    def process_callback_result(self, *args): return _freeswitch.CoreSession_process_callback_result(self, *args)
+    def say(self, *args): return _freeswitch.CoreSession_say(self, *args)
+    def sayPhrase(self, *args): return _freeswitch.CoreSession_sayPhrase(self, *args)
+    def hangupCause(self): return _freeswitch.CoreSession_hangupCause(self)
+    def getState(self): return _freeswitch.CoreSession_getState(self)
+    def recordFile(self, *args): return _freeswitch.CoreSession_recordFile(self, *args)
+    def originate(self, *args): return _freeswitch.CoreSession_originate(self, *args)
+    def destroy(self): return _freeswitch.CoreSession_destroy(self)
+    def setDTMFCallback(self, *args): return _freeswitch.CoreSession_setDTMFCallback(self, *args)
+    def speak(self, *args): return _freeswitch.CoreSession_speak(self, *args)
+    def set_tts_parms(self, *args): return _freeswitch.CoreSession_set_tts_parms(self, *args)
+    def set_tts_params(self, *args): return _freeswitch.CoreSession_set_tts_params(self, *args)
+    def collectDigits(self, *args): return _freeswitch.CoreSession_collectDigits(self, *args)
+    def getDigits(self, *args): return _freeswitch.CoreSession_getDigits(self, *args)
+    def transfer(self, *args): return _freeswitch.CoreSession_transfer(self, *args)
+    def read(self, *args): return _freeswitch.CoreSession_read(self, *args)
+    def playAndGetDigits(self, *args): return _freeswitch.CoreSession_playAndGetDigits(self, *args)
+    def streamFile(self, *args): return _freeswitch.CoreSession_streamFile(self, *args)
+    def sleep(self, *args): return _freeswitch.CoreSession_sleep(self, *args)
+    def flushEvents(self): return _freeswitch.CoreSession_flushEvents(self)
+    def flushDigits(self): return _freeswitch.CoreSession_flushDigits(self)
+    def setAutoHangup(self, *args): return _freeswitch.CoreSession_setAutoHangup(self, *args)
+    def setHangupHook(self, *args): return _freeswitch.CoreSession_setHangupHook(self, *args)
+    def ready(self): return _freeswitch.CoreSession_ready(self)
+    def bridged(self): return _freeswitch.CoreSession_bridged(self)
+    def answered(self): return _freeswitch.CoreSession_answered(self)
+    def mediaReady(self): return _freeswitch.CoreSession_mediaReady(self)
+    def waitForAnswer(self, *args): return _freeswitch.CoreSession_waitForAnswer(self, *args)
+    def execute(self, *args): return _freeswitch.CoreSession_execute(self, *args)
+    def sendEvent(self, *args): return _freeswitch.CoreSession_sendEvent(self, *args)
+    def setEventData(self, *args): return _freeswitch.CoreSession_setEventData(self, *args)
+    def getXMLCDR(self): return _freeswitch.CoreSession_getXMLCDR(self)
+    def begin_allow_threads(self): return _freeswitch.CoreSession_begin_allow_threads(self)
+    def end_allow_threads(self): return _freeswitch.CoreSession_end_allow_threads(self)
+    def get_uuid(self): return _freeswitch.CoreSession_get_uuid(self)
+    def get_cb_args(self): return _freeswitch.CoreSession_get_cb_args(self)
+    def check_hangup_hook(self): return _freeswitch.CoreSession_check_hangup_hook(self)
+    def run_dtmf_callback(self, *args): return _freeswitch.CoreSession_run_dtmf_callback(self, *args)
+    def consoleLog(self, *args): return _freeswitch.CoreSession_consoleLog(self, *args)
+    def consoleLog2(self, *args): return _freeswitch.CoreSession_consoleLog2(self, *args)
 CoreSession_swigregister = _freeswitch.CoreSession_swigregister
 CoreSession_swigregister(CoreSession)
 
+
+def console_log(*args):
+  return _freeswitch.console_log(*args)
 console_log = _freeswitch.console_log
+
+def console_log2(*args):
+  return _freeswitch.console_log2(*args)
 console_log2 = _freeswitch.console_log2
+
+def console_clean_log(*args):
+  return _freeswitch.console_clean_log(*args)
 console_clean_log = _freeswitch.console_clean_log
+
+def msleep(*args):
+  return _freeswitch.msleep(*args)
 msleep = _freeswitch.msleep
+
+def bridge(*args):
+  return _freeswitch.bridge(*args)
 bridge = _freeswitch.bridge
+
+def hanguphook(*args):
+  return _freeswitch.hanguphook(*args)
 hanguphook = _freeswitch.hanguphook
+
+def dtmf_callback(*args):
+  return _freeswitch.dtmf_callback(*args)
 dtmf_callback = _freeswitch.dtmf_callback
 class Session(CoreSession):
     __swig_setmethods__ = {}
@@ -346,15 +409,15 @@ class Session(CoreSession):
         except: self.this = this
     __swig_destroy__ = _freeswitch.delete_Session
     __del__ = lambda self : None;
-    def begin_allow_threads(*args): return _freeswitch.Session_begin_allow_threads(*args)
-    def end_allow_threads(*args): return _freeswitch.Session_end_allow_threads(*args)
-    def check_hangup_hook(*args): return _freeswitch.Session_check_hangup_hook(*args)
-    def destroy(*args): return _freeswitch.Session_destroy(*args)
-    def run_dtmf_callback(*args): return _freeswitch.Session_run_dtmf_callback(*args)
-    def setInputCallback(*args): return _freeswitch.Session_setInputCallback(*args)
-    def unsetInputCallback(*args): return _freeswitch.Session_unsetInputCallback(*args)
-    def setHangupHook(*args): return _freeswitch.Session_setHangupHook(*args)
-    def ready(*args): return _freeswitch.Session_ready(*args)
+    def begin_allow_threads(self): return _freeswitch.Session_begin_allow_threads(self)
+    def end_allow_threads(self): return _freeswitch.Session_end_allow_threads(self)
+    def check_hangup_hook(self): return _freeswitch.Session_check_hangup_hook(self)
+    def destroy(self): return _freeswitch.Session_destroy(self)
+    def run_dtmf_callback(self, *args): return _freeswitch.Session_run_dtmf_callback(self, *args)
+    def setInputCallback(self, *args): return _freeswitch.Session_setInputCallback(self, *args)
+    def unsetInputCallback(self): return _freeswitch.Session_unsetInputCallback(self)
+    def setHangupHook(self, *args): return _freeswitch.Session_setHangupHook(self, *args)
+    def ready(self): return _freeswitch.Session_ready(self)
     __swig_setmethods__["cb_function"] = _freeswitch.Session_cb_function_set
     __swig_getmethods__["cb_function"] = _freeswitch.Session_cb_function_get
     if _newclass:cb_function = _swig_property(_freeswitch.Session_cb_function_get, _freeswitch.Session_cb_function_set)
@@ -367,10 +430,11 @@ class Session(CoreSession):
     __swig_setmethods__["hangup_func_arg"] = _freeswitch.Session_hangup_func_arg_set
     __swig_getmethods__["hangup_func_arg"] = _freeswitch.Session_hangup_func_arg_get
     if _newclass:hangup_func_arg = _swig_property(_freeswitch.Session_hangup_func_arg_get, _freeswitch.Session_hangup_func_arg_set)
-    def setPython(*args): return _freeswitch.Session_setPython(*args)
-    def setSelf(*args): return _freeswitch.Session_setSelf(*args)
+    def setPython(self, *args): return _freeswitch.Session_setPython(self, *args)
+    def setSelf(self, *args): return _freeswitch.Session_setSelf(self, *args)
 Session_swigregister = _freeswitch.Session_swigregister
 Session_swigregister(Session)
 
+# This file is compatible with both classic and new-style classes.
 
 
index e7afa21ba574965cc80620093adf80a945110b7c..3639a0768f46b1f831f92c478533ace21a956e79 100644 (file)
@@ -1,29 +1,33 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- * 
- * This file is not intended to be easily readable and contains a number of 
+ * Version 2.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
  * ----------------------------------------------------------------------------- */
 
 #define SWIGPYTHON
 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
 
+
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -62,14 +66,20 @@ template <typename T> T SwigValueInit() {
 #ifndef SWIGUNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#     define SWIGUNUSED __attribute__ ((__unused__))
 #   else
 #     define SWIGUNUSED
 #   endif
 # elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
+#   define SWIGUNUSED __attribute__ ((__unused__))
 # else
-#   define SWIGUNUSED 
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 # endif
 #endif
 
@@ -77,7 +87,7 @@ template <typename T> T SwigValueInit() {
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 # else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
 # endif
 #endif
 
@@ -120,7 +130,7 @@ template <typename T> T SwigValueInit() {
 #   define SWIGSTDCALL __stdcall
 # else
 #   define SWIGSTDCALL
-# endif 
+# endif
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -135,13 +145,19 @@ template <typename T> T SwigValueInit() {
 
 
 
-/* Python.h has to appear first */
-#include <Python.h>
+#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
+/* Use debug wrappers with the Python release dll */
+# undef _DEBUG
+# include <Python.h>
+# define _DEBUG
+#else
+# include <Python.h>
+#endif
 
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -160,11 +176,11 @@ template <typename T> T SwigValueInit() {
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -188,17 +204,17 @@ template <typename T> T SwigValueInit() {
 #define SWIG_POINTER_OWN           0x1
 
 
-/* 
+/*
    Flags/methods for returning states.
-   
-   The swig conversion methods, as ConvertPtr, return and integer 
+
+   The SWIG conversion methods, as ConvertPtr, return an integer
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
-   
+
    Use the following macros/flags to set or process the returning
    states.
-   
-   In old swig versions, you usually write code as:
+
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -206,7 +222,7 @@ template <typename T> T SwigValueInit() {
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -215,7 +231,7 @@ template <typename T> T SwigValueInit() {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -230,28 +246,28 @@ template <typename T> T SwigValueInit() {
     } else {
       // fail code
     }
-    
+
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {         
-        if (<obj is ok>) {                            
-          if (<need new object>) {                    
-            *ptr = <ptr to new allocated object>; 
-            return SWIG_NEWOBJ;                       
-          } else {                                    
-            *ptr = <ptr to old object>;               
-            return SWIG_OLDOBJ;                       
-          }                                   
-        } else {                                      
-          return SWIG_BADOBJ;                 
-        }                                             
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {
+        if (<obj is ok>) {
+          if (<need new object>) {
+            *ptr = <ptr to new allocated object>;
+            return SWIG_NEWOBJ;
+          } else {
+            *ptr = <ptr to old object>;
+            return SWIG_OLDOBJ;
+          }
+        } else {
+          return SWIG_BADOBJ;
+        }
       }
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -260,18 +276,17 @@ template <typename T> T SwigValueInit() {
        int fooi(int);
 
    and you call
+
       food(1)   // cast rank '1'  (1 -> 1.0)
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
-#define SWIG_OK                    (0) 
+#define SWIG_OK                    (0)
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
 
 /* The CastRankLimit says how many bits are used for the cast rank */
 #define SWIG_CASTRANKLIMIT         (1 << 8)
@@ -292,7 +307,6 @@ template <typename T> T SwigValueInit() {
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -303,20 +317,18 @@ template <typename T> T SwigValueInit() {
 #  endif
 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 }
-SWIGINTERNINLINE int SWIG_CheckState(int r) { 
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
 }
 #else /* no cast-rank mode */
-#  define SWIG_AddCast
+#  define SWIG_AddCast(r) (r)
 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -356,7 +368,7 @@ typedef struct swig_module_info {
   void                    *clientdata;         /* Language specific module data */
 } swig_module_info;
 
-/* 
+/*
   Compare two type names skipping the space characters, therefore
   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
@@ -376,18 +388,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 */
 SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
+SWIG_TypeCmp(const char *nb, const char *tb) {
+  int equiv = 1;
   const char* te = tb + strlen(tb);
   const char* ne = nb;
-  while (!equiv && *ne) {
+  while (equiv != 0 && *ne) {
     for (nb = ne; *ne; ++ne) {
       if (*ne == '|') break;
     }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
     if (*ne) ++ne;
   }
   return equiv;
@@ -395,58 +407,65 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+  Return 0 if not equal, 1 if equal
 */
 SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
 }
 
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/*
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -457,7 +476,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
-/* 
+/*
    Dynamic pointer casting. Down an inheritance hierarchy
 */
 SWIGRUNTIME swig_type_info *
@@ -501,7 +520,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
     return type->name;
 }
 
-/* 
+/*
    Set the clientdata field for a type
 */
 SWIGRUNTIME void
@@ -509,14 +528,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
   swig_cast_info *cast = ti->cast;
   /* if (ti->clientdata == clientdata) return; */
   ti->clientdata = clientdata;
-  
+
   while (cast) {
     if (!cast->converter) {
       swig_type_info *tc = cast->type;
       if (!tc->clientdata) {
        SWIG_TypeClientData(tc, clientdata);
       }
-    }    
+    }
     cast = cast->next;
   }
 }
@@ -525,18 +544,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
   SWIG_TypeClientData(ti, clientdata);
   ti->owndata = 1;
 }
-  
+
 /*
   Search for a swig_type_info structure only by mangled name
   Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+                            swig_module_info *end,
                            const char *name) {
   swig_module_info *iter = start;
   do {
@@ -545,11 +564,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
       register size_t r = iter->size - 1;
       do {
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
-       register size_t i = (l + r) >> 1; 
+       register size_t i = (l + r) >> 1;
        const char *iname = iter->types[i]->name;
        if (iname) {
          register int compare = strcmp(name, iname);
-         if (compare == 0) {       
+         if (compare == 0) {
            return iter->types[i];
          } else if (compare < 0) {
            if (i) {
@@ -574,14 +593,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
   Search for a swig_type_info structure for either a mangled name or a human readable name.
   It first searches the mangled names of the types, which is a O(log #types)
   If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
+SWIG_TypeQueryModule(swig_module_info *start,
+                     swig_module_info *end,
                     const char *name) {
   /* STEP 1: Search the name field using binary search */
   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -600,12 +619,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
       iter = iter->next;
     } while (iter != end);
   }
-  
+
   /* neither found a match */
   return 0;
 }
 
-/* 
+/*
    Pack binary data into a string
 */
 SWIGRUNTIME char *
@@ -621,7 +640,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
   return c;
 }
 
-/* 
+/*
    Unpack binary data from a string
 */
 SWIGRUNTIME const char *
@@ -635,21 +654,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
       uu = ((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
       uu = ((d - ('a'-10)) << 4);
-    else 
+    else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu |= (d - '0');
     else if ((d >= 'a') && (d <= 'f'))
       uu |= (d - ('a'-10));
-    else 
+    else
       return (char *) 0;
     *u = uu;
   }
   return c;
 }
 
-/* 
+/*
    Pack 'void *' into a string buffer.
 */
 SWIGRUNTIME char *
@@ -709,22 +728,92 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 #endif
 
 /*  Errors in SWIG */
-#define  SWIG_UnknownError        -1 
-#define  SWIG_IOError             -2 
-#define  SWIG_RuntimeError        -3 
-#define  SWIG_IndexError          -4 
-#define  SWIG_TypeError           -5 
-#define  SWIG_DivisionByZero      -6 
-#define  SWIG_OverflowError       -7 
-#define  SWIG_SyntaxError         -8 
-#define  SWIG_ValueError          -9 
+#define  SWIG_UnknownError        -1
+#define  SWIG_IOError             -2
+#define  SWIG_RuntimeError        -3
+#define  SWIG_IndexError          -4
+#define  SWIG_TypeError           -5
+#define  SWIG_DivisionByZero      -6
+#define  SWIG_OverflowError       -7
+#define  SWIG_SyntaxError         -8
+#define  SWIG_ValueError          -9
 #define  SWIG_SystemError         -10
 #define  SWIG_AttributeError      -11
-#define  SWIG_MemoryError         -12 
+#define  SWIG_MemoryError         -12
 #define  SWIG_NullReferenceError   -13
 
 
 
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
+#define PyString_Check(name) PyBytes_Check(name)
+#define PyString_FromString(x) PyUnicode_FromString(x)
+#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
+#define PyString_AsString(str) PyBytes_AsString(str)
+#define PyString_Size(str) PyBytes_Size(str)   
+#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
+#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
+#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
+#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
+
+#endif
+
+#ifndef Py_TYPE
+#  define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+#  define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  char *cstr;
+  char *newstr;
+  Py_ssize_t len;
+  str = PyUnicode_AsUTF8String(str);
+  PyBytes_AsStringAndSize(str, &cstr, &len);
+  newstr = (char *) malloc(len+1);
+  memcpy(newstr, cstr, len+1);
+  Py_XDECREF(str);
+  return newstr;
+#else
+  return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+#  define SWIG_Python_str_DelForPy3(x) 
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyUnicode_FromString(c); 
+#else
+  return PyString_FromString(c);
+#endif
+}
 
 /* Add PyOS_snprintf for old Pythons */
 #if PY_VERSION_HEX < 0x02020000
@@ -771,6 +860,7 @@ PyString_FromFormat(const char *fmt, ...) {
 #  define PyObject_GenericGetAttr 0
 # endif
 #endif
+
 /* Py_NotImplemented is defined in 2.1 and up. */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef Py_NotImplemented
@@ -778,7 +868,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* A crude PyString_AsStringAndSize implementation for old Pythons */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef PyString_AsStringAndSize
@@ -793,7 +882,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* PyBool_FromLong for old Pythons */
 #if PY_VERSION_HEX < 0x02030000
 static
@@ -812,6 +900,67 @@ PyObject *PyBool_FromLong(long ok)
 typedef int Py_ssize_t;
 # define PY_SSIZE_T_MAX INT_MAX
 # define PY_SSIZE_T_MIN INT_MIN
+typedef inquiry lenfunc;
+typedef intargfunc ssizeargfunc;
+typedef intintargfunc ssizessizeargfunc;
+typedef intobjargproc ssizeobjargproc;
+typedef intintobjargproc ssizessizeobjargproc;
+typedef getreadbufferproc readbufferproc;
+typedef getwritebufferproc writebufferproc;
+typedef getsegcountproc segcountproc;
+typedef getcharbufferproc charbufferproc;
+static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
+{
+  long result = 0;
+  PyObject *i = PyNumber_Int(x);
+  if (i) {
+    result = PyInt_AsLong(i);
+    Py_DECREF(i);
+  }
+  return result;
+}
+#endif
+
+#if PY_VERSION_HEX < 0x02050000
+#define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
+#endif
+
+#if PY_VERSION_HEX < 0x02040000
+#define Py_VISIT(op)                           \
+  do {                                                 \
+    if (op) {                                  \
+      int vret = visit((op), arg);             \
+      if (vret)                                        \
+        return vret;                           \
+    }                                          \
+  } while (0)
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef struct {
+  PyTypeObject type;
+  PyNumberMethods as_number;
+  PyMappingMethods as_mapping;
+  PySequenceMethods as_sequence;
+  PyBufferProcs as_buffer;
+  PyObject *name, *slots;
+} PyHeapTypeObject;
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef destructor freefunc;
+#endif
+
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
+     (PY_MAJOR_VERSION > 3))
+# define SWIGPY_USE_CAPSULE
+# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
+
+#if PY_VERSION_HEX < 0x03020000
+#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
+#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -871,10 +1020,13 @@ SWIG_Python_AddErrorMsg(const char* mesg)
 
   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
   if (value) {
+    char *tmp;
     PyObject *old_str = PyObject_Str(value);
     PyErr_Clear();
     Py_XINCREF(type);
-    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+
+    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(old_str);
     Py_DECREF(value);
   } else {
@@ -882,8 +1034,6 @@ SWIG_Python_AddErrorMsg(const char* mesg)
   }
 }
 
-
-
 #if defined(SWIG_PYTHON_NO_THREADS)
 #  if defined(SWIG_PYTHON_THREADS)
 #    undef SWIG_PYTHON_THREADS
@@ -957,9 +1107,6 @@ SWIG_Python_AddErrorMsg(const char* mesg)
 
 #ifdef __cplusplus
 extern "C" {
-#if 0
-} /* cc-mode */
-#endif
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -980,18 +1127,29 @@ typedef struct swig_const_info {
   swig_type_info **ptype;
 } swig_const_info;
 
-#ifdef __cplusplus
-#if 0
-{ /* cc-mode */
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+#if PY_VERSION_HEX >= 0x03000000
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
+{
+  return PyInstanceMethod_New(func);
+}
+#else
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
+{
+  return NULL;
+}
 #endif
+
+#ifdef __cplusplus
 }
 #endif
 
 
 /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
  * pyrun.swg
  *
  * This file contains the runtime support for Python modules
@@ -1006,7 +1164,15 @@ typedef struct swig_const_info {
 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
-#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
+
+#ifdef SWIGPYTHON_BUILTIN
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
+#else
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+#endif
+
+#define SWIG_InternalNewPointerObj(ptr, type, flags)   SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+
 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
 #define swig_owntype                                    int
@@ -1021,7 +1187,7 @@ typedef struct swig_const_info {
 
 /* for C or C++ function pointers */
 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
-#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
 
 /* for C++ member pointers, ie, member methods */
 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
@@ -1030,9 +1196,9 @@ typedef struct swig_const_info {
 
 /* Runtime API */
 
-#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
+#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
+#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
 
 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
 #define SWIG_SetErrorMsg                               SWIG_Python_SetErrorMsg                            
@@ -1056,7 +1222,7 @@ SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
 SWIGINTERN void 
 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-  PyErr_SetString(errtype, (char *) msg);
+  PyErr_SetString(errtype, msg);
   SWIG_PYTHON_THREAD_END_BLOCK;
 }
 
@@ -1064,12 +1230,41 @@ SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
 
 /* Set a constant value */
 
+#if defined(SWIGPYTHON_BUILTIN)
+
+SWIGINTERN void
+SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
+  PyObject *s = PyString_InternFromString(key);
+  PyList_Append(seq, s);
+  Py_DECREF(s);
+}
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
+#if PY_VERSION_HEX < 0x02030000
+  PyDict_SetItemString(d, (char *)name, obj);
+#else
+  PyDict_SetItemString(d, name, obj);
+#endif
+  Py_DECREF(obj);
+  if (public_interface)
+    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
+}
+
+#else
+
 SWIGINTERN void
 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
-  PyDict_SetItemString(d, (char*) name, obj);
+#if PY_VERSION_HEX < 0x02030000
+  PyDict_SetItemString(d, (char *)name, obj);
+#else
+  PyDict_SetItemString(d, name, obj);
+#endif
   Py_DECREF(obj);                            
 }
 
+#endif
+
 /* Append a value to the result obj */
 
 SWIGINTERN PyObject*
@@ -1130,6 +1325,14 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
     }
   }  
   if (!PyTuple_Check(args)) {
+    if (min <= 1 && max >= 1) {
+      register int i;
+      objs[0] = args;
+      for (i = 1; i < max; ++i) {
+       objs[i] = 0;
+      }
+      return 2;
+    }
     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
     return 0;
   } else {
@@ -1182,11 +1385,11 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
 
 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
 
+#define SWIG_BUILTIN_TP_INIT       (SWIG_POINTER_OWN << 2)
+#define SWIG_BUILTIN_INIT          (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
+
 #ifdef __cplusplus
 extern "C" {
-#if 0
-} /* cc-mode */
-#endif
 #endif
 
 /*  How to access Py_None */
@@ -1228,7 +1431,7 @@ SWIG_Py_Void(void)
   return none;
 }
 
-/* PySwigClientData */
+/* SwigPyClientData */
 
 typedef struct {
   PyObject *klass;
@@ -1237,30 +1440,31 @@ typedef struct {
   PyObject *destroy;
   int delargs;
   int implicitconv;
-} PySwigClientData;
+  PyTypeObject *pytype;
+} SwigPyClientData;
 
 SWIGRUNTIMEINLINE int 
 SWIG_Python_CheckImplicit(swig_type_info *ty)
 {
-  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
   return data ? data->implicitconv : 0;
 }
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_ExceptionType(swig_type_info *desc) {
-  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
   PyObject *klass = data ? data->klass : 0;
   return (klass ? klass : PyExc_RuntimeError);
 }
 
 
-SWIGRUNTIME PySwigClientData * 
-PySwigClientData_New(PyObject* obj)
+SWIGRUNTIME SwigPyClientData * 
+SwigPyClientData_New(PyObject* obj)
 {
   if (!obj) {
     return 0;
   } else {
-    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
     /* the klass element */
     data->klass = obj;
     Py_INCREF(data->klass);
@@ -1303,19 +1507,19 @@ PySwigClientData_New(PyObject* obj)
       data->delargs = 0;
     }
     data->implicitconv = 0;
+    data->pytype = 0;
     return data;
   }
 }
 
 SWIGRUNTIME void 
-PySwigClientData_Del(PySwigClientData* data)
-{
+SwigPyClientData_Del(SwigPyClientData *data) {
   Py_XDECREF(data->newraw);
   Py_XDECREF(data->newargs);
   Py_XDECREF(data->destroy);
 }
 
-/* =============== PySwigObject =====================*/
+/* =============== SwigPyObject =====================*/
 
 typedef struct {
   PyObject_HEAD
@@ -1323,24 +1527,31 @@ typedef struct {
   swig_type_info *ty;
   int own;
   PyObject *next;
-} PySwigObject;
+#ifdef SWIGPYTHON_BUILTIN
+  PyObject *dict;
+#endif
+} SwigPyObject;
 
 SWIGRUNTIME PyObject *
-PySwigObject_long(PySwigObject *v)
+SwigPyObject_long(SwigPyObject *v)
 {
   return PyLong_FromVoidPtr(v->ptr);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_format(const char* fmt, PySwigObject *v)
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
 {
   PyObject *res = NULL;
   PyObject *args = PyTuple_New(1);
   if (args) {
-    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
-      PyObject *ofmt = PyString_FromString(fmt);
+    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
       if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+       res = PyUnicode_Format(ofmt,args);
+#else
        res = PyString_Format(ofmt,args);
+#endif
        Py_DECREF(ofmt);
       }
       Py_DECREF(args);
@@ -1350,104 +1561,118 @@ PySwigObject_format(const char* fmt, PySwigObject *v)
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_oct(PySwigObject *v)
+SwigPyObject_oct(SwigPyObject *v)
 {
-  return PySwigObject_format("%o",v);
+  return SwigPyObject_format("%o",v);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_hex(PySwigObject *v)
+SwigPyObject_hex(SwigPyObject *v)
 {
-  return PySwigObject_format("%x",v);
+  return SwigPyObject_format("%x",v);
 }
 
 SWIGRUNTIME PyObject *
 #ifdef METH_NOARGS
-PySwigObject_repr(PySwigObject *v)
+SwigPyObject_repr(SwigPyObject *v)
 #else
-PySwigObject_repr(PySwigObject *v, PyObject *args)
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
 #endif
 {
   const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *hex = PySwigObject_hex(v);    
-  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
-  Py_DECREF(hex);
+  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
   if (v->next) {
-#ifdef METH_NOARGS
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
-#else
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
-#endif
+# ifdef METH_NOARGS
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
+# else
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
+# endif
+# if PY_VERSION_HEX >= 0x03000000
+    PyObject *joined = PyUnicode_Concat(repr, nrep);
+    Py_DecRef(repr);
+    Py_DecRef(nrep);
+    repr = joined;
+# else
     PyString_ConcatAndDel(&repr,nrep);
+# endif
   }
   return repr;  
 }
 
 SWIGRUNTIME int
-PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
 {
-#ifdef METH_NOARGS
-  PyObject *repr = PySwigObject_repr(v);
-#else
-  PyObject *repr = PySwigObject_repr(v, NULL);
-#endif
-  if (repr) {
-    fputs(PyString_AsString(repr), fp);
-    Py_DECREF(repr);
-    return 0; 
-  } else {
-    return 1; 
-  }
+  void *i = v->ptr;
+  void *j = w->ptr;
+  return (i < j) ? -1 : ((i > j) ? 1 : 0);
 }
 
-SWIGRUNTIME PyObject *
-PySwigObject_str(PySwigObject *v)
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
 {
-  char result[SWIG_BUFFER_SIZE];
-  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
-    PyString_FromString(result) : 0;
+  PyObject* res;
+  if( op != Py_EQ && op != Py_NE ) {
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+  }
+  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
+  return res;  
 }
 
-SWIGRUNTIME int
-PySwigObject_compare(PySwigObject *v, PySwigObject *w)
-{
-  void *i = v->ptr;
-  void *j = w->ptr;
-  return (i < j) ? -1 : ((i > j) ? 1 : 0);
-}
 
-SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
+SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
 
+#ifdef SWIGPYTHON_BUILTIN
+static swig_type_info *SwigPyObject_stype = 0;
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+    SwigPyClientData *cd;
+    assert(SwigPyObject_stype);
+    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+    assert(cd);
+    assert(cd->pytype);
+    return cd->pytype;
+}
+#else
 SWIGRUNTIME PyTypeObject*
-PySwigObject_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
+SwigPyObject_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
   return type;
 }
+#endif
 
 SWIGRUNTIMEINLINE int
-PySwigObject_Check(PyObject *op) {
-  return ((op)->ob_type == PySwigObject_type())
-    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+SwigPyObject_Check(PyObject *op) {
+#ifdef SWIGPYTHON_BUILTIN
+  PyTypeObject *target_tp = SwigPyObject_type();
+  if (PyType_IsSubtype(op->ob_type, target_tp))
+    return 1;
+  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
+#else
+  return (Py_TYPE(op) == SwigPyObject_type())
+    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
+#endif
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
 
 SWIGRUNTIME void
-PySwigObject_dealloc(PyObject *v)
+SwigPyObject_dealloc(PyObject *v)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   PyObject *next = sobj->next;
   if (sobj->own == SWIG_POINTER_OWN) {
     swig_type_info *ty = sobj->ty;
-    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
     PyObject *destroy = data ? data->destroy : 0;
     if (destroy) {
       /* destroy is always a VARARGS method */
       PyObject *res;
       if (data->delargs) {
-       /* we need to create a temporal object to carry the destroy operation */
-       PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+       /* we need to create a temporary object to carry the destroy operation */
+       PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
        res = SWIG_Python_CallFunctor(destroy, tmp);
        Py_DECREF(tmp);
       } else {
@@ -1469,15 +1694,15 @@ PySwigObject_dealloc(PyObject *v)
 }
 
 SWIGRUNTIME PyObject* 
-PySwigObject_append(PyObject* v, PyObject* next)
+SwigPyObject_append(PyObject* v, PyObject* next)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
 #ifndef METH_O
   PyObject *tmp = 0;
   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
   next = tmp;
 #endif
-  if (!PySwigObject_Check(next)) {
+  if (!SwigPyObject_Check(next)) {
     return NULL;
   }
   sobj->next = next;
@@ -1487,12 +1712,12 @@ PySwigObject_append(PyObject* v, PyObject* next)
 
 SWIGRUNTIME PyObject* 
 #ifdef METH_NOARGS
-PySwigObject_next(PyObject* v)
+SwigPyObject_next(PyObject* v)
 #else
-PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   if (sobj->next) {    
     Py_INCREF(sobj->next);
     return sobj->next;
@@ -1503,56 +1728,58 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_disown(PyObject *v)
+SwigPyObject_disown(PyObject *v)
 #else
-PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = 0;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_acquire(PyObject *v)
+SwigPyObject_acquire(PyObject *v)
 #else
-PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = SWIG_POINTER_OWN;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
-PySwigObject_own(PyObject *v, PyObject *args)
+SwigPyObject_own(PyObject *v, PyObject *args)
 {
   PyObject *val = 0;
 #if (PY_VERSION_HEX < 0x02020000)
   if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
-#else
+#elif (PY_VERSION_HEX < 0x02050000)
   if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
+#else
+  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) 
 #endif
     {
       return NULL;
     } 
   else
     {
-      PySwigObject *sobj = (PySwigObject *)v;
+      SwigPyObject *sobj = (SwigPyObject *)v;
       PyObject *obj = PyBool_FromLong(sobj->own);
       if (val) {
 #ifdef METH_NOARGS
        if (PyObject_IsTrue(val)) {
-         PySwigObject_acquire(v);
+         SwigPyObject_acquire(v);
        } else {
-         PySwigObject_disown(v);
+         SwigPyObject_disown(v);
        }
 #else
        if (PyObject_IsTrue(val)) {
-         PySwigObject_acquire(v,args);
+         SwigPyObject_acquire(v,args);
        } else {
-         PySwigObject_disown(v,args);
+         SwigPyObject_disown(v,args);
        }
 #endif
       } 
@@ -1563,44 +1790,47 @@ PySwigObject_own(PyObject *v, PyObject *args)
 #ifdef METH_O
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #else
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #endif
 
 #if PY_VERSION_HEX < 0x02020000
 SWIGINTERN PyObject *
-PySwigObject_getattr(PySwigObject *sobj,char *name)
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
 {
   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
 }
 #endif
 
 SWIGRUNTIME PyTypeObject*
-_PySwigObject_type(void) {
+SwigPyObject_TypeOnce(void) {
   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
-  
-  static PyNumberMethods PySwigObject_as_number = {
+
+  static PyNumberMethods SwigPyObject_as_number = {
     (binaryfunc)0, /*nb_add*/
     (binaryfunc)0, /*nb_subtract*/
     (binaryfunc)0, /*nb_multiply*/
+    /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
     (binaryfunc)0, /*nb_divide*/
+#endif
     (binaryfunc)0, /*nb_remainder*/
     (binaryfunc)0, /*nb_divmod*/
     (ternaryfunc)0,/*nb_power*/
@@ -1614,13 +1844,23 @@ _PySwigObject_type(void) {
     0,            /*nb_and*/
     0,            /*nb_xor*/
     0,            /*nb_or*/
-    (coercion)0,   /*nb_coerce*/
-    (unaryfunc)PySwigObject_long, /*nb_int*/
-    (unaryfunc)PySwigObject_long, /*nb_long*/
+#if PY_VERSION_HEX < 0x03000000
+    0,   /*nb_coerce*/
+#endif
+    (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+    0, /*nb_reserved*/
+#endif
     (unaryfunc)0,                 /*nb_float*/
-    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
-    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
+    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
@@ -1629,81 +1869,97 @@ _PySwigObject_type(void) {
 #endif
   };
 
-  static PyTypeObject pyswigobject_type;  
+  static PyTypeObject swigpyobject_type;
   static int type_init = 0;
   if (!type_init) {
-    const PyTypeObject tmp
-      = {
-       PyObject_HEAD_INIT(NULL)
-       0,                                  /* ob_size */
-       (char *)"PySwigObject",             /* tp_name */
-       sizeof(PySwigObject),               /* tp_basicsize */
-       0,                                  /* tp_itemsize */
-       (destructor)PySwigObject_dealloc,   /* tp_dealloc */
-       (printfunc)PySwigObject_print,      /* tp_print */
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyObject",               /* tp_name */
+      sizeof(SwigPyObject),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
+      0,                                   /* tp_print */
 #if PY_VERSION_HEX < 0x02020000
-       (getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
+      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
+#else
+      (getattrfunc)0,                       /* tp_getattr */
+#endif
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX >= 0x03000000
+    0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
 #else
-       (getattrfunc)0,                     /* tp_getattr */ 
-#endif
-       (setattrfunc)0,                     /* tp_setattr */ 
-       (cmpfunc)PySwigObject_compare,      /* tp_compare */ 
-       (reprfunc)PySwigObject_repr,        /* tp_repr */    
-       &PySwigObject_as_number,            /* tp_as_number */
-       0,                                  /* tp_as_sequence */
-       0,                                  /* tp_as_mapping */
-       (hashfunc)0,                        /* tp_hash */
-       (ternaryfunc)0,                     /* tp_call */
-       (reprfunc)PySwigObject_str,         /* tp_str */
-       PyObject_GenericGetAttr,            /* tp_getattro */
-       0,                                  /* tp_setattro */
-       0,                                  /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT,                 /* tp_flags */
-       swigobject_doc,                     /* tp_doc */        
-       0,                                  /* tp_traverse */
-       0,                                  /* tp_clear */
-       0,                                  /* tp_richcompare */
-       0,                                  /* tp_weaklistoffset */
+      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyObject_repr,          /* tp_repr */
+      &SwigPyObject_as_number,              /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      0,                                   /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigobject_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
 #if PY_VERSION_HEX >= 0x02020000
-       0,                                  /* tp_iter */
-       0,                                  /* tp_iternext */
-       swigobject_methods,                 /* tp_methods */ 
-       0,                                  /* tp_members */
-       0,                                  /* tp_getset */             
-       0,                                  /* tp_base */               
-       0,                                  /* tp_dict */               
-       0,                                  /* tp_descr_get */          
-       0,                                  /* tp_descr_set */          
-       0,                                  /* tp_dictoffset */         
-       0,                                  /* tp_init */               
-       0,                                  /* tp_alloc */              
-       0,                                  /* tp_new */                
-       0,                                  /* tp_free */          
-        0,                                  /* tp_is_gc */  
-       0,                                  /* tp_bases */   
-       0,                                  /* tp_mro */
-       0,                                  /* tp_cache */   
-       0,                                  /* tp_subclasses */
-       0,                                  /* tp_weaklist */
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      swigobject_methods,                   /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
 #endif
 #if PY_VERSION_HEX >= 0x02030000
-       0,                                  /* tp_del */
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
 #endif
 #ifdef COUNT_ALLOCS
-       0,0,0,0                             /* tp_alloc -> tp_next */
+      0,0,0,0                               /* tp_alloc -> tp_next */
 #endif
-      };
-    pyswigobject_type = tmp;
-    pyswigobject_type.ob_type = &PyType_Type;
+    };
+    swigpyobject_type = tmp;
     type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpyobject_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpyobject_type) < 0)
+      return NULL;
+#endif
   }
-  return &pyswigobject_type;
+  return &swigpyobject_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own)
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
 {
-  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
   if (sobj) {
     sobj->ptr  = ptr;
     sobj->ty   = ty;
@@ -1722,10 +1978,10 @@ typedef struct {
   void *pack;
   swig_type_info *ty;
   size_t size;
-} PySwigPacked;
+} SwigPyPacked;
 
 SWIGRUNTIME int
-PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 {
   char result[SWIG_BUFFER_SIZE];
   fputs("<Swig Packed ", fp); 
@@ -1739,29 +1995,29 @@ PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 }
   
 SWIGRUNTIME PyObject *
-PySwigPacked_repr(PySwigPacked *v)
+SwigPyPacked_repr(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
   } else {
-    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
   }  
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_str(PySwigPacked *v)
+SwigPyPacked_str(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return PyString_FromFormat("%s%s", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
   } else {
-    return PyString_FromString(v->ty->name);
+    return SWIG_Python_str_FromChar(v->ty->name);
   }  
 }
 
 SWIGRUNTIME int
-PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
 {
   size_t i = v->size;
   size_t j = w->size;
@@ -1769,104 +2025,120 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
   return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
 }
 
-SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
+SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
 
 SWIGRUNTIME PyTypeObject*
-PySwigPacked_type(void) {
-  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
+SwigPyPacked_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
   return type;
 }
 
 SWIGRUNTIMEINLINE int
-PySwigPacked_Check(PyObject *op) {
-  return ((op)->ob_type == _PySwigPacked_type()) 
-    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+SwigPyPacked_Check(PyObject *op) {
+  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
+    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
 }
 
 SWIGRUNTIME void
-PySwigPacked_dealloc(PyObject *v)
+SwigPyPacked_dealloc(PyObject *v)
 {
-  if (PySwigPacked_Check(v)) {
-    PySwigPacked *sobj = (PySwigPacked *) v;
+  if (SwigPyPacked_Check(v)) {
+    SwigPyPacked *sobj = (SwigPyPacked *) v;
     free(sobj->pack);
   }
   PyObject_DEL(v);
 }
 
 SWIGRUNTIME PyTypeObject*
-_PySwigPacked_type(void) {
+SwigPyPacked_TypeOnce(void) {
   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject pyswigpacked_type;
-  static int type_init = 0;  
+  static PyTypeObject swigpypacked_type;
+  static int type_init = 0;
   if (!type_init) {
-    const PyTypeObject tmp
-      = {
-       PyObject_HEAD_INIT(NULL)
-       0,                                  /* ob_size */       
-       (char *)"PySwigPacked",             /* tp_name */       
-       sizeof(PySwigPacked),               /* tp_basicsize */  
-       0,                                  /* tp_itemsize */   
-       (destructor)PySwigPacked_dealloc,   /* tp_dealloc */    
-       (printfunc)PySwigPacked_print,      /* tp_print */      
-       (getattrfunc)0,                     /* tp_getattr */    
-       (setattrfunc)0,                     /* tp_setattr */    
-       (cmpfunc)PySwigPacked_compare,      /* tp_compare */    
-       (reprfunc)PySwigPacked_repr,        /* tp_repr */       
-       0,                                  /* tp_as_number */  
-       0,                                  /* tp_as_sequence */
-       0,                                  /* tp_as_mapping */ 
-       (hashfunc)0,                        /* tp_hash */       
-       (ternaryfunc)0,                     /* tp_call */       
-       (reprfunc)PySwigPacked_str,         /* tp_str */        
-       PyObject_GenericGetAttr,            /* tp_getattro */
-       0,                                  /* tp_setattro */
-       0,                                  /* tp_as_buffer */
-       Py_TPFLAGS_DEFAULT,                 /* tp_flags */
-       swigpacked_doc,                     /* tp_doc */
-       0,                                  /* tp_traverse */
-       0,                                  /* tp_clear */
-       0,                                  /* tp_richcompare */
-       0,                                  /* tp_weaklistoffset */
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyPacked",               /* tp_name */
+      sizeof(SwigPyPacked),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
+      (printfunc)SwigPyPacked_print,        /* tp_print */
+      (getattrfunc)0,                       /* tp_getattr */
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX>=0x03000000
+      0, /* tp_reserved in 3.0.1 */
+#else
+      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
+      0,                                    /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      (reprfunc)SwigPyPacked_str,           /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigpacked_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      0,                                    /* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
 #if PY_VERSION_HEX >= 0x02020000
-       0,                                  /* tp_iter */
-       0,                                  /* tp_iternext */
-       0,                                  /* tp_methods */ 
-       0,                                  /* tp_members */
-       0,                                  /* tp_getset */             
-       0,                                  /* tp_base */               
-       0,                                  /* tp_dict */               
-       0,                                  /* tp_descr_get */          
-       0,                                  /* tp_descr_set */          
-       0,                                  /* tp_dictoffset */         
-       0,                                  /* tp_init */               
-       0,                                  /* tp_alloc */              
-       0,                                  /* tp_new */                
-       0,                                  /* tp_free */          
-        0,                                  /* tp_is_gc */  
-       0,                                  /* tp_bases */   
-       0,                                  /* tp_mro */
-       0,                                  /* tp_cache */   
-       0,                                  /* tp_subclasses */
-       0,                                  /* tp_weaklist */
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      0,                                    /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
 #endif
 #if PY_VERSION_HEX >= 0x02030000
-       0,                                  /* tp_del */
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
 #endif
 #ifdef COUNT_ALLOCS
-       0,0,0,0                             /* tp_alloc -> tp_next */
+      0,0,0,0                               /* tp_alloc -> tp_next */
 #endif
-      };
-    pyswigpacked_type = tmp;
-    pyswigpacked_type.ob_type = &PyType_Type;
+    };
+    swigpypacked_type = tmp;
     type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpypacked_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpypacked_type) < 0)
+      return NULL;
+#endif
   }
-  return &pyswigpacked_type;
+  return &swigpypacked_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
 {
-  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
   if (sobj) {
     void *pack = malloc(size);
     if (pack) {
@@ -1883,10 +2155,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
 }
 
 SWIGRUNTIME swig_type_info *
-PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 {
-  if (PySwigPacked_Check(obj)) {
-    PySwigPacked *sobj = (PySwigPacked *)obj;
+  if (SwigPyPacked_Check(obj)) {
+    SwigPyPacked *sobj = (SwigPyPacked *)obj;
     if (sobj->size != size) return 0;
     memcpy(ptr, sobj->pack, size);
     return sobj->ty;
@@ -1902,65 +2174,88 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 SWIGRUNTIMEINLINE PyObject *
 _SWIG_This(void)
 {
-  return PyString_FromString("this");
+    return SWIG_Python_str_FromChar("this");
 }
 
+static PyObject *swig_this = NULL;
+
 SWIGRUNTIME PyObject *
 SWIG_This(void)
 {
-  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+  if (swig_this == NULL)
+    swig_this = _SWIG_This();
   return swig_this;
 }
 
 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
 
-SWIGRUNTIME PySwigObject *
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS 
+#endif
+
+SWIGRUNTIME SwigPyObject *
 SWIG_Python_GetSwigThis(PyObject *pyobj) 
 {
-  if (PySwigObject_Check(pyobj)) {
-    return (PySwigObject *) pyobj;
-  } else {
-    PyObject *obj = 0;
+  PyObject *obj;
+
+  if (SwigPyObject_Check(pyobj))
+    return (SwigPyObject *) pyobj;
+
+#ifdef SWIGPYTHON_BUILTIN
+  (void)obj;
+# ifdef PyWeakref_CheckProxy
+  if (PyWeakref_CheckProxy(pyobj)) {
+    pyobj = PyWeakref_GET_OBJECT(pyobj);
+    if (pyobj && SwigPyObject_Check(pyobj))
+      return (SwigPyObject*) pyobj;
+  }
+# endif
+  return NULL;
+#else
+
+  obj = 0;
+
 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
-    if (PyInstance_Check(pyobj)) {
-      obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+  if (PyInstance_Check(pyobj)) {
+    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+  } else {
+    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+    if (dictptr != NULL) {
+      PyObject *dict = *dictptr;
+      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
     } else {
-      PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
-      if (dictptr != NULL) {
-       PyObject *dict = *dictptr;
-       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
-      } else {
 #ifdef PyWeakref_CheckProxy
-       if (PyWeakref_CheckProxy(pyobj)) {
-         PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
-         return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
-       }
+      if (PyWeakref_CheckProxy(pyobj)) {
+       PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+       return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+      }
 #endif
-       obj = PyObject_GetAttr(pyobj,SWIG_This());
-       if (obj) {
-         Py_DECREF(obj);
-       } else {
-         if (PyErr_Occurred()) PyErr_Clear();
-         return 0;
-       }
+      obj = PyObject_GetAttr(pyobj,SWIG_This());
+      if (obj) {
+       Py_DECREF(obj);
+      } else {
+       if (PyErr_Occurred()) PyErr_Clear();
+       return 0;
       }
     }
+  }
 #else
-    obj = PyObject_GetAttr(pyobj,SWIG_This());
-    if (obj) {
-      Py_DECREF(obj);
-    } else {
-      if (PyErr_Occurred()) PyErr_Clear();
-      return 0;
-    }
+  obj = PyObject_GetAttr(pyobj,SWIG_This());
+  if (obj) {
+    Py_DECREF(obj);
+  } else {
+    if (PyErr_Occurred()) PyErr_Clear();
+    return 0;
+  }
 #endif
-    if (obj && !PySwigObject_Check(obj)) {
-      /* a PyObject is called 'this', try to get the 'real this'
-        PySwigObject from it */ 
-      return SWIG_Python_GetSwigThis(obj);
-    }
-    return (PySwigObject *)obj;
+  if (obj && !SwigPyObject_Check(obj)) {
+    /* a PyObject is called 'this', try to get the 'real this'
+       SwigPyObject from it */ 
+    return SWIG_Python_GetSwigThis(obj);
   }
+  return (SwigPyObject *)obj;
+#endif
 }
 
 /* Acquire a pointer value */
@@ -1968,7 +2263,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
 SWIGRUNTIME int
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
   if (own == SWIG_POINTER_OWN) {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (sobj) {
       int oldown = sobj->own;
       sobj->own = own;
@@ -1982,91 +2277,105 @@ SWIG_Python_AcquirePtr(PyObject *obj, int own) {
 
 SWIGRUNTIME int
 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
-  if (!obj) return SWIG_ERROR;
-  if (obj == Py_None) {
-    if (ptr) *ptr = 0;
+  int res;
+  SwigPyObject *sobj;
+  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
+
+  if (!obj)
+    return SWIG_ERROR;
+  if (obj == Py_None && !implicit_conv) {
+    if (ptr)
+      *ptr = 0;
     return SWIG_OK;
-  } else {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+  }
+
+  res = SWIG_ERROR;
+
+  sobj = SWIG_Python_GetSwigThis(obj);
+  if (own)
+    *own = 0;
+  while (sobj) {
+    void *vptr = sobj->ptr;
+    if (ty) {
+      swig_type_info *to = sobj->ty;
+      if (to == ty) {
+        /* no type cast needed */
+        if (ptr) *ptr = vptr;
+        break;
+      } else {
+        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+        if (!tc) {
+          sobj = (SwigPyObject *)sobj->next;
+        } else {
+          if (ptr) {
+            int newmemory = 0;
+            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+            if (newmemory == SWIG_CAST_NEW_MEMORY) {
+              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
+              if (own)
+                *own = *own | SWIG_CAST_NEW_MEMORY;
+            }
+          }
+          break;
+        }
+      }
+    } else {
+      if (ptr) *ptr = vptr;
+      break;
+    }
+  }
+  if (sobj) {
     if (own)
-      *own = 0;
-    while (sobj) {
-      void *vptr = sobj->ptr;
-      if (ty) {
-       swig_type_info *to = sobj->ty;
-       if (to == ty) {
-         /* no type cast needed */
-         if (ptr) *ptr = vptr;
-         break;
-       } else {
-         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
-         if (!tc) {
-           sobj = (PySwigObject *)sobj->next;
-         } else {
-           if (ptr) {
-              int newmemory = 0;
-              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
-              if (newmemory == SWIG_CAST_NEW_MEMORY) {
-                assert(own);
-                if (own)
-                  *own = *own | SWIG_CAST_NEW_MEMORY;
+      *own = *own | sobj->own;
+    if (flags & SWIG_POINTER_DISOWN) {
+      sobj->own = 0;
+    }
+    res = SWIG_OK;
+  } else {
+    if (implicit_conv) {
+      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+      if (data && !data->implicitconv) {
+        PyObject *klass = data->klass;
+        if (klass) {
+          PyObject *impconv;
+          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+          impconv = SWIG_Python_CallFunctor(klass, obj);
+          data->implicitconv = 0;
+          if (PyErr_Occurred()) {
+            PyErr_Clear();
+            impconv = 0;
+          }
+          if (impconv) {
+            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
+            if (iobj) {
+              void *vptr;
+              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+              if (SWIG_IsOK(res)) {
+                if (ptr) {
+                  *ptr = vptr;
+                  /* transfer the ownership to 'ptr' */
+                  iobj->own = 0;
+                  res = SWIG_AddCast(res);
+                  res = SWIG_AddNewMask(res);
+                } else {
+                  res = SWIG_AddCast(res);                 
+                }
               }
             }
-           break;
-         }
-       }
-      } else {
-       if (ptr) *ptr = vptr;
-       break;
+            Py_DECREF(impconv);
+          }
+        }
       }
     }
-    if (sobj) {
-      if (own)
-        *own = *own | sobj->own;
-      if (flags & SWIG_POINTER_DISOWN) {
-       sobj->own = 0;
-      }
-      return SWIG_OK;
-    } else {
-      int res = SWIG_ERROR;
-      if (flags & SWIG_POINTER_IMPLICIT_CONV) {
-       PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
-       if (data && !data->implicitconv) {
-         PyObject *klass = data->klass;
-         if (klass) {
-           PyObject *impconv;
-           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
-           impconv = SWIG_Python_CallFunctor(klass, obj);
-           data->implicitconv = 0;
-           if (PyErr_Occurred()) {
-             PyErr_Clear();
-             impconv = 0;
-           }
-           if (impconv) {
-             PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
-             if (iobj) {
-               void *vptr;
-               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
-               if (SWIG_IsOK(res)) {
-                 if (ptr) {
-                   *ptr = vptr;
-                   /* transfer the ownership to 'ptr' */
-                   iobj->own = 0;
-                   res = SWIG_AddCast(res);
-                   res = SWIG_AddNewMask(res);
-                 } else {
-                   res = SWIG_AddCast(res);                
-                 }
-               }
-             }
-             Py_DECREF(impconv);
-           }
-         }
-       }
-      }
-      return res;
+    if (!SWIG_IsOK(res) && obj == Py_None) {
+      if (ptr)
+        *ptr = 0;
+      if (PyErr_Occurred())
+        PyErr_Clear();
+      res = SWIG_OK;
     }
   }
+  return res;
 }
 
 /* Convert a function ptr value */
@@ -2081,10 +2390,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     /* here we get the method pointer for callbacks */
     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc) {
+    if (desc)
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-      if (!desc) return SWIG_ERROR;
-    }
+    if (!desc) 
+      return SWIG_ERROR;
     if (ty) {
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
       if (tc) {
@@ -2105,7 +2414,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
 
 SWIGRUNTIME int
 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
   if (!to) return SWIG_ERROR;
   if (ty) {
     if (to != ty) {
@@ -2122,12 +2431,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t
  * ----------------------------------------------------------------------------- */
 
 /*
-  Create a new instance object, whitout calling __init__, and set the
+  Create a new instance object, without calling __init__, and set the
   'this' attribute.
 */
 
 SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
 {
 #if (PY_VERSION_HEX >= 0x02020000)
   PyObject *inst = 0;
@@ -2151,19 +2460,31 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
 #endif
     }
   } else {
+#if PY_VERSION_HEX >= 0x03000000
+    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+    if (inst) {
+      PyObject_SetAttr(inst, SWIG_This(), swig_this);
+      Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+    }
+#else
     PyObject *dict = PyDict_New();
-    PyDict_SetItem(dict, SWIG_This(), swig_this);
-    inst = PyInstance_NewRaw(data->newargs, dict);
-    Py_DECREF(dict);
+    if (dict) {
+      PyDict_SetItem(dict, SWIG_This(), swig_this);
+      inst = PyInstance_NewRaw(data->newargs, dict);
+      Py_DECREF(dict);
+    }
+#endif
   }
   return inst;
 #else
 #if (PY_VERSION_HEX >= 0x02010000)
-  PyObject *inst;
+  PyObject *inst = 0;
   PyObject *dict = PyDict_New();
-  PyDict_SetItem(dict, SWIG_This(), swig_this);
-  inst = PyInstance_NewRaw(data->newargs, dict);
-  Py_DECREF(dict);
+  if (dict) {
+    PyDict_SetItem(dict, SWIG_This(), swig_this);
+    inst = PyInstance_NewRaw(data->newargs, dict);
+    Py_DECREF(dict);
+  }
   return (PyObject *) inst;
 #else
   PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
@@ -2214,12 +2535,12 @@ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
 SWIGINTERN PyObject *
 SWIG_Python_InitShadowInstance(PyObject *args) {
   PyObject *obj[2];
-  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
     return NULL;
   } else {
-    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
     if (sthis) {
-      PySwigObject_append((PyObject*) sthis, obj[1]);
+      SwigPyObject_append((PyObject*) sthis, obj[1]);
     } else {
       SWIG_Python_SetSwigThis(obj[0], obj[1]);
     }
@@ -2230,29 +2551,59 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
 /* Create a new pointer object */
 
 SWIGRUNTIME PyObject *
-SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
-  if (!ptr) {
+SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
+  SwigPyClientData *clientdata;
+  PyObject * robj;
+  int own;
+
+  if (!ptr)
     return SWIG_Py_Void();
-  } else {
-    int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-    PyObject *robj = PySwigObject_New(ptr, type, own);
-    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
-    if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
-      PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
-      if (inst) {
-       Py_DECREF(robj);
-       robj = inst;
+
+  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
+  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+  if (clientdata && clientdata->pytype) {
+    SwigPyObject *newobj;
+    if (flags & SWIG_BUILTIN_TP_INIT) {
+      newobj = (SwigPyObject*) self;
+      if (newobj->ptr) {
+        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
+        while (newobj->next)
+         newobj = (SwigPyObject *) newobj->next;
+        newobj->next = next_self;
+        newobj = (SwigPyObject *)next_self;
       }
+    } else {
+      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+    }
+    if (newobj) {
+      newobj->ptr = ptr;
+      newobj->ty = type;
+      newobj->own = own;
+      newobj->next = 0;
+#ifdef SWIGPYTHON_BUILTIN
+      newobj->dict = 0;
+#endif
+      return (PyObject*) newobj;
     }
-    return robj;
+    return SWIG_Py_Void();
+  }
+
+  assert(!(flags & SWIG_BUILTIN_TP_INIT));
+
+  robj = SwigPyObject_New(ptr, type, own);
+  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+    Py_DECREF(robj);
+    robj = inst;
   }
+  return robj;
 }
 
 /* Create a new packed object */
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
 }
 
 /* -----------------------------------------------------------------------------*
@@ -2264,15 +2615,19 @@ void *SWIG_ReturnGlobalTypeList(void *);
 #endif
 
 SWIGRUNTIME swig_module_info *
-SWIG_Python_GetModule(void) {
+SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
   static void *type_pointer = (void *)0;
   /* first check if module already created */
   if (!type_pointer) {
 #ifdef SWIG_LINK_RUNTIME
     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
 #else
+# ifdef SWIGPY_USE_CAPSULE
+    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
+# else
     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
                                    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+# endif
     if (PyErr_Occurred()) {
       PyErr_Clear();
       type_pointer = (void *)0;
@@ -2315,33 +2670,54 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
 #endif
 
 SWIGRUNTIME void
+#ifdef SWIGPY_USE_CAPSULE
+SWIG_Python_DestroyModule(PyObject *obj)
+#else
 SWIG_Python_DestroyModule(void *vptr)
+#endif
 {
+#ifdef SWIGPY_USE_CAPSULE
+  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
+#else
   swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
   swig_type_info **types = swig_module->types;
   size_t i;
   for (i =0; i < swig_module->size; ++i) {
     swig_type_info *ty = types[i];
     if (ty->owndata) {
-      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
-      if (data) PySwigClientData_Del(data);
+      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+      if (data) SwigPyClientData_Del(data);
     }
   }
   Py_DECREF(SWIG_This());
+  swig_this = NULL;
 }
 
 SWIGRUNTIME void
 SWIG_Python_SetModule(swig_module_info *swig_module) {
-  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
-
-  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
-                                  swig_empty_runtime_method_table);
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
+  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
+  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
+#endif
+#ifdef SWIGPY_USE_CAPSULE
+  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+#else
   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
   if (pointer && module) {
     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
   } else {
     Py_XDECREF(pointer);
   }
+#endif
 }
 
 /* The python cached type query */
@@ -2355,16 +2731,24 @@ SWIGRUNTIME swig_type_info *
 SWIG_Python_TypeQuery(const char *type)
 {
   PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = PyString_FromString(type); 
+  PyObject *key = SWIG_Python_str_FromChar(type); 
   PyObject *obj = PyDict_GetItem(cache, key);
   swig_type_info *descriptor;
   if (obj) {
+#ifdef SWIGPY_USE_CAPSULE
+    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
+#else
     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
   } else {
-    swig_module_info *swig_module = SWIG_Python_GetModule();
+    swig_module_info *swig_module = SWIG_GetModule(0);
     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
     if (descriptor) {
+#ifdef SWIGPY_USE_CAPSULE
+      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
+#else
       obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
       PyDict_SetItem(cache, key, obj);
       Py_DECREF(obj);
     }
@@ -2382,21 +2766,23 @@ SWIG_Python_TypeQuery(const char *type)
 
 SWIGRUNTIME int
 SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{
+{  
   if (PyErr_Occurred()) {
     PyObject *type = 0;
     PyObject *value = 0;
     PyObject *traceback = 0;
     PyErr_Fetch(&type, &value, &traceback);
     if (value) {
+      char *tmp;
       PyObject *old_str = PyObject_Str(value);
       Py_XINCREF(type);
       PyErr_Clear();
       if (infront) {
-       PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+       PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
       } else {
-       PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+       PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
       }
+      SWIG_Python_str_DelForPy3(tmp);
       Py_DECREF(old_str);
     }
     return 1;
@@ -2419,11 +2805,11 @@ SWIG_Python_ArgFail(int argnum)
 }
 
 SWIGRUNTIMEINLINE const char *
-PySwigObject_GetDesc(PyObject *self)
+SwigPyObject_GetDesc(PyObject *self)
 {
-  PySwigObject *v = (PySwigObject *)self;
+  SwigPyObject *v = (SwigPyObject *)self;
   swig_type_info *ty = v ? v->ty : 0;
-  return ty ? ty->str : (char*)"";
+  return ty ? ty->str : "";
 }
 
 SWIGRUNTIME void
@@ -2431,10 +2817,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
 {
   if (type) {
 #if defined(SWIG_COBJECT_TYPES)
-    if (obj && PySwigObject_Check(obj)) {
-      const char *otype = (const char *) PySwigObject_GetDesc(obj);
+    if (obj && SwigPyObject_Check(obj)) {
+      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
       if (otype) {
-       PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+       PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
                     type, otype);
        return;
       }
@@ -2444,10 +2830,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
       if (otype) {
        PyObject *str = PyObject_Str(obj);
-       const char *cstr = str ? PyString_AsString(str) : 0;
+       const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
        if (cstr) {
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
                       type, otype, cstr);
+          SWIG_Python_str_DelForPy3(cstr);
        } else {
          PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
                       type, otype);
@@ -2465,23 +2852,75 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
 
 /* Convert a pointer value, signal an exception on a type mismatch */
 SWIGRUNTIME void *
-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
   void *result;
   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
     PyErr_Clear();
-    if (flags & SWIG_POINTER_EXCEPTION) {
+#if SWIG_POINTER_EXCEPTION
+    if (flags) {
       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
       SWIG_Python_ArgFail(argnum);
     }
+#endif
   }
   return result;
 }
 
+#ifdef SWIGPYTHON_BUILTIN
+SWIGRUNTIME int
+SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
+  PyTypeObject *tp = obj->ob_type;
+  PyObject *descr;
+  PyObject *encoded_name;
+  descrsetfunc f;
+  int res = -1;
+
+# ifdef Py_USING_UNICODE
+  if (PyString_Check(name)) {
+    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
+    if (!name)
+      return -1;
+  } else if (!PyUnicode_Check(name))
+# else
+  if (!PyString_Check(name))
+# endif
+  {
+    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
+    return -1;
+  } else {
+    Py_INCREF(name);
+  }
 
-#ifdef __cplusplus
-#if 0
-{ /* cc-mode */
+  if (!tp->tp_dict) {
+    if (PyType_Ready(tp) < 0)
+      goto done;
+  }
+
+  descr = _PyType_Lookup(tp, name);
+  f = NULL;
+  if (descr != NULL)
+    f = descr->ob_type->tp_descr_set;
+  if (!f) {
+    if (PyString_Check(name)) {
+      encoded_name = name;
+      Py_INCREF(name);
+    } else {
+      encoded_name = PyUnicode_AsUTF8String(name);
+    }
+    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
+    Py_DECREF(encoded_name);
+  } else {
+    res = f(descr, obj, value);
+  }
+  
+  done:
+  Py_DECREF(name);
+  return res;
+}
 #endif
+
+
+#ifdef __cplusplus
 }
 #endif
 
@@ -2539,11 +2978,16 @@ static swig_module_info swig_module = {swig_types, 28, 0, 0, 0, 0};
 /*-----------------------------------------------
               @(target):= _freeswitch.so
   ------------------------------------------------*/
-#define SWIG_init    init_freeswitch
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_init    PyInit__freeswitch
 
+#else
+#  define SWIG_init    init_freeswitch
+
+#endif
 #define SWIG_name    "_freeswitch"
 
-#define SWIGVERSION 0x010335 
+#define SWIGVERSION 0x020012 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2555,28 +2999,28 @@ static swig_module_info swig_module = {swig_types, 28, 0, 0, 0, 0};
 
 
 namespace swig {
-  class PyObject_ptr {
+  class SwigPtr_PyObject {
   protected:
     PyObject *_obj;
 
   public:
-    PyObject_ptr() :_obj(0)
+    SwigPtr_PyObject() :_obj(0)
     {
     }
 
-    PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj)
+    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
     {
       Py_XINCREF(_obj);      
     }
     
-    PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
+    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
     {
       if (initial_ref) {
         Py_XINCREF(_obj);
       }
     }
     
-    PyObject_ptr & operator=(const PyObject_ptr& item) 
+    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
     {
       Py_XINCREF(item._obj);
       Py_XDECREF(_obj);
@@ -2584,7 +3028,7 @@ namespace swig {
       return *this;      
     }
     
-    ~PyObject_ptr() 
+    ~SwigPtr_PyObject() 
     {
       Py_XDECREF(_obj);
     }
@@ -2603,10 +3047,10 @@ namespace swig {
 
 
 namespace swig {
-  struct PyObject_var : PyObject_ptr {
-    PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { }
+  struct SwigVar_PyObject : SwigPtr_PyObject {
+    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
     
-    PyObject_var & operator = (PyObject* obj)
+    SwigVar_PyObject & operator = (PyObject* obj)
     {
       Py_XDECREF(_obj);
       _obj = obj;
@@ -2636,10 +3080,28 @@ SWIG_pchar_descriptor(void)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
-  if (PyString_Check(obj)) {
+#if PY_VERSION_HEX>=0x03000000
+  if (PyUnicode_Check(obj))
+#else  
+  if (PyString_Check(obj))
+#endif
+  {
     char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+    if (!alloc && cptr) {
+        /* We can't allow converting without allocation, since the internal
+           representation of string in Python 3 is UCS-2/UCS-4 but we require
+           a UTF-8 representation.
+           TODO(bhy) More detailed explanation */
+        return SWIG_RuntimeError;
+    }
+    obj = PyUnicode_AsUTF8String(obj);
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
+    if(alloc) *alloc = SWIG_NEWOBJ;
+#else
     PyString_AsStringAndSize(obj, &cstr, &len);
-    if (cptr)  {
+#endif
+    if (cptr) {
       if (alloc) {
        /* 
           In python the user should not be able to modify the inner
@@ -2664,10 +3126,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
          *alloc = SWIG_OLDOBJ;
        }
       } else {
-       *cptr = PyString_AsString(obj);
+        #if PY_VERSION_HEX>=0x03000000
+        assert(0); /* Should never reach here in Python 3 */
+        #endif
+       *cptr = SWIG_Python_str_AsChar(obj);
       }
     }
     if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+    Py_XDECREF(obj);
+#endif
     return SWIG_OK;
   } else {
     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
@@ -2695,9 +3163,13 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
     if (size > INT_MAX) {
       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
       return pchar_descriptor ? 
-       SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+       SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
     } else {
+#if PY_VERSION_HEX >= 0x03000000
+      return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#else
       return PyString_FromStringAndSize(carray, static_cast< int >(size));
+#endif
     }
   } else {
     return SWIG_Py_Void();
@@ -2864,13 +3336,10 @@ SWIGINTERNINLINE PyObject*
 }
 
 
-  #define SWIG_From_long   PyInt_FromLong 
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_int  (int value)
-{    
-  return SWIG_From_long  (value);
+SWIGINTERNINLINE PyObject*
+  SWIG_From_int  (int value)
+{
+  return PyInt_FromLong((long) value);
 }
 
 
@@ -2927,6 +3396,7 @@ SWIG_From_char  (char c)
 SWIGINTERN int
 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
 {
+#if PY_VERSION_HEX < 0x03000000
   if (PyInt_Check(obj)) {
     long v = PyInt_AsLong(obj);
     if (v >= 0) {
@@ -2935,13 +3405,27 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
     } else {
       return SWIG_OverflowError;
     }
-  } else if (PyLong_Check(obj)) {
+  } else
+#endif
+  if (PyLong_Check(obj)) {
     unsigned long v = PyLong_AsUnsignedLong(obj);
     if (!PyErr_Occurred()) {
       if (val) *val = v;
       return SWIG_OK;
     } else {
       PyErr_Clear();
+#if PY_VERSION_HEX >= 0x03000000
+      {
+        long v = PyLong_AsLong(obj);
+        if (!PyErr_Occurred()) {
+          if (v < 0) {
+            return SWIG_OverflowError;
+          }
+        } else {
+          PyErr_Clear();
+        }
+      }
+#endif
     }
   }
 #ifdef SWIG_PYTHON_CAST_MODE
@@ -2984,18 +3468,10 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
 }
 
 
-SWIGINTERNINLINE PyObject* 
-SWIG_From_unsigned_SS_long  (unsigned long value)
+SWIGINTERNINLINE PyObject*
+  SWIG_From_unsigned_SS_int  (unsigned int value)
 {
-  return (value > LONG_MAX) ?
-    PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); 
-}
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_unsigned_SS_int  (unsigned int value)
-{    
-  return SWIG_From_unsigned_SS_long  (value);
+  return PyInt_FromSize_t((size_t) value);
 }
 
 
@@ -3051,11 +3527,11 @@ fail:
 SWIGINTERN PyObject *_wrap_getGlobalVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
-  char *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:getGlobalVariable",&obj0)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
@@ -3225,7 +3701,6 @@ SWIGINTERN PyObject *_wrap_email(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
   char *arg5 = (char *) NULL ;
   char *arg6 = (char *) NULL ;
   char *arg7 = (char *) NULL ;
-  bool result;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
@@ -3254,6 +3729,7 @@ SWIGINTERN PyObject *_wrap_email(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|OOOOO:email",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
@@ -3342,7 +3818,6 @@ SWIGINTERN PyObject *_wrap_new_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObject
   int arg15 ;
   int arg16 ;
   int arg17 ;
-  IVRMenu *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -3404,6 +3879,7 @@ SWIGINTERN PyObject *_wrap_new_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject * obj14 = 0 ;
   PyObject * obj15 = 0 ;
   PyObject * obj16 = 0 ;
+  IVRMenu *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOOOOO:new_IVRMenu",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14,&obj15,&obj16)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IVRMenu, 0 |  0 );
@@ -3533,7 +4009,6 @@ SWIGINTERN PyObject *_wrap_delete_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObje
   }
   arg1 = reinterpret_cast< IVRMenu * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3650,10 +4125,10 @@ SWIGINTERN PyObject *IVRMenu_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
 SWIGINTERN PyObject *_wrap_new_API(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) NULL ;
-  API *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  API *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"|O:new_API",&obj0)) SWIG_fail;
   if (obj0) {
@@ -3685,7 +4160,6 @@ SWIGINTERN PyObject *_wrap_delete_API(PyObject *SWIGUNUSEDPARM(self), PyObject *
   }
   arg1 = reinterpret_cast< API * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3698,7 +4172,6 @@ SWIGINTERN PyObject *_wrap_API_execute(PyObject *SWIGUNUSEDPARM(self), PyObject
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -3710,6 +4183,7 @@ SWIGINTERN PyObject *_wrap_API_execute(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|O:API_execute",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_API, 0 |  0 );
@@ -3745,7 +4219,6 @@ SWIGINTERN PyObject *_wrap_API_executeString(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -3753,6 +4226,7 @@ SWIGINTERN PyObject *_wrap_API_executeString(PyObject *SWIGUNUSEDPARM(self), PyO
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:API_executeString",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_API, 0 |  0 );
@@ -3778,10 +4252,10 @@ fail:
 SWIGINTERN PyObject *_wrap_API_getTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   API *arg1 = (API *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:API_getTime",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_API, 0 |  0 );
@@ -3806,7 +4280,7 @@ SWIGINTERN PyObject *API_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_function_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3817,15 +4291,14 @@ SWIGINTERN PyObject *_wrap_input_callback_state_t_function_set(PyObject *SWIGUNU
   if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_function_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_function_set" "', argument " "2"" of type '" "void *""'"); 
   }
   if (arg1) (arg1)->function = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3835,18 +4308,18 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_function_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  void *result = 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  void *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_function_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   result = (void *) ((arg1)->function);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
   return resultobj;
@@ -3857,7 +4330,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_threadState_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3868,15 +4341,14 @@ SWIGINTERN PyObject *_wrap_input_callback_state_t_threadState_set(PyObject *SWIG
   if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_threadState_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_threadState_set" "', argument " "2"" of type '" "void *""'"); 
   }
   if (arg1) (arg1)->threadState = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3886,18 +4358,18 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_threadState_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  void *result = 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  void *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_threadState_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   result = (void *) ((arg1)->threadState);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
   return resultobj;
@@ -3908,7 +4380,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_extra_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3919,15 +4391,14 @@ SWIGINTERN PyObject *_wrap_input_callback_state_t_extra_set(PyObject *SWIGUNUSED
   if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_extra_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_extra_set" "', argument " "2"" of type '" "void *""'"); 
   }
   if (arg1) (arg1)->extra = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -3937,18 +4408,18 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_extra_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  void *result = 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  void *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_extra_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   result = (void *) ((arg1)->extra);
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
   return resultobj;
@@ -3959,7 +4430,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_funcargs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *arg2 = (char *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -3972,9 +4443,9 @@ SWIGINTERN PyObject *_wrap_input_callback_state_t_funcargs_set(PyObject *SWIGUNU
   if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_funcargs_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_set" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_set" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_funcargs_set" "', argument " "2"" of type '" "char *""'");
@@ -3998,18 +4469,18 @@ fail:
 
 SWIGINTERN PyObject *_wrap_input_callback_state_t_funcargs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  char *result = 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_funcargs_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_get" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_get" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   result = (char *) ((arg1)->funcargs);
   resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
@@ -4020,10 +4491,10 @@ fail:
 
 SWIGINTERN PyObject *_wrap_new_input_callback_state_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *result = 0 ;
+  input_callback_state *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)":new_input_callback_state_t")) SWIG_fail;
-  result = (input_callback_state_t *)new input_callback_state_t();
+  result = (input_callback_state *)new input_callback_state();
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_input_callback_state, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
@@ -4033,7 +4504,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_delete_input_callback_state_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
@@ -4041,11 +4512,10 @@ SWIGINTERN PyObject *_wrap_delete_input_callback_state_t(PyObject *SWIGUNUSEDPAR
   if (!PyArg_ParseTuple(args,(char *)"O:delete_input_callback_state_t",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state_t" "', argument " "1"" of type '" "input_callback_state_t *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state_t" "', argument " "1"" of type '" "input_callback_state *""'"); 
   }
-  arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
+  arg1 = reinterpret_cast< input_callback_state * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4083,7 +4553,6 @@ SWIGINTERN PyObject *_wrap_DTMF_digit_set(PyObject *SWIGUNUSEDPARM(self), PyObje
   } 
   arg2 = static_cast< char >(val2);
   if (arg1) (arg1)->digit = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4094,10 +4563,10 @@ fail:
 SWIGINTERN PyObject *_wrap_DTMF_digit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   DTMF *arg1 = (DTMF *) 0 ;
-  char result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:DTMF_digit_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DTMF, 0 |  0 );
@@ -4144,7 +4613,6 @@ SWIGINTERN PyObject *_wrap_DTMF_duration_set(PyObject *SWIGUNUSEDPARM(self), PyO
     }
   }
   if (arg1) (arg1)->duration = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4155,10 +4623,10 @@ fail:
 SWIGINTERN PyObject *_wrap_DTMF_duration_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   DTMF *arg1 = (DTMF *) 0 ;
-  uint32_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  uint32_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:DTMF_duration_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DTMF, 0 |  0 );
@@ -4178,13 +4646,13 @@ SWIGINTERN PyObject *_wrap_new_DTMF(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
   PyObject *resultobj = 0;
   char arg1 ;
   uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
-  DTMF *result = 0 ;
   char val1 ;
   int ecode1 = 0 ;
   void *argp2 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  DTMF *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:new_DTMF",&obj0,&obj1)) SWIG_fail;
   ecode1 = SWIG_AsVal_char(obj0, &val1);
@@ -4229,7 +4697,6 @@ SWIGINTERN PyObject *_wrap_delete_DTMF(PyObject *SWIGUNUSEDPARM(self), PyObject
   }
   arg1 = reinterpret_cast< DTMF * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4260,10 +4727,10 @@ fail:
 SWIGINTERN PyObject *_wrap_new_Stream__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
-  Stream *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  Stream *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_Stream",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_stream_handle_t, 0 |  0 );
@@ -4285,8 +4752,8 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) {
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 0) {
@@ -4303,11 +4770,11 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Stream'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Stream'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    Stream()\n"
-    "    Stream(switch_stream_handle_t *)\n");
-  return NULL;
+    "    Stream::Stream()\n"
+    "    Stream::Stream(switch_stream_handle_t *)\n");
+  return 0;
 }
 
 
@@ -4325,7 +4792,6 @@ SWIGINTERN PyObject *_wrap_delete_Stream(PyObject *SWIGUNUSEDPARM(self), PyObjec
   }
   arg1 = reinterpret_cast< Stream * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4337,13 +4803,13 @@ SWIGINTERN PyObject *_wrap_Stream_read(PyObject *SWIGUNUSEDPARM(self), PyObject
   PyObject *resultobj = 0;
   Stream *arg1 = (Stream *) 0 ;
   int *arg2 = (int *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:Stream_read",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 |  0 );
@@ -4442,10 +4908,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Stream_get_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Stream *arg1 = (Stream *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Stream_get_data",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 |  0 );
@@ -4491,7 +4957,6 @@ SWIGINTERN PyObject *_wrap_Event_event_set(PyObject *SWIGUNUSEDPARM(self), PyObj
   }
   arg2 = reinterpret_cast< switch_event_t * >(argp2);
   if (arg1) (arg1)->event = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4502,10 +4967,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_event_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  switch_event_t *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_event_t *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_event_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4563,10 +5028,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_serialized_string_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_serialized_string_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4605,7 +5070,6 @@ SWIGINTERN PyObject *_wrap_Event_mine_set(PyObject *SWIGUNUSEDPARM(self), PyObje
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->mine = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4616,10 +5080,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_mine_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_mine_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4639,7 +5103,6 @@ SWIGINTERN PyObject *_wrap_new_Event__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) NULL ;
-  Event *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
@@ -4648,6 +5111,7 @@ SWIGINTERN PyObject *_wrap_new_Event__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyO
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  Event *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:new_Event",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
@@ -4678,13 +5142,13 @@ SWIGINTERN PyObject *_wrap_new_Event__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   switch_event_t *arg1 = (switch_event_t *) 0 ;
   int arg2 = (int) 0 ;
-  Event *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  Event *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:new_Event",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_event_t, 0 |  0 );
@@ -4713,8 +5177,8 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) {
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if ((argc >= 1) && (argc <= 2)) {
@@ -4752,11 +5216,11 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Event'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Event'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    Event(char const *,char const *)\n"
-    "    Event(switch_event_t *,int)\n");
-  return NULL;
+    "    Event::Event(char const *,char const *)\n"
+    "    Event::Event(switch_event_t *,int)\n");
+  return 0;
 }
 
 
@@ -4774,7 +5238,6 @@ SWIGINTERN PyObject *_wrap_delete_Event(PyObject *SWIGUNUSEDPARM(self), PyObject
   }
   arg1 = reinterpret_cast< Event * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -4787,7 +5250,6 @@ SWIGINTERN PyObject *_wrap_Event_chat_execute(PyObject *SWIGUNUSEDPARM(self), Py
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -4799,6 +5261,7 @@ SWIGINTERN PyObject *_wrap_Event_chat_execute(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|O:Event_chat_execute",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4834,7 +5297,6 @@ SWIGINTERN PyObject *_wrap_Event_chat_send(PyObject *SWIGUNUSEDPARM(self), PyObj
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -4842,6 +5304,7 @@ SWIGINTERN PyObject *_wrap_Event_chat_send(PyObject *SWIGUNUSEDPARM(self), PyObj
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:Event_chat_send",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4870,7 +5333,6 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *SWIGUNUSEDPARM(self), PyObj
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -4878,6 +5340,7 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *SWIGUNUSEDPARM(self), PyObj
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:Event_serialize",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4906,13 +5369,13 @@ SWIGINTERN PyObject *_wrap_Event_setPriority(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 ;
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O|O:Event_setPriority",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4947,7 +5410,6 @@ SWIGINTERN PyObject *_wrap_Event_getHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -4955,6 +5417,7 @@ SWIGINTERN PyObject *_wrap_Event_getHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:Event_getHeader",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -4980,10 +5443,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_getBody(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_getBody",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5002,10 +5465,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_getType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_getType",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5025,7 +5488,6 @@ SWIGINTERN PyObject *_wrap_Event_addBody(PyObject *SWIGUNUSEDPARM(self), PyObjec
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -5033,6 +5495,7 @@ SWIGINTERN PyObject *_wrap_Event_addBody(PyObject *SWIGUNUSEDPARM(self), PyObjec
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:Event_addBody",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5060,7 +5523,6 @@ SWIGINTERN PyObject *_wrap_Event_addHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -5072,6 +5534,7 @@ SWIGINTERN PyObject *_wrap_Event_addHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:Event_addHeader",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5105,7 +5568,6 @@ SWIGINTERN PyObject *_wrap_Event_delHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -5113,6 +5575,7 @@ SWIGINTERN PyObject *_wrap_Event_delHeader(PyObject *SWIGUNUSEDPARM(self), PyObj
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:Event_delHeader",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5138,10 +5601,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Event_fire(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   Event *arg1 = (Event *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Event_fire",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 |  0 );
@@ -5187,7 +5650,6 @@ SWIGINTERN PyObject *_wrap_EventConsumer_events_set(PyObject *SWIGUNUSEDPARM(sel
   }
   arg2 = reinterpret_cast< switch_queue_t * >(argp2);
   if (arg1) (arg1)->events = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5198,10 +5660,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_events_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  switch_queue_t *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_queue_t *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_events_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5248,7 +5710,6 @@ SWIGINTERN PyObject *_wrap_EventConsumer_e_event_id_set(PyObject *SWIGUNUSEDPARM
     }
   }
   if (arg1) (arg1)->e_event_id = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5259,10 +5720,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_e_event_id_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  switch_event_types_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_event_types_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_e_event_id_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5320,10 +5781,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_e_callback_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_e_callback_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5381,10 +5842,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_e_subclass_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_e_subclass_name_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5442,10 +5903,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_e_cb_arg_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_e_cb_arg_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5501,10 +5962,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_enodes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  switch_event_node_t **result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_event_node_t **result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_enodes_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5551,7 +6012,6 @@ SWIGINTERN PyObject *_wrap_EventConsumer_node_index_set(PyObject *SWIGUNUSEDPARM
     }
   }
   if (arg1) (arg1)->node_index = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5562,10 +6022,10 @@ fail:
 SWIGINTERN PyObject *_wrap_EventConsumer_node_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
-  uint32_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  uint32_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:EventConsumer_node_index_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5586,7 +6046,6 @@ SWIGINTERN PyObject *_wrap_new_EventConsumer(PyObject *SWIGUNUSEDPARM(self), PyO
   char *arg1 = (char *) NULL ;
   char *arg2 = (char *) "" ;
   int arg3 = (int) 5000 ;
-  EventConsumer *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
@@ -5598,6 +6057,7 @@ SWIGINTERN PyObject *_wrap_new_EventConsumer(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  EventConsumer *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"|OOO:new_EventConsumer",&obj0,&obj1,&obj2)) SWIG_fail;
   if (obj0) {
@@ -5647,7 +6107,6 @@ SWIGINTERN PyObject *_wrap_delete_EventConsumer(PyObject *SWIGUNUSEDPARM(self),
   }
   arg1 = reinterpret_cast< EventConsumer * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5660,7 +6119,6 @@ SWIGINTERN PyObject *_wrap_EventConsumer_bind(PyObject *SWIGUNUSEDPARM(self), Py
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) "" ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -5672,6 +6130,7 @@ SWIGINTERN PyObject *_wrap_EventConsumer_bind(PyObject *SWIGUNUSEDPARM(self), Py
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|O:EventConsumer_bind",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5708,7 +6167,6 @@ SWIGINTERN PyObject *_wrap_EventConsumer_pop(PyObject *SWIGUNUSEDPARM(self), PyO
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   int arg2 = (int) 0 ;
   int arg3 = (int) 0 ;
-  Event *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -5718,6 +6176,7 @@ SWIGINTERN PyObject *_wrap_EventConsumer_pop(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  Event *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O|OO:EventConsumer_pop",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EventConsumer, 0 |  0 );
@@ -5791,7 +6250,6 @@ SWIGINTERN PyObject *_wrap_delete_CoreSession(PyObject *SWIGUNUSEDPARM(self), Py
   }
   arg1 = reinterpret_cast< CoreSession * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5822,7 +6280,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_session_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< switch_core_session_t * >(argp2);
   if (arg1) (arg1)->session = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5833,10 +6290,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_session_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  switch_core_session_t *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_core_session_t *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_session_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -5875,7 +6332,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_channel_set(PyObject *SWIGUNUSEDPARM(self
   }
   arg2 = reinterpret_cast< switch_channel_t * >(argp2);
   if (arg1) (arg1)->channel = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5886,10 +6342,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_channel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  switch_channel_t *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_channel_t *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_channel_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -5928,7 +6384,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_flags_set(PyObject *SWIGUNUSEDPARM(self),
   } 
   arg2 = static_cast< unsigned int >(val2);
   if (arg1) (arg1)->flags = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5939,10 +6394,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_flags_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  unsigned int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  unsigned int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flags_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -5981,7 +6436,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_allocated_set(PyObject *SWIGUNUSEDPARM(se
   } 
   arg2 = static_cast< int >(val2);
   if (arg1) (arg1)->allocated = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -5992,10 +6446,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_allocated_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_allocated_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6034,7 +6488,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_cb_state_set(PyObject *SWIGUNUSEDPARM(sel
   }
   arg2 = reinterpret_cast< input_callback_state * >(argp2);
   if (arg1) (arg1)->cb_state = *arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -6045,10 +6498,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_cb_state_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  input_callback_state *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  input_callback_state *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_cb_state_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6095,7 +6548,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_hook_state_set(PyObject *SWIGUNUSEDPARM(s
     }
   }
   if (arg1) (arg1)->hook_state = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -6106,10 +6558,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_hook_state_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  switch_channel_state_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_channel_state_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_hook_state_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6156,7 +6608,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_cause_set(PyObject *SWIGUNUSEDPARM(self),
     }
   }
   if (arg1) (arg1)->cause = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -6167,10 +6618,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_cause_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  switch_call_cause_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_call_cause_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_cause_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6228,10 +6679,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_uuid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_uuid_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6289,10 +6740,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_tts_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_tts_name_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6350,10 +6801,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_voice_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_voice_name_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6375,7 +6826,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_insertFile(PyObject *SWIGUNUSEDPARM(self)
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -6390,6 +6840,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_insertFile(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_insertFile",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6427,10 +6878,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_answer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_answer",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6449,10 +6900,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_preAnswer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_preAnswer",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6613,7 +7064,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_getPrivate(PyObject *SWIGUNUSEDPARM(self)
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
-  void *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -6621,6 +7071,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_getPrivate(PyObject *SWIGUNUSEDPARM(self)
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  void *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_getPrivate",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6647,7 +7098,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_getVariable(PyObject *SWIGUNUSEDPARM(self
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -6655,6 +7105,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_getVariable(PyObject *SWIGUNUSEDPARM(self
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_getVariable",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6681,7 +7132,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_process_callback_result(PyObject *SWIGUNU
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
-  switch_status_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -6689,6 +7139,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_process_callback_result(PyObject *SWIGUNU
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  switch_status_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_process_callback_result",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6858,10 +7309,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_hangupCause(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_hangupCause",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6880,10 +7331,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_getState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_getState",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6906,7 +7357,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *SWIGUNUSEDPARM(self)
   int arg3 = (int) 0 ;
   int arg4 = (int) 0 ;
   int arg5 = (int) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -6923,6 +7373,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|OOO:CoreSession_recordFile",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -6973,7 +7424,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *SWIGUNUSEDPARM(self),
   char *arg3 = (char *) 0 ;
   int arg4 = (int) 60 ;
   switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -6990,6 +7440,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *SWIGUNUSEDPARM(self),
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:CoreSession_originate",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7096,7 +7547,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_speak(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -7104,6 +7554,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_speak(PyObject *SWIGUNUSEDPARM(self), PyO
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_speak",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7220,13 +7671,13 @@ SWIGINTERN PyObject *_wrap_CoreSession_collectDigits__SWIG_0(PyObject *SWIGUNUSE
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_collectDigits",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7252,7 +7703,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_collectDigits__SWIG_1(PyObject *SWIGUNUSE
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7262,6 +7712,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_collectDigits__SWIG_1(PyObject *SWIGUNUSE
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_collectDigits",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7293,8 +7744,8 @@ SWIGINTERN PyObject *_wrap_CoreSession_collectDigits(PyObject *self, PyObject *a
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 2) {
@@ -7335,11 +7786,11 @@ SWIGINTERN PyObject *_wrap_CoreSession_collectDigits(PyObject *self, PyObject *a
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_collectDigits'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'CoreSession_collectDigits'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    collectDigits(CoreSession *,int)\n"
-    "    collectDigits(CoreSession *,int,int)\n");
-  return NULL;
+    "    CoreSession::collectDigits(int)\n"
+    "    CoreSession::collectDigits(int,int)\n");
+  return 0;
 }
 
 
@@ -7349,7 +7800,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits__SWIG_0(PyObject *SWIGUNUSEDPAR
   int arg2 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7363,6 +7813,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits__SWIG_0(PyObject *SWIGUNUSEDPAR
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7402,7 +7853,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits__SWIG_1(PyObject *SWIGUNUSEDPAR
   char *arg3 = (char *) 0 ;
   int arg4 ;
   int arg5 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7419,6 +7869,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits__SWIG_1(PyObject *SWIGUNUSEDPAR
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7462,8 +7913,8 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits(PyObject *self, PyObject *args)
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 5) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 4) {
@@ -7524,11 +7975,11 @@ SWIGINTERN PyObject *_wrap_CoreSession_getDigits(PyObject *self, PyObject *args)
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_getDigits'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'CoreSession_getDigits'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    getDigits(CoreSession *,int,char *,int)\n"
-    "    getDigits(CoreSession *,int,char *,int,int)\n");
-  return NULL;
+    "    CoreSession::getDigits(int,char *,int)\n"
+    "    CoreSession::getDigits(int,char *,int,int)\n");
+  return 0;
 }
 
 
@@ -7538,7 +7989,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_transfer(PyObject *SWIGUNUSEDPARM(self),
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   char *arg4 = (char *) NULL ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -7554,6 +8004,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_transfer(PyObject *SWIGUNUSEDPARM(self),
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|OO:CoreSession_transfer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7603,7 +8054,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_read(PyObject *SWIGUNUSEDPARM(self), PyOb
   int arg5 ;
   char *arg6 = (char *) 0 ;
   int arg7 = (int) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7627,6 +8077,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_read(PyObject *SWIGUNUSEDPARM(self), PyOb
   PyObject * obj4 = 0 ;
   PyObject * obj5 = 0 ;
   PyObject * obj6 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO|O:CoreSession_read",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7692,7 +8143,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
   char *arg10 = (char *) NULL ;
   int arg11 = (int) 0 ;
   char *arg12 = (char *) NULL ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7735,6 +8185,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM
   PyObject * obj9 = 0 ;
   PyObject * obj10 = 0 ;
   PyObject * obj11 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO|OOO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7828,7 +8279,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *SWIGUNUSEDPARM(self)
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 = (int) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -7839,6 +8289,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *SWIGUNUSEDPARM(self)
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|O:CoreSession_streamFile",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7873,7 +8324,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *SWIGUNUSEDPARM(self), PyO
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 = (int) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int val2 ;
@@ -7883,6 +8333,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *SWIGUNUSEDPARM(self), PyO
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO|O:CoreSession_sleep",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7913,10 +8364,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_flushEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flushEvents",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7935,10 +8386,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_flushDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_flushDigits",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -7958,13 +8409,13 @@ SWIGINTERN PyObject *_wrap_CoreSession_setAutoHangup(PyObject *SWIGUNUSEDPARM(se
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool arg2 ;
-  int result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   bool val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  int result;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_setAutoHangup",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8016,10 +8467,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_ready(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_ready",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8038,10 +8489,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_bridged(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_bridged",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8060,10 +8511,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_answered(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_answered",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8082,10 +8533,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_mediaReady(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_mediaReady",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8241,10 +8692,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_getXMLCDR(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_getXMLCDR",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8263,10 +8714,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_begin_allow_threads",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8285,10 +8736,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_end_allow_threads",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8307,10 +8758,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_get_uuid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  char *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  char *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_get_uuid",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8329,10 +8780,10 @@ fail:
 SWIGINTERN PyObject *_wrap_CoreSession_get_cb_args(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
-  switch_input_args_t *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_input_args_t *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_get_cb_args",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8340,10 +8791,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_get_cb_args(PyObject *SWIGUNUSEDPARM(self
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_get_cb_args" "', argument " "1"" of type '" "CoreSession const *""'"); 
   }
   arg1 = reinterpret_cast< CoreSession * >(argp1);
-  {
-    switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
-    result = (switch_input_args_t *) &_result_ref;
-  }
+  result = (switch_input_args_t *) &((CoreSession const *)arg1)->get_cb_args();
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_input_args_t, 0 |  0 );
   return resultobj;
 fail:
@@ -8377,7 +8825,6 @@ SWIGINTERN PyObject *_wrap_CoreSession_run_dtmf_callback(PyObject *SWIGUNUSEDPAR
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -8386,6 +8833,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_run_dtmf_callback(PyObject *SWIGUNUSEDPAR
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  switch_status_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_run_dtmf_callback",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
@@ -8737,10 +9185,10 @@ fail:
 SWIGINTERN PyObject *_wrap_hanguphook(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-  switch_status_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  switch_status_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:hanguphook",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 |  0 );
@@ -8763,7 +9211,6 @@ SWIGINTERN PyObject *_wrap_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObjec
   switch_input_type_t arg3 ;
   void *arg4 = (void *) 0 ;
   unsigned int arg5 ;
-  switch_status_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -8777,6 +9224,7 @@ SWIGINTERN PyObject *_wrap_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObjec
   PyObject * obj2 = 0 ;
   PyObject * obj3 = 0 ;
   PyObject * obj4 = 0 ;
+  switch_status_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:dtmf_callback",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 |  0 );
@@ -8835,7 +9283,6 @@ SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
-  PYTHON::Session *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
@@ -8843,6 +9290,7 @@ SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) {
   int res2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
+  PYTHON::Session *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"OO:new_Session",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
@@ -8868,11 +9316,11 @@ fail:
 SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   char *arg1 = (char *) 0 ;
-  PYTHON::Session *result = 0 ;
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   PyObject * obj0 = 0 ;
+  PYTHON::Session *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_Session",&obj0)) SWIG_fail;
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
@@ -8893,10 +9341,10 @@ fail:
 SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-  PYTHON::Session *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PYTHON::Session *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:new_Session",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 |  0 );
@@ -8918,8 +9366,8 @@ SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 0) {
@@ -8957,13 +9405,13 @@ SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Session'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Session'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    PYTHON::Session()\n"
-    "    PYTHON::Session(char *,CoreSession *)\n"
-    "    PYTHON::Session(char *)\n"
-    "    PYTHON::Session(switch_core_session_t *)\n");
-  return NULL;
+    "    PYTHON::Session::Session()\n"
+    "    PYTHON::Session::Session(char *,CoreSession *)\n"
+    "    PYTHON::Session::Session(char *)\n"
+    "    PYTHON::Session::Session(switch_core_session_t *)\n");
+  return 0;
 }
 
 
@@ -8981,7 +9429,6 @@ SWIGINTERN PyObject *_wrap_delete_Session(PyObject *SWIGUNUSEDPARM(self), PyObje
   }
   arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
   delete arg1;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -8992,10 +9439,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_begin_allow_threads",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9014,10 +9461,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_end_allow_threads",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9080,7 +9527,6 @@ SWIGINTERN PyObject *_wrap_Session_run_dtmf_callback(PyObject *SWIGUNUSEDPARM(se
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   int res2 ;
@@ -9089,6 +9535,7 @@ SWIGINTERN PyObject *_wrap_Session_run_dtmf_callback(PyObject *SWIGUNUSEDPARM(se
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
+  switch_status_t result;
   
   if (!PyArg_ParseTuple(args,(char *)"OOO:Session_run_dtmf_callback",&obj0,&obj1,&obj2)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9178,8 +9625,8 @@ SWIGINTERN PyObject *_wrap_Session_setInputCallback(PyObject *self, PyObject *ar
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 2) {
@@ -9211,11 +9658,11 @@ SWIGINTERN PyObject *_wrap_Session_setInputCallback(PyObject *self, PyObject *ar
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Session_setInputCallback'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Session_setInputCallback'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    setInputCallback(PYTHON::Session *,PyObject *,PyObject *)\n"
-    "    setInputCallback(PYTHON::Session *,PyObject *)\n");
-  return NULL;
+    "    PYTHON::Session::setInputCallback(PyObject *,PyObject *)\n"
+    "    PYTHON::Session::setInputCallback(PyObject *)\n");
+  return 0;
 }
 
 
@@ -9297,8 +9744,8 @@ SWIGINTERN PyObject *_wrap_Session_setHangupHook(PyObject *self, PyObject *args)
   int ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
   if (argc == 2) {
@@ -9330,21 +9777,21 @@ SWIGINTERN PyObject *_wrap_Session_setHangupHook(PyObject *self, PyObject *args)
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Session_setHangupHook'.\n"
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Session_setHangupHook'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    setHangupHook(PYTHON::Session *,PyObject *,PyObject *)\n"
-    "    setHangupHook(PYTHON::Session *,PyObject *)\n");
-  return NULL;
+    "    PYTHON::Session::setHangupHook(PyObject *,PyObject *)\n"
+    "    PYTHON::Session::setHangupHook(PyObject *)\n");
+  return 0;
 }
 
 
 SWIGINTERN PyObject *_wrap_Session_ready(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  bool result;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  bool result;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_ready",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9377,7 +9824,6 @@ SWIGINTERN PyObject *_wrap_Session_cb_function_set(PyObject *SWIGUNUSEDPARM(self
   arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
   arg2 = obj1;
   if (arg1) (arg1)->cb_function = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9388,10 +9834,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_cb_function_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  PyObject *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_cb_function_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9424,7 +9870,6 @@ SWIGINTERN PyObject *_wrap_Session_cb_arg_set(PyObject *SWIGUNUSEDPARM(self), Py
   arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
   arg2 = obj1;
   if (arg1) (arg1)->cb_arg = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9435,10 +9880,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_cb_arg_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  PyObject *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_cb_arg_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9471,7 +9916,6 @@ SWIGINTERN PyObject *_wrap_Session_hangup_func_set(PyObject *SWIGUNUSEDPARM(self
   arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
   arg2 = obj1;
   if (arg1) (arg1)->hangup_func = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9482,10 +9926,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_hangup_func_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  PyObject *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_hangup_func_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9518,7 +9962,6 @@ SWIGINTERN PyObject *_wrap_Session_hangup_func_arg_set(PyObject *SWIGUNUSEDPARM(
   arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
   arg2 = obj1;
   if (arg1) (arg1)->hangup_func_arg = arg2;
-  
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
@@ -9529,10 +9972,10 @@ fail:
 SWIGINTERN PyObject *_wrap_Session_hangup_func_arg_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
-  PyObject *result = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
   
   if (!PyArg_ParseTuple(args,(char *)"O:Session_hangup_func_arg_get",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 |  0 );
@@ -9604,6 +10047,7 @@ SWIGINTERN PyObject *Session_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObje
 }
 
 static PyMethodDef SwigMethods[] = {
+        { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
         { (char *)"setGlobalVariable", _wrap_setGlobalVariable, METH_VARARGS, NULL},
         { (char *)"getGlobalVariable", _wrap_getGlobalVariable, METH_VARARGS, NULL},
         { (char *)"consoleLog", _wrap_consoleLog, METH_VARARGS, NULL},
@@ -9793,7 +10237,7 @@ static PyMethodDef SwigMethods[] = {
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static void *_p_PYTHON__SessionTo_p_CoreSession(void *x, int *newmemory) {
+static void *_p_PYTHON__SessionTo_p_CoreSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CoreSession *)  ((PYTHON::Session *) x));
 }
 static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)0, 0};
@@ -9927,18 +10371,18 @@ static swig_const_info swig_const_table[] = {
 #endif
 /* -----------------------------------------------------------------------------
  * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
  * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
  * swig_module, and does all the lookup, filling in the swig_module.types
  * array with the correct data and linking the correct swig_cast_info
  * structures together.
  *
- * The generated swig_type_info structures are assigned staticly to an initial 
+ * The generated swig_type_info structures are assigned staticly to an initial
  * array. We just loop through that array, and handle each type individually.
  * First we lookup if this type has been already loaded, and if so, use the
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -9948,17 +10392,17 @@ static swig_const_info swig_const_table[] = {
  * a column is one of the swig_cast_info structures for that type.
  * The cast_initial array is actually an array of arrays, because each row has
  * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
+ * we find the array of casts associated with the type, and loop through it
  * adding the casts to the list. The one last trick we need to do is making
  * sure the type pointer in the swig_cast_info struct is correct.
  *
- * First off, we lookup the cast->type name to see if it is already loaded. 
+ * First off, we lookup the cast->type name to see if it is already loaded.
  * There are three cases to handle:
  *  1) If the cast->type has already been loaded AND the type we are adding
  *     casting info to has not been loaded (it is in this module), THEN we
  *     replace the cast->type pointer with the type pointer that has already
  *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
+ *  2) If BOTH types (the one we are adding casting info to, and the
  *     cast->type) are loaded, THEN the cast info has already been loaded by
  *     the previous module so we just ignore it.
  *  3) Finally, if cast->type has not already been loaded, then we add that
@@ -9984,8 +10428,6 @@ SWIG_InitializeModule(void *clientdata) {
   swig_module_info *module_head, *iter;
   int found, init;
   
-  clientdata = clientdata;
-  
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
     /* Initialize the swig_module */
@@ -10023,7 +10465,7 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
   
-  /* When multiple interpeters are used, a module could have already been initialized in
+  /* When multiple interpreters are used, a module could have already been initialized in
        a different interpreter, but not yet have a pointer in this interpreter.
        In this case, we do not want to continue adding types... everything should be
        set up already */
@@ -10191,26 +10633,58 @@ extern "C" {
   
   SWIGINTERN PyObject *
   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+    return PyUnicode_InternFromString("<Swig global variables>");
+#else
     return PyString_FromString("<Swig global variables>");
+#endif
   }
   
   SWIGINTERN PyObject *
   swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *str = PyUnicode_InternFromString("(");
+    PyObject *tail;
+    PyObject *joined;
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      tail = PyUnicode_FromString(var->name);
+      joined = PyUnicode_Concat(str, tail);
+      Py_DecRef(str);
+      Py_DecRef(tail);
+      str = joined;
+      if (var->next) {
+        tail = PyUnicode_InternFromString(", ");
+        joined = PyUnicode_Concat(str, tail);
+        Py_DecRef(str);
+        Py_DecRef(tail);
+        str = joined;
+      }
+    }
+    tail = PyUnicode_InternFromString(")");
+    joined = PyUnicode_Concat(str, tail);
+    Py_DecRef(str);
+    Py_DecRef(tail);
+    str = joined;
+#else
     PyObject *str = PyString_FromString("(");
-    swig_globalvar  *var;
+    swig_globalvar *var;
     for (var = v->vars; var; var=var->next) {
       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
     }
     PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
     return str;
   }
   
   SWIGINTERN int
   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    char *tmp;
     PyObject *str = swig_varlink_str(v);
     fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", PyString_AsString(str));
+    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(str);
     return 0;
   }
@@ -10264,19 +10738,23 @@ extern "C" {
   swig_varlink_type(void) {
     static char varlink__doc__[] = "Swig var link object";
     static PyTypeObject varlink_type;
-    static int type_init = 0;  
+    static int type_init = 0;
     if (!type_init) {
-      const PyTypeObject tmp
-      = {
+      const PyTypeObject tmp = {
+        /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+        PyVarObject_HEAD_INIT(NULL, 0)
+#else
         PyObject_HEAD_INIT(NULL)
-        0,                                  /* Number of items in variable part (ob_size) */
-        (char *)"swigvarlink",              /* Type name (tp_name) */
-        sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
-        0,                                  /* Itemsize (tp_itemsize) */
-        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
-        (printfunc) swig_varlink_print,     /* Print (tp_print) */
-        (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
-        (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
+        0,                                  /* ob_size */
+#endif
+        (char *)"swigvarlink",              /* tp_name */
+        sizeof(swig_varlinkobject),         /* tp_basicsize */
+        0,                                  /* tp_itemsize */
+        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
+        (printfunc) swig_varlink_print,     /* tp_print */
+        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
+        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
         0,                                  /* tp_compare */
         (reprfunc) swig_varlink_repr,       /* tp_repr */
         0,                                  /* tp_as_number */
@@ -10284,7 +10762,7 @@ extern "C" {
         0,                                  /* tp_as_mapping */
         0,                                  /* tp_hash */
         0,                                  /* tp_call */
-        (reprfunc)swig_varlink_str,        /* tp_str */
+        (reprfunc) swig_varlink_str,        /* tp_str */
         0,                                  /* tp_getattro */
         0,                                  /* tp_setattro */
         0,                                  /* tp_as_buffer */
@@ -10300,13 +10778,21 @@ extern "C" {
 #if PY_VERSION_HEX >= 0x02030000
         0,                                  /* tp_del */
 #endif
+#if PY_VERSION_HEX >= 0x02060000
+        0,                                  /* tp_version */
+#endif
 #ifdef COUNT_ALLOCS
         0,0,0,0                             /* tp_alloc -> tp_next */
 #endif
       };
       varlink_type = tmp;
-      varlink_type.ob_type = &PyType_Type;
       type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+      varlink_type.ob_type = &PyType_Type;
+#else
+      if (PyType_Ready(&varlink_type) < 0)
+      return NULL;
+#endif
     }
     return &varlink_type;
   }
@@ -10357,7 +10843,7 @@ extern "C" {
     for (i = 0; constants[i].type; ++i) {
       switch(constants[i].type) {
       case SWIG_PY_POINTER:
-        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
         break;
       case SWIG_PY_BINARY:
         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
@@ -10397,15 +10883,15 @@ extern "C" {
           }
         }
         if (ci) {
-          size_t shift = (ci->ptype) - types;
-          swig_type_info *ty = types_initial[shift];
-          size_t ldoc = (c - methods[i].ml_doc);
-          size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
-          char *ndoc = (char*)malloc(ldoc + lptr + 10);
-          if (ndoc) {
-            char *buff = ndoc;
-            void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
-            if (ptr) {
+          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+          if (ptr) {
+            size_t shift = (ci->ptype) - types;
+            swig_type_info *ty = types_initial[shift];
+            size_t ldoc = (c - methods[i].ml_doc);
+            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+            char *ndoc = (char*)malloc(ldoc + lptr + 10);
+            if (ndoc) {
+              char *buff = ndoc;
               strncpy(buff, methods[i].ml_doc, ldoc);
               buff += ldoc;
               strncpy(buff, "swig_ptr: ", 10);
@@ -10430,22 +10916,140 @@ extern "C" {
 #ifdef __cplusplus
 extern "C"
 #endif
-SWIGEXPORT void SWIG_init(void) {
-  PyObject *m, *d;
+
+SWIGEXPORT 
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+  PyObject *m, *d, *md;
+#if PY_VERSION_HEX >= 0x03000000
+  static struct PyModuleDef SWIG_module = {
+# if PY_VERSION_HEX >= 0x03020000
+    PyModuleDef_HEAD_INIT,
+# else
+    {
+      PyObject_HEAD_INIT(NULL)
+      NULL, /* m_init */
+      0,    /* m_index */
+      NULL, /* m_copy */
+    },
+# endif
+    (char *) SWIG_name,
+    NULL,
+    -1,
+    SwigMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  };
+#endif
+  
+#if defined(SWIGPYTHON_BUILTIN)
+  static SwigPyClientData SwigPyObject_clientdata = {
+    0, 0, 0, 0, 0, 0, 0
+  };
+  static PyGetSetDef this_getset_def = {
+    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
+  };
+  static SwigPyGetSet thisown_getset_closure = {
+    (PyCFunction) SwigPyObject_own,
+    (PyCFunction) SwigPyObject_own
+  };
+  static PyGetSetDef thisown_getset_def = {
+    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
+  };
+  PyObject *metatype_args;
+  PyTypeObject *builtin_pytype;
+  int builtin_base_count;
+  swig_type_info *builtin_basetype;
+  PyObject *tuple;
+  PyGetSetDescrObject *static_getset;
+  PyTypeObject *metatype;
+  SwigPyClientData *cd;
+  PyObject *public_interface, *public_symbol;
+  PyObject *this_descr;
+  PyObject *thisown_descr;
+  int i;
+  
+  (void)builtin_pytype;
+  (void)builtin_base_count;
+  (void)builtin_basetype;
+  (void)tuple;
+  (void)static_getset;
+  
+  /* metatype is used to implement static member variables. */
+  metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
+  assert(metatype_args);
+  metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
+  assert(metatype);
+  Py_DECREF(metatype_args);
+  metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
+  assert(PyType_Ready(metatype) >= 0);
+#endif
   
   /* Fix SwigMethods to carry the callback ptrs when needed */
   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
   
+#if PY_VERSION_HEX >= 0x03000000
+  m = PyModule_Create(&SWIG_module);
+#else
   m = Py_InitModule((char *) SWIG_name, SwigMethods);
-  d = PyModule_GetDict(m);
+#endif
+  md = d = PyModule_GetDict(m);
+  (void)md;
   
   SWIG_InitializeModule(0);
-  SWIG_InstallConstants(d,swig_const_table);
   
+#ifdef SWIGPYTHON_BUILTIN
+  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
+  assert(SwigPyObject_stype);
+  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+  if (!cd) {
+    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
+    SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
+  } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
+    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
+# if PY_VERSION_HEX >= 0x03000000
+    return NULL;
+# else
+    return;
+# endif
+  }
+  
+  /* All objects have a 'this' attribute */
+  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
+  (void)this_descr;
+  
+  /* All objects have a 'thisown' attribute */
+  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
+  (void)thisown_descr;
+  
+  public_interface = PyList_New(0);
+  public_symbol = 0;
+  (void)public_symbol;
+  
+  PyDict_SetItemString(md, "__all__", public_interface);
+  Py_DECREF(public_interface);
+  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
+  for (i = 0; swig_const_table[i].name != 0; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
+#endif
+  
+  SWIG_InstallConstants(d,swig_const_table);
   
   SWIG_Python_SetConstant(d, "S_HUP",SWIG_From_int(static_cast< int >(S_HUP)));
   SWIG_Python_SetConstant(d, "S_FREE",SWIG_From_int(static_cast< int >(S_FREE)));
   SWIG_Python_SetConstant(d, "S_RDLOCK",SWIG_From_int(static_cast< int >(S_RDLOCK)));
+#if PY_VERSION_HEX >= 0x03000000
+  return m;
+#else
+  return;
+#endif
 }
 
 #include "mod_python_extra.c"
index 1e2147f31feec45c76029a21a16aaab356b03056..62f8fe3e9a24bedb060ed60298fbeca23e12e55f 100644 (file)
@@ -1,27 +1,34 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- * 
- * This file is not intended to be easily readable and contains a number of 
+ * Version 2.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG 
- * interface file instead. 
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+#define SWIGLUA
+#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
+#define SWIG_LUA_MODULE_GLOBAL
+
 
 #ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
 template<typename T> class SwigValueWrapper {
-    T *tt;
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
 public:
-    SwigValueWrapper() : tt(0) { }
-    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
-    SwigValueWrapper(const T& t) : tt(new T(t)) { }
-    ~SwigValueWrapper() { delete tt; } 
-    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
-    operator T&() const { return *tt; }
-    T *operator&() { return tt; }
-private:
-    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
 };
 
 template <typename T> T SwigValueInit() {
@@ -60,14 +67,20 @@ template <typename T> T SwigValueInit() {
 #ifndef SWIGUNUSED
 # if defined(__GNUC__)
 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#     define SWIGUNUSED __attribute__ ((__unused__))
 #   else
 #     define SWIGUNUSED
 #   endif
 # elif defined(__ICC)
-#   define SWIGUNUSED __attribute__ ((__unused__)) 
+#   define SWIGUNUSED __attribute__ ((__unused__))
 # else
-#   define SWIGUNUSED 
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 # endif
 #endif
 
@@ -75,7 +88,7 @@ template <typename T> T SwigValueInit() {
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 # else
-#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
 # endif
 #endif
 
@@ -118,7 +131,7 @@ template <typename T> T SwigValueInit() {
 #   define SWIGSTDCALL __stdcall
 # else
 #   define SWIGSTDCALL
-# endif 
+# endif
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -135,7 +148,7 @@ template <typename T> T SwigValueInit() {
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -154,11 +167,11 @@ template <typename T> T SwigValueInit() {
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
-  
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -182,17 +195,17 @@ template <typename T> T SwigValueInit() {
 #define SWIG_POINTER_OWN           0x1
 
 
-/* 
+/*
    Flags/methods for returning states.
-   
-   The swig conversion methods, as ConvertPtr, return and integer 
+
+   The SWIG conversion methods, as ConvertPtr, return an integer
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
-   
+
    Use the following macros/flags to set or process the returning
    states.
-   
-   In old swig versions, you usually write code as:
+
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -200,7 +213,7 @@ template <typename T> T SwigValueInit() {
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -209,7 +222,7 @@ template <typename T> T SwigValueInit() {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -224,28 +237,28 @@ template <typename T> T SwigValueInit() {
     } else {
       // fail code
     }
-    
+
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
-
-      int SWIG_ConvertPtr(obj, ptr,...) {         
-        if (<obj is ok>) {                            
-          if (<need new object>) {                    
-            *ptr = <ptr to new allocated object>; 
-            return SWIG_NEWOBJ;                       
-          } else {                                    
-            *ptr = <ptr to old object>;               
-            return SWIG_OLDOBJ;                       
-          }                                   
-        } else {                                      
-          return SWIG_BADOBJ;                 
-        }                                             
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {
+        if (<obj is ok>) {
+          if (<need new object>) {
+            *ptr = <ptr to new allocated object>;
+            return SWIG_NEWOBJ;
+          } else {
+            *ptr = <ptr to old object>;
+            return SWIG_OLDOBJ;
+          }
+        } else {
+          return SWIG_BADOBJ;
+        }
       }
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -254,18 +267,17 @@ template <typename T> T SwigValueInit() {
        int fooi(int);
 
    and you call
+
       food(1)   // cast rank '1'  (1 -> 1.0)
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
-#define SWIG_OK                    (0) 
+#define SWIG_OK                    (0)
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
-#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
 
 /* The CastRankLimit says how many bits are used for the cast rank */
 #define SWIG_CASTRANKLIMIT         (1 << 8)
@@ -286,7 +298,6 @@ template <typename T> T SwigValueInit() {
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -297,20 +308,18 @@ template <typename T> T SwigValueInit() {
 #  endif
 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 }
-SWIGINTERNINLINE int SWIG_CheckState(int r) { 
-  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
 }
 #else /* no cast-rank mode */
-#  define SWIG_AddCast
+#  define SWIG_AddCast(r) (r)
 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -350,7 +359,7 @@ typedef struct swig_module_info {
   void                    *clientdata;         /* Language specific module data */
 } swig_module_info;
 
-/* 
+/*
   Compare two type names skipping the space characters, therefore
   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
@@ -370,18 +379,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if not equal, 1 if equal
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 */
 SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
-  int equiv = 0;
+SWIG_TypeCmp(const char *nb, const char *tb) {
+  int equiv = 1;
   const char* te = tb + strlen(tb);
   const char* ne = nb;
-  while (!equiv && *ne) {
+  while (equiv != 0 && *ne) {
     for (nb = ne; *ne; ++ne) {
       if (*ne == '|') break;
     }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
     if (*ne) ++ne;
   }
   return equiv;
@@ -389,58 +398,65 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
 
 /*
   Check type equivalence in a name list like <name1>|<name2>|...
-  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+  Return 0 if not equal, 1 if equal
 */
 SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
-  int equiv = 0;
-  const char* te = tb + strlen(tb);
-  const char* ne = nb;
-  while (!equiv && *ne) {
-    for (nb = ne; *ne; ++ne) {
-      if (*ne == '|') break;
-    }
-    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
-    if (*ne) ++ne;
-  }
-  return equiv;
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
 }
 
-
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/*
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -451,7 +467,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
-/* 
+/*
    Dynamic pointer casting. Down an inheritance hierarchy
 */
 SWIGRUNTIME swig_type_info *
@@ -495,7 +511,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
     return type->name;
 }
 
-/* 
+/*
    Set the clientdata field for a type
 */
 SWIGRUNTIME void
@@ -503,14 +519,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
   swig_cast_info *cast = ti->cast;
   /* if (ti->clientdata == clientdata) return; */
   ti->clientdata = clientdata;
-  
+
   while (cast) {
     if (!cast->converter) {
       swig_type_info *tc = cast->type;
       if (!tc->clientdata) {
        SWIG_TypeClientData(tc, clientdata);
       }
-    }    
+    }
     cast = cast->next;
   }
 }
@@ -519,18 +535,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
   SWIG_TypeClientData(ti, clientdata);
   ti->owndata = 1;
 }
-  
+
 /*
   Search for a swig_type_info structure only by mangled name
   Search is a O(log #types)
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start, 
-                            swig_module_info *end, 
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+                            swig_module_info *end,
                            const char *name) {
   swig_module_info *iter = start;
   do {
@@ -539,11 +555,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
       register size_t r = iter->size - 1;
       do {
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
-       register size_t i = (l + r) >> 1; 
+       register size_t i = (l + r) >> 1;
        const char *iname = iter->types[i]->name;
        if (iname) {
          register int compare = strcmp(name, iname);
-         if (compare == 0) {       
+         if (compare == 0) {
            return iter->types[i];
          } else if (compare < 0) {
            if (i) {
@@ -568,14 +584,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
   Search for a swig_type_info structure for either a mangled name or a human readable name.
   It first searches the mangled names of the types, which is a O(log #types)
   If a type is not found it then searches the human readable names, which is O(#types).
-  
-  We start searching at module start, and finish searching when start == end.  
+
+  We start searching at module start, and finish searching when start == end.
   Note: if start == end at the beginning of the function, we go all the way around
   the circular list.
 */
 SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start, 
-                     swig_module_info *end, 
+SWIG_TypeQueryModule(swig_module_info *start,
+                     swig_module_info *end,
                     const char *name) {
   /* STEP 1: Search the name field using binary search */
   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -594,12 +610,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
       iter = iter->next;
     } while (iter != end);
   }
-  
+
   /* neither found a match */
   return 0;
 }
 
-/* 
+/*
    Pack binary data into a string
 */
 SWIGRUNTIME char *
@@ -615,7 +631,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
   return c;
 }
 
-/* 
+/*
    Unpack binary data from a string
 */
 SWIGRUNTIME const char *
@@ -629,21 +645,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
       uu = ((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
       uu = ((d - ('a'-10)) << 4);
-    else 
+    else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
       uu |= (d - '0');
     else if ((d >= 'a') && (d <= 'f'))
       uu |= (d - ('a'-10));
-    else 
+    else
       return (char *) 0;
     *u = uu;
   }
   return c;
 }
 
-/* 
+/*
    Pack 'void *' into a string buffer.
 */
 SWIGRUNTIME char *
@@ -703,9 +719,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 #endif
 
 /* -----------------------------------------------------------------------------
- * See the LICENSE file for information on copyright, usage and redistribution
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
- *
  * luarun.swg
  *
  * This file contains the runtime support for Lua modules
@@ -722,6 +735,92 @@ extern "C" {
 #include <stdlib.h>  /* for malloc */
 #include <assert.h>  /* for a few sanity tests */
 
+/* -----------------------------------------------------------------------------
+ * Lua flavors
+ * ----------------------------------------------------------------------------- */
+
+#define SWIG_LUA_FLAVOR_LUA 1
+#define SWIG_LUA_FLAVOR_ELUA 2
+#define SWIG_LUA_FLAVOR_ELUAC 3
+
+#if !defined(SWIG_LUA_TARGET)
+# error SWIG_LUA_TARGET not defined
+#endif
+
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
+#  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
+#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
+#  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
+#  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
+#else /* SWIG_LUA_FLAVOR_LUA */
+#  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
+#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
+#  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
+#  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
+#endif
+
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
+#  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
+#  define LSTRVAL LRO_STRVAL
+#endif
+
+/* -----------------------------------------------------------------------------
+ * compatibility defines
+ * ----------------------------------------------------------------------------- */
+
+/* History of Lua C API length functions:  In Lua 5.0 (and before?)
+   there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
+   but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
+   this function was again renamed, to "lua_rawlen" (to emphasize that
+   it doesn't call the "__len" metamethod), and the compatibility
+   define of lua_strlen was removed.  All SWIG uses have been updated
+   to "lua_rawlen", and we add our own defines of that here for older
+   versions of Lua.  */
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
+# define lua_rawlen lua_strlen
+#elif LUA_VERSION_NUM == 501
+# define lua_rawlen lua_objlen
+#endif
+
+
+/* lua_pushglobaltable is the recommended "future-proof" way to get
+   the global table for Lua 5.2 and later.  Here we define
+   lua_pushglobaltable ourselves for Lua versions before 5.2.  */
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
+#endif
+
+
+/* --------------------------------------------------------------------------
+ * Helper functions for error handling
+ * -------------------------------------------------------------------------- */
+
+/* Push the string STR on the Lua stack, like lua_pushstring, but
+   prefixed with the the location of the innermost Lua call-point
+   (as formated by luaL_where).  */
+SWIGRUNTIME void
+SWIG_Lua_pusherrstring (lua_State *L, const char *str)
+{
+  luaL_where (L, 1);
+  lua_pushstring (L, str);
+  lua_concat (L, 2);
+}
+
+/* Push a formatted string generated from FMT and following args on
+   the Lua stack, like lua_pushfstring, but prefixed with the the
+   location of the innermost Lua call-point (as formated by luaL_where).  */
+SWIGRUNTIME void
+SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
+{
+  va_list argp;
+  va_start(argp, fmt);
+  luaL_where(L, 1);
+  lua_pushvfstring(L, fmt, argp);
+  va_end(argp);
+  lua_concat(L, 2);
+}
+
+
 /* -----------------------------------------------------------------------------
  * global swig types
  * ----------------------------------------------------------------------------- */
@@ -761,6 +860,15 @@ typedef struct {
   lua_CFunction   setmethod;
 } swig_lua_attribute;
 
+// Can be used to create namespaces. Currently used to
+// wrap class static methods/variables/constants
+typedef struct {
+  const char            *name;
+  swig_lua_method       *ns_methods;
+  swig_lua_attribute    *ns_attributes;
+  swig_lua_const_info   *ns_constants;
+} swig_lua_namespace;
+
 typedef struct swig_lua_class {
   const char    *name;
   swig_type_info   **type;
@@ -768,11 +876,12 @@ typedef struct swig_lua_class {
   void    (*destructor)(void *);
   swig_lua_method   *methods;
   swig_lua_attribute     *attributes;
+  swig_lua_namespace    cls_static;
   struct swig_lua_class **bases;
   const char **base_names;
 } swig_lua_class;
 
-/* this is the struct for wrappering all pointers in SwigLua
+/* this is the struct for wrapping all pointers in SwigLua
 */
 typedef struct {
   swig_type_info   *type;
@@ -780,10 +889,10 @@ typedef struct {
   void        *ptr;
 } swig_lua_userdata;
 
-/* this is the struct for wrapping arbitary packed binary data
+/* this is the struct for wrapping arbitrary packed binary data
 (currently it is only used for member function pointers)
 the data ordering is similar to swig_lua_userdata, but it is currently not possible
-to tell the two structures apart within Swig, other than by looking at the type
+to tell the two structures apart within SWIG, other than by looking at the type
 */
 typedef struct {
   swig_type_info   *type;
@@ -806,19 +915,20 @@ typedef struct {
 
 /* Contract support */
 #define SWIG_contract_assert(expr, msg)  \
-  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
+  if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
+
 
 /* helper #defines */
 #define SWIG_fail {goto fail;}
 #define SWIG_fail_arg(func_name,argnum,type) \
-  {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
+  {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
   func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
   goto fail;}
 #define SWIG_fail_ptr(func_name,argnum,type) \
   SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
 #define SWIG_check_num_args(func_name,a,b) \
   if (lua_gettop(L)<a || lua_gettop(L)>b) \
-  {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
+  {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
   goto fail;}
 
 
@@ -864,15 +974,14 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  * ----------------------------------------------------------------------------- */
 
 /* this function is called when trying to set an immutable.
-default value is to print an error.
+default action is to print an error.
 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
 {
 /*  there should be 1 param passed in: the new value */
 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
   lua_pop(L,1);  /* remove it */
-  lua_pushstring(L,"This variable is immutable");
-  lua_error(L);
+  luaL_error(L,"This variable is immutable");
 #endif
     return 0;   /* should not return anything */
 }
@@ -888,12 +997,24 @@ SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
    lua_tostring(L,2));
 */
   /* get the metatable */
-  assert(lua_istable(L,1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,1)); /* just in case */
+#else
+  assert(lua_istable(L,1)); /* default Lua action */
+#endif
   lua_getmetatable(L,1);  /* get the metatable */
-  assert(lua_istable(L,-1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,-1));  /* just in case */
+#else
+  assert(lua_istable(L,-1));
+#endif
   SWIG_Lua_get_table(L,".get");  /* get the .get table */
   lua_remove(L,3);  /* remove metatable */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  if (lua_isrotable(L,-1))
+#else
   if (lua_istable(L,-1))
+#endif
   {
     /* look for the key in the .get table */
     lua_pushvalue(L,2);  /* key */
@@ -908,7 +1029,7 @@ SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
   }
   lua_pop(L,1);  /* remove the .get */
   lua_pushnil(L);  /* return a nil */
-    return 1;
+  return 1;
 }
 
 /* the module.set method used for setting linked data */
@@ -920,12 +1041,24 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
   (3) any for the new value
 */
   /* get the metatable */
-  assert(lua_istable(L,1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,1));  /* just in case */
+#else
+  assert(lua_istable(L,1)); /* default Lua action */
+#endif
   lua_getmetatable(L,1);  /* get the metatable */
-  assert(lua_istable(L,-1));  /* just in case */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  assert(lua_isrotable(L,-1));  /* just in case */
+#else
+  assert(lua_istable(L,-1));
+#endif
   SWIG_Lua_get_table(L,".set");  /* get the .set table */
   lua_remove(L,4);  /* remove metatable */
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+  if (lua_isrotable(L,-1))
+#else
   if (lua_istable(L,-1))
+#endif
   {
     /* look for the key in the .set table */
     lua_pushvalue(L,2);  /* key */
@@ -937,6 +1070,11 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
       lua_call(L,1,0);
       return 0;
     }
+#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) 
+    else {
+      return 0; // Exits stoically if an invalid key is initialized.
+    }
+#endif
   }
   lua_settop(L,3);  /* reset back to start */
   /* we now have the table, key & new value, so just set directly */
@@ -944,7 +1082,8 @@ SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
   return 0;
 }
 
-/* registering a module in lua */
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
+/* registering a module in lua. Pushes the module table on the stack. */
 SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
 {
   assert(lua_istable(L,-1));  /* just in case */
@@ -961,8 +1100,16 @@ SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
   lua_newtable(L);    /* the .set table */
   lua_rawset(L,-3);  /* add .set into metatable */
   lua_setmetatable(L,-2);  /* sets meta table in module */
+#ifdef SWIG_LUA_MODULE_GLOBAL
+  /* If requested, install the module directly into the global namespace. */
   lua_rawset(L,-3);        /* add module into parent */
   SWIG_Lua_get_table(L,name);   /* get the table back out */
+#else
+  /* Do not install the module table as global name. The stack top has
+     the module table with the name below. We pop the top and replace
+     the name with it. */
+  lua_replace(L,-2);
+#endif
 }
 
 /* ending the register */
@@ -990,6 +1137,7 @@ SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_C
   }
   lua_pop(L,1);       /* tidy stack (remove meta) */
 }
+#endif
 
 /* adding a function module */
 SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
@@ -997,6 +1145,138 @@ SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_
   SWIG_Lua_add_function(L,name,fn);
 }
 
+/* -----------------------------------------------------------------------------
+ * global variable support code: namespaces
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L)
+{
+/*  there should be 2 params passed in
+  (1) table (not the meta table)
+  (2) string name of the attribute
+*/
+  assert(lua_istable(L,-2));  /* just in case */
+  lua_getmetatable(L,-2);
+  assert(lua_istable(L,-1));
+  SWIG_Lua_get_table(L,".get"); /* find the .get table */
+  assert(lua_istable(L,-1));
+  /* look for the key in the .get table */
+  lua_pushvalue(L,2);  /* key */
+  lua_rawget(L,-2);
+  lua_remove(L,-2); /* stack tidy, remove .get table */
+  if (lua_iscfunction(L,-1))
+  {  /* found it so call the fn & return its value */
+    lua_call(L,0,1);  /* 1 value in (userdata),1 out (result) */
+    lua_remove(L,-2); /* stack tidy, remove metatable */
+    return 1;
+  }
+  lua_pop(L,1);  /* remove whatever was there */
+  /* ok, so try the .fn table */
+  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
+  assert(lua_istable(L,-1));  /* just in case */
+  lua_pushvalue(L,2);  /* key */
+  lua_rawget(L,-2);  /* look for the fn */
+  lua_remove(L,-2); /* stack tidy, remove .fn table */
+  if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
+  {  /* found it so return the fn & let lua call it */
+    lua_remove(L,-2); /* stack tidy, remove metatable */
+    return 1;
+  }
+  lua_pop(L,1);  /* remove whatever was there */
+  return 0;
+}
+
+SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L)
+{
+/*  there should be 3 params passed in
+  (1) table (not the meta table)
+  (2) string name of the attribute
+  (3) any for the new value
+*/
+
+  assert(lua_istable(L,1));
+  lua_getmetatable(L,1);    /* get the meta table */
+  assert(lua_istable(L,-1));
+
+  SWIG_Lua_get_table(L,".set"); /* find the .set table */
+  if (lua_istable(L,-1))
+  {
+    /* look for the key in the .set table */
+    lua_pushvalue(L,2);  /* key */
+    lua_rawget(L,-2);
+    if (lua_iscfunction(L,-1))
+    {  /* found it so call the fn & return its value */
+      lua_pushvalue(L,3);  /* value */
+      lua_call(L,1,0);
+      return 0;
+    }
+    lua_pop(L,1);  /* remove the value */
+  }
+  lua_pop(L,1);  /* remove the value .set table */
+  return 0;
+}
+
+SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration
+SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration
+
+/* helper function - register namespace methods and attributes into namespace */
+SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns)
+{
+  int i = 0;
+  assert(lua_istable(L,-1));
+  /* There must be table at the top of the stack */
+  SWIG_Lua_InstallConstants(L, ns->ns_constants);
+
+  lua_getmetatable(L,-1);
+
+  /* add fns */
+  for(i=0;ns->ns_attributes[i].name;i++){
+    SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
+  }
+
+  /* add methods to the metatable */
+  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
+  assert(lua_istable(L,-1));  /* just in case */
+  for(i=0;ns->ns_methods[i].name;i++){
+    SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method);
+  }
+  lua_pop(L,1);
+
+  /* clear stack - remove metatble */
+  lua_pop(L,1);
+  return 0;
+}
+
+/* helper function. creates namespace table and add it to module table */
+SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
+{
+  assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */
+  lua_checkstack(L,5);
+  lua_pushstring(L, ns->name);
+  lua_newtable(L); /* namespace itself */
+  lua_newtable(L); /* metatable for namespace */
+
+  /* add a table called ".get" */
+  lua_pushstring(L,".get");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+  /* add a table called ".set" */
+  lua_pushstring(L,".set");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+  /* add a table called ".fn" */
+  lua_pushstring(L,".fn");
+  lua_newtable(L);
+  lua_rawset(L,-3);
+
+  /* add accessor fns for using the .get,.set&.fn */
+  SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
+  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
+
+  lua_setmetatable(L,-2); /* set metatable */
+  lua_rawset(L,-3); /* add namespace to module table */
+  return 0;
+}
 /* -----------------------------------------------------------------------------
  * global variable support code: classes
  * ----------------------------------------------------------------------------- */
@@ -1119,6 +1399,56 @@ SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
   return 0;
 }
 
+/* the class.__tostring method called by the interpreter and print */
+SWIGINTERN int  SWIG_Lua_class_tostring(lua_State* L)
+{
+/*  there should be 1 param passed in
+  (1) userdata (not the metatable) */
+  assert(lua_isuserdata(L,1));  /* just in case */
+  unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
+  lua_getmetatable(L,1);    /* get the meta table */
+  assert(lua_istable(L,-1));  /* just in case */
+  
+  lua_getfield(L, -1, ".type");
+  const char* className = lua_tostring(L, -1);
+  
+  char output[256];
+  sprintf(output, "<%s userdata: %lX>", className, userData);
+  
+  lua_pushstring(L, (const char*)output);
+  return 1;
+}
+
+/* to manually disown some userdata */
+SWIGINTERN int  SWIG_Lua_class_disown(lua_State* L)
+{
+/*  there should be 1 params passed in
+  (1) userdata (not the meta table) */
+  swig_lua_userdata* usr;
+  assert(lua_isuserdata(L,-1));  /* just in case */
+  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
+  
+  usr->own = 0; /* clear our ownership */
+  return 0;
+}
+
+/* Constructor proxy. Used when class name entry in module is not class constructor,
+but special table instead. */
+SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L)
+{
+  /* unlimited number of parameters
+     First one is our proxy table and we should remove it
+     Other we should pass to real constructor
+   */
+   assert(lua_istable(L,1));
+   lua_pushstring(L,".constructor");
+   lua_rawget(L,1);
+   assert(!lua_isnil(L,-1));
+   lua_replace(L,1); /* replace our table with real constructor */
+   lua_call(L,lua_gettop(L)-1,1);
+   return 1;
+}
+
 /* gets the swig class registry (or creates it) */
 SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
 {
@@ -1163,6 +1493,21 @@ SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_C
   }
 }
 
+/* helper to recursively add class static details (static attributes, operations and constants) */
+SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss)
+{
+  int i = 0;
+  /* The class namespace table must be on the top of the stack */
+  assert(lua_istable(L,-1));
+  /* call all the base classes first: we can then override these later: */
+  for(i=0;clss->bases[i];i++)
+  {
+    SWIG_Lua_add_class_static_details(L,clss->bases[i]);
+  }
+
+  SWIG_Lua_add_namespace_details(L, &clss->cls_static);
+}
+
 /* helper to recursively add class details (attributes & operations) */
 SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
 {
@@ -1213,18 +1558,45 @@ SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
       swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
       if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
     }
-  }    
+  }
 }
 
-/* performs the entire class registration process */
-SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+/* Register class static methods,attributes etc as well as constructor proxy */
+SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss)
 {
+  lua_checkstack(L,5); /* just in case */
+  assert(lua_istable(L,-1));  /* just in case */
+  assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */
+
+  SWIG_Lua_namespace_register(L,&clss->cls_static);
+
+  SWIG_Lua_get_table(L,clss->name); // Get namespace table back
+  assert(lua_istable(L,-1)); /* just in case */
+
   /*  add its constructor to module with the name of the class
   so you can do MyClass(...) as well as new_MyClass(...)
   BUT only if a constructor is defined
   (this overcomes the problem of pure virtual classes without constructors)*/
   if (clss->constructor)
-    SWIG_Lua_add_function(L,clss->name,clss->constructor);
+  {
+    SWIG_Lua_add_function(L,".constructor", clss->constructor);
+    lua_getmetatable(L,-1);
+    assert(lua_istable(L,-1)); /* just in case */
+    SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy);
+    lua_pop(L,1);
+  }
+
+  assert(lua_istable(L,-1)); /* just in case */
+  SWIG_Lua_add_class_static_details(L, clss);
+
+  /* clear stack */
+  lua_pop(L,1);
+}
+
+/* performs the entire class registration process */
+SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+{
+  SWIG_Lua_class_register_static(L,clss);
 
   SWIG_Lua_get_class_registry(L);  /* get the registry */
   lua_pushstring(L,clss->name);  /* get the name */
@@ -1244,11 +1616,15 @@ SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
   /* add a table called ".fn" */
   lua_pushstring(L,".fn");
   lua_newtable(L);
+  /* add manual disown method */
+  SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
   lua_rawset(L,-3);
   /* add accessor fns for using the .get,.set&.fn */
   SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
   SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
+  /* add tostring method for better output */
+  SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
   /* add it */
   lua_rawset(L,-3);  /* metatable into registry */
   lua_pop(L,1);      /* tidy stack (remove registry) */
@@ -1291,7 +1667,9 @@ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *t
   usr->ptr=ptr;  /* set the ptr */
   usr->type=type;
   usr->own=own;
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
   _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+#endif
 }
 
 /* takes a object from the lua stack & converts it into an object of the correct type
@@ -1329,9 +1707,8 @@ SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *typ
        int argnum,const char* func_name){
   void* result;
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
-    lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
-      func_name,(type && type->str)?type->str:"void*",argnum);
-    lua_error(L);
+    luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
+               func_name,(type && type->str)?type->str:"void*",argnum);
   }
   return result;
 }
@@ -1368,7 +1745,7 @@ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
   swig_lua_userdata* usr;
   if (lua_isuserdata(L,tp))
   {
-    usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
+    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
     if (usr && usr->type && usr->type->str)
       return usr->type->str;
     return "userdata (unknown type)";
@@ -1404,6 +1781,7 @@ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
  * global variable support code: class/struct typemap functions
  * ----------------------------------------------------------------------------- */
 
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
 /* Install Constants */
 SWIGINTERN void
 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
@@ -1445,6 +1823,7 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
     }
   }
 }
+#endif
 
 /* -----------------------------------------------------------------------------
  * executing lua code from within the wrapper
@@ -1453,8 +1832,8 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
 #endif
-/* Executes a C string in Lua a really simple way of calling lua from C
-Unfortunately lua keeps changing its API's, so we need a conditional compile
+/* Executes a C string in Lua which is a really simple way of calling lua from C
+Unfortunately lua keeps changing its APIs, so we need a conditional compile
 In lua 5.0.X its lua_dostring()
 In lua 5.1.X its luaL_dostring()
 */
@@ -1527,7 +1906,6 @@ static swig_module_info swig_module = {swig_types, 30, 0, 0, 0, 0};
 
 #define SWIG_LUACODE   luaopen_freeswitch_luacode
 
-
 namespace swig {
 typedef struct{} LANGUAGE_OBJ;
 }
@@ -1537,21 +1915,28 @@ typedef struct{} LANGUAGE_OBJ;
 #include "switch_cpp.h"
 #include "freeswitch_lua.h"
 
+
+SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
+  int ret = lua_isstring(L, idx);
+  if (!ret)
+   ret = lua_isnil(L, idx);
+  return ret;
+}
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 static int _wrap_setGlobalVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("setGlobalVariable",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("setGlobalVariable",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setGlobalVariable",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("setGlobalVariable",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("setGlobalVariable",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   setGlobalVariable(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1564,16 +1949,15 @@ fail:
 
 
 static int _wrap_getGlobalVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *result = 0 ;
   
   SWIG_check_num_args("getGlobalVariable",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("getGlobalVariable",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("getGlobalVariable",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (char *)getGlobalVariable(arg1);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -1586,17 +1970,16 @@ fail:
 
 
 static int _wrap_consoleLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("consoleLog",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   consoleLog(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1609,7 +1992,7 @@ fail:
 
 
 static int _wrap_consoleLog2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -1617,18 +2000,17 @@ static int _wrap_consoleLog2(lua_State* L) {
   char *arg5 = (char *) 0 ;
   
   SWIG_check_num_args("consoleLog2",5,5)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog2",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleLog2",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
   if(!lua_isnumber(L,4)) SWIG_fail_arg("consoleLog2",4,"int");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("consoleLog2",5,"char *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("consoleLog2",5,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (char *)lua_tostring(L, 5);
   consoleLog2(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1641,14 +2023,13 @@ fail:
 
 
 static int _wrap_consoleCleanLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   
   SWIG_check_num_args("consoleCleanLog",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   consoleCleanLog(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1661,13 +2042,12 @@ fail:
 
 
 static int _wrap_running(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   bool result;
   
   SWIG_check_num_args("running",0,0)
   result = (bool)running();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -1679,7 +2059,7 @@ fail:
 
 
 static int _wrap_email(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
@@ -1690,13 +2070,13 @@ static int _wrap_email(lua_State* L) {
   bool result;
   
   SWIG_check_num_args("email",2,7)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("email",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("email",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("email",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("email",4,"char *");
-  if(lua_gettop(L)>=5 && !lua_isstring(L,5)) SWIG_fail_arg("email",5,"char *");
-  if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("email",6,"char *");
-  if(lua_gettop(L)>=7 && !lua_isstring(L,7)) SWIG_fail_arg("email",7,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("email",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("email",2,"char *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("email",3,"char *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("email",4,"char *");
+  if(lua_gettop(L)>=5 && !SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("email",5,"char *");
+  if(lua_gettop(L)>=6 && !SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("email",6,"char *");
+  if(lua_gettop(L)>=7 && !SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("email",7,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   if(lua_gettop(L)>=3){
@@ -1715,8 +2095,7 @@ static int _wrap_email(lua_State* L) {
     arg7 = (char *)lua_tostring(L, 7);
   }
   result = (bool)email(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -1728,7 +2107,7 @@ fail:
 
 
 static int _wrap_new_IVRMenu(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -1748,24 +2127,24 @@ static int _wrap_new_IVRMenu(lua_State* L) {
   int arg17 ;
   IVRMenu *result = 0 ;
   
-  SWIG_check_num_args("IVRMenu",17,17)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("IVRMenu",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("IVRMenu",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("IVRMenu",4,"char const *");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("IVRMenu",5,"char const *");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("IVRMenu",6,"char const *");
-  if(!lua_isstring(L,7)) SWIG_fail_arg("IVRMenu",7,"char const *");
-  if(!lua_isstring(L,8)) SWIG_fail_arg("IVRMenu",8,"char const *");
-  if(!lua_isstring(L,9)) SWIG_fail_arg("IVRMenu",9,"char const *");
-  if(!lua_isstring(L,10)) SWIG_fail_arg("IVRMenu",10,"char const *");
-  if(!lua_isstring(L,11)) SWIG_fail_arg("IVRMenu",11,"char const *");
-  if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu",12,"int");
-  if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu",13,"int");
-  if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu",14,"int");
-  if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu",15,"int");
-  if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu",16,"int");
-  if(!lua_isnumber(L,17)) SWIG_fail_arg("IVRMenu",17,"int");
+  SWIG_check_num_args("IVRMenu::IVRMenu",17,17)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::IVRMenu",1,"IVRMenu *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IVRMenu::IVRMenu",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::IVRMenu",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("IVRMenu::IVRMenu",4,"char const *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("IVRMenu::IVRMenu",5,"char const *");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("IVRMenu::IVRMenu",6,"char const *");
+  if(!SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("IVRMenu::IVRMenu",7,"char const *");
+  if(!SWIG_lua_isnilstring(L,8)) SWIG_fail_arg("IVRMenu::IVRMenu",8,"char const *");
+  if(!SWIG_lua_isnilstring(L,9)) SWIG_fail_arg("IVRMenu::IVRMenu",9,"char const *");
+  if(!SWIG_lua_isnilstring(L,10)) SWIG_fail_arg("IVRMenu::IVRMenu",10,"char const *");
+  if(!SWIG_lua_isnilstring(L,11)) SWIG_fail_arg("IVRMenu::IVRMenu",11,"char const *");
+  if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu::IVRMenu",12,"int");
+  if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu::IVRMenu",13,"int");
+  if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu::IVRMenu",14,"int");
+  if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu::IVRMenu",15,"int");
+  if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu::IVRMenu",16,"int");
+  if(!lua_isnumber(L,17)) SWIG_fail_arg("IVRMenu::IVRMenu",17,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("new_IVRMenu",1,SWIGTYPE_p_IVRMenu);
@@ -1788,7 +2167,6 @@ static int _wrap_new_IVRMenu(lua_State* L) {
   arg16 = (int)lua_tonumber(L, 16);
   arg17 = (int)lua_tonumber(L, 17);
   result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,(char const *)arg9,(char const *)arg10,(char const *)arg11,arg12,arg13,arg14,arg15,arg16,arg17);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_IVRMenu,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -1800,43 +2178,18 @@ fail:
 }
 
 
-static int _wrap_delete_IVRMenu(lua_State* L) {
-  int SWIG_arg = -1;
-  IVRMenu *arg1 = (IVRMenu *) 0 ;
-  
-  SWIG_check_num_args("IVRMenu",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_IVRMenu",1,SWIGTYPE_p_IVRMenu);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_IVRMenu_bindAction(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   char *arg4 = (char *) 0 ;
   
-  SWIG_check_num_args("bindAction",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bindAction",1,"IVRMenu *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("bindAction",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("bindAction",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("bindAction",4,"char const *");
+  SWIG_check_num_args("IVRMenu::bindAction",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::bindAction",1,"IVRMenu *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IVRMenu::bindAction",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::bindAction",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("IVRMenu::bindAction",4,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("IVRMenu_bindAction",1,SWIGTYPE_p_IVRMenu);
@@ -1846,7 +2199,6 @@ static int _wrap_IVRMenu_bindAction(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (char *)lua_tostring(L, 4);
   (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1859,15 +2211,15 @@ fail:
 
 
 static int _wrap_IVRMenu_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   IVRMenu *arg1 = (IVRMenu *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("execute",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"IVRMenu *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("execute",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("IVRMenu::execute",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu::execute",1,"IVRMenu *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("IVRMenu::execute",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("IVRMenu::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){
     SWIG_fail_ptr("IVRMenu_execute",1,SWIGTYPE_p_IVRMenu);
@@ -1880,7 +2232,6 @@ static int _wrap_IVRMenu_execute(lua_State* L) {
   
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->execute(arg2,(char const *)arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -1904,24 +2255,32 @@ static swig_lua_method swig_IVRMenu_methods[] = {
 static swig_lua_attribute swig_IVRMenu_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_IVRMenu_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_IVRMenu_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_IVRMenu_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_IVRMenu_bases[] = {0};
 static const char *swig_IVRMenu_base_names[] = {0};
-static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases, swig_IVRMenu_base_names };
+static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, { "IVRMenu", swig_IVRMenu_cls_methods, swig_IVRMenu_cls_attributes, swig_IVRMenu_cls_constants }, swig_IVRMenu_bases, swig_IVRMenu_base_names };
 
 static int _wrap_new_API(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) NULL ;
   API *result = 0 ;
   
-  SWIG_check_num_args("API",0,1)
-  if(lua_gettop(L)>=1 && !SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"CoreSession *");
+  SWIG_check_num_args("API::API",0,1)
+  if(lua_gettop(L)>=1 && !SWIG_isptrtype(L,1)) SWIG_fail_arg("API::API",1,"CoreSession *");
   if(lua_gettop(L)>=1){
     if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
       SWIG_fail_ptr("new_API",1,SWIGTYPE_p_CoreSession);
     }
   }
   result = (API *)new API(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_API,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -1933,42 +2292,17 @@ fail:
 }
 
 
-static int _wrap_delete_API(lua_State* L) {
-  int SWIG_arg = -1;
-  API *arg1 = (API *) 0 ;
-  
-  SWIG_check_num_args("API",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"API *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_API",1,SWIGTYPE_p_API);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_API_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"API *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("API::execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::execute",1,"API *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("API::execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("API::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_execute",1,SWIGTYPE_p_API);
@@ -1979,8 +2313,7 @@ static int _wrap_API_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (char *)(arg1)->execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -1993,14 +2326,14 @@ fail:
 
 
 static int _wrap_API_executeString(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("executeString",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("executeString",1,"API *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("executeString",2,"char const *");
+  SWIG_check_num_args("API::executeString",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::executeString",1,"API *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("API::executeString",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_executeString",1,SWIGTYPE_p_API);
@@ -2008,8 +2341,7 @@ static int _wrap_API_executeString(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->executeString((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   free(result);
   return SWIG_arg;
   
@@ -2022,20 +2354,19 @@ fail:
 
 
 static int _wrap_API_getTime(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   API *arg1 = (API *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getTime",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getTime",1,"API *");
+  SWIG_check_num_args("API::getTime",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API::getTime",1,"API *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){
     SWIG_fail_ptr("API_getTime",1,SWIGTYPE_p_API);
   }
   
   result = (char *)(arg1)->getTime();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2059,18 +2390,27 @@ static swig_lua_method swig_API_methods[] = {
 static swig_lua_attribute swig_API_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_API_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_API_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_API_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_API_bases[] = {0};
 static const char *swig_API_base_names[] = {0};
-static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases, swig_API_base_names };
+static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, { "API", swig_API_cls_methods, swig_API_cls_attributes, swig_API_cls_constants }, swig_API_bases, swig_API_base_names };
 
 static int _wrap_input_callback_state_t_function_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("function",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("function",2,"void *");
+  SWIG_check_num_args("input_callback_state::function",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::function",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::function",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_function_set",1,SWIGTYPE_p_input_callback_state);
@@ -2079,8 +2419,6 @@ static int _wrap_input_callback_state_t_function_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_function_set");
   if (arg1) (arg1)->function = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2092,19 +2430,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_function_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("function",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::function",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::function",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_function_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->function);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2117,13 +2454,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_threadState_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("threadState",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("threadState",2,"void *");
+  SWIG_check_num_args("input_callback_state::threadState",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::threadState",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::threadState",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_threadState_set",1,SWIGTYPE_p_input_callback_state);
@@ -2132,8 +2469,6 @@ static int _wrap_input_callback_state_t_threadState_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_threadState_set");
   if (arg1) (arg1)->threadState = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2145,19 +2480,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_threadState_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("threadState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::threadState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::threadState",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_threadState_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->threadState);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2170,13 +2504,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_extra_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("extra",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("extra",2,"void *");
+  SWIG_check_num_args("input_callback_state::extra",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::extra",1,"input_callback_state *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("input_callback_state::extra",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_extra_set",1,SWIGTYPE_p_input_callback_state);
@@ -2185,8 +2519,6 @@ static int _wrap_input_callback_state_t_extra_set(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_extra_set");
   if (arg1) (arg1)->extra = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2198,19 +2530,18 @@ fail:
 
 
 static int _wrap_input_callback_state_t_extra_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("extra",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::extra",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::extra",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_extra_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (void *) ((arg1)->extra);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2223,13 +2554,13 @@ fail:
 
 
 static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("funcargs",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("funcargs",2,"char *");
+  SWIG_check_num_args("input_callback_state::funcargs",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::funcargs",1,"input_callback_state *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("input_callback_state::funcargs",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_funcargs_set",1,SWIGTYPE_p_input_callback_state);
@@ -2237,7 +2568,7 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->funcargs) delete [] arg1->funcargs;
+    delete [] arg1->funcargs;
     if (arg2) {
       arg1->funcargs = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->funcargs, (const char *)arg2);
@@ -2245,7 +2576,6 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) {
       arg1->funcargs = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2258,20 +2588,19 @@ fail:
 
 
 static int _wrap_input_callback_state_t_funcargs_get(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *arg1 = (input_callback_state *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("funcargs",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *");
+  SWIG_check_num_args("input_callback_state::funcargs",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state::funcargs",1,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){
     SWIG_fail_ptr("input_callback_state_t_funcargs_get",1,SWIGTYPE_p_input_callback_state);
   }
   
   result = (char *) ((arg1)->funcargs);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2283,12 +2612,11 @@ fail:
 
 
 static int _wrap_new_input_callback_state_t(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *result = 0 ;
+  int SWIG_arg = 0;
+  input_callback_state *result = 0 ;
   
-  SWIG_check_num_args("input_callback_state_t::input_callback_state_t",0,0)
-  result = (input_callback_state_t *)new input_callback_state_t();
-  SWIG_arg=0;
+  SWIG_check_num_args("input_callback_state::input_callback_state",0,0)
+  result = (input_callback_state *)new input_callback_state();
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2300,57 +2628,41 @@ fail:
 }
 
 
-static int _wrap_delete_input_callback_state_t(lua_State* L) {
-  int SWIG_arg = -1;
-  input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
-  
-  SWIG_check_num_args("input_callback_state_t::~input_callback_state_t",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state_t::~input_callback_state_t",1,"input_callback_state_t *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_input_callback_state_t",1,SWIGTYPE_p_input_callback_state);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static void swig_delete_input_callback_state_t(void *obj) {
-input_callback_state_t *arg1 = (input_callback_state_t *) obj;
+input_callback_state *arg1 = (input_callback_state *) obj;
 delete arg1;
 }
-static swig_lua_method swig_input_callback_state_t_methods[] = {
+static swig_lua_method swig_input_callback_state_methods[] = {
     {0,0}
 };
-static swig_lua_attribute swig_input_callback_state_t_attributes[] = {
+static swig_lua_attribute swig_input_callback_state_attributes[] = {
     { "function", _wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set},
     { "threadState", _wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set},
     { "extra", _wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set},
     { "funcargs", _wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set},
     {0,0,0}
 };
-static swig_lua_class *swig_input_callback_state_t_bases[] = {0};
-static const char *swig_input_callback_state_t_base_names[] = {0};
-static swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases, swig_input_callback_state_t_base_names };
+static swig_lua_attribute swig_input_callback_state_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_input_callback_state_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_input_callback_state_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
+static swig_lua_class *swig_input_callback_state_bases[] = {0};
+static const char *swig_input_callback_state_base_names[] = {0};
+static swig_lua_class _wrap_class_input_callback_state = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_methods, swig_input_callback_state_attributes, { "input_callback_state_t", swig_input_callback_state_cls_methods, swig_input_callback_state_cls_attributes, swig_input_callback_state_cls_constants }, swig_input_callback_state_bases, swig_input_callback_state_base_names };
 
 static int _wrap_DTMF_digit_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   char arg2 ;
   
-  SWIG_check_num_args("digit",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("digit",2,"char");
+  SWIG_check_num_args("DTMF::digit",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::digit",1,"DTMF *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("DTMF::digit",2,"char");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_digit_set",1,SWIGTYPE_p_DTMF);
@@ -2359,8 +2671,6 @@ static int _wrap_DTMF_digit_set(lua_State* L) {
   arg2 = (lua_tostring(L, 2))[0];
   if (arg1) (arg1)->digit = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2372,19 +2682,18 @@ fail:
 
 
 static int _wrap_DTMF_digit_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   char result;
   
-  SWIG_check_num_args("digit",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *");
+  SWIG_check_num_args("DTMF::digit",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::digit",1,"DTMF *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_digit_get",1,SWIGTYPE_p_DTMF);
   }
   
   result = (char) ((arg1)->digit);
-  SWIG_arg=0;
   lua_pushfstring(L,"%c",result); SWIG_arg++;
   return SWIG_arg;
   
@@ -2397,14 +2706,14 @@ fail:
 
 
 static int _wrap_DTMF_duration_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   uint32_t arg2 ;
   uint32_t *argp2 ;
   
-  SWIG_check_num_args("duration",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("duration",2,"uint32_t");
+  SWIG_check_num_args("DTMF::duration",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::duration",1,"DTMF *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("DTMF::duration",2,"uint32_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_duration_set",1,SWIGTYPE_p_DTMF);
@@ -2418,8 +2727,6 @@ static int _wrap_DTMF_duration_set(lua_State* L) {
   
   if (arg1) (arg1)->duration = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2431,21 +2738,20 @@ fail:
 
 
 static int _wrap_DTMF_duration_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   DTMF *arg1 = (DTMF *) 0 ;
   uint32_t result;
   
-  SWIG_check_num_args("duration",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *");
+  SWIG_check_num_args("DTMF::duration",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF::duration",1,"DTMF *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){
     SWIG_fail_ptr("DTMF_duration_get",1,SWIGTYPE_p_DTMF);
   }
   
   result =  ((arg1)->duration);
-  SWIG_arg=0;
   {
-    uint32_t * resultptr = new uint32_t((uint32_t &) result);
+    uint32_t * resultptr = new uint32_t((const uint32_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -2459,15 +2765,15 @@ fail:
 
 
 static int _wrap_new_DTMF(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char arg1 ;
   uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
-  DTMF *result = 0 ;
   uint32_t *argp2 ;
+  DTMF *result = 0 ;
   
-  SWIG_check_num_args("DTMF",1,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("DTMF",1,"char");
-  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF",2,"uint32_t");
+  SWIG_check_num_args("DTMF::DTMF",1,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("DTMF::DTMF",1,"char");
+  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF::DTMF",2,"uint32_t");
   arg1 = (lua_tostring(L, 1))[0];
   if(lua_gettop(L)>=2){
     if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){
@@ -2476,7 +2782,6 @@ static int _wrap_new_DTMF(lua_State* L) {
     arg2 = *argp2;
   }
   result = (DTMF *)new DTMF(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_DTMF,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2488,31 +2793,6 @@ fail:
 }
 
 
-static int _wrap_delete_DTMF(lua_State* L) {
-  int SWIG_arg = -1;
-  DTMF *arg1 = (DTMF *) 0 ;
-  
-  SWIG_check_num_args("DTMF",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF",1,"DTMF *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_DTMF",1,SWIGTYPE_p_DTMF);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static void swig_delete_DTMF(void *obj) {
 DTMF *arg1 = (DTMF *) obj;
 delete arg1;
@@ -2525,17 +2805,25 @@ static swig_lua_attribute swig_DTMF_attributes[] = {
     { "duration", _wrap_DTMF_duration_get, _wrap_DTMF_duration_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_DTMF_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_DTMF_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_DTMF_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_DTMF_bases[] = {0};
 static const char *swig_DTMF_base_names[] = {0};
-static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases, swig_DTMF_base_names };
+static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, { "DTMF", swig_DTMF_cls_methods, swig_DTMF_cls_attributes, swig_DTMF_cls_constants }, swig_DTMF_bases, swig_DTMF_base_names };
 
 static int _wrap_new_Stream__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *result = 0 ;
   
-  SWIG_check_num_args("Stream",0,0)
+  SWIG_check_num_args("Stream::Stream",0,0)
   result = (Stream *)new Stream();
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2548,19 +2836,18 @@ fail:
 
 
 static int _wrap_new_Stream__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
   Stream *result = 0 ;
   
-  SWIG_check_num_args("Stream",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"switch_stream_handle_t *");
+  SWIG_check_num_args("Stream::Stream",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::Stream",1,"switch_stream_handle_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_stream_handle_t,0))){
     SWIG_fail_ptr("new_Stream",1,SWIGTYPE_p_switch_stream_handle_t);
   }
   
   result = (Stream *)new Stream(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2597,45 +2884,23 @@ static int _wrap_new_Stream(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Stream'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Stream'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    Stream::Stream()\n"
+    "    Stream::Stream(switch_stream_handle_t *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Stream(lua_State* L) {
-  int SWIG_arg = -1;
-  Stream *arg1 = (Stream *) 0 ;
-  
-  SWIG_check_num_args("Stream",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"Stream *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Stream",1,SWIGTYPE_p_Stream);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Stream_read(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   int *arg2 = (int *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("read",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("read",2,"int *");
+  SWIG_check_num_args("Stream::read",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::read",1,"Stream *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Stream::read",2,"int *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream);
@@ -2647,8 +2912,7 @@ static int _wrap_Stream_read(lua_State* L) {
   }
   
   result = (char *)(arg1)->read(arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2660,13 +2924,13 @@ fail:
 
 
 static int _wrap_Stream_write(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("write",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("write",1,"Stream *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("write",2,"char const *");
+  SWIG_check_num_args("Stream::write",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::write",1,"Stream *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Stream::write",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_write",1,SWIGTYPE_p_Stream);
@@ -2674,7 +2938,6 @@ static int _wrap_Stream_write(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->write((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2687,15 +2950,15 @@ fail:
 
 
 static int _wrap_Stream_raw_write(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 ;
   
-  SWIG_check_num_args("raw_write",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int");
+  SWIG_check_num_args("Stream::raw_write",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::raw_write",1,"Stream *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Stream::raw_write",2,"char const *");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("Stream::raw_write",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream);
@@ -2704,7 +2967,6 @@ static int _wrap_Stream_raw_write(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (int)lua_tonumber(L, 3);
   (arg1)->raw_write((char const *)arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2717,20 +2979,19 @@ fail:
 
 
 static int _wrap_Stream_get_data(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Stream *arg1 = (Stream *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("get_data",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_data",1,"Stream *");
+  SWIG_check_num_args("Stream::get_data",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream::get_data",1,"Stream *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
     SWIG_fail_ptr("Stream_get_data",1,SWIGTYPE_p_Stream);
   }
   
   result = (char *)(arg1)->get_data();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2755,18 +3016,27 @@ static swig_lua_method swig_Stream_methods[] = {
 static swig_lua_attribute swig_Stream_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_Stream_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_Stream_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_Stream_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_Stream_bases[] = {0};
 static const char *swig_Stream_base_names[] = {0};
-static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases, swig_Stream_base_names };
+static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, { "Stream", swig_Stream_cls_methods, swig_Stream_cls_attributes, swig_Stream_cls_constants }, swig_Stream_bases, swig_Stream_base_names };
 
 static int _wrap_Event_event_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_event_t *arg2 = (switch_event_t *) 0 ;
   
-  SWIG_check_num_args("event",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"switch_event_t *");
+  SWIG_check_num_args("Event::event",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::event",1,"Event *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Event::event",2,"switch_event_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_event_set",1,SWIGTYPE_p_Event);
@@ -2779,8 +3049,6 @@ static int _wrap_Event_event_set(lua_State* L) {
   
   if (arg1) (arg1)->event = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2792,19 +3060,18 @@ fail:
 
 
 static int _wrap_Event_event_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_event_t *result = 0 ;
   
-  SWIG_check_num_args("event",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *");
+  SWIG_check_num_args("Event::event",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::event",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_event_get",1,SWIGTYPE_p_Event);
   }
   
   result = (switch_event_t *) ((arg1)->event);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_event_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2817,13 +3084,13 @@ fail:
 
 
 static int _wrap_Event_serialized_string_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("serialized_string",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *");
+  SWIG_check_num_args("Event::serialized_string",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialized_string",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::serialized_string",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialized_string_set",1,SWIGTYPE_p_Event);
@@ -2831,7 +3098,7 @@ static int _wrap_Event_serialized_string_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->serialized_string) delete [] arg1->serialized_string;
+    delete [] arg1->serialized_string;
     if (arg2) {
       arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->serialized_string, (const char *)arg2);
@@ -2839,7 +3106,6 @@ static int _wrap_Event_serialized_string_set(lua_State* L) {
       arg1->serialized_string = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -2852,20 +3118,19 @@ fail:
 
 
 static int _wrap_Event_serialized_string_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("serialized_string",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *");
+  SWIG_check_num_args("Event::serialized_string",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialized_string",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialized_string_get",1,SWIGTYPE_p_Event);
   }
   
   result = (char *) ((arg1)->serialized_string);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2877,13 +3142,13 @@ fail:
 
 
 static int _wrap_Event_mine_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   int arg2 ;
   
-  SWIG_check_num_args("mine",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int");
+  SWIG_check_num_args("Event::mine",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::mine",1,"Event *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("Event::mine",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_mine_set",1,SWIGTYPE_p_Event);
@@ -2892,8 +3157,6 @@ static int _wrap_Event_mine_set(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   if (arg1) (arg1)->mine = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -2905,19 +3168,18 @@ fail:
 
 
 static int _wrap_Event_mine_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   int result;
   
-  SWIG_check_num_args("mine",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *");
+  SWIG_check_num_args("Event::mine",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::mine",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_mine_get",1,SWIGTYPE_p_Event);
   }
   
   result = (int) ((arg1)->mine);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -2930,20 +3192,19 @@ fail:
 
 
 static int _wrap_new_Event__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) NULL ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("Event",1,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("Event",1,"char const *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("Event",2,"char const *");
+  SWIG_check_num_args("Event::Event",1,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("Event::Event",1,"char const *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::Event",2,"char const *");
   arg1 = (char *)lua_tostring(L, 1);
   if(lua_gettop(L)>=2){
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (Event *)new Event((char const *)arg1,(char const *)arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -2956,14 +3217,14 @@ fail:
 
 
 static int _wrap_new_Event__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_event_t *arg1 = (switch_event_t *) 0 ;
   int arg2 = (int) 0 ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("Event",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"switch_event_t *");
-  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event",2,"int");
+  SWIG_check_num_args("Event::Event",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::Event",1,"switch_event_t *");
+  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event::Event",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_event_t,0))){
     SWIG_fail_ptr("new_Event",1,SWIGTYPE_p_switch_event_t);
@@ -2973,7 +3234,6 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) {
     arg2 = (int)lua_tonumber(L, 2);
   }
   result = (Event *)new Event(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3017,14 +3277,14 @@ static int _wrap_new_Event(lua_State* L) {
   if ((argc >= 1) && (argc <= 2)) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       if (argc <= 1) {
         return _wrap_new_Event__SWIG_0(L);
       }
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_new_Event__SWIG_0(L);
@@ -3032,47 +3292,25 @@ static int _wrap_new_Event(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Event'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Event'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    Event::Event(char const *,char const *)\n"
+    "    Event::Event(switch_event_t *,int)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Event(lua_State* L) {
-  int SWIG_arg = -1;
-  Event *arg1 = (Event *) 0 ;
-  
-  SWIG_check_num_args("Event",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"Event *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Event",1,SWIGTYPE_p_Event);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Event_chat_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("chat_execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_execute",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("chat_execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("chat_execute",3,"char const *");
+  SWIG_check_num_args("Event::chat_execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::chat_execute",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::chat_execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Event::chat_execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_chat_execute",1,SWIGTYPE_p_Event);
@@ -3083,7 +3321,6 @@ static int _wrap_Event_chat_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3096,14 +3333,14 @@ fail:
 
 
 static int _wrap_Event_chat_send(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("chat_send",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_send",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("chat_send",2,"char const *");
+  SWIG_check_num_args("Event::chat_send",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::chat_send",1,"Event *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::chat_send",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_chat_send",1,SWIGTYPE_p_Event);
@@ -3113,7 +3350,6 @@ static int _wrap_Event_chat_send(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (int)(arg1)->chat_send((char const *)arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3126,14 +3362,14 @@ fail:
 
 
 static int _wrap_Event_serialize(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("serialize",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
+  SWIG_check_num_args("Event::serialize",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::serialize",1,"Event *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::serialize",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_serialize",1,SWIGTYPE_p_Event);
@@ -3143,8 +3379,7 @@ static int _wrap_Event_serialize(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   result = (char *)(arg1)->serialize((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3156,15 +3391,15 @@ fail:
 
 
 static int _wrap_Event_setPriority(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ;
-  bool result;
   switch_priority_t *argp2 ;
+  bool result;
   
-  SWIG_check_num_args("setPriority",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"Event *");
-  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"switch_priority_t");
+  SWIG_check_num_args("Event::setPriority",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::setPriority",1,"Event *");
+  if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("Event::setPriority",2,"switch_priority_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_setPriority",1,SWIGTYPE_p_Event);
@@ -3177,8 +3412,7 @@ static int _wrap_Event_setPriority(lua_State* L) {
     arg2 = *argp2;
   }
   result = (bool)(arg1)->setPriority(arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3190,14 +3424,14 @@ fail:
 
 
 static int _wrap_Event_getHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getHeader",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char const *");
+  SWIG_check_num_args("Event::getHeader",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::getHeader",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getHeader",1,SWIGTYPE_p_Event);
@@ -3205,8 +3439,7 @@ static int _wrap_Event_getHeader(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->getHeader((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3218,20 +3451,19 @@ fail:
 
 
 static int _wrap_Event_getBody(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getBody",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"Event *");
+  SWIG_check_num_args("Event::getBody",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getBody",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getBody",1,SWIGTYPE_p_Event);
   }
   
   result = (char *)(arg1)->getBody();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3243,20 +3475,19 @@ fail:
 
 
 static int _wrap_Event_getType(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getType",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"Event *");
+  SWIG_check_num_args("Event::getType",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::getType",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_getType",1,SWIGTYPE_p_Event);
   }
   
   result = (char *)(arg1)->getType();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3268,14 +3499,14 @@ fail:
 
 
 static int _wrap_Event_addBody(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("addBody",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *");
+  SWIG_check_num_args("Event::addBody",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::addBody",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::addBody",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_addBody",1,SWIGTYPE_p_Event);
@@ -3283,8 +3514,7 @@ static int _wrap_Event_addBody(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->addBody((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3296,16 +3526,16 @@ fail:
 
 
 static int _wrap_Event_addHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("addHeader",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *");
+  SWIG_check_num_args("Event::addHeader",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::addHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::addHeader",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("Event::addHeader",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_addHeader",1,SWIGTYPE_p_Event);
@@ -3314,8 +3544,7 @@ static int _wrap_Event_addHeader(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3327,14 +3556,14 @@ fail:
 
 
 static int _wrap_Event_delHeader(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("delHeader",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"Event *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *");
+  SWIG_check_num_args("Event::delHeader",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::delHeader",1,"Event *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Event::delHeader",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_delHeader",1,SWIGTYPE_p_Event);
@@ -3342,8 +3571,7 @@ static int _wrap_Event_delHeader(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->delHeader((char const *)arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3355,20 +3583,19 @@ fail:
 
 
 static int _wrap_Event_fire(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   Event *arg1 = (Event *) 0 ;
   bool result;
   
-  SWIG_check_num_args("fire",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("fire",1,"Event *");
+  SWIG_check_num_args("Event::fire",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event::fire",1,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
     SWIG_fail_ptr("Event_fire",1,SWIGTYPE_p_Event);
   }
   
   result = (bool)(arg1)->fire();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3403,18 +3630,27 @@ static swig_lua_attribute swig_Event_attributes[] = {
     { "mine", _wrap_Event_mine_get, _wrap_Event_mine_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_Event_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_Event_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_Event_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_Event_bases[] = {0};
 static const char *swig_Event_base_names[] = {0};
-static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases, swig_Event_base_names };
+static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, { "Event", swig_Event_cls_methods, swig_Event_cls_attributes, swig_Event_cls_constants }, swig_Event_bases, swig_Event_base_names };
 
 static int _wrap_EventConsumer_events_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_queue_t *arg2 = (switch_queue_t *) 0 ;
   
-  SWIG_check_num_args("events",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("events",2,"switch_queue_t *");
+  SWIG_check_num_args("EventConsumer::events",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::events",1,"EventConsumer *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("EventConsumer::events",2,"switch_queue_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_events_set",1,SWIGTYPE_p_EventConsumer);
@@ -3427,8 +3663,6 @@ static int _wrap_EventConsumer_events_set(lua_State* L) {
   
   if (arg1) (arg1)->events = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3440,19 +3674,18 @@ fail:
 
 
 static int _wrap_EventConsumer_events_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_queue_t *result = 0 ;
   
-  SWIG_check_num_args("events",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::events",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::events",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_events_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (switch_queue_t *) ((arg1)->events);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_queue_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3465,14 +3698,14 @@ fail:
 
 
 static int _wrap_EventConsumer_e_event_id_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_types_t arg2 ;
   switch_event_types_t *argp2 ;
   
-  SWIG_check_num_args("e_event_id",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("e_event_id",2,"switch_event_types_t");
+  SWIG_check_num_args("EventConsumer::e_event_id",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_event_id",1,"EventConsumer *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("EventConsumer::e_event_id",2,"switch_event_types_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_event_id_set",1,SWIGTYPE_p_EventConsumer);
@@ -3486,8 +3719,6 @@ static int _wrap_EventConsumer_e_event_id_set(lua_State* L) {
   
   if (arg1) (arg1)->e_event_id = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3499,21 +3730,20 @@ fail:
 
 
 static int _wrap_EventConsumer_e_event_id_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_types_t result;
   
-  SWIG_check_num_args("e_event_id",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_event_id",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_event_id",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_event_id_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result =  ((arg1)->e_event_id);
-  SWIG_arg=0;
   {
-    switch_event_types_t * resultptr = new switch_event_types_t((switch_event_types_t &) result);
+    switch_event_types_t * resultptr = new switch_event_types_t((const switch_event_types_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_event_types_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -3527,13 +3757,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_callback",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_callback",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_callback",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_callback",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_callback",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_callback_set",1,SWIGTYPE_p_EventConsumer);
@@ -3541,7 +3771,7 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_callback) delete [] arg1->e_callback;
+    delete [] arg1->e_callback;
     if (arg2) {
       arg1->e_callback = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_callback, (const char *)arg2);
@@ -3549,7 +3779,6 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) {
       arg1->e_callback = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3562,20 +3791,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_callback_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_callback",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_callback",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_callback",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_callback_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_callback);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3587,13 +3815,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_subclass_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_subclass_name",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_subclass_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_subclass_name",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_subclass_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_subclass_name_set",1,SWIGTYPE_p_EventConsumer);
@@ -3601,7 +3829,7 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_subclass_name) delete [] arg1->e_subclass_name;
+    delete [] arg1->e_subclass_name;
     if (arg2) {
       arg1->e_subclass_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_subclass_name, (const char *)arg2);
@@ -3609,7 +3837,6 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) {
       arg1->e_subclass_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3622,20 +3849,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_subclass_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_subclass_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_subclass_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_subclass_name",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_subclass_name_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_subclass_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3647,13 +3873,13 @@ fail:
 
 
 static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("e_cb_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("e_cb_arg",2,"char *");
+  SWIG_check_num_args("EventConsumer::e_cb_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_cb_arg",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::e_cb_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_cb_arg_set",1,SWIGTYPE_p_EventConsumer);
@@ -3661,7 +3887,7 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->e_cb_arg) delete [] arg1->e_cb_arg;
+    delete [] arg1->e_cb_arg;
     if (arg2) {
       arg1->e_cb_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->e_cb_arg, (const char *)arg2);
@@ -3669,7 +3895,6 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) {
       arg1->e_cb_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3682,20 +3907,19 @@ fail:
 
 
 static int _wrap_EventConsumer_e_cb_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("e_cb_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::e_cb_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::e_cb_arg",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_e_cb_arg_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (char *) ((arg1)->e_cb_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3707,13 +3931,13 @@ fail:
 
 
 static int _wrap_EventConsumer_enodes_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_node_t **arg2 ;
   
-  SWIG_check_num_args("enodes",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]");
+  SWIG_check_num_args("EventConsumer::enodes",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::enodes",1,"EventConsumer *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("EventConsumer::enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_enodes_set",1,SWIGTYPE_p_EventConsumer);
@@ -3729,7 +3953,6 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) {
     switch_event_node_t * *b = (switch_event_node_t * *) arg1->enodes;
     for (ii = 0; ii < (size_t)SWITCH_EVENT_ALL+1; ii++) b[ii] = *((switch_event_node_t * *) arg2 + ii);
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3742,19 +3965,18 @@ fail:
 
 
 static int _wrap_EventConsumer_enodes_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   switch_event_node_t **result = 0 ;
   
-  SWIG_check_num_args("enodes",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::enodes",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::enodes",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_enodes_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result = (switch_event_node_t **)(switch_event_node_t **) ((arg1)->enodes);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_switch_event_node_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3767,14 +3989,14 @@ fail:
 
 
 static int _wrap_EventConsumer_node_index_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   uint32_t arg2 ;
   uint32_t *argp2 ;
   
-  SWIG_check_num_args("node_index",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("node_index",2,"uint32_t");
+  SWIG_check_num_args("EventConsumer::node_index",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::node_index",1,"EventConsumer *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("EventConsumer::node_index",2,"uint32_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_node_index_set",1,SWIGTYPE_p_EventConsumer);
@@ -3788,8 +4010,6 @@ static int _wrap_EventConsumer_node_index_set(lua_State* L) {
   
   if (arg1) (arg1)->node_index = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -3801,21 +4021,20 @@ fail:
 
 
 static int _wrap_EventConsumer_node_index_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   uint32_t result;
   
-  SWIG_check_num_args("node_index",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::node_index",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::node_index",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_node_index_get",1,SWIGTYPE_p_EventConsumer);
   }
   
   result =  ((arg1)->node_index);
-  SWIG_arg=0;
   {
-    uint32_t * resultptr = new uint32_t((uint32_t &) result);
+    uint32_t * resultptr = new uint32_t((const uint32_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -3829,16 +4048,16 @@ fail:
 
 
 static int _wrap_new_EventConsumer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) NULL ;
   char *arg2 = (char *) "" ;
   int arg3 = (int) 5000 ;
   EventConsumer *result = 0 ;
   
-  SWIG_check_num_args("EventConsumer",0,3)
-  if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg("EventConsumer",1,"char const *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("EventConsumer",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer",3,"int");
+  SWIG_check_num_args("EventConsumer::EventConsumer",0,3)
+  if(lua_gettop(L)>=1 && !SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("EventConsumer::EventConsumer",1,"char const *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::EventConsumer",2,"char const *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer::EventConsumer",3,"int");
   if(lua_gettop(L)>=1){
     arg1 = (char *)lua_tostring(L, 1);
   }
@@ -3849,7 +4068,6 @@ static int _wrap_new_EventConsumer(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (EventConsumer *)new EventConsumer((char const *)arg1,(char const *)arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_EventConsumer,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3861,42 +4079,17 @@ fail:
 }
 
 
-static int _wrap_delete_EventConsumer(lua_State* L) {
-  int SWIG_arg = -1;
-  EventConsumer *arg1 = (EventConsumer *) 0 ;
-  
-  SWIG_check_num_args("EventConsumer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer",1,"EventConsumer *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_EventConsumer",1,SWIGTYPE_p_EventConsumer);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_EventConsumer_bind(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) "" ;
   int result;
   
-  SWIG_check_num_args("bind",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bind",1,"EventConsumer *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("bind",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("bind",3,"char const *");
+  SWIG_check_num_args("EventConsumer::bind",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::bind",1,"EventConsumer *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("EventConsumer::bind",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("EventConsumer::bind",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_bind",1,SWIGTYPE_p_EventConsumer);
@@ -3907,7 +4100,6 @@ static int _wrap_EventConsumer_bind(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   result = (int)(arg1)->bind((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -3920,16 +4112,16 @@ fail:
 
 
 static int _wrap_EventConsumer_pop(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   int arg2 = (int) 0 ;
   int arg3 = (int) 0 ;
   Event *result = 0 ;
   
-  SWIG_check_num_args("pop",1,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("pop",1,"EventConsumer *");
-  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("pop",2,"int");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("pop",3,"int");
+  SWIG_check_num_args("EventConsumer::pop",1,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::pop",1,"EventConsumer *");
+  if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("EventConsumer::pop",2,"int");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("EventConsumer::pop",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_pop",1,SWIGTYPE_p_EventConsumer);
@@ -3942,7 +4134,6 @@ static int _wrap_EventConsumer_pop(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (Event *)(arg1)->pop(arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -3955,18 +4146,17 @@ fail:
 
 
 static int _wrap_EventConsumer_cleanup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   EventConsumer *arg1 = (EventConsumer *) 0 ;
   
-  SWIG_check_num_args("cleanup",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cleanup",1,"EventConsumer *");
+  SWIG_check_num_args("EventConsumer::cleanup",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer::cleanup",1,"EventConsumer *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){
     SWIG_fail_ptr("EventConsumer_cleanup",1,SWIGTYPE_p_EventConsumer);
   }
   
   (arg1)->cleanup();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -3998,43 +4188,27 @@ static swig_lua_attribute swig_EventConsumer_attributes[] = {
     { "node_index", _wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_EventConsumer_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_EventConsumer_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_EventConsumer_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_EventConsumer_bases[] = {0};
 static const char *swig_EventConsumer_base_names[] = {0};
-static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases, swig_EventConsumer_base_names };
-
-static int _wrap_delete_CoreSession(lua_State* L) {
-  int SWIG_arg = -1;
-  CoreSession *arg1 = (CoreSession *) 0 ;
-  
-  SWIG_check_num_args("CoreSession",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession",1,"CoreSession *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_CoreSession",1,SWIGTYPE_p_CoreSession);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
+static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, { "EventConsumer", swig_EventConsumer_cls_methods, swig_EventConsumer_cls_attributes, swig_EventConsumer_cls_constants }, swig_EventConsumer_bases, swig_EventConsumer_base_names };
 
 static int _wrap_CoreSession_session_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
   
-  SWIG_check_num_args("session",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("session",2,"switch_core_session_t *");
+  SWIG_check_num_args("CoreSession::session",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::session",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::session",2,"switch_core_session_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_session_set",1,SWIGTYPE_p_CoreSession);
@@ -4047,8 +4221,6 @@ static int _wrap_CoreSession_session_set(lua_State* L) {
   
   if (arg1) (arg1)->session = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4060,19 +4232,18 @@ fail:
 
 
 static int _wrap_CoreSession_session_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_core_session_t *result = 0 ;
   
-  SWIG_check_num_args("session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::session",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::session",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_session_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (switch_core_session_t *) ((arg1)->session);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_core_session_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4085,13 +4256,13 @@ fail:
 
 
 static int _wrap_CoreSession_channel_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_t *arg2 = (switch_channel_t *) 0 ;
   
-  SWIG_check_num_args("channel",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("channel",2,"switch_channel_t *");
+  SWIG_check_num_args("CoreSession::channel",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::channel",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::channel",2,"switch_channel_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_channel_set",1,SWIGTYPE_p_CoreSession);
@@ -4104,8 +4275,6 @@ static int _wrap_CoreSession_channel_set(lua_State* L) {
   
   if (arg1) (arg1)->channel = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4117,19 +4286,18 @@ fail:
 
 
 static int _wrap_CoreSession_channel_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_t *result = 0 ;
   
-  SWIG_check_num_args("channel",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::channel",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::channel",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_channel_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (switch_channel_t *) ((arg1)->channel);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_channel_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4142,23 +4310,22 @@ fail:
 
 
 static int _wrap_CoreSession_flags_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   unsigned int arg2 ;
   
-  SWIG_check_num_args("flags",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("flags",2,"unsigned int");
+  SWIG_check_num_args("CoreSession::flags",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flags",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::flags",2,"unsigned int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flags_set",1,SWIGTYPE_p_CoreSession);
   }
   
+  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
   arg2 = (unsigned int)lua_tonumber(L, 2);
   if (arg1) (arg1)->flags = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4170,19 +4337,18 @@ fail:
 
 
 static int _wrap_CoreSession_flags_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   unsigned int result;
   
-  SWIG_check_num_args("flags",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flags",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flags",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flags_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (unsigned int) ((arg1)->flags);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4195,13 +4361,13 @@ fail:
 
 
 static int _wrap_CoreSession_allocated_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   
-  SWIG_check_num_args("allocated",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("allocated",2,"int");
+  SWIG_check_num_args("CoreSession::allocated",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::allocated",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::allocated",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_allocated_set",1,SWIGTYPE_p_CoreSession);
@@ -4210,8 +4376,6 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   if (arg1) (arg1)->allocated = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4223,19 +4387,18 @@ fail:
 
 
 static int _wrap_CoreSession_allocated_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("allocated",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::allocated",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::allocated",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_allocated_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int) ((arg1)->allocated);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4248,13 +4411,13 @@ fail:
 
 
 static int _wrap_CoreSession_cb_state_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   input_callback_state *arg2 = (input_callback_state *) 0 ;
   
-  SWIG_check_num_args("cb_state",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("cb_state",2,"input_callback_state *");
+  SWIG_check_num_args("CoreSession::cb_state",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cb_state",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::cb_state",2,"input_callback_state *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cb_state_set",1,SWIGTYPE_p_CoreSession);
@@ -4267,8 +4430,6 @@ static int _wrap_CoreSession_cb_state_set(lua_State* L) {
   
   if (arg1) (arg1)->cb_state = *arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4280,19 +4441,18 @@ fail:
 
 
 static int _wrap_CoreSession_cb_state_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   input_callback_state *result = 0 ;
   
-  SWIG_check_num_args("cb_state",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::cb_state",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cb_state",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cb_state_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (input_callback_state *)& ((arg1)->cb_state);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4305,14 +4465,14 @@ fail:
 
 
 static int _wrap_CoreSession_hook_state_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_state_t arg2 ;
   switch_channel_state_t *argp2 ;
   
-  SWIG_check_num_args("hook_state",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("hook_state",2,"switch_channel_state_t");
+  SWIG_check_num_args("CoreSession::hook_state",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hook_state",1,"CoreSession *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("CoreSession::hook_state",2,"switch_channel_state_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hook_state_set",1,SWIGTYPE_p_CoreSession);
@@ -4326,8 +4486,6 @@ static int _wrap_CoreSession_hook_state_set(lua_State* L) {
   
   if (arg1) (arg1)->hook_state = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4339,21 +4497,20 @@ fail:
 
 
 static int _wrap_CoreSession_hook_state_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_channel_state_t result;
   
-  SWIG_check_num_args("hook_state",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hook_state",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hook_state",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hook_state_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result =  ((arg1)->hook_state);
-  SWIG_arg=0;
   {
-    switch_channel_state_t * resultptr = new switch_channel_state_t((switch_channel_state_t &) result);
+    switch_channel_state_t * resultptr = new switch_channel_state_t((const switch_channel_state_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_channel_state_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -4367,14 +4524,14 @@ fail:
 
 
 static int _wrap_CoreSession_cause_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_call_cause_t arg2 ;
   switch_call_cause_t *argp2 ;
   
-  SWIG_check_num_args("cause",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *");
-  if(!lua_isuserdata(L,2)) SWIG_fail_arg("cause",2,"switch_call_cause_t");
+  SWIG_check_num_args("CoreSession::cause",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cause",1,"CoreSession *");
+  if(!lua_isuserdata(L,2)) SWIG_fail_arg("CoreSession::cause",2,"switch_call_cause_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cause_set",1,SWIGTYPE_p_CoreSession);
@@ -4388,8 +4545,6 @@ static int _wrap_CoreSession_cause_set(lua_State* L) {
   
   if (arg1) (arg1)->cause = arg2;
   
-  SWIG_arg=0;
-  
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4401,21 +4556,20 @@ fail:
 
 
 static int _wrap_CoreSession_cause_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_call_cause_t result;
   
-  SWIG_check_num_args("cause",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::cause",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::cause",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_cause_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result =  ((arg1)->cause);
-  SWIG_arg=0;
   {
-    switch_call_cause_t * resultptr = new switch_call_cause_t((switch_call_cause_t &) result);
+    switch_call_cause_t * resultptr = new switch_call_cause_t((const switch_call_cause_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_call_cause_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -4429,13 +4583,13 @@ fail:
 
 
 static int _wrap_CoreSession_uuid_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("uuid",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("uuid",2,"char *");
+  SWIG_check_num_args("CoreSession::uuid",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::uuid",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::uuid",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_uuid_set",1,SWIGTYPE_p_CoreSession);
@@ -4443,7 +4597,7 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->uuid) delete [] arg1->uuid;
+    delete [] arg1->uuid;
     if (arg2) {
       arg1->uuid = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->uuid, (const char *)arg2);
@@ -4451,7 +4605,6 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) {
       arg1->uuid = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4464,20 +4617,19 @@ fail:
 
 
 static int _wrap_CoreSession_uuid_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("uuid",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::uuid",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::uuid",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_uuid_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->uuid);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4489,13 +4641,13 @@ fail:
 
 
 static int _wrap_CoreSession_tts_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("tts_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("tts_name",2,"char *");
+  SWIG_check_num_args("CoreSession::tts_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::tts_name",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::tts_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_tts_name_set",1,SWIGTYPE_p_CoreSession);
@@ -4503,7 +4655,7 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->tts_name) delete [] arg1->tts_name;
+    delete [] arg1->tts_name;
     if (arg2) {
       arg1->tts_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->tts_name, (const char *)arg2);
@@ -4511,7 +4663,6 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) {
       arg1->tts_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4524,20 +4675,19 @@ fail:
 
 
 static int _wrap_CoreSession_tts_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("tts_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::tts_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::tts_name",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_tts_name_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->tts_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4549,13 +4699,13 @@ fail:
 
 
 static int _wrap_CoreSession_voice_name_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("voice_name",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("voice_name",2,"char *");
+  SWIG_check_num_args("CoreSession::voice_name",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::voice_name",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::voice_name",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_voice_name_set",1,SWIGTYPE_p_CoreSession);
@@ -4563,7 +4713,7 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->voice_name) delete [] arg1->voice_name;
+    delete [] arg1->voice_name;
     if (arg2) {
       arg1->voice_name = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->voice_name, (const char *)arg2);
@@ -4571,7 +4721,6 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) {
       arg1->voice_name = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4584,20 +4733,19 @@ fail:
 
 
 static int _wrap_CoreSession_voice_name_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("voice_name",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::voice_name",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::voice_name",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_voice_name_get",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *) ((arg1)->voice_name);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4609,18 +4757,18 @@ fail:
 
 
 static int _wrap_CoreSession_insertFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   int result;
   
-  SWIG_check_num_args("insertFile",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("insertFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("insertFile",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("insertFile",3,"char const *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("insertFile",4,"int");
+  SWIG_check_num_args("CoreSession::insertFile",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::insertFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::insertFile",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::insertFile",3,"char const *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::insertFile",4,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_insertFile",1,SWIGTYPE_p_CoreSession);
@@ -4630,7 +4778,6 @@ static int _wrap_CoreSession_insertFile(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (int)(arg1)->insertFile((char const *)arg2,(char const *)arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4643,19 +4790,18 @@ fail:
 
 
 static int _wrap_CoreSession_answer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("answer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answer",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::answer",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::answer",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_answer",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->answer();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4668,19 +4814,18 @@ fail:
 
 
 static int _wrap_CoreSession_preAnswer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("preAnswer",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("preAnswer",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::preAnswer",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::preAnswer",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_preAnswer",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->preAnswer();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -4693,13 +4838,13 @@ fail:
 
 
 static int _wrap_CoreSession_hangup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) "normal_clearing" ;
   
-  SWIG_check_num_args("hangup",1,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup",1,"CoreSession *");
-  if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char const *");
+  SWIG_check_num_args("CoreSession::hangup",1,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangup",1,"CoreSession *");
+  if(lua_gettop(L)>=2 && !SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::hangup",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangup",1,SWIGTYPE_p_CoreSession);
@@ -4709,7 +4854,6 @@ static int _wrap_CoreSession_hangup(lua_State* L) {
     arg2 = (char *)lua_tostring(L, 2);
   }
   (arg1)->hangup((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4722,18 +4866,17 @@ fail:
 
 
 static int _wrap_CoreSession_hangupState(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("hangupState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupState",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hangupState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangupState",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangupState",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->hangupState();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4746,15 +4889,15 @@ fail:
 
 
 static int _wrap_CoreSession_setVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setVariable",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVariable",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setVariable",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setVariable",3,"char *");
+  SWIG_check_num_args("CoreSession::setVariable",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setVariable",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::setVariable",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::setVariable",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setVariable",1,SWIGTYPE_p_CoreSession);
@@ -4763,7 +4906,6 @@ static int _wrap_CoreSession_setVariable(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setVariable(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4776,15 +4918,15 @@ fail:
 
 
 static int _wrap_CoreSession_setPrivate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   void *arg3 = (void *) 0 ;
   
-  SWIG_check_num_args("setPrivate",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPrivate",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setPrivate",2,"char *");
-  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setPrivate",3,"void *");
+  SWIG_check_num_args("CoreSession::setPrivate",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setPrivate",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::setPrivate",2,"char *");
+  if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("CoreSession::setPrivate",3,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setPrivate",1,SWIGTYPE_p_CoreSession);
@@ -4793,7 +4935,6 @@ static int _wrap_CoreSession_setPrivate(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"CoreSession_setPrivate");
   (arg1)->setPrivate(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4806,14 +4947,14 @@ fail:
 
 
 static int _wrap_CoreSession_getPrivate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   void *result = 0 ;
   
-  SWIG_check_num_args("getPrivate",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getPrivate",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getPrivate",2,"char *");
+  SWIG_check_num_args("CoreSession::getPrivate",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getPrivate",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::getPrivate",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getPrivate",1,SWIGTYPE_p_CoreSession);
@@ -4821,7 +4962,6 @@ static int _wrap_CoreSession_getPrivate(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (void *)(arg1)->getPrivate(arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -4834,14 +4974,14 @@ fail:
 
 
 static int _wrap_CoreSession_getVariable(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getVariable",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getVariable",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("getVariable",2,"char *");
+  SWIG_check_num_args("CoreSession::getVariable",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getVariable",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::getVariable",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getVariable",1,SWIGTYPE_p_CoreSession);
@@ -4849,8 +4989,7 @@ static int _wrap_CoreSession_getVariable(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (char *)(arg1)->getVariable(arg2);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4862,14 +5001,14 @@ fail:
 
 
 static int _wrap_CoreSession_process_callback_result(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   switch_status_t result;
   
-  SWIG_check_num_args("process_callback_result",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("process_callback_result",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("process_callback_result",2,"char *");
+  SWIG_check_num_args("CoreSession::process_callback_result",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::process_callback_result",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::process_callback_result",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_process_callback_result",1,SWIGTYPE_p_CoreSession);
@@ -4877,9 +5016,8 @@ static int _wrap_CoreSession_process_callback_result(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (arg1)->process_callback_result(arg2);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -4893,7 +5031,7 @@ fail:
 
 
 static int _wrap_CoreSession_say(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -4901,13 +5039,13 @@ static int _wrap_CoreSession_say(lua_State* L) {
   char *arg5 = (char *) 0 ;
   char *arg6 = (char *) NULL ;
   
-  SWIG_check_num_args("say",5,6)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("say",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("say",2,"char const *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("say",3,"char const *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("say",4,"char const *");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("say",5,"char const *");
-  if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("say",6,"char const *");
+  SWIG_check_num_args("CoreSession::say",5,6)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::say",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::say",2,"char const *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::say",3,"char const *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::say",4,"char const *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("CoreSession::say",5,"char const *");
+  if(lua_gettop(L)>=6 && !SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::say",6,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_say",1,SWIGTYPE_p_CoreSession);
@@ -4921,7 +5059,6 @@ static int _wrap_CoreSession_say(lua_State* L) {
     arg6 = (char *)lua_tostring(L, 6);
   }
   (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4934,17 +5071,17 @@ fail:
 
 
 static int _wrap_CoreSession_sayPhrase(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) "" ;
   char *arg4 = (char *) NULL ;
   
-  SWIG_check_num_args("sayPhrase",2,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("sayPhrase",4,"char const *");
+  SWIG_check_num_args("CoreSession::sayPhrase",2,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sayPhrase",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::sayPhrase",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::sayPhrase",3,"char const *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::sayPhrase",4,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession);
@@ -4958,7 +5095,6 @@ static int _wrap_CoreSession_sayPhrase(lua_State* L) {
     arg4 = (char *)lua_tostring(L, 4);
   }
   (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -4971,20 +5107,19 @@ fail:
 
 
 static int _wrap_CoreSession_hangupCause(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangupCause",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupCause",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::hangupCause",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::hangupCause",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_hangupCause",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->hangupCause();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -4996,20 +5131,19 @@ fail:
 
 
 static int _wrap_CoreSession_getState(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getState",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getState",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::getState",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getState",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getState",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->getState();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5021,7 +5155,7 @@ fail:
 
 
 static int _wrap_CoreSession_recordFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 = (int) 0 ;
@@ -5029,12 +5163,12 @@ static int _wrap_CoreSession_recordFile(lua_State* L) {
   int arg5 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("recordFile",2,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recordFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("recordFile",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("recordFile",3,"int");
-  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("recordFile",4,"int");
-  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("recordFile",5,"int");
+  SWIG_check_num_args("CoreSession::recordFile",2,5)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::recordFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::recordFile",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::recordFile",3,"int");
+  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::recordFile",4,"int");
+  if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::recordFile",5,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_recordFile",1,SWIGTYPE_p_CoreSession);
@@ -5051,7 +5185,6 @@ static int _wrap_CoreSession_recordFile(lua_State* L) {
     arg5 = (int)lua_tonumber(L, 5);
   }
   result = (int)(arg1)->recordFile(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5064,7 +5197,7 @@ fail:
 
 
 static int _wrap_CoreSession_originate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -5072,12 +5205,12 @@ static int _wrap_CoreSession_originate(lua_State* L) {
   switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ;
   int result;
   
-  SWIG_check_num_args("originate",3,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int");
-  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("originate",5,"switch_state_handler_table_t *");
+  SWIG_check_num_args("CoreSession::originate",3,5)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::originate",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::originate",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::originate",3,"char *");
+  if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::originate",4,"int");
+  if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("CoreSession::originate",5,"switch_state_handler_table_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_originate",1,SWIGTYPE_p_CoreSession);
@@ -5098,7 +5231,6 @@ static int _wrap_CoreSession_originate(lua_State* L) {
     }
   }
   result = (int)(arg1)->originate(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5111,18 +5243,17 @@ fail:
 
 
 static int _wrap_CoreSession_destroy(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("destroy",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::destroy",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::destroy",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_destroy",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->destroy();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5135,15 +5266,15 @@ fail:
 
 
 static int _wrap_CoreSession_setDTMFCallback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setDTMFCallback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setDTMFCallback",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setDTMFCallback",2,"void *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setDTMFCallback",3,"char *");
+  SWIG_check_num_args("CoreSession::setDTMFCallback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setDTMFCallback",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setDTMFCallback",2,"void *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::setDTMFCallback",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setDTMFCallback",1,SWIGTYPE_p_CoreSession);
@@ -5152,7 +5283,6 @@ static int _wrap_CoreSession_setDTMFCallback(lua_State* L) {
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setDTMFCallback");
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setDTMFCallback(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5165,14 +5295,14 @@ fail:
 
 
 static int _wrap_CoreSession_speak(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int result;
   
-  SWIG_check_num_args("speak",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("speak",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("speak",2,"char *");
+  SWIG_check_num_args("CoreSession::speak",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::speak",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::speak",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_speak",1,SWIGTYPE_p_CoreSession);
@@ -5180,7 +5310,6 @@ static int _wrap_CoreSession_speak(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (int)(arg1)->speak(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5193,15 +5322,15 @@ fail:
 
 
 static int _wrap_CoreSession_set_tts_parms(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("set_tts_parms",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_parms",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_parms",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_parms",3,"char *");
+  SWIG_check_num_args("CoreSession::set_tts_parms",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::set_tts_parms",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::set_tts_parms",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::set_tts_parms",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_set_tts_parms",1,SWIGTYPE_p_CoreSession);
@@ -5210,7 +5339,6 @@ static int _wrap_CoreSession_set_tts_parms(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->set_tts_parms(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5223,15 +5351,15 @@ fail:
 
 
 static int _wrap_CoreSession_set_tts_params(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("set_tts_params",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_params",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_params",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_params",3,"char *");
+  SWIG_check_num_args("CoreSession::set_tts_params",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::set_tts_params",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::set_tts_params",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::set_tts_params",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_set_tts_params",1,SWIGTYPE_p_CoreSession);
@@ -5240,7 +5368,6 @@ static int _wrap_CoreSession_set_tts_params(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->set_tts_params(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5253,14 +5380,14 @@ fail:
 
 
 static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int result;
   
-  SWIG_check_num_args("collectDigits",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int");
+  SWIG_check_num_args("CoreSession::collectDigits",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::collectDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::collectDigits",2,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession);
@@ -5268,7 +5395,6 @@ static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) {
   
   arg2 = (int)lua_tonumber(L, 2);
   result = (int)(arg1)->collectDigits(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5281,16 +5407,16 @@ fail:
 
 
 static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
   int result;
   
-  SWIG_check_num_args("collectDigits",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("collectDigits",3,"int");
+  SWIG_check_num_args("CoreSession::collectDigits",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::collectDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::collectDigits",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::collectDigits",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession);
@@ -5299,7 +5425,6 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) {
   arg2 = (int)lua_tonumber(L, 2);
   arg3 = (int)lua_tonumber(L, 3);
   result = (int)(arg1)->collectDigits(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5362,24 +5487,27 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'CoreSession_collectDigits'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'CoreSession_collectDigits'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CoreSession::collectDigits(int)\n"
+    "    CoreSession::collectDigits(int,int)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getDigits",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int");
+  SWIG_check_num_args("CoreSession::getDigits",4,4)
+  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 (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
@@ -5389,8 +5517,7 @@ static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5402,7 +5529,7 @@ fail:
 
 
 static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   char *arg3 = (char *) 0 ;
@@ -5410,12 +5537,12 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
   int arg5 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getDigits",5,5)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("getDigits",5,"int");
+  SWIG_check_num_args("CoreSession::getDigits",5,5)
+  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 (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession);
@@ -5426,8 +5553,7 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) {
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (int)lua_tonumber(L, 5);
   result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5461,7 +5587,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
@@ -5490,7 +5616,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
@@ -5509,24 +5635,27 @@ static int _wrap_CoreSession_getDigits(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'CoreSession_getDigits'");
+  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");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_CoreSession_transfer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   char *arg4 = (char *) NULL ;
   int result;
   
-  SWIG_check_num_args("transfer",2,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("transfer",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("transfer",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("transfer",3,"char *");
-  if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("transfer",4,"char *");
+  SWIG_check_num_args("CoreSession::transfer",2,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::transfer",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::transfer",2,"char *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::transfer",3,"char *");
+  if(lua_gettop(L)>=4 && !SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::transfer",4,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_transfer",1,SWIGTYPE_p_CoreSession);
@@ -5540,7 +5669,6 @@ static int _wrap_CoreSession_transfer(lua_State* L) {
     arg4 = (char *)lua_tostring(L, 4);
   }
   result = (int)(arg1)->transfer(arg2,arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5553,7 +5681,7 @@ fail:
 
 
 static int _wrap_CoreSession_read(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
@@ -5563,14 +5691,14 @@ static int _wrap_CoreSession_read(lua_State* L) {
   int arg7 = (int) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("read",6,7)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("read",2,"int");
-  if(!lua_isnumber(L,3)) SWIG_fail_arg("read",3,"int");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("read",4,"char const *");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("read",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("read",6,"char const *");
-  if(lua_gettop(L)>=7 && !lua_isnumber(L,7)) SWIG_fail_arg("read",7,"int");
+  SWIG_check_num_args("CoreSession::read",6,7)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::read",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::read",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::read",3,"int");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::read",4,"char const *");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::read",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::read",6,"char const *");
+  if(lua_gettop(L)>=7 && !lua_isnumber(L,7)) SWIG_fail_arg("CoreSession::read",7,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_read",1,SWIGTYPE_p_CoreSession);
@@ -5585,8 +5713,7 @@ static int _wrap_CoreSession_read(lua_State* L) {
     arg7 = (int)lua_tonumber(L, 7);
   }
   result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6,arg7);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5598,7 +5725,7 @@ fail:
 
 
 static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 ;
@@ -5613,19 +5740,19 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
   char *arg12 = (char *) NULL ;
   char *result = 0 ;
   
-  SWIG_check_num_args("playAndGetDigits",9,12)
-  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");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("playAndGetDigits",4,"int");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("playAndGetDigits",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("playAndGetDigits",6,"char *");
-  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_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char const *");
-  if(lua_gettop(L)>=11 && !lua_isnumber(L,11)) SWIG_fail_arg("playAndGetDigits",11,"int");
-  if(lua_gettop(L)>=12 && !lua_isstring(L,12)) SWIG_fail_arg("playAndGetDigits",12,"char const *");
+  SWIG_check_num_args("CoreSession::playAndGetDigits",9,12)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::playAndGetDigits",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::playAndGetDigits",2,"int");
+  if(!lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::playAndGetDigits",3,"int");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("CoreSession::playAndGetDigits",4,"int");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::playAndGetDigits",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::playAndGetDigits",6,"char *");
+  if(!SWIG_lua_isnilstring(L,7)) SWIG_fail_arg("CoreSession::playAndGetDigits",7,"char *");
+  if(!SWIG_lua_isnilstring(L,8)) SWIG_fail_arg("CoreSession::playAndGetDigits",8,"char *");
+  if(!SWIG_lua_isnilstring(L,9)) SWIG_fail_arg("CoreSession::playAndGetDigits",9,"char *");
+  if(lua_gettop(L)>=10 && !SWIG_lua_isnilstring(L,10)) SWIG_fail_arg("CoreSession::playAndGetDigits",10,"char const *");
+  if(lua_gettop(L)>=11 && !lua_isnumber(L,11)) SWIG_fail_arg("CoreSession::playAndGetDigits",11,"int");
+  if(lua_gettop(L)>=12 && !SWIG_lua_isnilstring(L,12)) SWIG_fail_arg("CoreSession::playAndGetDigits",12,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession);
@@ -5649,8 +5776,7 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) {
     arg12 = (char *)lua_tostring(L, 12);
   }
   result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10,arg11,(char const *)arg12);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5662,16 +5788,16 @@ fail:
 
 
 static int _wrap_CoreSession_streamFile(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   int arg3 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("streamFile",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("streamFile",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("streamFile",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("streamFile",3,"int");
+  SWIG_check_num_args("CoreSession::streamFile",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::streamFile",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::streamFile",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::streamFile",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_streamFile",1,SWIGTYPE_p_CoreSession);
@@ -5682,7 +5808,6 @@ static int _wrap_CoreSession_streamFile(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (int)(arg1)->streamFile(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5695,16 +5820,16 @@ fail:
 
 
 static int _wrap_CoreSession_sleep(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int arg2 ;
   int arg3 = (int) 0 ;
   int result;
   
-  SWIG_check_num_args("sleep",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *");
-  if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int");
-  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int");
+  SWIG_check_num_args("CoreSession::sleep",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sleep",1,"CoreSession *");
+  if(!lua_isnumber(L,2)) SWIG_fail_arg("CoreSession::sleep",2,"int");
+  if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("CoreSession::sleep",3,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession);
@@ -5715,7 +5840,6 @@ static int _wrap_CoreSession_sleep(lua_State* L) {
     arg3 = (int)lua_tonumber(L, 3);
   }
   result = (int)(arg1)->sleep(arg2,arg3);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5728,19 +5852,18 @@ fail:
 
 
 static int _wrap_CoreSession_flushEvents(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("flushEvents",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushEvents",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flushEvents",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flushEvents",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flushEvents",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->flushEvents();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5753,19 +5876,18 @@ fail:
 
 
 static int _wrap_CoreSession_flushDigits(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   int result;
   
-  SWIG_check_num_args("flushDigits",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushDigits",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::flushDigits",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::flushDigits",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_flushDigits",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (int)(arg1)->flushDigits();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5778,14 +5900,14 @@ fail:
 
 
 static int _wrap_CoreSession_setAutoHangup(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool arg2 ;
   int result;
   
-  SWIG_check_num_args("setAutoHangup",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setAutoHangup",1,"CoreSession *");
-  if(!lua_isboolean(L,2)) SWIG_fail_arg("setAutoHangup",2,"bool");
+  SWIG_check_num_args("CoreSession::setAutoHangup",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setAutoHangup",1,"CoreSession *");
+  if(!lua_isboolean(L,2)) SWIG_fail_arg("CoreSession::setAutoHangup",2,"bool");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setAutoHangup",1,SWIGTYPE_p_CoreSession);
@@ -5793,7 +5915,6 @@ static int _wrap_CoreSession_setAutoHangup(lua_State* L) {
   
   arg2 = (lua_toboolean(L, 2)!=0);
   result = (int)(arg1)->setAutoHangup(arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -5806,13 +5927,13 @@ fail:
 
 
 static int _wrap_CoreSession_setHangupHook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setHangupHook",2,"void *");
+  SWIG_check_num_args("CoreSession::setHangupHook",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setHangupHook",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setHangupHook",2,"void *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setHangupHook",1,SWIGTYPE_p_CoreSession);
@@ -5820,7 +5941,6 @@ static int _wrap_CoreSession_setHangupHook(lua_State* L) {
   
   arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setHangupHook");
   (arg1)->setHangupHook(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5833,20 +5953,19 @@ fail:
 
 
 static int _wrap_CoreSession_ready(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("ready",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::ready",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::ready",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_ready",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->ready();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5858,20 +5977,19 @@ fail:
 
 
 static int _wrap_CoreSession_bridged(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("bridged",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bridged",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::bridged",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::bridged",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_bridged",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->bridged();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5883,20 +6001,19 @@ fail:
 
 
 static int _wrap_CoreSession_answered(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("answered",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answered",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::answered",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::answered",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_answered",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->answered();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5908,20 +6025,19 @@ fail:
 
 
 static int _wrap_CoreSession_mediaReady(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("mediaReady",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mediaReady",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::mediaReady",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::mediaReady",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_mediaReady",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->mediaReady();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -5933,13 +6049,13 @@ fail:
 
 
 static int _wrap_CoreSession_waitForAnswer(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("waitForAnswer",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("waitForAnswer",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("waitForAnswer",2,"CoreSession *");
+  SWIG_check_num_args("CoreSession::waitForAnswer",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::waitForAnswer",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::waitForAnswer",2,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_waitForAnswer",1,SWIGTYPE_p_CoreSession);
@@ -5951,7 +6067,6 @@ static int _wrap_CoreSession_waitForAnswer(lua_State* L) {
   }
   
   (arg1)->waitForAnswer(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5964,15 +6079,15 @@ fail:
 
 
 static int _wrap_CoreSession_execute(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) NULL ;
   
-  SWIG_check_num_args("execute",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
-  if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+  SWIG_check_num_args("CoreSession::execute",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::execute",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::execute",2,"char const *");
+  if(lua_gettop(L)>=3 && !SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::execute",3,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_execute",1,SWIGTYPE_p_CoreSession);
@@ -5983,7 +6098,6 @@ static int _wrap_CoreSession_execute(lua_State* L) {
     arg3 = (char *)lua_tostring(L, 3);
   }
   (arg1)->execute((char const *)arg2,(char const *)arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -5996,13 +6110,13 @@ fail:
 
 
 static int _wrap_CoreSession_sendEvent(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   Event *arg2 = (Event *) 0 ;
   
-  SWIG_check_num_args("sendEvent",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"Event *");
+  SWIG_check_num_args("CoreSession::sendEvent",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::sendEvent",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::sendEvent",2,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_sendEvent",1,SWIGTYPE_p_CoreSession);
@@ -6014,7 +6128,6 @@ static int _wrap_CoreSession_sendEvent(lua_State* L) {
   }
   
   (arg1)->sendEvent(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6027,13 +6140,13 @@ fail:
 
 
 static int _wrap_CoreSession_setEventData(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   Event *arg2 = (Event *) 0 ;
   
-  SWIG_check_num_args("setEventData",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventData",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setEventData",2,"Event *");
+  SWIG_check_num_args("CoreSession::setEventData",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::setEventData",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::setEventData",2,"Event *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_setEventData",1,SWIGTYPE_p_CoreSession);
@@ -6045,7 +6158,6 @@ static int _wrap_CoreSession_setEventData(lua_State* L) {
   }
   
   (arg1)->setEventData(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6058,20 +6170,19 @@ fail:
 
 
 static int _wrap_CoreSession_getXMLCDR(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("getXMLCDR",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getXMLCDR",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::getXMLCDR",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::getXMLCDR",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_getXMLCDR",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)(arg1)->getXMLCDR();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6083,20 +6194,19 @@ fail:
 
 
 static int _wrap_CoreSession_begin_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("begin_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::begin_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::begin_allow_threads",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_begin_allow_threads",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->begin_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6108,20 +6218,19 @@ fail:
 
 
 static int _wrap_CoreSession_end_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   bool result;
   
-  SWIG_check_num_args("end_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::end_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::end_allow_threads",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_end_allow_threads",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (bool)(arg1)->end_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6133,20 +6242,19 @@ fail:
 
 
 static int _wrap_CoreSession_get_uuid(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("get_uuid",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_uuid",1,"CoreSession const *");
+  SWIG_check_num_args("CoreSession::get_uuid",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::get_uuid",1,"CoreSession const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_get_uuid",1,SWIGTYPE_p_CoreSession);
   }
   
   result = (char *)((CoreSession const *)arg1)->get_uuid();
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6158,22 +6266,18 @@ fail:
 
 
 static int _wrap_CoreSession_get_cb_args(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   switch_input_args_t *result = 0 ;
   
-  SWIG_check_num_args("get_cb_args",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_cb_args",1,"CoreSession const *");
+  SWIG_check_num_args("CoreSession::get_cb_args",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::get_cb_args",1,"CoreSession const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_get_cb_args",1,SWIGTYPE_p_CoreSession);
   }
   
-  {
-    switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
-    result = (switch_input_args_t *) &_result_ref;
-  }
-  SWIG_arg=0;
+  result = (switch_input_args_t *) &((CoreSession const *)arg1)->get_cb_args();
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_input_args_t,0); SWIG_arg++; 
   return SWIG_arg;
   
@@ -6186,18 +6290,17 @@ fail:
 
 
 static int _wrap_CoreSession_check_hangup_hook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   
-  SWIG_check_num_args("check_hangup_hook",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"CoreSession *");
+  SWIG_check_num_args("CoreSession::check_hangup_hook",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::check_hangup_hook",1,"CoreSession *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_check_hangup_hook",1,SWIGTYPE_p_CoreSession);
   }
   
   (arg1)->check_hangup_hook();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6210,17 +6313,17 @@ fail:
 
 
 static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
-  SWIG_check_num_args("run_dtmf_callback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"CoreSession *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *");
-  if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t");
+  SWIG_check_num_args("CoreSession::run_dtmf_callback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::run_dtmf_callback",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("CoreSession::run_dtmf_callback",2,"void *");
+  if(!lua_isuserdata(L,3)) SWIG_fail_arg("CoreSession::run_dtmf_callback",3,"switch_input_type_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_run_dtmf_callback",1,SWIGTYPE_p_CoreSession);
@@ -6234,9 +6337,8 @@ static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6250,15 +6352,15 @@ fail:
 
 
 static int _wrap_CoreSession_consoleLog(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("consoleLog",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("consoleLog",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog",3,"char *");
+  SWIG_check_num_args("CoreSession::consoleLog",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::consoleLog",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::consoleLog",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::consoleLog",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_consoleLog",1,SWIGTYPE_p_CoreSession);
@@ -6267,7 +6369,6 @@ static int _wrap_CoreSession_consoleLog(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->consoleLog(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6280,7 +6381,7 @@ fail:
 
 
 static int _wrap_CoreSession_consoleLog2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -6288,13 +6389,13 @@ static int _wrap_CoreSession_consoleLog2(lua_State* L) {
   int arg5 ;
   char *arg6 = (char *) 0 ;
   
-  SWIG_check_num_args("consoleLog2",6,6)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("consoleLog2",1,"CoreSession *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("consoleLog2",3,"char *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("consoleLog2",4,"char *");
-  if(!lua_isnumber(L,5)) SWIG_fail_arg("consoleLog2",5,"int");
-  if(!lua_isstring(L,6)) SWIG_fail_arg("consoleLog2",6,"char *");
+  SWIG_check_num_args("CoreSession::consoleLog2",6,6)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::consoleLog2",1,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::consoleLog2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("CoreSession::consoleLog2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("CoreSession::consoleLog2",4,"char *");
+  if(!lua_isnumber(L,5)) SWIG_fail_arg("CoreSession::consoleLog2",5,"int");
+  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("CoreSession::consoleLog2",6,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
     SWIG_fail_ptr("CoreSession_consoleLog2",1,SWIGTYPE_p_CoreSession);
@@ -6306,7 +6407,6 @@ static int _wrap_CoreSession_consoleLog2(lua_State* L) {
   arg5 = (int)lua_tonumber(L, 5);
   arg6 = (char *)lua_tostring(L, 6);
   (arg1)->consoleLog2(arg2,arg3,arg4,arg5,arg6);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6387,22 +6487,30 @@ static swig_lua_attribute swig_CoreSession_attributes[] = {
     { "voice_name", _wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_CoreSession_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_CoreSession_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_CoreSession_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_CoreSession_bases[] = {0};
 static const char *swig_CoreSession_base_names[] = {0};
-static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases, swig_CoreSession_base_names };
+static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, { "CoreSession", swig_CoreSession_cls_methods, swig_CoreSession_cls_attributes, swig_CoreSession_cls_constants }, swig_CoreSession_bases, swig_CoreSession_base_names };
 
 static int _wrap_console_log(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   
   SWIG_check_num_args("console_log",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_log",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("console_log",2,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_log",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("console_log",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   console_log(arg1,arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6415,7 +6523,7 @@ fail:
 
 
 static int _wrap_console_log2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
@@ -6423,18 +6531,17 @@ static int _wrap_console_log2(lua_State* L) {
   char *arg5 = (char *) 0 ;
   
   SWIG_check_num_args("console_log2",5,5)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_log2",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("console_log2",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("console_log2",3,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_log2",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("console_log2",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("console_log2",3,"char *");
   if(!lua_isnumber(L,4)) SWIG_fail_arg("console_log2",4,"int");
-  if(!lua_isstring(L,5)) SWIG_fail_arg("console_log2",5,"char *");
+  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("console_log2",5,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   arg5 = (char *)lua_tostring(L, 5);
   console_log2(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6447,14 +6554,13 @@ fail:
 
 
 static int _wrap_console_clean_log(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   
   SWIG_check_num_args("console_clean_log",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *");
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   console_clean_log(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6467,14 +6573,14 @@ fail:
 
 
 static int _wrap_msleep(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   unsigned int arg1 ;
   
   SWIG_check_num_args("switch_msleep",1,1)
   if(!lua_isnumber(L,1)) SWIG_fail_arg("switch_msleep",1,"unsigned int");
+  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
   arg1 = (unsigned int)lua_tonumber(L, 1);
   switch_msleep(arg1);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6487,7 +6593,7 @@ fail:
 
 
 static int _wrap_bridge(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   CoreSession *arg1 = 0 ;
   CoreSession *arg2 = 0 ;
   
@@ -6505,7 +6611,6 @@ static int _wrap_bridge(lua_State* L) {
   }
   
   bridge(*arg1,*arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6518,7 +6623,7 @@ fail:
 
 
 static int _wrap_hanguphook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   switch_status_t result;
   
@@ -6530,9 +6635,8 @@ static int _wrap_hanguphook(lua_State* L) {
   }
   
   result = hanguphook(arg1);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6546,14 +6650,14 @@ fail:
 
 
 static int _wrap_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
   void *arg4 = (void *) 0 ;
   unsigned int arg5 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
   SWIG_check_num_args("dtmf_callback",5,5)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("dtmf_callback",1,"switch_core_session_t *");
@@ -6574,11 +6678,11 @@ static int _wrap_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"dtmf_callback");
+  SWIG_contract_assert((lua_tonumber(L,5)>=0),"number must not be negative")
   arg5 = (unsigned int)lua_tonumber(L, 5);
   result = dtmf_callback(arg1,arg2,arg3,arg4,arg5);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6592,13 +6696,12 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",0,0)
+  SWIG_check_num_args("LUA::Session::Session",0,0)
   result = (LUA::Session *)new LUA::Session();
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6610,14 +6713,14 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session",2,"CoreSession *");
+  SWIG_check_num_args("LUA::Session::Session",2,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::Session",2,"CoreSession *");
   arg1 = (char *)lua_tostring(L, 1);
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){
@@ -6625,8 +6728,7 @@ static int _wrap_new_Session__SWIG_1(lua_State* L) {
   }
   
   result = (LUA::Session *)new LUA::Session(arg1,arg2);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6638,16 +6740,15 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *");
+  SWIG_check_num_args("LUA::Session::Session",1,1)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (LUA::Session *)new LUA::Session(arg1);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6659,20 +6760,19 @@ fail:
 
 
 static int _wrap_new_Session__SWIG_3(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   LUA::Session *result = 0 ;
   
-  SWIG_check_num_args("LUA::Session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session",1,"switch_core_session_t *");
+  SWIG_check_num_args("LUA::Session::Session",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"switch_core_session_t *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){
     SWIG_fail_ptr("new_Session",1,SWIGTYPE_p_switch_core_session_t);
   }
   
   result = (LUA::Session *)new LUA::Session(arg1);
-  SWIG_arg=0;
-  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
+  SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; 
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6710,7 +6810,7 @@ static int _wrap_new_Session(lua_State* L) {
   if (argc == 1) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       return _wrap_new_Session__SWIG_2(L);
@@ -6719,7 +6819,7 @@ static int _wrap_new_Session(lua_State* L) {
   if (argc == 2) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
@@ -6736,44 +6836,24 @@ static int _wrap_new_Session(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Session'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Session'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::Session()\n"
+    "    LUA::Session::Session(char *,CoreSession *)\n"
+    "    LUA::Session::Session(char *)\n"
+    "    LUA::Session::Session(switch_core_session_t *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Session(lua_State* L) {
-  int SWIG_arg = -1;
-  LUA::Session *arg1 = (LUA::Session *) 0 ;
-  
-  SWIG_check_num_args("LUA::~Session",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Session",1,"LUA::Session *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_LUA__Session);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Session_destroy__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("destroy",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("destroy",2,"char const *");
+  SWIG_check_num_args("LUA::Session::destroy",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::destroy",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::destroy",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session);
@@ -6781,7 +6861,6 @@ static int _wrap_Session_destroy__SWIG_0(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->destroy((char const *)arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6794,18 +6873,17 @@ fail:
 
 
 static int _wrap_Session_destroy__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("destroy",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::destroy",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::destroy",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->destroy();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6850,7 +6928,7 @@ static int _wrap_Session_destroy(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_destroy__SWIG_0(L);
@@ -6858,26 +6936,28 @@ static int _wrap_Session_destroy(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_destroy'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_destroy'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::destroy(char const *)\n"
+    "    LUA::Session::destroy()\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_begin_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("begin_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::begin_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::begin_allow_threads",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->begin_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6889,20 +6969,19 @@ fail:
 
 
 static int _wrap_Session_end_allow_threads(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("end_allow_threads",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::end_allow_threads",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::end_allow_threads",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->end_allow_threads();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -6914,18 +6993,17 @@ fail:
 
 
 static int _wrap_Session_check_hangup_hook(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("check_hangup_hook",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::check_hangup_hook",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::check_hangup_hook",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->check_hangup_hook();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -6938,17 +7016,17 @@ fail:
 
 
 static int _wrap_Session_run_dtmf_callback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   void *arg2 = (void *) 0 ;
   switch_input_type_t arg3 ;
-  switch_status_t result;
   switch_input_type_t *argp3 ;
+  switch_status_t result;
   
-  SWIG_check_num_args("run_dtmf_callback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"LUA::Session *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *");
-  if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t");
+  SWIG_check_num_args("LUA::Session::run_dtmf_callback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",1,"LUA::Session *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",2,"void *");
+  if(!lua_isuserdata(L,3)) SWIG_fail_arg("LUA::Session::run_dtmf_callback",3,"switch_input_type_t");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_LUA__Session);
@@ -6962,9 +7040,8 @@ static int _wrap_Session_run_dtmf_callback(lua_State* L) {
   arg3 = *argp3;
   
   result = (arg1)->run_dtmf_callback(arg2,arg3);
-  SWIG_arg=0;
   {
-    switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+    switch_status_t * resultptr = new switch_status_t((const switch_status_t &) result);
     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
   }
   return SWIG_arg;
@@ -6978,18 +7055,17 @@ fail:
 
 
 static int _wrap_Session_unsetInputCallback(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   
-  SWIG_check_num_args("unsetInputCallback",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("unsetInputCallback",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::unsetInputCallback",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::unsetInputCallback",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_unsetInputCallback",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->unsetInputCallback();
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7002,15 +7078,15 @@ fail:
 
 
 static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setInputCallback",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setInputCallback",3,"char *");
+  SWIG_check_num_args("LUA::Session::setInputCallback",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setInputCallback",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setInputCallback",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::setInputCallback",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session);
@@ -7019,7 +7095,6 @@ static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setInputCallback(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7032,13 +7107,13 @@ fail:
 
 
 static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("setInputCallback",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *");
+  SWIG_check_num_args("LUA::Session::setInputCallback",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setInputCallback",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setInputCallback",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session);
@@ -7046,7 +7121,6 @@ static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->setInputCallback(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7077,7 +7151,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_setInputCallback__SWIG_1(L);
@@ -7096,11 +7170,11 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Session_setInputCallback__SWIG_0(L);
@@ -7109,21 +7183,24 @@ static int _wrap_Session_setInputCallback(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_setInputCallback'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_setInputCallback'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::setInputCallback(char *,char *)\n"
+    "    LUA::Session::setInputCallback(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("setHangupHook",3,"char *");
+  SWIG_check_num_args("LUA::Session::setHangupHook",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setHangupHook",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setHangupHook",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::setHangupHook",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
@@ -7132,7 +7209,6 @@ static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   (arg1)->setHangupHook(arg2,arg3);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7145,13 +7221,13 @@ fail:
 
 
 static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("setHangupHook",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
+  SWIG_check_num_args("LUA::Session::setHangupHook",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setHangupHook",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::setHangupHook",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
@@ -7159,7 +7235,6 @@ static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   (arg1)->setHangupHook(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7190,7 +7265,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Session_setHangupHook__SWIG_1(L);
@@ -7209,11 +7284,11 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Session_setHangupHook__SWIG_0(L);
@@ -7222,26 +7297,28 @@ static int _wrap_Session_setHangupHook(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Session_setHangupHook'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Session_setHangupHook'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Session::setHangupHook(char *,char *)\n"
+    "    LUA::Session::setHangupHook(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Session_ready(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   bool result;
   
-  SWIG_check_num_args("ready",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::ready",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::ready",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (bool)(arg1)->ready();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7253,18 +7330,18 @@ fail:
 
 
 static int _wrap_Session_originate(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
   int result;
   
-  SWIG_check_num_args("originate",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *");
-  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *");
-  if(!lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int");
+  SWIG_check_num_args("LUA::Session::originate",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::originate",1,"LUA::Session *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session::originate",2,"CoreSession *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Session::originate",3,"char *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("LUA::Session::originate",4,"int");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_originate",1,SWIGTYPE_p_LUA__Session);
@@ -7278,7 +7355,6 @@ static int _wrap_Session_originate(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
   result = (int)(arg1)->originate(arg2,arg3,arg4);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -7291,13 +7367,13 @@ fail:
 
 
 static int _wrap_Session_cb_function_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("cb_function",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("cb_function",2,"char *");
+  SWIG_check_num_args("LUA::Session::cb_function",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_function",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::cb_function",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_LUA__Session);
@@ -7305,7 +7381,7 @@ static int _wrap_Session_cb_function_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->cb_function) delete [] arg1->cb_function;
+    delete [] arg1->cb_function;
     if (arg2) {
       arg1->cb_function = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->cb_function, (const char *)arg2);
@@ -7313,7 +7389,6 @@ static int _wrap_Session_cb_function_set(lua_State* L) {
       arg1->cb_function = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7326,20 +7401,19 @@ fail:
 
 
 static int _wrap_Session_cb_function_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("cb_function",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::cb_function",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_function",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->cb_function);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7351,13 +7425,13 @@ fail:
 
 
 static int _wrap_Session_cb_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("cb_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("cb_arg",2,"char *");
+  SWIG_check_num_args("LUA::Session::cb_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_arg",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::cb_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_LUA__Session);
@@ -7365,7 +7439,7 @@ static int _wrap_Session_cb_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->cb_arg) delete [] arg1->cb_arg;
+    delete [] arg1->cb_arg;
     if (arg2) {
       arg1->cb_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->cb_arg, (const char *)arg2);
@@ -7373,7 +7447,6 @@ static int _wrap_Session_cb_arg_set(lua_State* L) {
       arg1->cb_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7386,20 +7459,19 @@ fail:
 
 
 static int _wrap_Session_cb_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("cb_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::cb_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::cb_arg",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->cb_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7411,13 +7483,13 @@ fail:
 
 
 static int _wrap_Session_hangup_func_str_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("hangup_func_str",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_str",2,"char *");
+  SWIG_check_num_args("LUA::Session::hangup_func_str",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_str",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::hangup_func_str",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_LUA__Session);
@@ -7425,7 +7497,7 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->hangup_func_str) delete [] arg1->hangup_func_str;
+    delete [] arg1->hangup_func_str;
     if (arg2) {
       arg1->hangup_func_str = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->hangup_func_str, (const char *)arg2);
@@ -7433,7 +7505,6 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) {
       arg1->hangup_func_str = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7446,20 +7517,19 @@ fail:
 
 
 static int _wrap_Session_hangup_func_str_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangup_func_str",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::hangup_func_str",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_str",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->hangup_func_str);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7471,13 +7541,13 @@ fail:
 
 
 static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *arg2 = (char *) 0 ;
   
-  SWIG_check_num_args("hangup_func_arg",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_arg",2,"char *");
+  SWIG_check_num_args("LUA::Session::hangup_func_arg",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_arg",1,"LUA::Session *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Session::hangup_func_arg",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_LUA__Session);
@@ -7485,7 +7555,7 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   {
-    if (arg1->hangup_func_arg) delete [] arg1->hangup_func_arg;
+    delete [] arg1->hangup_func_arg;
     if (arg2) {
       arg1->hangup_func_arg = (char *) (new char[strlen((const char *)arg2)+1]);
       strcpy((char *)arg1->hangup_func_arg, (const char *)arg2);
@@ -7493,7 +7563,6 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
       arg1->hangup_func_arg = 0;
     }
   }
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7506,20 +7575,19 @@ fail:
 
 
 static int _wrap_Session_hangup_func_arg_get(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   char *result = 0 ;
   
-  SWIG_check_num_args("hangup_func_arg",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::hangup_func_arg",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::hangup_func_arg",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_LUA__Session);
   }
   
   result = (char *) ((arg1)->hangup_func_arg);
-  SWIG_arg=0;
-  lua_pushstring(L,(const char*)result); SWIG_arg++;
+  lua_pushstring(L,(const char *)result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7531,20 +7599,19 @@ fail:
 
 
 static int _wrap_Session_setLUA(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
   lua_State *arg2 = (lua_State *) 0 ;
   
   arg2 = L;
-  SWIG_check_num_args("setLUA",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"LUA::Session *");
+  SWIG_check_num_args("LUA::Session::setLUA",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session::setLUA",1,"LUA::Session *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
     SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_LUA__Session);
   }
   
   (arg1)->setLUA(arg2);
-  SWIG_arg=0;
   
   return SWIG_arg;
   
@@ -7581,26 +7648,34 @@ static swig_lua_attribute swig_LUA_Session_attributes[] = {
     { "hangup_func_arg", _wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set},
     {0,0,0}
 };
+static swig_lua_attribute swig_LUA_Session_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_LUA_Session_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_LUA_Session_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_LUA_Session_bases[] = {0,0};
 static const char *swig_LUA_Session_base_names[] = {"CoreSession *",0};
-static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases, swig_LUA_Session_base_names };
+static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, { "Session", swig_LUA_Session_cls_methods, swig_LUA_Session_cls_attributes, swig_LUA_Session_cls_constants }, swig_LUA_Session_bases, swig_LUA_Session_base_names };
 
 static int _wrap_new_Dbh__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",3,3)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("LUA::Dbh",3,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",3,3)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::Dbh",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::Dbh",3,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2,arg3);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7613,18 +7688,17 @@ fail:
 
 
 static int _wrap_new_Dbh__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   char *arg2 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",2,2)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",2,2)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::Dbh",2,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   arg2 = (char *)lua_tostring(L, 2);
   result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7637,15 +7711,14 @@ fail:
 
 
 static int _wrap_new_Dbh__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   char *arg1 = (char *) 0 ;
   LUA::Dbh *result = 0 ;
   
-  SWIG_check_num_args("LUA::Dbh",1,1)
-  if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *");
+  SWIG_check_num_args("LUA::Dbh::Dbh",1,1)
+  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Dbh::Dbh",1,"char *");
   arg1 = (char *)lua_tostring(L, 1);
   result = (LUA::Dbh *)new LUA::Dbh(arg1);
-  SWIG_arg=0;
   SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; 
   return SWIG_arg;
   
@@ -7667,7 +7740,7 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 1) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       return _wrap_new_Dbh__SWIG_2(L);
@@ -7676,11 +7749,11 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 2) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_new_Dbh__SWIG_1(L);
@@ -7690,15 +7763,15 @@ static int _wrap_new_Dbh(lua_State* L) {
   if (argc == 3) {
     int _v;
     {
-      _v = lua_isstring(L,argv[0]);
+      _v = SWIG_lua_isnilstring(L,argv[0]);
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_new_Dbh__SWIG_0(L);
@@ -7707,51 +7780,29 @@ static int _wrap_new_Dbh(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'new_Dbh'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Dbh'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Dbh::Dbh(char *,char *,char *)\n"
+    "    LUA::Dbh::Dbh(char *,char *)\n"
+    "    LUA::Dbh::Dbh(char *)\n");
   lua_error(L);return 0;
 }
 
 
-static int _wrap_delete_Dbh(lua_State* L) {
-  int SWIG_arg = -1;
-  LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
-  
-  SWIG_check_num_args("LUA::~Dbh",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Dbh",1,"LUA::Dbh *");
-  
-  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,SWIG_POINTER_DISOWN))){
-    SWIG_fail_ptr("delete_Dbh",1,SWIGTYPE_p_LUA__Dbh);
-  }
-  
-  delete arg1;
-  
-  SWIG_arg=0;
-  
-  return SWIG_arg;
-  
-  if(0) SWIG_fail;
-  
-fail:
-  lua_error(L);
-  return SWIG_arg;
-}
-
-
 static int _wrap_Dbh_release(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   bool result;
   
-  SWIG_check_num_args("release",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("release",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::release",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::release",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_release",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (bool)(arg1)->release();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7763,20 +7814,19 @@ fail:
 
 
 static int _wrap_Dbh_connected(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   bool result;
   
-  SWIG_check_num_args("connected",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("connected",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::connected",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::connected",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_connected",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (bool)(arg1)->connected();
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7788,18 +7838,18 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   char *arg4 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",4,4)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
-  if(!lua_isstring(L,4)) SWIG_fail_arg("test_reactive",4,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::test_reactive",3,"char *");
+  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("LUA::Dbh::test_reactive",4,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -7809,8 +7859,7 @@ static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (char *)lua_tostring(L, 4);
   result = (bool)(arg1)->test_reactive(arg2,arg3,arg4);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7822,16 +7871,16 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   char *arg3 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",3,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
-  if(!lua_isstring(L,3)) SWIG_fail_arg("test_reactive",3,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",3,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
+  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("LUA::Dbh::test_reactive",3,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -7840,8 +7889,7 @@ static int _wrap_Dbh_test_reactive__SWIG_1(lua_State* L) {
   arg2 = (char *)lua_tostring(L, 2);
   arg3 = (char *)lua_tostring(L, 3);
   result = (bool)(arg1)->test_reactive(arg2,arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7853,14 +7901,14 @@ fail:
 
 
 static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   bool result;
   
-  SWIG_check_num_args("test_reactive",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("test_reactive",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("test_reactive",2,"char *");
+  SWIG_check_num_args("LUA::Dbh::test_reactive",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::test_reactive",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::test_reactive",2,"char *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_test_reactive",1,SWIGTYPE_p_LUA__Dbh);
@@ -7868,8 +7916,7 @@ static int _wrap_Dbh_test_reactive__SWIG_2(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (bool)(arg1)->test_reactive(arg2);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -7899,7 +7946,7 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         return _wrap_Dbh_test_reactive__SWIG_2(L);
@@ -7918,11 +7965,11 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           return _wrap_Dbh_test_reactive__SWIG_1(L);
@@ -7942,15 +7989,15 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
     if (_v) {
       {
-        _v = lua_isstring(L,argv[1]);
+        _v = SWIG_lua_isnilstring(L,argv[1]);
       }
       if (_v) {
         {
-          _v = lua_isstring(L,argv[2]);
+          _v = SWIG_lua_isnilstring(L,argv[2]);
         }
         if (_v) {
           {
-            _v = lua_isstring(L,argv[3]);
+            _v = SWIG_lua_isnilstring(L,argv[3]);
           }
           if (_v) {
             return _wrap_Dbh_test_reactive__SWIG_0(L);
@@ -7960,13 +8007,17 @@ static int _wrap_Dbh_test_reactive(lua_State* L) {
     }
   }
   
-  lua_pushstring(L,"No matching function for overloaded 'Dbh_test_reactive'");
+  SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Dbh_test_reactive'\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    LUA::Dbh::test_reactive(char *,char *,char *)\n"
+    "    LUA::Dbh::test_reactive(char *,char *)\n"
+    "    LUA::Dbh::test_reactive(char *)\n");
   lua_error(L);return 0;
 }
 
 
 static int _wrap_Dbh_query(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   SWIGLUA_FN arg3 ;
@@ -7978,10 +8029,10 @@ static int _wrap_Dbh_query(lua_State* L) {
     };
     arg3 = default_swiglua_fn;
   }
-  SWIG_check_num_args("query",2,3)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("query",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("query",2,"char *");
-  if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg("query",3,"SWIGLUA_FN");
+  SWIG_check_num_args("LUA::Dbh::query",2,3)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::query",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::query",2,"char *");
+  if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg("LUA::Dbh::query",3,"SWIGLUA_FN");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_query",1,SWIGTYPE_p_LUA__Dbh);
@@ -7995,8 +8046,7 @@ static int _wrap_Dbh_query(lua_State* L) {
     }
   }
   result = (bool)(arg1)->query(arg2,arg3);
-  SWIG_arg=0;
-  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -8008,19 +8058,18 @@ fail:
 
 
 static int _wrap_Dbh_affected_rows(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   int result;
   
-  SWIG_check_num_args("affected_rows",1,1)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("affected_rows",1,"LUA::Dbh *");
+  SWIG_check_num_args("LUA::Dbh::affected_rows",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::affected_rows",1,"LUA::Dbh *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_affected_rows",1,SWIGTYPE_p_LUA__Dbh);
   }
   
   result = (int)(arg1)->affected_rows();
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -8033,14 +8082,14 @@ fail:
 
 
 static int _wrap_Dbh_load_extension(lua_State* L) {
-  int SWIG_arg = -1;
+  int SWIG_arg = 0;
   LUA::Dbh *arg1 = (LUA::Dbh *) 0 ;
   char *arg2 = (char *) 0 ;
   int result;
   
-  SWIG_check_num_args("load_extension",2,2)
-  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("load_extension",1,"LUA::Dbh *");
-  if(!lua_isstring(L,2)) SWIG_fail_arg("load_extension",2,"char const *");
+  SWIG_check_num_args("LUA::Dbh::load_extension",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Dbh::load_extension",1,"LUA::Dbh *");
+  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("LUA::Dbh::load_extension",2,"char const *");
   
   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
     SWIG_fail_ptr("Dbh_load_extension",1,SWIGTYPE_p_LUA__Dbh);
@@ -8048,7 +8097,6 @@ static int _wrap_Dbh_load_extension(lua_State* L) {
   
   arg2 = (char *)lua_tostring(L, 2);
   result = (int)(arg1)->load_extension((char const *)arg2);
-  SWIG_arg=0;
   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
@@ -8076,15 +8124,24 @@ static swig_lua_method swig_LUA_Dbh_methods[] = {
 static swig_lua_attribute swig_LUA_Dbh_attributes[] = {
     {0,0,0}
 };
+static swig_lua_attribute swig_LUA_Dbh_cls_attributes[] = {
+    {0,0,0}
+};
+static swig_lua_method swig_LUA_Dbh_cls_methods[] = {
+    {0,0}
+};
+static swig_lua_const_info swig_LUA_Dbh_cls_constants[] = {
+    {0,0,0,0,0,0}
+};
 static swig_lua_class *swig_LUA_Dbh_bases[] = {0};
 static const char *swig_LUA_Dbh_base_names[] = {0};
-static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names };
+static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, { "Dbh", swig_LUA_Dbh_cls_methods, swig_LUA_Dbh_cls_attributes, swig_LUA_Dbh_cls_constants }, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names };
 
 #ifdef __cplusplus
 }
 #endif
 
-static const struct luaL_reg swig_commands[] = {
+static const struct luaL_Reg swig_commands[] = {
     { "setGlobalVariable", _wrap_setGlobalVariable},
     { "getGlobalVariable", _wrap_getGlobalVariable},
     { "consoleLog", _wrap_consoleLog},
@@ -8107,15 +8164,15 @@ static swig_lua_var_info swig_variables[] = {
 };
 
 static swig_lua_const_info swig_constants[] = {
-{ SWIG_LUA_INT,     (char *)"S_HUP", (long) S_HUP, 0, 0, 0},
-{ SWIG_LUA_INT,     (char *)"S_FREE", (long) S_FREE, 0, 0, 0},
-{ SWIG_LUA_INT,     (char *)"S_RDLOCK", (long) S_RDLOCK, 0, 0, 0},
+    {SWIG_LUA_CONSTTAB_INT("S_HUP", S_HUP)},
+    {SWIG_LUA_CONSTTAB_INT("S_FREE", S_FREE)},
+    {SWIG_LUA_CONSTTAB_INT("S_RDLOCK", S_RDLOCK)},
     {0,0,0,0,0,0}
 };
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
-static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *newmemory) {
+static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((CoreSession *)  ((LUA::Session *) x));
 }
 static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0};
@@ -8128,7 +8185,7 @@ static swig_type_info _swigt__p_LUA__Dbh = {"_p_LUA__Dbh", "LUA::Dbh *", 0, 0, (
 static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session *", 0, 0, (void*)&_wrap_class_LUA_Session, 0};
 static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0};
-static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0};
+static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state, 0};
 static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0};
@@ -8251,18 +8308,18 @@ static swig_cast_info *swig_cast_initial[] = {
 
 /* -----------------------------------------------------------------------------
  * Type initialization:
- * This problem is tough by the requirement that no dynamic 
- * memory is used. Also, since swig_type_info structures store pointers to 
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
  * swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization. 
- * The idea is that swig generates all the structures that are needed. 
- * The runtime then collects these partially filled structures. 
- * The SWIG_InitializeModule function takes these initial arrays out of 
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
  * swig_module, and does all the lookup, filling in the swig_module.types
  * array with the correct data and linking the correct swig_cast_info
  * structures together.
  *
- * The generated swig_type_info structures are assigned staticly to an initial 
+ * The generated swig_type_info structures are assigned staticly to an initial
  * array. We just loop through that array, and handle each type individually.
  * First we lookup if this type has been already loaded, and if so, use the
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -8272,17 +8329,17 @@ static swig_cast_info *swig_cast_initial[] = {
  * a column is one of the swig_cast_info structures for that type.
  * The cast_initial array is actually an array of arrays, because each row has
  * a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it 
+ * we find the array of casts associated with the type, and loop through it
  * adding the casts to the list. The one last trick we need to do is making
  * sure the type pointer in the swig_cast_info struct is correct.
  *
- * First off, we lookup the cast->type name to see if it is already loaded. 
+ * First off, we lookup the cast->type name to see if it is already loaded.
  * There are three cases to handle:
  *  1) If the cast->type has already been loaded AND the type we are adding
  *     casting info to has not been loaded (it is in this module), THEN we
  *     replace the cast->type pointer with the type pointer that has already
  *     been loaded.
- *  2) If BOTH types (the one we are adding casting info to, and the 
+ *  2) If BOTH types (the one we are adding casting info to, and the
  *     cast->type) are loaded, THEN the cast info has already been loaded by
  *     the previous module so we just ignore it.
  *  3) Finally, if cast->type has not already been loaded, then we add that
@@ -8308,8 +8365,6 @@ SWIG_InitializeModule(void *clientdata) {
   swig_module_info *module_head, *iter;
   int found, init;
 
-  clientdata = clientdata;
-
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
     /* Initialize the swig_module */
@@ -8347,7 +8402,7 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
 
-  /* When multiple interpeters are used, a module could have already been initialized in
+  /* When multiple interpreters are used, a module could have already been initialized in
      a different interpreter, but not yet have a pointer in this interpreter.
      In this case, we do not want to continue adding types... everything should be
      set up already */
@@ -8361,7 +8416,7 @@ SWIG_InitializeModule(void *clientdata) {
     swig_type_info *type = 0;
     swig_type_info *ret;
     swig_cast_info *cast;
-  
+
 #ifdef SWIGRUNTIME_DEBUG
     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
 #endif
@@ -8388,7 +8443,7 @@ SWIG_InitializeModule(void *clientdata) {
     /* Insert casting types */
     cast = swig_module.cast_initial[i];
     while (cast->type) {
-    
+
       /* Don't need to add information already in the list */
       ret = 0;
 #ifdef SWIGRUNTIME_DEBUG
@@ -8496,16 +8551,24 @@ extern "C" {
 #endif
 /* this is the initialization function
   added at the very end of the code
-  the function is always called SWIG_init, but an eariler #define will rename it
+  the function is always called SWIG_init, but an earlier #define will rename it
 */
-SWIGEXPORT int SWIG_init(lua_State* L)
+#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
+LUALIB_API int SWIG_init(lua_State* L)
+#else
+SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
+#endif
 {
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
   int i;
   /* start with global table */
-  lua_pushvalue(L,LUA_GLOBALSINDEX);
+  lua_pushglobaltable (L);
   /* SWIG's internal initalisation */
   SWIG_InitializeModule((void*)L);
   SWIG_PropagateClientData();
+#endif
+
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
   /* add a global fn */
   SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
   SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
@@ -8519,7 +8582,10 @@ SWIGEXPORT int SWIG_init(lua_State* L)
   for (i = 0; swig_variables[i].name; i++){
     SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
   }
-  /* set up base class pointers (the hierachy) */
+#endif
+
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
+  /* set up base class pointers (the hierarchy) */
   for (i = 0; swig_types[i]; i++){
     if (swig_types[i]->clientdata){
       SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
@@ -8531,14 +8597,24 @@ SWIGEXPORT int SWIG_init(lua_State* L)
       SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
     }
   }
+#endif
+
+#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
   /* constants */
   SWIG_Lua_InstallConstants(L,swig_constants);
+#endif
+
+#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
   /* invoke user-specific initialization */
   SWIG_init_user(L);
   /* end module */
-  lua_pop(L,1);  /* tidy stack (remove module table)*/
-  lua_pop(L,1);  /* tidy stack (remove global table)*/
+  /* Note: We do not clean up the stack here (Lua will do this for us). At this
+     point, we have the globals table and out module table on the stack. Returning
+     one value makes the module table the result of the require command. */
   return 1;
+#else
+  return 0;
+#endif
 }
 
 #ifdef __cplusplus