]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4405 d0543943-73ff-0310...
authorBrian West <brian@freeswitch.org>
Tue, 27 Feb 2007 19:56:33 +0000 (19:56 +0000)
committerBrian West <brian@freeswitch.org>
Tue, 27 Feb 2007 19:56:33 +0000 (19:56 +0000)
src/mod/languages/mod_ruby/Makefile [deleted file]
src/mod/languages/mod_ruby/README [deleted file]
src/mod/languages/mod_ruby/config.h [deleted file]
src/mod/languages/mod_ruby/mod_ruby.c [deleted file]
src/mod/languages/mod_ruby/switch_swig.i [deleted file]
src/mod/languages/mod_ruby/switch_swig_wrap.c [deleted file]

diff --git a/src/mod/languages/mod_ruby/Makefile b/src/mod/languages/mod_ruby/Makefile
deleted file mode 100644 (file)
index dee3721..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-LCFLAGS=-fPIC -DZTS -DPTHREADS
-CFLAGS += -fPIC -I../../../../libs/ruby-1.8.5/
-RBMOD=freeswitch
-LDFLAGS=-lruby-static -L$(PREFIX)/lib/ 
-SWIGCFILE=../../../switch_swig.c
-SWIGIFILE=../../../switch_swig.i
-
-all:   depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(RBMOD).$(DYNAMIC_LIB_EXTEN)
-
-depends:
-       MAKE=$(MAKE) MOD_CFLAGS=-fPIC $(BASE)/build/buildlib.sh $(BASE) install ruby-1.8.5.tar.gz --prefix=$(PREFIX)
-       cp -f config.h ../../../../libs/ruby-1.8.5/
-
-%.o:  %.c
-       $(CC) $(LCFLAGS) $(CFLAGS) -c $< -o $@
-
-mod_ruby.c:
-       $(CC) $(LCFLAGS) $(CFLAGS) -c mod_ruby.c -o mod_ruby.o
-
-reswig: 
-       rm -f switch_swig_wrap.c config.m4 CREDITS *${RBMOD}*
-       swig -o switch_swig_wrap.c -l$(SWIGIFILE) -ignoremissing -DMULTIPLICITY -ruby -module $(RBMOD) $(SWIGCFILE)
-
-switch_swig_wrap.o: switch_swig_wrap.c Makefile
-       $(CC)  -w $(CFLAGS) -c $< -o $@
-
-switch_swig.o: $(SWIGCFILE) Makefile
-       $(CC)  -w $(CFLAGS) -c $< -o $@
-
-
-$(RBMOD).$(DYNAMIC_LIB_EXTEN): $(MODNAME).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o Makefile
-       $(CC) $(SOLINK) -o rb_$(RBMOD).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o $(LDFLAGS)
-
-
-$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS) Makefile
-       $(CC) $(LCFLAGS) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN)  $(MODNAME).o $(OBJS) $(LDFLAGS)
-
-clean:
-       rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
-
-install:
-       #cp -f rb_$(RBMOD).$(DYNAMIC_LIB_EXTEN) $(MDIR)
-       cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
diff --git a/src/mod/languages/mod_ruby/README b/src/mod/languages/mod_ruby/README
deleted file mode 100644 (file)
index 050a1dc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Well here is what I know.  As of now more or less the license
-maybe compatible.  I am releasing with the clause that if the
-author of Ruby comes back and doesnt offer a license to us I 
-will be pulling it back from the tree.  Im sorry but licensing
-is licensing.  
-
---Brian Fertig
-  mod_ruby - Developer/Maintainer
diff --git a/src/mod/languages/mod_ruby/config.h b/src/mod/languages/mod_ruby/config.h
deleted file mode 100644 (file)
index 47a9cdf..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-//#define PACKAGE_NAME ""
-//#define PACKAGE_TARNAME ""
-//#define PACKAGE_VERSION ""
-//#define PACKAGE_STRING ""
-//#define PACKAGE_BUGREPORT ""
-#define USE_BUILTIN_FRAME_ADDRESS 1
-#define STDC_HEADERS 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_UNISTD_H 1
-#define _FILE_OFFSET_BITS 64
-#define HAVE_LONG_LONG 1
-#define HAVE_OFF_T 1
-#define SIZEOF_INT 4
-#define SIZEOF_SHORT 2
-#define SIZEOF_LONG 4
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF___INT64 0
-#define SIZEOF_OFF_T 8
-#define SIZEOF_VOIDP 4
-#define SIZEOF_FLOAT 4
-#define SIZEOF_DOUBLE 8
-#define SIZEOF_TIME_T 4
-#define rb_pid_t pid_t
-#define rb_gid_t gid_t
-#define rb_uid_t uid_t
-#define HAVE_PROTOTYPES 1
-#define TOKEN_PASTE(x,y) x##y
-#define HAVE_STDARG_PROTOTYPES 1
-#define NORETURN(x) x __attribute__ ((noreturn))
-#define HAVE_DECL_SYS_NERR 1
-#define HAVE_LIBCRYPT 1
-#define HAVE_LIBDL 1
-#define HAVE_DIRENT_H 1
-#define STDC_HEADERS 1
-#define HAVE_SYS_WAIT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRING_H 1
-#define HAVE_UNISTD_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_SYS_FILE_H 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_SYSCALL_H 1
-#define HAVE_FCNTL_H 1
-#define HAVE_SYS_FCNTL_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TIMES_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYSCALL_H 1
-#define HAVE_PWD_H 1
-#define HAVE_GRP_H 1
-#define HAVE_A_OUT_H 1
-#define HAVE_UTIME_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_SYS_RESOURCE_H 1
-#define HAVE_NETINET_IN_SYSTM_H 1
-#define HAVE_FLOAT_H 1
-#define HAVE_PTHREAD_H 1
-#define HAVE_UCONTEXT_H 1
-#define SIZEOF_RLIM_T 8
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-#define HAVE_ST_BLKSIZE 1
-#define HAVE_STRUCT_STAT_ST_BLOCKS 1
-#define HAVE_ST_BLOCKS 1
-#define HAVE_STRUCT_STAT_ST_RDEV 1
-#define HAVE_ST_RDEV 1
-#define GETGROUPS_T gid_t
-#define RETSIGTYPE void
-#define HAVE_ALLOCA_H 1
-#define HAVE_ALLOCA 1
-#define _LARGEFILE_SOURCE 1
-#define HAVE_FSEEKO 1
-#define HAVE_FTELLO 1
-#define HAVE_DUP2 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_STRERROR 1
-#define HAVE_STRFTIME 1
-#define HAVE_STRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOUL 1
-#define HAVE_CRYPT 1
-#define HAVE_FLOCK 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_ISNAN 1
-#define HAVE_FINITE 1
-#define HAVE_ISINF 1
-#define HAVE_HYPOT 1
-#define HAVE_ACOSH 1
-#define HAVE_ERF 1
-#define HAVE_FMOD 1
-#define HAVE_KILLPG 1
-#define HAVE_WAIT4 1
-#define HAVE_WAITPID 1
-#define HAVE_SYSCALL 1
-#define HAVE_CHROOT 1
-#define HAVE_FSYNC 1
-#define HAVE_GETCWD 1
-#define HAVE_TRUNCATE 1
-#define HAVE_TIMES 1
-#define HAVE_UTIMES 1
-#define HAVE_FCNTL 1
-#define HAVE_LOCKF 1
-#define HAVE_LSTAT 1
-#define HAVE_SYMLINK 1
-#define HAVE_LINK 1
-#define HAVE_READLINK 1
-#define HAVE_SETITIMER 1
-#define HAVE_SETEUID 1
-#define HAVE_SETREUID 1
-#define HAVE_SETRESUID 1
-#define HAVE_SETEGID 1
-#define HAVE_SETREGID 1
-#define HAVE_SETRESGID 1
-#define HAVE_PAUSE 1
-#define HAVE_LCHOWN 1
-#define HAVE_GETPGRP 1
-#define HAVE_SETPGRP 1
-#define HAVE_GETPGID 1
-#define HAVE_SETPGID 1
-#define HAVE_INITGROUPS 1
-#define HAVE_GETGROUPS 1
-#define HAVE_SETGROUPS 1
-#define HAVE_GETPRIORITY 1
-#define HAVE_GETRLIMIT 1
-#define HAVE_SETRLIMIT 1
-#define HAVE_SYSCONF 1
-#define HAVE_DLOPEN 1
-#define HAVE_SIGPROCMASK 1
-#define HAVE_SIGACTION 1
-#define HAVE__SETJMP 1
-#define HAVE_SETSID 1
-#define HAVE_TELLDIR 1
-#define HAVE_SEEKDIR 1
-#define HAVE_FCHMOD 1
-#define HAVE_MKTIME 1
-#define HAVE_TIMEGM 1
-#define HAVE_COSH 1
-#define HAVE_SINH 1
-#define HAVE_TANH 1
-#define HAVE_SETUID 1
-#define HAVE_SETGID 1
-#define HAVE_SETENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_STRUCT_TM_TM_ZONE 1
-#define HAVE_TM_ZONE 1
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-#define HAVE_DAYLIGHT 1
-#define NEGATIVE_TIME_T 1
-#define POSIX_SIGNAL 1
-#define GETPGRP_VOID 1
-#define SETPGRP_VOID 1
-#define RSHIFT(x,y) ((x)>>(int)y)
-#define FILE_READPTR _IO_read_ptr
-#define FILE_READEND _IO_read_end
-#define HUGE_ST_INO 1
-#define HAVE__SC_CLK_TCK 1
-#define STACK_GROW_DIRECTION -1
-#define DEFAULT_KCODE KCODE_NONE
-#define USE_ELF 1
-#define DLEXT ".so"
-#define RUBY_LIB "/usr/local/lib/ruby/1.8"
-#define RUBY_SITE_LIB "/usr/local/lib/ruby/site_ruby"
-#define RUBY_SITE_LIB2 "/usr/local/lib/ruby/site_ruby/1.8"
-#define RUBY_PLATFORM "i686-linux"
-#define RUBY_ARCHLIB "/usr/local/lib/ruby/1.8/i686-linux"
-#define RUBY_SITE_ARCHLIB "/usr/local/lib/ruby/site_ruby/1.8/i686-linux"
diff --git a/src/mod/languages/mod_ruby/mod_ruby.c b/src/mod/languages/mod_ruby/mod_ruby.c
deleted file mode 100644 (file)
index 16548d4..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/* 
- * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- * Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
- *
- * Version: MPL 1.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- *
- * The Initial Developer of the Original Code is
- * Anthony Minessale II <anthmct@yahoo.com>
- * Portions created by the Initial Developer are Copyright (C)
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * 
- * Brian Fertig <brian.fertig@convergencetek.com>
- *
- *
- * mod_ruby.c -- ruby Module
- *
- */
-
-#ifndef _REENTRANT
-#define _REENTRANT
-#endif
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <switch.h>
-
-#include <ruby.h>
-
-const char modname[] = "mod_ruby";
-
-static void ruby_function(switch_core_session_t *session, char *data)
-{
-       char *uuid = switch_core_session_get_uuid(session);
-       uint32_t ulen = strlen(uuid);
-       uint32_t len = strlen((char *) data) + ulen + 2;
-       char *mydata = switch_core_session_alloc(session, len);
-       int argc, state;
-       char *argv[5];
-       char ruby_code[1024]; 
-
-       snprintf(mydata, len, "%s %s", uuid, data);
-
-       argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-       
-       sprintf(ruby_code, "$uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
-
-       ruby_init();
-       
-       ruby_init_loadpath();
-
-       ruby_script("embedded");        
-       rb_load_file(data);
-       rb_p(rb_eval_string_protect(argv[1], &state));
-       if (state) {
-               VALUE error = rb_inspect(rb_gv_get("$!"));
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Your code is broken.  \nHere is the error I found: %s\n",error);              
-       }
-       state = ruby_exec();
-       state = ruby_cleanup(state);
-       ruby_finalize();        
-}
-
-static const switch_application_interface_t ruby_application_interface = {
-       /*.interface_name */ "ruby",
-       /*.application_function */ ruby_function,
-       NULL, NULL, NULL,
-       /* flags */ SAF_NONE, /* should we support no media mode here?  If so, we need to detect the mode, and either disable the media functions or indicate media if/when we need */
-       /*.next*/ NULL
-};
-
-static switch_loadable_module_interface_t ruby_module_interface = {
-       /*.module_name */ modname,
-       /*.endpoint_interface */ NULL,
-       /*.timer_interface */ NULL,
-       /*.dialplan_interface */ NULL,
-       /*.codec_interface */ NULL,
-       /*.application_interface */ &ruby_application_interface,
-       /*.api_interface */ NULL,
-       /*.file_interface */ NULL,
-       /*.speech_interface */ NULL,
-       /*.directory_interface */ NULL
-};
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
-{
-       /* connect my internal structure to the blank pointer passed to me */
-       *module_interface = &ruby_module_interface;
-
-       /* indicate that the module should continue to be loaded */
-       return SWITCH_STATUS_SUCCESS;
-}
-
-/* For Emacs:
- * Local Variables:
- * mode:c
- * indent-tabs-mode:nil
- * tab-width:4
- * c-basic-offset:4
- * End:
- * For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
- */
diff --git a/src/mod/languages/mod_ruby/switch_swig.i b/src/mod/languages/mod_ruby/switch_swig.i
deleted file mode 100644 (file)
index 98907a9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-%module fs_elmoscript
-%{
-#include "switch.h"
-%}
-
-%include "/usr/local/freeswitch/include/switch.h"
-
diff --git a/src/mod/languages/mod_ruby/switch_swig_wrap.c b/src/mod/languages/mod_ruby/switch_swig_wrap.c
deleted file mode 100644 (file)
index dcc9a96..0000000
+++ /dev/null
@@ -1,1183 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.21
- * 
- * 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. 
- * ----------------------------------------------------------------------------- */
-
-/* ruby.swg */
-/* Implementation : RUBY */
-#define SWIGRUBY 1
-
-#include "ruby.h"
-
-/* Flags for pointer conversion */
-#define SWIG_POINTER_EXCEPTION     0x1
-#define SWIG_POINTER_DISOWN        0x2
-
-#define NUM2USHRT(n) (\
-    (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
-    ? (unsigned short) NUM2UINT(n) \
-    : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
-               NUM2UINT(n)), (short)0)\
-)
-
-#define NUM2SHRT(n) (\
-    (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
-    ? (short)NUM2INT(n)\
-    : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
-               NUM2INT(n)), (short)0)\
-)
-
-/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
-#ifndef NUM2LL
-#define NUM2LL(x) NUM2LONG((x))
-#endif
-#ifndef LL2NUM
-#define LL2NUM(x) INT2NUM((long) (x))
-#endif
-#ifndef ULL2NUM
-#define ULL2NUM(x) UINT2NUM((unsigned long) (x))
-#endif
-
-/* Ruby 1.7 doesn't (yet) define NUM2ULL() */
-#ifndef NUM2ULL
-#ifdef HAVE_LONG_LONG
-#define NUM2ULL(x) rb_num2ull((x))
-#else
-#define NUM2ULL(x) NUM2ULONG(x)
-#endif
-#endif
-
-/*
- * Need to be very careful about how these macros are defined, especially
- * when compiling C++ code or C code with an ANSI C compiler.
- *
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
- * a Ruby method so that it can be passed as an argument to API functions
- * like rb_define_method() and rb_define_singleton_method().
- *
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
- * can be passed as an argument to API functions like Data_Wrap_Struct()
- * and Data_Make_Struct().
- */
-#ifdef __cplusplus
-#  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
-#    define VALUEFUNC(f) ((VALUE (*)()) f)
-#    define VOIDFUNC(f)  ((void (*)()) f)
-#  else
-#    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
-#      define VALUEFUNC(f) ((VALUE (*)()) f)
-#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
-#    else /* These definitions should work for Ruby 1.7 */
-#      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
-#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
-#    endif
-#  endif
-#else
-#  define VALUEFUNC(f) (f)
-#  define VOIDFUNC(f) (f)
-#endif
-
-typedef struct {
-  VALUE klass;
-  VALUE mImpl;
-  void  (*mark)(void *);
-  void  (*destroy)(void *);
-} swig_class;
-
-/* Don't use for expressions have side effect */
-#ifndef RB_STRING_VALUE
-#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
-#endif
-#ifndef StringValue
-#define StringValue(s) RB_STRING_VALUE(s)
-#endif
-#ifndef StringValuePtr
-#define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
-#endif
-#ifndef StringValueLen
-#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
-#endif
-#ifndef SafeStringValue
-#define SafeStringValue(v) do {\
-    StringValue(v);\
-    rb_check_safe_str(v);\
-} while (0)
-#endif
-
-#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
-#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
-#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
-#endif
-
-/* Contract support */
-
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
-
-
-/*************************************************************** -*- c -*-
- * ruby/precommon.swg
- *
- * Rename all exported symbols from common.swg, to avoid symbol
- * clashes if multiple interpreters are included
- *
- ************************************************************************/
-
-#define SWIG_TypeRegister    SWIG_Ruby_TypeRegister
-#define SWIG_TypeCheck       SWIG_Ruby_TypeCheck
-#define SWIG_TypeCast        SWIG_Ruby_TypeCast
-#define SWIG_TypeDynamicCast SWIG_Ruby_TypeDynamicCast
-#define SWIG_TypeName        SWIG_Ruby_TypeName
-#define SWIG_TypeQuery       SWIG_Ruby_TypeQuery
-#define SWIG_TypeClientData  SWIG_Ruby_TypeClientData
-#define SWIG_PackData        SWIG_Ruby_PackData 
-#define SWIG_UnpackData      SWIG_Ruby_UnpackData 
-
-/* Also rename all exported symbols from rubydef.swig */
-
-/* Common SWIG API */
-#define SWIG_ConvertPtr(obj, pp, type, flags) \
-  SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
-#define SWIG_NewPointerObj(p, type, flags) \
-  SWIG_Ruby_NewPointerObj(p, type, flags)
-#define SWIG_MustGetPtr(p, type, argnum, flags) \
-  SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
-
-/* Ruby-specific SWIG API */
-
-#define SWIG_InitRuntime() \
-  SWIG_Ruby_InitRuntime()
-#define SWIG_define_class(ty) \
-  SWIG_Ruby_define_class(ty)
-#define SWIG_NewClassInstance(value, ty) \
-  SWIG_Ruby_NewClassInstance(value, ty)
-#define SWIG_MangleStr(value) \
-  SWIG_Ruby_MangleStr(value)
-#define SWIG_CheckConvert(value, ty) \
-  SWIG_Ruby_CheckConvert(value, ty)
-#define SWIG_NewPackedObj(ptr, sz, ty) \
-  SWIG_Ruby_NewPackedObj(ptr, sz, ty)
-#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
-  SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
-
-
-/***********************************************************************
- * common.swg
- *
- *     This file contains generic SWIG runtime support for pointer
- *     type checking as well as a few commonly used macros to control
- *     external linkage.
- *
- * Author : David Beazley (beazley@cs.uchicago.edu)
- *
- * Copyright (c) 1999-2000, The University of Chicago
- * 
- * This file may be freely redistributed without license or fee provided
- * this copyright message remains intact.
- ************************************************************************/
-
-#include <string.h>
-
-#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-#  if defined(_MSC_VER) || defined(__GNUC__)
-#    if defined(STATIC_LINKED)
-#      define SWIGEXPORT(a) a
-#      define SWIGIMPORT(a) extern a
-#    else
-#      define SWIGEXPORT(a) __declspec(dllexport) a
-#      define SWIGIMPORT(a) extern a
-#    endif
-#  else
-#    if defined(__BORLANDC__)
-#      define SWIGEXPORT(a) a _export
-#      define SWIGIMPORT(a) a _export
-#    else
-#      define SWIGEXPORT(a) a
-#      define SWIGIMPORT(a) a
-#    endif
-#  endif
-#else
-#  define SWIGEXPORT(a) a
-#  define SWIGIMPORT(a) a
-#endif
-
-#ifdef SWIG_GLOBAL
-#  define SWIGRUNTIME(a) SWIGEXPORT(a)
-#else
-#  define SWIGRUNTIME(a) static a
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *(*swig_converter_func)(void *);
-typedef struct swig_type_info *(*swig_dycast_func)(void **);
-
-typedef struct swig_type_info {
-  const char             *name;
-  swig_converter_func     converter;
-  const char             *str;
-  void                   *clientdata;
-  swig_dycast_func        dcast;
-  struct swig_type_info  *next;
-  struct swig_type_info  *prev;
-} swig_type_info;
-
-#ifdef SWIG_NOINCLUDE
-
-SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
-SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
-SWIGIMPORT(void *)           SWIG_TypeCast(swig_type_info *, void *);
-SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
-SWIGIMPORT(const char *)     SWIG_TypeName(const swig_type_info *);
-SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
-SWIGIMPORT(void)             SWIG_TypeClientData(swig_type_info *, void *);
-SWIGIMPORT(char *)           SWIG_PackData(char *, void *, int);
-SWIGIMPORT(char *)           SWIG_UnpackData(char *, void *, int);
-
-#else
-
-static swig_type_info *swig_type_list = 0;
-
-/* Register a type mapping with the type-checking */
-SWIGRUNTIME(swig_type_info *)
-SWIG_TypeRegister(swig_type_info *ti) {
-  swig_type_info *tc, *head, *ret, *next;
-  /* Check to see if this type has already been registered */
-  tc = swig_type_list;
-  while (tc) {
-    if (strcmp(tc->name, ti->name) == 0) {
-      /* Already exists in the table.  Just add additional types to the list */
-      if (tc->clientdata) ti->clientdata = tc->clientdata;
-      head = tc;
-      next = tc->next;
-      goto l1;
-    }
-    tc = tc->prev;
-  }
-  head = ti;
-  next = 0;
-
-  /* Place in list */
-  ti->prev = swig_type_list;
-  swig_type_list = ti;
-
-  /* Build linked lists */
-  l1:
-  ret = head;
-  tc = ti + 1;
-  /* Patch up the rest of the links */
-  while (tc->name) {
-    head->next = tc;
-    tc->prev = head;
-    head = tc;
-    tc++;
-  }
-  if (next) next->prev = head;
-  head->next = next;
-  return ret;
-}
-
-/* Check the typename */
-SWIGRUNTIME(swig_type_info *) 
-SWIG_TypeCheck(char *c, swig_type_info *ty) {
-  swig_type_info *s;
-  if (!ty) return 0;        /* Void pointer */
-  s = ty->next;             /* First element always just a name */
-  do {
-    if (strcmp(s->name,c) == 0) {
-      if (s == ty->next) return s;
-      /* Move s to the top of the linked list */
-      s->prev->next = s->next;
-      if (s->next) {
-        s->next->prev = s->prev;
-      }
-      /* Insert s as second element in the list */
-      s->next = ty->next;
-      if (ty->next) ty->next->prev = s;
-      ty->next = s;
-      s->prev = ty;
-      return s;
-    }
-    s = s->next;
-  } while (s && (s != ty->next));
-  return 0;
-}
-
-/* Cast a pointer up an inheritance hierarchy */
-SWIGRUNTIME(void *) 
-SWIG_TypeCast(swig_type_info *ty, void *ptr) {
-  if ((!ty) || (!ty->converter)) return ptr;
-  return (*ty->converter)(ptr);
-}
-
-/* Dynamic pointer casting. Down an inheritance hierarchy */
-SWIGRUNTIME(swig_type_info *) 
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
-  swig_type_info *lastty = ty;
-  if (!ty || !ty->dcast) return ty;
-  while (ty && (ty->dcast)) {
-    ty = (*ty->dcast)(ptr);
-    if (ty) lastty = ty;
-  }
-  return lastty;
-}
-
-/* Return the name associated with this type */
-SWIGRUNTIME(const char *)
-SWIG_TypeName(const swig_type_info *ty) {
-  return ty->name;
-}
-
-/* Search for a swig_type_info structure */
-SWIGRUNTIME(swig_type_info *)
-SWIG_TypeQuery(const char *name) {
-  swig_type_info *ty = swig_type_list;
-  while (ty) {
-    if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
-    if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
-    ty = ty->prev;
-  }
-  return 0;
-}
-
-/* Set the clientdata field for a type */
-SWIGRUNTIME(void)
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
-  swig_type_info *tc, *equiv;
-  if (ti->clientdata == clientdata) return;
-  ti->clientdata = clientdata;
-  equiv = ti->next;
-  while (equiv) {
-    if (!equiv->converter) {
-      tc = swig_type_list;
-      while (tc) {
-        if ((strcmp(tc->name, equiv->name) == 0))
-          SWIG_TypeClientData(tc,clientdata);
-        tc = tc->prev;
-      }
-    }
-    equiv = equiv->next;
-  }
-}
-
-/* Pack binary data into a string */
-SWIGRUNTIME(char *)
-SWIG_PackData(char *c, void *ptr, int sz) {
-  static char hex[17] = "0123456789abcdef";
-  int i;
-  unsigned char *u = (unsigned char *) ptr;
-  register unsigned char uu;
-  for (i = 0; i < sz; i++,u++) {
-    uu = *u;
-    *(c++) = hex[(uu & 0xf0) >> 4];
-    *(c++) = hex[uu & 0xf];
-  }
-  return c;
-}
-
-/* Unpack binary data from a string */
-SWIGRUNTIME(char *)
-SWIG_UnpackData(char *c, void *ptr, int sz) {
-  register unsigned char uu = 0;
-  register int d;
-  unsigned char *u = (unsigned char *) ptr;
-  int i;
-  for (i = 0; i < sz; i++, u++) {
-    d = *(c++);
-    if ((d >= '0') && (d <= '9'))
-      uu = ((d - '0') << 4);
-    else if ((d >= 'a') && (d <= 'f'))
-      uu = ((d - ('a'-10)) << 4);
-    d = *(c++);
-    if ((d >= '0') && (d <= '9'))
-      uu |= (d - '0');
-    else if ((d >= 'a') && (d <= 'f'))
-      uu |= (d - ('a'-10));
-    *u = uu;
-  }
-  return c;
-}
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* rubydef.swg */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static VALUE _mSWIG = Qnil;
-static VALUE _cSWIG_Pointer = Qnil;
-
-/* Initialize Ruby runtime support */
-SWIGRUNTIME(void)
-SWIG_Ruby_InitRuntime(void)
-{
-    if (_mSWIG == Qnil) {
-        _mSWIG = rb_define_module("SWIG");
-    }
-}
-
-/* Define Ruby class for C type */
-SWIGRUNTIME(void)
-SWIG_Ruby_define_class(swig_type_info *type)
-{
-    VALUE klass;
-    char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
-    sprintf(klass_name, "TYPE%s", type->name);
-    if (NIL_P(_cSWIG_Pointer)) {
-       _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
-       rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
-    }
-    klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
-    free((void *) klass_name);
-}
-
-/* Create a new pointer object */
-SWIGRUNTIME(VALUE)
-SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
-{
-    char *klass_name;
-    swig_class *sklass;
-    VALUE klass;
-    VALUE obj;
-    
-    if (!ptr)
-       return Qnil;
-    
-    if (type->clientdata) {
-      sklass = (swig_class *) type->clientdata;
-      obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
-    } else {
-      klass_name = (char *) malloc(4 + strlen(type->name) + 1);
-      sprintf(klass_name, "TYPE%s", type->name);
-      klass = rb_const_get(_mSWIG, rb_intern(klass_name));
-      free((void *) klass_name);
-      obj = Data_Wrap_Struct(klass, 0, 0, ptr);
-    }
-    rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
-    return obj;
-}
-
-/* Create a new class instance (always owned) */
-SWIGRUNTIME(VALUE)
-SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
-{
-    VALUE obj;
-    swig_class *sklass = (swig_class *) type->clientdata;
-    obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
-    rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
-    return obj;
-}
-
-/* Get type mangle from class name */
-SWIGRUNTIME(char *)
-SWIG_Ruby_MangleStr(VALUE obj)
-{
-  VALUE stype = rb_iv_get(obj, "__swigtype__");
-  return StringValuePtr(stype);
-}
-
-/* Convert a pointer value */
-SWIGRUNTIME(int)
-SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
-{
-  char *c;
-  swig_type_info *tc;
-
-  /* Grab the pointer */
-  if (NIL_P(obj)) {
-    *ptr = 0;
-    return 0;
-  } else {
-    Data_Get_Struct(obj, void, *ptr);
-  }
-  
-  /* Do type-checking if type info was provided */
-  if (ty) {
-    if (ty->clientdata) {
-        if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
-          if (*ptr == 0)
-            rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
-          return 0;
-        }
-    }
-    if ((c = SWIG_MangleStr(obj)) == NULL) {
-      if (flags & SWIG_POINTER_EXCEPTION)
-        rb_raise(rb_eTypeError, "Expected %s", ty->str);
-      else
-        return -1;
-    }
-    tc = SWIG_TypeCheck(c, ty);
-    if (!tc) {
-      if (flags & SWIG_POINTER_EXCEPTION)
-        rb_raise(rb_eTypeError, "Expected %s", ty->str);
-      else
-        return -1;
-    }
-    *ptr = SWIG_TypeCast(tc, *ptr);
-  }
-  return 0;
-}
-
-/* Convert a pointer value, signal an exception on a type mismatch */
-SWIGRUNTIME(void *)
-SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
-{
-  void *result;
-  SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
-  return result;
-}
-
-/* Check convert */
-SWIGRUNTIME(int)
-SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
-{
-  char *c = SWIG_MangleStr(obj);
-  if (!c)
-    return 0;
-  return SWIG_TypeCheck(c,ty) != 0;
-}
-
-SWIGRUNTIME(VALUE)
-SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
-  char result[1024];
-  char *r = result;
-  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
-  *(r++) = '_';
-  r = SWIG_PackData(r, ptr, sz);
-  strcpy(r, type->name);
-  return rb_str_new2(result);
-}
-
-/* Convert a packed value value */
-SWIGRUNTIME(void)
-SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
-  swig_type_info *tc;
-  char  *c;
-
-  if (TYPE(obj) != T_STRING) goto type_error;
-  c = StringValuePtr(obj);
-  /* Pointer values must start with leading underscore */
-  if (*c != '_') goto type_error;
-  c++;
-  c = SWIG_UnpackData(c, ptr, sz);
-  if (ty) {
-    tc = SWIG_TypeCheck(c, ty);
-    if (!tc) goto type_error;
-  }
-  return;
-
-type_error:
-
-  if (flags) {
-    if (ty) {
-      rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
-    } else {
-      rb_raise(rb_eTypeError, "Expected a pointer");
-    }
-  }
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-/* -------- TYPES TABLE (BEGIN) -------- */
-
-#define  SWIGTYPE_p_switch_channel_t swig_types[0] 
-#define  SWIGTYPE_p_switch_file_handle_t swig_types[1] 
-#define  SWIGTYPE_p_switch_core_session_t swig_types[2] 
-#define  SWIGTYPE_p_p_switch_core_session_t swig_types[3] 
-#define  SWIGTYPE_p_uint32_t swig_types[4] 
-#define  SWIGTYPE_p_switch_input_callback_function_t swig_types[5] 
-static swig_type_info *swig_types[7];
-
-/* -------- TYPES TABLE (END) -------- */
-
-#define SWIG_init    Init_freeswitch
-#define SWIG_name    "Freeswitch"
-
-static VALUE mFreeswitch;
-extern void fs_core_set_globals(void);
-extern int fs_core_init(char *);
-extern int fs_core_destroy(void);
-extern int fs_loadable_module_init(void);
-extern int fs_loadable_module_shutdown(void);
-extern int fs_console_loop(void);
-extern void fs_consol_log(char *,char *);
-extern void fs_consol_clean(char *);
-extern switch_core_session_t *fs_core_session_locate(char *);
-extern void fs_channel_answer(switch_core_session_t *);
-extern void fs_channel_pre_answer(switch_core_session_t *);
-extern void fs_channel_hangup(switch_core_session_t *,char *);
-extern void fs_channel_set_variable(switch_core_session_t *,char *,char *);
-extern void fs_channel_get_variable(switch_core_session_t *,char *);
-extern void fs_channel_set_state(switch_core_session_t *,char *);
-extern int fs_ivr_play_file(switch_core_session_t *,char *);
-extern int fs_switch_ivr_record_file(switch_core_session_t *,switch_file_handle_t *,char *,switch_input_callback_function_t,void *,unsigned int,unsigned int);
-extern int fs_switch_ivr_sleep(switch_core_session_t *,uint32_t);
-extern int fs_ivr_play_file2(switch_core_session_t *,char *);
-extern int fs_switch_ivr_collect_digits_callback(switch_core_session_t *,switch_input_callback_function_t,void *,unsigned int,unsigned int);
-extern int fs_switch_ivr_collect_digits_count(switch_core_session_t *,char *,unsigned int,unsigned int,char const *,char *,unsigned int);
-extern int fs_switch_ivr_originate(switch_core_session_t *,switch_core_session_t **,char *,uint32_t);
-extern int fs_switch_ivr_session_transfer(switch_core_session_t *,char *,char *,char *);
-extern int fs_switch_ivr_speak_text(switch_core_session_t *,char *,char *,uint32_t,char *);
-extern char *fs_switch_channel_get_variable(switch_channel_t *,char *);
-extern int fs_switch_channel_set_variable(switch_channel_t *,char *,char *);
-
-#include "switch.h"
-
-static VALUE
-_wrap_fs_core_set_globals(int argc, VALUE *argv, VALUE self) {
-    if ((argc < 0) || (argc > 0))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
-    fs_core_set_globals();
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_core_init(int argc, VALUE *argv, VALUE self) {
-    char *arg1 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 1) || (argc > 1))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
-    arg1 = StringValuePtr(argv[0]);
-    result = (int)fs_core_init(arg1);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_core_destroy(int argc, VALUE *argv, VALUE self) {
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 0) || (argc > 0))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
-    result = (int)fs_core_destroy();
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_loadable_module_init(int argc, VALUE *argv, VALUE self) {
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 0) || (argc > 0))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
-    result = (int)fs_loadable_module_init();
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_loadable_module_shutdown(int argc, VALUE *argv, VALUE self) {
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 0) || (argc > 0))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
-    result = (int)fs_loadable_module_shutdown();
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_console_loop(int argc, VALUE *argv, VALUE self) {
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 0) || (argc > 0))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
-    result = (int)fs_console_loop();
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_consol_log(int argc, VALUE *argv, VALUE self) {
-    char *arg1 ;
-    char *arg2 ;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    arg1 = StringValuePtr(argv[0]);
-    arg2 = StringValuePtr(argv[1]);
-    fs_consol_log(arg1,arg2);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_consol_clean(int argc, VALUE *argv, VALUE self) {
-    char *arg1 ;
-    
-    if ((argc < 1) || (argc > 1))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
-    arg1 = StringValuePtr(argv[0]);
-    fs_consol_clean(arg1);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_core_session_locate(int argc, VALUE *argv, VALUE self) {
-    char *arg1 ;
-    switch_core_session_t *result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 1) || (argc > 1))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
-    arg1 = StringValuePtr(argv[0]);
-    result = (switch_core_session_t *)fs_core_session_locate(arg1);
-    
-    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_switch_core_session_t,0);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_channel_answer(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    
-    if ((argc < 1) || (argc > 1))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    fs_channel_answer(arg1);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_channel_pre_answer(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    
-    if ((argc < 1) || (argc > 1))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    fs_channel_pre_answer(arg1);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_channel_hangup(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    fs_channel_hangup(arg1,arg2);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_channel_set_variable(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    
-    if ((argc < 3) || (argc > 3))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    arg3 = StringValuePtr(argv[2]);
-    fs_channel_set_variable(arg1,arg2,arg3);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_channel_get_variable(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    fs_channel_get_variable(arg1,arg2);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_channel_set_state(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    fs_channel_set_state(arg1,arg2);
-    
-    return Qnil;
-}
-
-
-static VALUE
-_wrap_fs_ivr_play_file(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    result = (int)fs_ivr_play_file(arg1,arg2);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_record_file(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    switch_file_handle_t *arg2 = (switch_file_handle_t *) 0 ;
-    char *arg3 ;
-    switch_input_callback_function_t arg4 ;
-    void *arg5 = (void *) 0 ;
-    unsigned int arg6 ;
-    unsigned int arg7 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 7) || (argc > 7))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_switch_file_handle_t, 1);
-    arg3 = StringValuePtr(argv[2]);
-    {
-        switch_input_callback_function_t * ptr;
-        SWIG_ConvertPtr(argv[3], (void **) &ptr, SWIGTYPE_p_switch_input_callback_function_t, 1);
-        if (ptr) arg4 = *ptr;
-    }
-    SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, 1);
-    arg6 = NUM2UINT(argv[5]);
-    arg7 = NUM2UINT(argv[6]);
-    result = (int)fs_switch_ivr_record_file(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_sleep(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    uint32_t arg2 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    {
-        uint32_t * ptr;
-        SWIG_ConvertPtr(argv[1], (void **) &ptr, SWIGTYPE_p_uint32_t, 1);
-        if (ptr) arg2 = *ptr;
-    }
-    result = (int)fs_switch_ivr_sleep(arg1,arg2);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_ivr_play_file2(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    result = (int)fs_ivr_play_file2(arg1,arg2);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_collect_digits_callback(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    switch_input_callback_function_t arg2 ;
-    void *arg3 = (void *) 0 ;
-    unsigned int arg4 ;
-    unsigned int arg5 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 5) || (argc > 5))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    {
-        switch_input_callback_function_t * ptr;
-        SWIG_ConvertPtr(argv[1], (void **) &ptr, SWIGTYPE_p_switch_input_callback_function_t, 1);
-        if (ptr) arg2 = *ptr;
-    }
-    SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, 1);
-    arg4 = NUM2UINT(argv[3]);
-    arg5 = NUM2UINT(argv[4]);
-    result = (int)fs_switch_ivr_collect_digits_callback(arg1,arg2,arg3,arg4,arg5);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_collect_digits_count(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    unsigned int arg3 ;
-    unsigned int arg4 ;
-    char *arg5 ;
-    char *arg6 ;
-    unsigned int arg7 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 7) || (argc > 7))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    arg3 = NUM2UINT(argv[2]);
-    arg4 = NUM2UINT(argv[3]);
-    arg5 = StringValuePtr(argv[4]);
-    arg6 = StringValuePtr(argv[5]);
-    arg7 = NUM2UINT(argv[6]);
-    result = (int)fs_switch_ivr_collect_digits_count(arg1,arg2,arg3,arg4,(char const *)arg5,arg6,arg7);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_originate(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    switch_core_session_t **arg2 = (switch_core_session_t **) 0 ;
-    char *arg3 ;
-    uint32_t arg4 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 4) || (argc > 4))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_p_switch_core_session_t, 1);
-    arg3 = StringValuePtr(argv[2]);
-    {
-        uint32_t * ptr;
-        SWIG_ConvertPtr(argv[3], (void **) &ptr, SWIGTYPE_p_uint32_t, 1);
-        if (ptr) arg4 = *ptr;
-    }
-    result = (int)fs_switch_ivr_originate(arg1,arg2,arg3,arg4);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_session_transfer(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    char *arg4 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 4) || (argc > 4))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    arg3 = StringValuePtr(argv[2]);
-    arg4 = StringValuePtr(argv[3]);
-    result = (int)fs_switch_ivr_session_transfer(arg1,arg2,arg3,arg4);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_ivr_speak_text(int argc, VALUE *argv, VALUE self) {
-    switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    uint32_t arg4 ;
-    char *arg5 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 5) || (argc > 5))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_core_session_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    arg3 = StringValuePtr(argv[2]);
-    {
-        uint32_t * ptr;
-        SWIG_ConvertPtr(argv[3], (void **) &ptr, SWIGTYPE_p_uint32_t, 1);
-        if (ptr) arg4 = *ptr;
-    }
-    arg5 = StringValuePtr(argv[4]);
-    result = (int)fs_switch_ivr_speak_text(arg1,arg2,arg3,arg4,arg5);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_channel_get_variable(int argc, VALUE *argv, VALUE self) {
-    switch_channel_t *arg1 = (switch_channel_t *) 0 ;
-    char *arg2 ;
-    char *result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 2) || (argc > 2))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_channel_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    result = (char *)fs_switch_channel_get_variable(arg1,arg2);
-    
-    vresult = rb_str_new2(result);
-    return vresult;
-}
-
-
-static VALUE
-_wrap_fs_switch_channel_set_variable(int argc, VALUE *argv, VALUE self) {
-    switch_channel_t *arg1 = (switch_channel_t *) 0 ;
-    char *arg2 ;
-    char *arg3 ;
-    int result;
-    VALUE vresult = Qnil;
-    
-    if ((argc < 3) || (argc > 3))
-    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
-    SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_switch_channel_t, 1);
-    arg2 = StringValuePtr(argv[1]);
-    arg3 = StringValuePtr(argv[2]);
-    result = (int)fs_switch_channel_set_variable(arg1,arg2,arg3);
-    
-    vresult = INT2NUM(result);
-    return vresult;
-}
-
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-
-static swig_type_info _swigt__p_switch_channel_t[] = {{"_p_switch_channel_t", 0, "switch_channel_t *", 0},{"_p_switch_channel_t"},{0}};
-static swig_type_info _swigt__p_switch_file_handle_t[] = {{"_p_switch_file_handle_t", 0, "switch_file_handle_t *", 0},{"_p_switch_file_handle_t"},{0}};
-static swig_type_info _swigt__p_switch_core_session_t[] = {{"_p_switch_core_session_t", 0, "switch_core_session_t *", 0},{"_p_switch_core_session_t"},{0}};
-static swig_type_info _swigt__p_p_switch_core_session_t[] = {{"_p_p_switch_core_session_t", 0, "switch_core_session_t **", 0},{"_p_p_switch_core_session_t"},{0}};
-static swig_type_info _swigt__p_uint32_t[] = {{"_p_uint32_t", 0, "uint32_t *", 0},{"_p_uint32_t"},{0}};
-static swig_type_info _swigt__p_switch_input_callback_function_t[] = {{"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},{"_p_switch_input_callback_function_t"},{0}};
-
-static swig_type_info *swig_types_initial[] = {
-_swigt__p_switch_channel_t, 
-_swigt__p_switch_file_handle_t, 
-_swigt__p_switch_core_session_t, 
-_swigt__p_p_switch_core_session_t, 
-_swigt__p_uint32_t, 
-_swigt__p_switch_input_callback_function_t, 
-0
-};
-
-
-/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT(void) Init_freeswitch(void) {
-    int i;
-    
-    SWIG_InitRuntime();
-    mFreeswitch = rb_define_module("Freeswitch");
-    
-    for (i = 0; swig_types_initial[i]; i++) {
-        swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
-        SWIG_define_class(swig_types[i]);
-    }
-    
-    rb_define_module_function(mFreeswitch, "fs_core_set_globals", _wrap_fs_core_set_globals, -1);
-    rb_define_module_function(mFreeswitch, "fs_core_init", _wrap_fs_core_init, -1);
-    rb_define_module_function(mFreeswitch, "fs_core_destroy", _wrap_fs_core_destroy, -1);
-    rb_define_module_function(mFreeswitch, "fs_loadable_module_init", _wrap_fs_loadable_module_init, -1);
-    rb_define_module_function(mFreeswitch, "fs_loadable_module_shutdown", _wrap_fs_loadable_module_shutdown, -1);
-    rb_define_module_function(mFreeswitch, "fs_console_loop", _wrap_fs_console_loop, -1);
-    rb_define_module_function(mFreeswitch, "fs_consol_log", _wrap_fs_consol_log, -1);
-    rb_define_module_function(mFreeswitch, "fs_consol_clean", _wrap_fs_consol_clean, -1);
-    rb_define_module_function(mFreeswitch, "fs_core_session_locate", _wrap_fs_core_session_locate, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_answer", _wrap_fs_channel_answer, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_pre_answer", _wrap_fs_channel_pre_answer, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_hangup", _wrap_fs_channel_hangup, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_set_variable", _wrap_fs_channel_set_variable, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_get_variable", _wrap_fs_channel_get_variable, -1);
-    rb_define_module_function(mFreeswitch, "fs_channel_set_state", _wrap_fs_channel_set_state, -1);
-    rb_define_module_function(mFreeswitch, "fs_ivr_play_file", _wrap_fs_ivr_play_file, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_record_file", _wrap_fs_switch_ivr_record_file, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_sleep", _wrap_fs_switch_ivr_sleep, -1);
-    rb_define_module_function(mFreeswitch, "fs_ivr_play_file2", _wrap_fs_ivr_play_file2, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_collect_digits_callback", _wrap_fs_switch_ivr_collect_digits_callback, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_collect_digits_count", _wrap_fs_switch_ivr_collect_digits_count, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_originate", _wrap_fs_switch_ivr_originate, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_session_transfer", _wrap_fs_switch_ivr_session_transfer, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_ivr_speak_text", _wrap_fs_switch_ivr_speak_text, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_channel_get_variable", _wrap_fs_switch_channel_get_variable, -1);
-    rb_define_module_function(mFreeswitch, "fs_switch_channel_set_variable", _wrap_fs_switch_channel_set_variable, -1);
-}
-