Browse Source

rtpengine : add node fallback if node out of port

When rtpengine answers with error-reason 'Ran out of ports' adopt the same behavor that when node answers 'Parallel session limit reached'

(cherry picked from commit 853068a26c34deff86e17b63f49abea2c8f4403c)
dvillaume 4 năm trước cách đây
mục cha
commit
ee7838842a
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      src/modules/rtpengine/rtpengine.c

+ 10 - 0
src/modules/rtpengine/rtpengine.c

@@ -290,6 +290,9 @@ static pv_spec_t *media_duration_pvar = NULL;
 #define RTPENGINE_SESS_LIMIT_MSG "Parallel session limit reached"
 #define RTPENGINE_SESS_LIMIT_MSG "Parallel session limit reached"
 #define RTPENGINE_SESS_LIMIT_MSG_LEN (sizeof(RTPENGINE_SESS_LIMIT_MSG)-1)
 #define RTPENGINE_SESS_LIMIT_MSG_LEN (sizeof(RTPENGINE_SESS_LIMIT_MSG)-1)
 
 
+#define RTPENGINE_SESS_OUT_OF_PORTS_MSG "Ran out of ports"
+#define RTPENGINE_SESS_OUT_OF_PORTS_MSG_LEN (sizeof(RTPENGINE_SESS_OUT_OF_PORTS_MSG)-1)
+
 char* force_send_ip_str="";
 char* force_send_ip_str="";
 int force_send_ip_af = AF_UNSPEC;
 int force_send_ip_af = AF_UNSPEC;
 
 
@@ -2623,6 +2626,13 @@ select_node:
 				LM_WARN("proxy %.*s: %.*s", node->rn_url.len, node->rn_url.s , error.len, error.s);
 				LM_WARN("proxy %.*s: %.*s", node->rn_url.len, node->rn_url.s , error.len, error.s);
 				goto select_node;
 				goto select_node;
 			}
 			}
+			if ((RTPENGINE_SESS_OUT_OF_PORTS_MSG_LEN == error.len) &&
+				(strncmp(error.s, RTPENGINE_SESS_OUT_OF_PORTS_MSG, RTPENGINE_SESS_OUT_OF_PORTS_MSG_LEN) == 0))
+			{
+				LM_WARN("proxy %.*s: %.*s", node->rn_url.len, node->rn_url.s , error.len, error.s);
+				goto select_node;
+			}
+
 			LM_ERR("proxy replied with error: %.*s\n", error.len, error.s);
 			LM_ERR("proxy replied with error: %.*s\n", error.len, error.s);
 		}
 		}
 		goto error;
 		goto error;