Răsfoiți Sursa

Merge branch 'signalwire:master' into master

Seven Du 1 an în urmă
părinte
comite
6c838582d3

+ 1 - 1
build/next-release.txt

@@ -1 +1 @@
-1.10.10-dev
+1.10.11-dev

+ 2 - 2
conf/vanilla/freeswitch.xml

@@ -9,11 +9,11 @@
 
     Before you start to modify this default please visit this wiki page:
 
-    http://wiki.freeswitch.org/wiki/Getting_Started_Guide#Some_stuff_to_try_out.21
+    https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Configuration/Default-Configuration_6587388/#6-configuration-files
 
     If all else fails you can read our FAQ located at:
 
-    http://wiki.freeswitch.org/wiki/FreeSwitch_FAQ
+    https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Miscellaneous/FAQ/
 
     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
 -->

+ 2 - 2
configure.ac

@@ -3,10 +3,10 @@
 
 # Must change all of the below together
 # For a release, set revision for that tagged release as well and uncomment
-AC_INIT([freeswitch], [1.10.10-dev], bugs@freeswitch.org)
+AC_INIT([freeswitch], [1.10.11-dev], bugs@freeswitch.org)
 AC_SUBST(SWITCH_VERSION_MAJOR, [1])
 AC_SUBST(SWITCH_VERSION_MINOR, [10])
-AC_SUBST(SWITCH_VERSION_MICRO, [10-dev])
+AC_SUBST(SWITCH_VERSION_MICRO, [11-dev])
 AC_SUBST(SWITCH_VERSION_REVISION, [])
 AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
 

+ 5 - 4
src/include/switch_rtp.h

@@ -106,12 +106,13 @@ typedef struct icand_s {
 } icand_t;
 
 #define MAX_CAND 50
+#define MAX_CAND_IDX_COUNT 2
 typedef struct ice_s {
 
-	icand_t cands[MAX_CAND][2];
-	int cand_idx[2];
-	int chosen[2];
-	int is_chosen[2];
+	icand_t cands[MAX_CAND][MAX_CAND_IDX_COUNT];
+	int cand_idx[MAX_CAND_IDX_COUNT];
+	int chosen[MAX_CAND_IDX_COUNT];
+	int is_chosen[MAX_CAND_IDX_COUNT];
 	char *ufrag;
 	char *pwd;
 	char *options;

+ 8 - 0
src/include/switch_utils.h

@@ -498,6 +498,14 @@ SWITCH_DECLARE(switch_size_t) switch_fp_read_dline(FILE *fd, char **buf, switch_
 SWITCH_DECLARE(switch_status_t) switch_frame_alloc(switch_frame_t **frame, switch_size_t size);
 SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_frame_t **clone);
 SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame);
+
+/*! \brief Check if a 32 bit unsigned number is in a range.
+ * \param str string to check. Should not contain non-digit characters.
+ * \param from start of range including this number
+ * \param to end of range including this number
+ * \return true or false
+ */
+SWITCH_DECLARE(switch_bool_t) switch_is_uint_in_range(const char *str, unsigned int from, unsigned int to);
 SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
 SWITCH_DECLARE(switch_bool_t) switch_is_leading_number(const char *str);
 SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param, switch_memory_pool_t *pool);

+ 14 - 0
src/mod/databases/mod_mariadb/mod_mariadb.c

