[Freeswitch-svn] [commit] r12392 - in freeswitch/trunk: . conf/autoload_configs libs/esl/perl src src/mod/applications/mod_enum src/mod/endpoints/mod_sofia

FreeSWITCH SVN anthm at freeswitch.org
Tue Mar 3 12:16:05 PST 2009


Author: anthm
Date: Tue Mar  3 14:16:05 2009
New Revision: 12392

Log:
FSCORE-297 FSCORE-305 FSCORE-315

Modified:
   freeswitch/trunk/conf/autoload_configs/xml_rpc.conf.xml
   freeswitch/trunk/libs/esl/perl/ESL.pm
   freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
   freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_rtp.c

Changes in other areas also in this revision:
Modified:
   freeswitch/trunk/   (props changed)

Modified: freeswitch/trunk/conf/autoload_configs/xml_rpc.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/xml_rpc.conf.xml	(original)
+++ freeswitch/trunk/conf/autoload_configs/xml_rpc.conf.xml	Tue Mar  3 14:16:05 2009
@@ -3,8 +3,8 @@
     <!-- The port where you want to run the http service (default 8080) -->
     <param name="http-port" value="8080"/>
     <!-- if all 3 of the following params exist all http traffic will require auth -->
-    <param name="auth-realm" value="freeswitch"/>
-    <param name="auth-user" value="freeswitch"/>
-    <param name="auth-pass" value="works"/>
+    <!-- <param name="auth-realm" value="freeswitch"/> -->
+    <!-- <param name="auth-user" value="freeswitch"/> -->
+    <!-- <param name="auth-pass" value="works"/> -->
   </settings>
 </configuration>

Modified: freeswitch/trunk/libs/esl/perl/ESL.pm
==============================================================================
--- freeswitch/trunk/libs/esl/perl/ESL.pm	(original)
+++ freeswitch/trunk/libs/esl/perl/ESL.pm	Tue Mar  3 14:16:05 2009
@@ -1,8 +1,5 @@
-# This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.35
-#
+# This file was created automatically by SWIG 1.3.29.
 # Don't modify this file, modify the SWIG interface instead.
-
 package ESL;
 require Exporter;
 require DynaLoader;

Modified: freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	(original)
+++ freeswitch/trunk/libs/esl/perl/esl_wrap.cpp	Tue Mar  3 14:16:05 2009
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
+ * Version 1.3.29
  * 
  * 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
@@ -12,7 +12,7 @@
 #define SWIG_CASTRANK_MODE
 
 #ifdef __cplusplus
-template<typename T> class SwigValueWrapper {
+template<class T> class SwigValueWrapper {
     T *tt;
 public:
     SwigValueWrapper() : tt(0) { }
@@ -25,10 +25,6 @@
 private:
     SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
 };
-
-template <typename T> T SwigValueInit() {
-  return T();
-}
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -38,14 +34,14 @@
 
 /* template workaround for compilers that cannot correctly implement the C++ standard */
 #ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-#  define SWIGTEMPLATEDISAMBIGUATOR template
+# if defined(__SUNPRO_CC)
+#   if (__SUNPRO_CC <= 0x560)
+#     define SWIGTEMPLATEDISAMBIGUATOR template
+#   else
+#     define SWIGTEMPLATEDISAMBIGUATOR 
+#   endif
 # else
-#  define SWIGTEMPLATEDISAMBIGUATOR
+#   define SWIGTEMPLATEDISAMBIGUATOR 
 # endif
 #endif
 
@@ -124,16 +120,10 @@
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
 # define _CRT_SECURE_NO_DEPRECATE
 #endif
 
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
@@ -143,7 +133,7 @@
 
 /* This should only be incremented when either the layout of swig_type_info changes,
    or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "4"
+#define SWIG_RUNTIME_VERSION "2"
 
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 #ifdef SWIG_TYPE_TABLE
@@ -178,7 +168,6 @@
 
 /* Flags for pointer conversions */
 #define SWIG_POINTER_DISOWN        0x1
-#define SWIG_CAST_NEW_MEMORY       0x2
 
 /* Flags for new pointer objects */
 #define SWIG_POINTER_OWN           0x1
@@ -319,10 +308,10 @@
 extern "C" {
 #endif
 
-typedef void *(*swig_converter_func)(void *, int *);
+typedef void *(*swig_converter_func)(void *);
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
-/* Structure to store information on one type */
+/* Structure to store inforomation on one type */
 typedef struct swig_type_info {
   const char             *name;			/* mangled name of this type */
   const char             *str;			/* human readable name of this type */
@@ -367,7 +356,7 @@
     while ((*f2 == ' ') && (f2 != l2)) ++f2;
     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
   }
-  return (int)((l1 - f1) - (l2 - f2));
+  return (l1 - f1) - (l2 - f2);
 }
 
 /*
@@ -449,8 +438,8 @@
   Cast a pointer up an inheritance hierarchy
 */
 SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
 }
 
 /* 
@@ -803,10 +792,6 @@
 #  endif
 #endif /* !INT2PTR */
 
