Module: kamailio Branch: master Commit: 853068a26c34deff86e17b63f49abea2c8f4403c URL: https://github.com/kamailio/kamailio/commit/853068a26c34deff86e17b63f49abea2...
Author: dvillaume david.villaume@gmail.com Committer: GitHub noreply@github.com Date: 2021-02-03T10:19:46+01:00
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'
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/853068a26c34deff86e17b63f49abea2... Patch: https://github.com/kamailio/kamailio/commit/853068a26c34deff86e17b63f49abea2...
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 7eb0843793..00b27be148 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -294,6 +294,9 @@ static pv_spec_t *media_duration_pvar = NULL; #define RTPENGINE_SESS_LIMIT_MSG "Parallel session limit reached" #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=""; int force_send_ip_af = AF_UNSPEC;
@@ -2632,6 +2635,13 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_ LM_WARN("proxy %.*s: %.*s", node->rn_url.len, node->rn_url.s , error.len, error.s); 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); } goto error;