@@ -627,13 +627,27 @@ switch_status_t mariadb_send_query(mariadb_handle_t *handle, const char* sql)
 {
 	char *err_str;
 	int ret;
+	unsigned retries = 60; /* 60 tries, will take 30 to 60 seconds at worst */
 
 	switch_safe_free(handle->sql);
 	handle->sql = strdup(sql);
+    again:
 	handle->stored_results = 0;
 	ret = mysql_real_query(&handle->con, sql, (unsigned long)strlen(sql));	
 	if (ret) {
 		err_str = mariadb_handle_get_error(handle);
+		if (strstr(err_str, "Deadlock found when trying to get lock; try restarting transaction")) {
+			if (--retries > 0) {
+				switch_safe_free(err_str);
+				/* We are waiting for 500 ms and random time is not more than 500 ms.
+				  This is necessary so that the delay on the primary and secondary servers does not coincide and deadlock does not occur again. */
+				switch_yield(500 + (rand() & 511));
+				goto again;
+			}
+
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "DeadLock. The retries are over.\n");
+		}
+
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to send query (%s) to database: %s\n", sql, err_str);
 		switch_safe_free(err_str);
 		mariadb_finish_results(handle);

+ 11 - 0
src/mod/endpoints/mod_verto/mod_verto.c

@@ -3865,6 +3865,15 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
 		cJSON *i, *indialog =  cJSON_GetObjectItem(msg, "inDialog");
 		const char *body = cJSON_GetObjectCstr(msg, "body");
 		switch_bool_t is_dialog = indialog && (indialog->type == cJSON_True || (indialog->type == cJSON_String && switch_true(indialog->valuestring)));
+		const char *context = NULL;
+
+		switch_mutex_lock(jsock->flag_mutex);
+
+		if (!(context = switch_event_get_header(jsock->vars, "user_context"))) {
+			context = switch_either(jsock->context, jsock->profile->context);
+		}
+
+		switch_mutex_unlock(jsock->flag_mutex);
 
 		if (!zstr(to)) {
 			if (strchr(to, '+')) {
@@ -3901,6 +3910,8 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call_id", call_id);
 			}
 
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", context);
+
 			switch_event_add_body(event, "%s", body);
 
 			if (strcasecmp(proto, VERTO_CHAT_PROTO)) {

+ 130 - 0
src/mod/languages/mod_managed/freeswitch_wrap.cxx

@@ -21077,6 +21077,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_frame_free___(void *
 }
 
 
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_is_uint_in_range___(char * jarg1, unsigned int jarg2, unsigned int jarg3) {
+  int jresult ;
+  char *arg1 = (char *) 0 ;
+  unsigned int arg2 ;
+  unsigned int arg3 ;
+  switch_bool_t result;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (unsigned int)jarg2; 
+  arg3 = (unsigned int)jarg3; 
+  result = (switch_bool_t)switch_is_uint_in_range((char const *)arg1,arg2,arg3);
+  jresult = (int)result; 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_is_number___(char * jarg1) {
   int jresult ;
   char *arg1 = (char *) 0 ;
@@ -33245,6 +33261,50 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_microsecon
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_max_ptime_set___(void * jarg1, int jarg2) {
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int arg2 ;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  arg2 = (int)jarg2; 
+  if (arg1) (arg1)->max_ptime = arg2;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_max_ptime_get___(void * jarg1) {
+  int jresult ;
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int result;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  result = (int) ((arg1)->max_ptime);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_min_ptime_set___(void * jarg1, int jarg2) {
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int arg2 ;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  arg2 = (int)jarg2; 
+  if (arg1) (arg1)->min_ptime = arg2;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_min_ptime_get___(void * jarg1) {
+  int jresult ;
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int result;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  result = (int) ((arg1)->min_ptime);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_stereo_set___(void * jarg1, int jarg2) {
   switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
   int arg2 ;
@@ -33267,6 +33327,28 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_stereo_get
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_sprop_stereo_set___(void * jarg1, int jarg2) {
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int arg2 ;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  arg2 = (int)jarg2; 
+  if (arg1) (arg1)->sprop_stereo = arg2;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_sprop_stereo_get___(void * jarg1) {
+  int jresult ;
+  switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
+  int result;
+  
+  arg1 = (switch_codec_fmtp *)jarg1; 
+  result = (int) ((arg1)->sprop_stereo);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_codec_fmtp_private_info_set___(void * jarg1, void * jarg2) {
   switch_codec_fmtp *arg1 = (switch_codec_fmtp *) 0 ;
   void *arg2 = (void *) 0 ;
@@ -36802,6 +36884,44 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_channel_get_variab
 }
 
 
+SWIGEXPORT char * SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_channel_get_variable_strdup___(void * jarg1, char * jarg2) {
+  char * jresult ;
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_channel_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (char *)switch_channel_get_variable_strdup(arg1,(char const *)arg2);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_channel_get_variable_buf___(void * jarg1, char * jarg2, char * jarg3, void * jarg4) {
+  int jresult ;
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  switch_size_t arg4 ;
+  switch_size_t *argp4 ;
+  switch_status_t result;
+  
+  arg1 = (switch_channel_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  argp4 = (switch_size_t *)jarg4; 
+  if (!argp4) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0);
+    return 0;
+  }
+  arg4 = *argp4; 
+  result = (switch_status_t)switch_channel_get_variable_buf(arg1,(char const *)arg2,arg3,arg4);
+  jresult = (int)result; 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_channel_get_variables___(void * jarg1, void * jarg2) {
   int jresult ;
   switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@@ -45145,6 +45265,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_MAX_CAND_get___() {
 }
 
 
+SWIGEXPORT int SWIGSTDCALL CSharp_FreeSWITCHfNative_MAX_CAND_IDX_COUNT_get___() {
+  int jresult ;
+  int result;
+  
+  result = (int)(2);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_FreeSWITCHfNative_ice_t_cands_set___(void * jarg1, void * jarg2) {
   ice_s *arg1 = (ice_s *) 0 ;
   icand_t (*arg2)[2] ;

+ 80 - 1
src/mod/languages/mod_managed/managed/swig.cs

@@ -10932,6 +10932,11 @@ else
     return ret;
   }
 
+  public static switch_bool_t switch_is_uint_in_range(string str, uint from, uint to) {
+    switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_uint_in_range(str, from, to);
+    return ret;
+  }
+
   public static switch_bool_t switch_is_number(string str) {
     switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_number(str);
     return ret;
@@ -11884,6 +11889,17 @@ else
     return ret;
   }
 
+  public static string switch_channel_get_variable_strdup(SWIGTYPE_p_switch_channel channel, string varname) {
+    string ret = freeswitchPINVOKE.switch_channel_get_variable_strdup(SWIGTYPE_p_switch_channel.getCPtr(channel), varname);
+    return ret;
+  }
+
+  public static switch_status_t switch_channel_get_variable_buf(SWIGTYPE_p_switch_channel channel, string varname, string buf, SWIGTYPE_p_switch_size_t buflen) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_get_variable_buf(SWIGTYPE_p_switch_channel.getCPtr(channel), varname, buf, SWIGTYPE_p_switch_size_t.getCPtr(buflen));
+    if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
   public static switch_status_t switch_channel_get_variables(SWIGTYPE_p_switch_channel channel, SWIGTYPE_p_p_switch_event arg1) {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_get_variables(SWIGTYPE_p_switch_channel.getCPtr(channel), SWIGTYPE_p_p_switch_event.getCPtr(arg1));
     return ret;
@@ -15223,6 +15239,7 @@ else
   public static readonly string SWITCH_RTP_CRYPTO_KEY_80 = freeswitchPINVOKE.SWITCH_RTP_CRYPTO_KEY_80_get();
   public static readonly int SWITCH_RTP_BUNDLE_INTERNAL_PT = freeswitchPINVOKE.SWITCH_RTP_BUNDLE_INTERNAL_PT_get();
   public static readonly int MAX_CAND = freeswitchPINVOKE.MAX_CAND_get();
+  public static readonly int MAX_CAND_IDX_COUNT = freeswitchPINVOKE.MAX_CAND_IDX_COUNT_get();
   public static readonly int SWITCH_XML_BUFSIZE = freeswitchPINVOKE.SWITCH_XML_BUFSIZE_get();
 }
 
@@ -20575,6 +20592,9 @@ class freeswitchPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_frame_free___")]
   public static extern int switch_frame_free(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_is_uint_in_range___")]
+  public static extern int switch_is_uint_in_range(string jarg1, uint jarg2, uint jarg3);
+
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_is_number___")]
   public static extern int switch_is_number(string jarg1);
 
@@ -23614,12 +23634,30 @@ class freeswitchPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_microseconds_per_packet_get___")]
   public static extern int switch_codec_fmtp_microseconds_per_packet_get(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_max_ptime_set___")]
+  public static extern void switch_codec_fmtp_max_ptime_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_max_ptime_get___")]
+  public static extern int switch_codec_fmtp_max_ptime_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_min_ptime_set___")]
+  public static extern void switch_codec_fmtp_min_ptime_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_min_ptime_get___")]
+  public static extern int switch_codec_fmtp_min_ptime_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_stereo_set___")]
   public static extern void switch_codec_fmtp_stereo_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
 
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_stereo_get___")]
   public static extern int switch_codec_fmtp_stereo_get(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_sprop_stereo_set___")]
+  public static extern void switch_codec_fmtp_sprop_stereo_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_sprop_stereo_get___")]
+  public static extern int switch_codec_fmtp_sprop_stereo_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_codec_fmtp_private_info_set___")]
   public static extern void switch_codec_fmtp_private_info_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
@@ -24487,6 +24525,12 @@ class freeswitchPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_channel_get_variable_dup___")]
   public static extern string switch_channel_get_variable_dup(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3, int jarg4);
 
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_channel_get_variable_strdup___")]
+  public static extern string switch_channel_get_variable_strdup(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_channel_get_variable_buf___")]
+  public static extern int switch_channel_get_variable_buf(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
+
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_channel_get_variables___")]
   public static extern int switch_channel_get_variables(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
@@ -26281,6 +26325,9 @@ class freeswitchPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_MAX_CAND_get___")]
   public static extern int MAX_CAND_get();
 
+  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_MAX_CAND_IDX_COUNT_get___")]
+  public static extern int MAX_CAND_IDX_COUNT_get();
+
   [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_ice_t_cands_set___")]
   public static extern void ice_t_cands_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
@@ -31066,7 +31113,8 @@ public enum switch_call_cause_t {
   SWITCH_CAUSE_BAD_IDENTITY_INFO = 821,
   SWITCH_CAUSE_UNSUPPORTED_CERTIFICATE = 822,
   SWITCH_CAUSE_INVALID_IDENTITY = 823,
-  SWITCH_CAUSE_STALE_DATE = 824
+  SWITCH_CAUSE_STALE_DATE = 824,
+  SWITCH_CAUSE_REJECT_ALL = 825
 }
 
 }
@@ -32781,6 +32829,7 @@ public enum switch_codec_control_command_t {
   SCC_VIDEO_RESET,
   SCC_AUDIO_PACKET_LOSS,
   SCC_AUDIO_ADJUST_BITRATE,
+  SCC_AUDIO_VAD,
   SCC_DEBUG,
   SCC_CODEC_SPECIFIC
 }
@@ -32905,6 +32954,26 @@ public class switch_codec_fmtp : global::System.IDisposable {
     } 
   }
 
+  public int max_ptime {
+    set {
+      freeswitchPINVOKE.switch_codec_fmtp_max_ptime_set(swigCPtr, value);
+    } 
+    get {
+      int ret = freeswitchPINVOKE.switch_codec_fmtp_max_ptime_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public int min_ptime {
+    set {
+      freeswitchPINVOKE.switch_codec_fmtp_min_ptime_set(swigCPtr, value);
+    } 
+    get {
+      int ret = freeswitchPINVOKE.switch_codec_fmtp_min_ptime_get(swigCPtr);
+      return ret;
+    } 
+  }
+
   public int stereo {
     set {
       freeswitchPINVOKE.switch_codec_fmtp_stereo_set(swigCPtr, value);
@@ -32915,6 +32984,16 @@ public class switch_codec_fmtp : global::System.IDisposable {
     } 
   }
 
+  public int sprop_stereo {
+    set {
+      freeswitchPINVOKE.switch_codec_fmtp_sprop_stereo_set(swigCPtr, value);
+    } 
+    get {
+      int ret = freeswitchPINVOKE.switch_codec_fmtp_sprop_stereo_get(swigCPtr);
+      return ret;
+    } 
+  }
+
   public SWIGTYPE_p_void private_info {
     set {
       freeswitchPINVOKE.switch_codec_fmtp_private_info_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value));

+ 3 - 1
src/mod/loggers/mod_logfile/mod_logfile.c

@@ -98,6 +98,8 @@ static switch_status_t mod_logfile_openlogfile(logfile_profile_t *profile, switc
 
 	stat = switch_file_open(&afd, profile->logfile, flags, SWITCH_FPROT_OS_DEFAULT, module_pool);
 	if (stat != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "logfile %s open error, status=%d\n", profile->logfile, stat);
+
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -459,7 +461,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_logfile_load)
 		if ((profiles = switch_xml_child(cfg, "profiles"))) {
 			for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
 				if (load_profile(xprofile) != SWITCH_STATUS_SUCCESS) {
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error loading profile.");
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error loading profile.\n");
 				}
 			}
 		}

+ 2 - 2
src/switch_console.c

@@ -1849,7 +1849,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
 			SWITCH_STANDARD_STREAM(mystream);
 
 			if (!strcasecmp(argv[0], "stickyadd")) {
-				mystream.write_function(&mystream, "insert into complete values (1,");
+				mystream.write_function(&mystream, "insert into complete (sticky, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, hostname) values (1,");
 				for (x = 0; x < 10; x++) {
 					if (argv[x + 1] && !strcasecmp(argv[x + 1], "_any_")) {
 						mystream.write_function(&mystream, "%s", "'', ");
@@ -1865,7 +1865,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
 				switch_core_sql_exec(mystream.data);
 				status = SWITCH_STATUS_SUCCESS;
 			} else if (!strcasecmp(argv[0], "add")) {
-				mystream.write_function(&mystream, "insert into complete values (0,");
+				mystream.write_function(&mystream, "insert into complete (sticky, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, hostname) values (0,");
 				for (x = 0; x < 10; x++) {
 					if (argv[x + 1] && !strcasecmp(argv[x + 1], "_any_")) {
 						mystream.write_function(&mystream, "%s", "'', ");

+ 8 - 3
src/switch_core_media.c

@@ -4185,10 +4185,15 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
 
 				argc = switch_split(data, ' ', fields);
 
+				if (argc < 6 || !switch_is_uint_in_range(fields[1], 1, MAX_CAND_IDX_COUNT)) {
+					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Invalid data\n");
+					continue;
+				}
+
 				cid = fields[1] ? atoi(fields[1]) - 1 : 0;
 
-				if (argc < 6 || engine->ice_in.cand_idx[cid] >= MAX_CAND - 1) {
-					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Invalid data\n");
+				if (engine->ice_in.cand_idx[cid] >= MAX_CAND - 1) {
+					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Too many candidates\n");
 					continue;
 				}
 
@@ -4268,7 +4273,7 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
 	
  relay:
 	
-	for (cid = 0; cid < 2; cid++) {
+	for (cid = 0; cid < MAX_CAND_IDX_COUNT; cid++) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG, "Searching for %s candidate.\n", cid ? "rtcp" : "rtp");
 
 		for (ai = 0; ai < engine->cand_acl_count; ai++) {

+ 5 - 10
src/switch_rtp.c

@@ -3646,10 +3646,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d
 	unsigned long ssl_ctx_error = 0;
 	const SSL_METHOD *ssl_method;
 	SSL_CTX *ssl_ctx;
+#if OPENSSL_VERSION_NUMBER < 0x30000000
 	BIO *bio;
-#if OPENSSL_VERSION_NUMBER >= 0x30000000
-	EVP_PKEY *dh_pk;
-#else
 	DH *dh;
 #endif
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -3730,21 +3728,18 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d
 
 	switch_assert(dtls->ssl_ctx);
 
-	bio = BIO_new_file(dtls->pem, "r");
 #if OPENSSL_VERSION_NUMBER < 0x30000000
+	bio = BIO_new_file(dtls->pem, "r");
 	dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
 	BIO_free(bio);
 	if (dh) {
 		SSL_CTX_set_tmp_dh(dtls->ssl_ctx, dh);
 		DH_free(dh);
 	}
-#else 
-	if((dh_pk = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL)) != NULL) {
-		SSL_CTX_set0_tmp_dh_pkey(dtls->ssl_ctx, dh_pk);
-		EVP_PKEY_free(dh_pk);
+#else
+	if(!SSL_CTX_set_dh_auto(dtls->ssl_ctx, 1)) {
+		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Failed enable auto DH!\n");
 	}
-
-	BIO_free(bio);
 #endif
 	SSL_CTX_set_mode(dtls->ssl_ctx, SSL_MODE_AUTO_RETRY);
 

+ 24 - 0
src/switch_utils.c

@@ -1607,6 +1607,30 @@ SWITCH_DECLARE(char *) switch_separate_paren_args(char *str)
 	return args;
 }
 
+SWITCH_DECLARE(switch_bool_t) switch_is_uint_in_range(const char *str, unsigned int from, unsigned int to)
+{
+	unsigned int number;
+	const char *original_str = str;
+
+	if (str == NULL || *str == '\0' || from > to) {
+		return SWITCH_FALSE;
+	}
+
+	for (; *str != '\0'; str++) {
+		if (!isdigit(*str)) {
+			return SWITCH_FALSE;
+		}
+	}
+
+	number = atoi(original_str);
+
+	if (number < from || number > to) {
+		return SWITCH_FALSE;
+	}
+
+	return SWITCH_TRUE;
+}
+
 SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str)
 {
 	const char *p;

+ 15 - 0
tests/unit/switch_core.c

@@ -95,6 +95,21 @@ FST_CORE_BEGIN("./conf")
 		FST_TEST_END()
 #endif
 
+		FST_TEST_BEGIN(test_switch_is_number_in_range)
+		{
+			fst_check_int_equals(switch_is_uint_in_range("x5", 0, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("0", 1, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("-11", -10, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("-10", -10, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("-5", -10, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("-5", -10, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("5", -10, 10), SWITCH_FALSE);
+			fst_check_int_equals(switch_is_uint_in_range("0", 0, 10), SWITCH_TRUE);
+			fst_check_int_equals(switch_is_uint_in_range("10", 0, 10), SWITCH_TRUE);
+			fst_check_int_equals(switch_is_uint_in_range("11", 0, 10), SWITCH_FALSE);
+		}
+		FST_TEST_END()
+
 		FST_TEST_BEGIN(test_md5)
 		{
 			char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 };