-#ifndef SvPV_nolen
-# define SvPV_nolen(x) SvPV(x,PL_na)
-#endif
-
 #ifndef get_sv
 #  define get_sv perl_get_sv
 #endif
@@ -955,11 +940,6 @@
 
 /* SWIG Perl macros */
 
-/* Macro to declare an XS function */
-#ifndef XSPROTO
-#   define XSPROTO(name) void name(pTHX_ CV* cv)
-#endif
-
 /* Macro to call an XS function */
 #ifdef PERL_OBJECT 
 #  define SWIG_CALLXS(_name) _name(cv,pPerl) 
@@ -971,50 +951,51 @@
 #  endif 
 #endif 
 
+/* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */
+
 #ifdef PERL_OBJECT
 #define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
 
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *);
 #ifdef __cplusplus
 }
 #endif
 
 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
 #define SWIGCLASS_STATIC
-
-#else /* PERL_OBJECT */
-
+#else
 #define MAGIC_PPERL
 #define SWIGCLASS_STATIC static SWIGUNUSED
-
 #ifndef MULTIPLICITY
 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
 
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+typedef int (*SwigMagicFuncHack)(SV *, MAGIC *);
 #ifdef __cplusplus
 }
 #endif
 
-#else /* MULTIPLICITY */
 
+#else
 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
-
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *);
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* MULTIPLICITY */
-#endif /* PERL_OBJECT */
+#endif
+#endif
 
 /* Workaround for bug in perl 5.6.x croak and earlier */
 #if (PERL_VERSION < 8)
@@ -1038,35 +1019,6 @@
 #endif
 
 
-/* 
-   Define how strict is the cast between strings and integers/doubles
-   when overloading between these types occurs.
-   
-   The default is making it as strict as possible by using SWIG_AddCast
-   when needed.
-   
-   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
-   disable the SWIG_AddCast, making the casting between string and
-   numbers less strict.
-
-   In the end, we try to solve the overloading between strings and
-   numerical types in the more natural way, but if you can avoid it,
-   well, avoid it using %rename, for example.
-*/
-#ifndef SWIG_PERL_NO_STRICT_STR2NUM
-# ifndef SWIG_PERL_STRICT_STR2NUM
-#  define SWIG_PERL_STRICT_STR2NUM
-# endif
-#endif
-#ifdef SWIG_PERL_STRICT_STR2NUM
-/* string takes precedence */
-#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
-#else
-/* number takes precedence */
-#define SWIG_Str2NumCast(x) x
-#endif
-
-
 
 #include <stdlib.h>
 
@@ -1083,7 +1035,7 @@
 
 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)) 
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
 			    || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
 }
 
@@ -1141,11 +1093,7 @@
     if (!tc) {
       return SWIG_ERROR;
     }
-    {
-      int newmemory = 0;
-      *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
-      assert(!newmemory); /* newmemory handling not yet implemented */
-    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
   } else {
     *ptr = voidptr;
   }
@@ -1235,7 +1183,7 @@
   const char  *c = 0;
 
   if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
-  c = SvPV_nolen(obj);
+  c = SvPV(obj, PL_na);
   /* Pointer values must start with leading underscore */
   if (*c != '_') return SWIG_ERROR;
   c++;
@@ -1252,7 +1200,7 @@
 #define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
 
 
-typedef XSPROTO(SwigPerlWrapper);
+typedef XS(SwigPerlWrapper);
 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
 
 /* Structure for command table */
@@ -1305,8 +1253,8 @@
   sv_magic(sv,sv,'U',(char *) name,strlen(name));
   mg = mg_find(sv,'U');
   mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
-  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
-  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_get = (SwigMagicFuncHack) get;
+  mg->mg_virtual->svt_set = (SwigMagicFuncHack) set;
   mg->mg_virtual->svt_len = 0;
   mg->mg_virtual->svt_clear = 0;
   mg->mg_virtual->svt_free = 0;
