]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
change switch_strip_spaces to specify if you want it to dup the string or destroy...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 22 Dec 2010 02:30:19 +0000 (20:30 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 22 Dec 2010 02:30:28 +0000 (20:30 -0600)
src/include/switch_utils.h
src/mod/applications/mod_commands/mod_commands.c
src/mod/languages/mod_managed/freeswitch_wrap.cxx
src/mod/languages/mod_managed/managed/swig.cs
src/mod/languages/mod_perl/mod_perl_wrap.cpp
src/switch_utils.c

index e2a73352262cf47b92ef0e3f7ce6753c8cae549b..3360f33fe5de968da75c939af933eb78c357b8b8 100644 (file)
@@ -622,7 +622,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(_In_ char *buf, char delim,
 SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
 
 SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
-SWITCH_DECLARE(char *) switch_strip_spaces(const char *str);
+SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup);
 SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str);
 SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len);
 SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size_t len);
index dba86e3103b0dc66754ed5e934819dc8c0851ee3..2deb437948c36c605d234f4df55bab16e7c13981 100644 (file)
@@ -1428,8 +1428,8 @@ SWITCH_STANDARD_API(cond_function)
                int a_is_num, b_is_num;
                *expr++ = '\0';
                b = expr;
-               s_a = switch_strip_spaces(a);
-               s_b = switch_strip_spaces(b);
+               s_a = switch_strip_spaces(a, SWITCH_TRUE);
+               s_b = switch_strip_spaces(b, SWITCH_TRUE);
                a_is_num = switch_is_number(s_a);
                b_is_num = switch_is_number(s_b);
 
index 1d3c5d60ced7efa23afa54d6efc313498ebcd77c..2c88f65ab60df0c1ccce09ff51889f8649555677 100644 (file)
@@ -12726,13 +12726,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_is_number(char * jarg1) {
 }
 
 
-SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strip_spaces(char * jarg1) {
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strip_spaces(char * jarg1, int jarg2) {
   char * jresult ;
   char *arg1 = (char *) 0 ;
+  switch_bool_t arg2 ;
   char *result = 0 ;
   
   arg1 = (char *)jarg1; 
-  result = (char *)switch_strip_spaces((char const *)arg1);
+  arg2 = (switch_bool_t)jarg2; 
+  result = (char *)switch_strip_spaces(arg1,arg2);
   jresult = SWIG_csharp_string_callback((const char *)result); 
   return jresult;
 }
@@ -23624,6 +23626,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_caller_extension(void * ja
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_sort_cid(void * jarg1, int jarg2) {
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  switch_bool_t arg2 ;
+  
+  arg1 = (switch_channel_t *)jarg1; 
+  arg2 = (switch_bool_t)jarg2; 
+  switch_channel_sort_cid(arg1,arg2);
+}
+
+
 SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_caller_extension(void * jarg1) {
   void * jresult ;
   switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@@ -29013,6 +29025,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1
 }
 
 
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_debug_jitter_buffer(void * jarg1, char * jarg2) {
+  int jresult ;
+  switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  switch_status_t result;
+  
+  arg1 = (switch_rtp_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (switch_status_t)switch_rtp_debug_jitter_buffer(arg1,(char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_deactivate_jitter_buffer(void * jarg1) {
   int jresult ;
   switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
index 9decf740457a4d38663723e25f3c958d0b8a15d4..bf328811dd9964041ca2c7b06746146d623487b2 100644 (file)
@@ -2867,8 +2867,8 @@ public class freeswitch {
     return ret;
   }
 
-  public static string switch_strip_spaces(string str) {
-    string ret = freeswitchPINVOKE.switch_strip_spaces(str);
+  public static string switch_strip_spaces(string str, switch_bool_t dup) {
+    string ret = freeswitchPINVOKE.switch_strip_spaces(str, (int)dup);
     return ret;
   }
 
@@ -3318,6 +3318,10 @@ public class freeswitch {
     freeswitchPINVOKE.switch_channel_set_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_extension.getCPtr(caller_extension));
   }
 
+  public static void switch_channel_sort_cid(SWIGTYPE_p_switch_channel channel, switch_bool_t arg1) {
+    freeswitchPINVOKE.switch_channel_sort_cid(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)arg1);
+  }
+
   public static switch_caller_extension switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel channel) {
     IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel));
     switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false);
@@ -4635,6 +4639,11 @@ public class freeswitch {
     return ret;
   }
 
+  public static switch_status_t switch_rtp_debug_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, string name) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_debug_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), name);
+    return ret;
+  }
+
   public static switch_status_t switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session) {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
     return ret;
@@ -8647,7 +8656,7 @@ class freeswitchPINVOKE {
   public static extern int switch_is_number(string jarg1);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_strip_spaces")]
-  public static extern string switch_strip_spaces(string jarg1);
+  public static extern string switch_strip_spaces(string jarg1, int jarg2);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_strip_whitespace")]
   public static extern string switch_strip_whitespace(string jarg1);
@@ -11313,6 +11322,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_caller_extension")]
   public static extern void switch_channel_set_caller_extension(HandleRef jarg1, HandleRef jarg2);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_sort_cid")]
+  public static extern void switch_channel_sort_cid(HandleRef jarg1, int jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_caller_extension")]
   public static extern IntPtr switch_channel_get_caller_extension(HandleRef jarg1);
 
@@ -12441,6 +12453,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")]
   public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_debug_jitter_buffer")]
+  public static extern int switch_rtp_debug_jitter_buffer(HandleRef jarg1, string jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_deactivate_jitter_buffer")]
   public static extern int switch_rtp_deactivate_jitter_buffer(HandleRef jarg1);
 
@@ -21509,6 +21524,7 @@ public enum switch_channel_flag_t {
   CF_BRIDGE_NOWRITE,
   CF_RECOVERED,
   CF_JITTERBUFFER,
+  CF_DIALPLAN,
   CF_FLAG_MAX
 }
 
index 370c88bc99fbef8b20e7bf198107f78abedec013..2efbdf1abc4127d5414c1752d1f628dd1e592974 100644 (file)
@@ -9732,17 +9732,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/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%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/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%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/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%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 1a29e2b7155edd746198b472c24f01408d9ad7e9..7331a971b357df72d7c875ef2fce964830e93266 100644 (file)
@@ -831,9 +831,9 @@ SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str)
        return s;
 }
 
-SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
+SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup)
 {
-       const char *sp = str;
+       char *sp = str;
        char *p, *s = NULL;
 
        if (!sp)
@@ -843,7 +843,11 @@ SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
                sp++;
        }
 
-       s = strdup(sp);
+       if (dup) {
+               s = strdup(sp);
+       } else {
+               s = sp;
+       }
 
        if (!s)
                return NULL;