@@ -1320,7 +1268,7 @@
 
   /* first check if pointer already created */
   if (!type_pointer) {
-    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
     if (pointer && SvOK(pointer)) {
       type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
     }
@@ -1334,7 +1282,7 @@
   SV *pointer;
 
   /* create a new pointer */
-  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
   sv_setiv(pointer, PTR2IV(module));
 }
 
@@ -1429,12 +1377,6 @@
 #ifdef check
   #undef check
 #endif
-#ifdef seekdir
-  #undef seekdir
-#endif
-#ifdef open
-  #undef open
-#endif
 
 
 
@@ -1463,8 +1405,7 @@
 #define SWIG_name   "ESLc::boot_ESL"
 #define SWIG_prefix "ESLc::"
 
-#define SWIGVERSION 0x010335 
-#define SWIG_VERSION SWIGVERSION
+#define SWIGVERSION 0x010329 
 
 
 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
@@ -1493,7 +1434,7 @@
 
 
 SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
+SWIG_pchar_descriptor()
 {
   static int init = 0;
   static swig_type_info* info = 0;
@@ -1547,8 +1488,16 @@
 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
 {
   SV *obj = sv_newmortal();
-  if (carray) {
-    sv_setpvn(obj, carray, size);
+  if (size && carray) {
+    if (carray[size - 1] == 0) {
+      sv_setpv(obj, carray);
+    } else {
+      char *tmp = (new char[size + 1]);
+      memcpy(tmp, carray, size);
+      tmp[size] = 0;
+      sv_setpv(obj, tmp);
+      delete[] tmp;
+    }
   } else {
     sv_setsv(obj, &PL_sv_undef);
   }
@@ -1564,12 +1513,14 @@
 
 
 #include <limits.h>
-#if !defined(SWIG_NO_LLONG_MAX)
-# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
-#   define LLONG_MAX __LONG_LONG_MAX__
-#   define LLONG_MIN (-LLONG_MAX - 1LL)
-#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
-# endif
+#ifndef LLONG_MIN
+# define LLONG_MIN	LONG_LONG_MIN
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX	LONG_LONG_MAX
+#endif
+#ifndef ULLONG_MAX
+# define ULLONG_MAX	ULONG_LONG_MAX
 #endif
 
 
@@ -1583,7 +1534,7 @@
     if (val) *val = (double) SvIV(obj);
     return SWIG_AddCast(SWIG_OK);
   } else {
-    const char *nptr = SvPV_nolen(obj);
+    const char *nptr = SvPV(obj, PL_na);
     if (nptr) {
       char *endptr;
       double v = strtod(nptr, &endptr);
@@ -1593,7 +1544,7 @@
       } else {
 	if (*endptr == '\0') {
 	  if (val) *val = v;
-	  return SWIG_Str2NumCast(SWIG_OK);
+	  return SWIG_AddCast(SWIG_OK);
 	}
       }
     }
@@ -1646,19 +1597,17 @@
     return SWIG_OK;
   } else {
     int dispatch = 0;
-    const char *nptr = SvPV_nolen(obj);
+    const char *nptr = SvPV(obj, PL_na);
     if (nptr) {
       char *endptr;
-      long v;
-      errno = 0;
-      v = strtol(nptr, &endptr,0);
+      long v = strtol(nptr, &endptr,0);
       if (errno == ERANGE) {
 	errno = 0;
 	return SWIG_OverflowError;
       } else {
 	if (*endptr == '\0') {
 	  if (val) *val = v;
-	  return SWIG_Str2NumCast(SWIG_OK);
+	  return SWIG_AddCast(SWIG_OK);
 	}
       }
     }
@@ -1719,10 +1668,6 @@
   return obj;
 }
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifdef PERL_OBJECT
 #define MAGIC_CLASS _wrap_ESL_var::
 class _wrap_ESL_var : public CPerlObj {
@@ -1742,10 +1687,6 @@
 #endif
 
 #ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
 extern "C" {
 #endif
 XS(_wrap_ESLevent_event_set) {
@@ -1838,11 +1779,11 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialized_string_set" "', argument " "2"" of type '" "char *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     if (arg1->serialized_string) delete[] arg1->serialized_string;
     if (arg2) {
-      size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
-      arg1->serialized_string = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
+      size_t size = strlen(arg2) + 1;
+      arg1->serialized_string = reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
     } else {
       arg1->serialized_string = 0;
     }
@@ -1876,7 +1817,7 @@
     }
     arg1 = reinterpret_cast< ESLevent * >(argp1);
     result = (char *) ((arg1)->serialized_string);
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
     
     XSRETURN(argvi);
   fail:
@@ -1973,13 +1914,13 @@
     if (!SWIG_IsOK(res1)) {
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLevent" "', argument " "1"" of type '" "char const *""'");
     }
-    arg1 = reinterpret_cast< char * >(buf1);
+    arg1 = buf1;
     if (items > 1) {
       res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
       if (!SWIG_IsOK(res2)) {
         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLevent" "', argument " "2"" of type '" "char const *""'");
       }
-      arg2 = reinterpret_cast< char * >(buf2);
+      arg2 = buf2;
     }
     result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
@@ -2222,10 +2163,10 @@
       if (!SWIG_IsOK(res2)) {
         SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_serialize" "', argument " "2"" of type '" "char const *""'");
       }
-      arg2 = reinterpret_cast< char * >(buf2);
+      arg2 = buf2;
     }
     result = (char *)(arg1)->serialize((char const *)arg2);
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -2306,9 +2247,9 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (char *)(arg1)->getHeader(arg2);
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
     
     if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
     XSRETURN(argvi);
@@ -2338,7 +2279,7 @@
     }
     arg1 = reinterpret_cast< ESLevent * >(argp1);
     result = (char *)(arg1)->getBody();
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
     
     XSRETURN(argvi);
   fail:
@@ -2366,7 +2307,7 @@
     }
     arg1 = reinterpret_cast< ESLevent * >(argp1);
     result = (char *)(arg1)->getType();
-    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
     
     XSRETURN(argvi);
   fail:
@@ -2401,7 +2342,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_addBody" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (bool)(arg1)->addBody((char const *)arg2);
     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
     
@@ -2444,12 +2385,12 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_addHeader" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
     if (!SWIG_IsOK(res3)) {
       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLevent_addHeader" "', argument " "3"" of type '" "char const *""'");
     }
-    arg3 = reinterpret_cast< char * >(buf3);
+    arg3 = buf3;
     result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
     
@@ -2490,7 +2431,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_delHeader" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (bool)(arg1)->delHeader((char const *)arg2);
     ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
     
@@ -2585,17 +2526,17 @@
     if (!SWIG_IsOK(res1)) {
       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ESLconnection" "', argument " "1"" of type '" "char const *""'");
     }
-    arg1 = reinterpret_cast< char * >(buf1);
+    arg1 = buf1;
     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ESLconnection" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
     if (!SWIG_IsOK(res3)) {
       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ESLconnection" "', argument " "3"" of type '" "char const *""'");
     }
-    arg3 = reinterpret_cast< char * >(buf3);
+    arg3 = buf3;
     result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLconnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -2826,7 +2767,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_send" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (int)(arg1)->send((char const *)arg2);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
     
@@ -2865,7 +2806,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_sendRecv" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (ESLevent *)(arg1)->sendRecv((char const *)arg2);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ESLevent, 0 | SWIG_SHADOW); argvi++ ;
     
@@ -3116,12 +3057,12 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_filter" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
     if (!SWIG_IsOK(res3)) {
       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_filter" "', argument " "3"" of type '" "char const *""'");
     }
-    arg3 = reinterpret_cast< char * >(buf3);
+    arg3 = buf3;
     result = (int)(arg1)->filter((char const *)arg2,(char const *)arg3);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
     
@@ -3166,12 +3107,12 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_events" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
     if (!SWIG_IsOK(res3)) {
       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_events" "', argument " "3"" of type '" "char const *""'");
     }
-    arg3 = reinterpret_cast< char * >(buf3);
+    arg3 = buf3;
     result = (int)(arg1)->events((char const *)arg2,(char const *)arg3);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
     
@@ -3220,20 +3161,20 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_execute" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     if (items > 2) {
       res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
       if (!SWIG_IsOK(res3)) {
         SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ESLconnection_execute" "', argument " "3"" of type '" "char const *""'");
       }
-      arg3 = reinterpret_cast< char * >(buf3);
+      arg3 = buf3;
     }
     if (items > 3) {
       res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
       if (!SWIG_IsOK(res4)) {
         SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ESLconnection_execute" "', argument " "4"" of type '" "char const *""'");
       }
-      arg4 = reinterpret_cast< char * >(buf4);
+      arg4 = buf4;
     }
     result = (int)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
@@ -3277,7 +3218,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_setBlockingExecute" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (int)(arg1)->setBlockingExecute((char const *)arg2);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
     
@@ -3316,7 +3257,7 @@
     if (!SWIG_IsOK(res2)) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLconnection_setEventLock" "', argument " "2"" of type '" "char const *""'");
     }
-    arg2 = reinterpret_cast< char * >(buf2);
+    arg2 = buf2;
     result = (int)(arg1)->setEventLock((char const *)arg2);
     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
     
@@ -3452,7 +3393,7 @@
  * structures together.
  *
  * The generated swig_type_info structures are assigned staticly to an initial 
- * array. We just loop through that array, and handle each type individually.
+ * array. We just loop though 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
  * cast linked list. The cast data is initially stored in something like a
@@ -3490,58 +3431,32 @@
 #define SWIGRUNTIME_DEBUG
 #endif
 
-
 SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
-  swig_module_info *module_head, *iter;
-  int found, init;
+  swig_module_info *module_head;
+  static int init_run = 0;
   
   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 */
-    swig_module.type_initial = swig_type_initial;
-    swig_module.cast_initial = swig_cast_initial;
-    swig_module.next = &swig_module;
-    init = 1;
-  } else {
-    init = 0;
-  }
+  if (init_run) return;
+  init_run = 1;
+  
+  /* Initialize the swig_module */
+  swig_module.type_initial = swig_type_initial;
+  swig_module.cast_initial = swig_cast_initial;
   
   /* Try and load any already created modules */
   module_head = SWIG_GetModule(clientdata);
-  if (!module_head) {
-    /* This is the first module loaded for this interpreter */
-    /* so set the swig module into the interpreter */
-    SWIG_SetModule(clientdata, &swig_module);
-    module_head = &swig_module;
-  } else {
-    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    found=0;
-    iter=module_head;
-    do {
-      if (iter==&swig_module) {
-        found=1;
-        break;
-      }
-      iter=iter->next;
-    } while (iter!= module_head);
-    
-    /* if the is found in the list, then all is done and we may leave */
-    if (found) return;
-    /* otherwise we must add out module into the list */
+  if (module_head) {
     swig_module.next = module_head->next;
     module_head->next = &swig_module;
+  } else {
+    /* This is the first module loaded */
+    swig_module.next = &swig_module;
+    SWIG_SetModule(clientdata, &swig_module);
   }
   
-  /* When multiple interpeters 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 */
-  if (init == 0) return;
-  
   /* Now work on filling in swig_module.types */
 #ifdef SWIGRUNTIME_DEBUG
   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
@@ -3695,7 +3610,7 @@
   /* 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((char*) swig_variables[i].name, TRUE | 0x2);
     if (swig_variables[i].type) {
       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
     } else {
@@ -3707,7 +3622,7 @@
   /* 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((char*)swig_constants[i].name, TRUE | 0x2);
     switch(swig_constants[i].type) {
     case SWIG_INT:
       sv_setiv(sv, (IV) swig_constants[i].lvalue);

Modified: freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	Tue Mar  3 14:16:05 2009
@@ -93,9 +93,9 @@
 	route = switch_core_alloc(globals.pool, sizeof(*route));
 
 
-	route->service = strdup(service);
-	route->regex = strdup(regex);
-	route->replace = strdup(replace);
+	route->service = switch_core_strdup(globals.pool, service);
+	route->regex = switch_core_strdup(globals.pool, regex);
+	route->replace = switch_core_strdup(globals.pool, replace);
 
 	switch_mutex_lock(MUTEX);
 	if (!globals.route_order) {

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Tue Mar  3 14:16:05 2009
@@ -2964,12 +2964,12 @@
 	
 	while (mod_sofia_globals.threads) {
 		switch_cond_next();
-		if (++sanity >= 10000) {
+		if (++sanity >= 60000) {
 			break;
 		}
 	}
 
-	switch_yield(1000000);
+	//switch_yield(1000000);
 	su_deinit();
 
 	switch_mutex_lock(mod_sofia_globals.hash_mutex);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Mar  3 14:16:05 2009
@@ -662,7 +662,7 @@
 	return NULL;
 }
 
-void launch_sofia_worker_thread(sofia_profile_t *profile)
+switch_thread_t *launch_sofia_worker_thread(sofia_profile_t *profile)
 {
 	switch_thread_t *thread;
 	switch_threadattr_t *thd_attr = NULL;
@@ -680,6 +680,8 @@
 			break;
 		}
 	}
+
+	return thread;
 }
 
 void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj)
@@ -693,6 +695,8 @@
 	int use_timer = !sofia_test_pflag(profile, PFLAG_DISABLE_TIMER);
 	const char *supported = NULL;
 	int sanity;
+	switch_thread_t *worker_thread;
+	switch_status_t st;
 
 	switch_mutex_lock(mod_sofia_globals.mutex);
 	mod_sofia_globals.threads++;
@@ -823,7 +827,7 @@
 	profile->started = switch_epoch_time_now(NULL);
 
 	sofia_set_pflag_locked(profile, PFLAG_RUNNING);
-	launch_sofia_worker_thread(profile);
+	worker_thread = launch_sofia_worker_thread(profile);
 
 	switch_yield(1000000);
 
@@ -850,15 +854,11 @@
 	sofia_reg_unregister(profile);
 	nua_shutdown(profile->nua);
 	su_root_run(profile->s_root);
-	nua_shutdown(profile->nua);
-	su_root_run(profile->s_root);
-
+	
 	sofia_clear_pflag_locked(profile, PFLAG_RUNNING);
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n");
 
-	while (sofia_test_pflag(profile, PFLAG_WORKER_RUNNING)) {
-		switch_yield(100000);
-	}
+	switch_thread_join(&st, worker_thread);
 	
 	sanity = 4;
 	while (profile->inuse) {
@@ -3243,10 +3243,7 @@
 	case nua_callstate_terminating:
 		if (status == 488 || switch_channel_get_state(channel) == CS_HIBERNATE) {
 			tech_pvt->q850_cause = SWITCH_CAUSE_MANDATORY_IE_MISSING;
-		} else if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
-			sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
 		}
-		break;
 	case nua_callstate_terminated:
 		if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 			sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
@@ -3274,17 +3271,17 @@
 				switch_channel_hangup(channel, cause);
 			}
 		}
-
-		if (tech_pvt->sofia_private) {
-			tech_pvt->sofia_private = NULL;
-		}
-
-		tech_pvt->nh = NULL;
-		
-
-		if (nh) {
-			nua_handle_bind(nh, NULL);
-			nua_handle_destroy(nh);
+		if (ss_state == nua_callstate_terminated) {
+			if (tech_pvt->sofia_private) {
+				tech_pvt->sofia_private = NULL;
+			}
+			
+			tech_pvt->nh = NULL;
+			
+			if (nh) {
+				nua_handle_bind(nh, NULL);
+				nua_handle_destroy(nh);
+			}
 		}
 		break;
 	}

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Tue Mar  3 14:16:05 2009
@@ -249,6 +249,20 @@
 	return val;
 }
 
+static void switch_core_unset_variables(void)
+{
+	switch_hash_index_t *hi;
+    const void *var;
+    void *val;
+
+	switch_mutex_lock(runtime.global_var_mutex);
+	for (hi = switch_hash_first(NULL, runtime.global_vars); hi; hi = switch_hash_next(hi)) {
+		switch_hash_this(hi, &var, NULL, &val);
+		free(val);
+	}
+	switch_mutex_unlock(runtime.global_var_mutex);
+}
+
 SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value)
 {
 	char *val;
@@ -1488,6 +1502,7 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
 	switch_log_shutdown();
 
+	switch_core_unset_variables();
 	switch_core_memory_stop();
 
 	if (runtime.console && runtime.console != stdout && runtime.console != stderr) {

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Tue Mar  3 14:16:05 2009
@@ -409,7 +409,26 @@
 
 SWITCH_DECLARE(void) switch_rtp_shutdown(void)
 {
+	switch_core_port_allocator_t *alloc = NULL;
+	switch_hash_index_t *hi;
+    const void *var;
+    void *val;
+
+	switch_mutex_lock(port_lock);
+
+	for (hi = switch_hash_first(NULL, alloc_hash); hi; hi = switch_hash_next(hi)) {
+		switch_hash_this(hi, &var, NULL, &val);
+		if ((alloc = (switch_core_port_allocator_t *) val)) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroy port allocator for %s\n", (char *)var);
+			switch_core_port_allocator_destroy(&alloc);
+		}
+	}
+
 	switch_core_hash_destroy(&alloc_hash);
+	switch_mutex_unlock(port_lock);
+
+	crypto_kernel_shutdown();
+
 }
 
 SWITCH_DECLARE(switch_port_t) switch_rtp_set_start_port(switch_port_t port)



More information about the Freeswitch-svn mailing list