[sr-dev] git:master:d2db2229: rtpengine: small addition to nh_show_rtpp

lucian balanceanu lucian.balanceanu at 1and1.ro
Mon Mar 16 08:46:43 CET 2015


Module: kamailio
Branch: master
Commit: d2db2229f83cdf584c1dbb3485c31f01bc3e7dab
URL: https://github.com/kamailio/kamailio/commit/d2db2229f83cdf584c1dbb3485c31f01bc3e7dab

Author: lucian balanceanu <lucian.balanceanu at 1and1.ro>
Committer: lucian balanceanu <lucian.balanceanu at 1and1.ro>
Date: 2015-03-16T09:42:09+02:00

rtpengine: small addition to nh_show_rtpp

- if a RTP proxy has been disabled by a mi command
a "(permanent)" quote will appear when printing the disabled
status.

---

Modified: modules/rtpengine/doc/rtpengine_admin.xml
Modified: modules/rtpengine/rtpengine.c

---

Diff:  https://github.com/kamailio/kamailio/commit/d2db2229f83cdf584c1dbb3485c31f01bc3e7dab.diff
Patch: https://github.com/kamailio/kamailio/commit/d2db2229f83cdf584c1dbb3485c31f01bc3e7dab.patch

---

diff --git a/modules/rtpengine/doc/rtpengine_admin.xml b/modules/rtpengine/doc/rtpengine_admin.xml
index 576dd80..c03bc7d 100644
--- a/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/modules/rtpengine/doc/rtpengine_admin.xml
@@ -797,7 +797,9 @@ $ &ctltool; fifo nh_enable_rtpp udp:192.168.2.133:8081 0
 			<title><function moreinfo="none">nh_show_rtpp</function></title>
 			<para>
 			Displays all the &rtp; proxies and their information: set and
-			status (disabled or not, weight and recheck_ticks).
+			status (disabled or not, weight and recheck_ticks). If a RTP proxy has been disabled by a mi command
+			a "(permanent)" quote will appear when printing the disabled status. This is to differentiate from
+			a temporary disable due to the proxy being not found responsive by kamailio.
 			</para>
 			<para>
 			No parameter.
diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 8b2a5b3..63fdba5 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -109,6 +109,8 @@ MODULE_VERSION
 #define MI_RTP_PROXY_NOT_FOUND_LEN	(sizeof(MI_RTP_PROXY_NOT_FOUND)-1)
 #define MI_PING_DISABLED			"NATping disabled from script"
 #define MI_PING_DISABLED_LEN		(sizeof(MI_PING_DISABLED)-1)
+#define MI_DISABLED_PERMANENT        "1 (permanent)"
+#define MI_DISABLED_PERMANENT_LEN    (sizeof(MI_DISABLED_PERMANENT)-1)
 #define MI_SET						"set"
 #define MI_SET_LEN					(sizeof(MI_SET)-1)
 #define MI_INDEX					"index"
@@ -760,8 +762,19 @@ static struct mi_root* mi_show_rtpproxies(struct mi_root* cmd_tree,
 
 			add_rtpp_node_int_info(crt_node, MI_INDEX, MI_INDEX_LEN,
 				crt_rtpp->idx, child, len,string,error);
-			add_rtpp_node_int_info(crt_node, MI_DISABLED, MI_DISABLED_LEN,
-				crt_rtpp->rn_disabled, child, len,string,error);
+			
+			if (( 1 == crt_rtpp->rn_disabled ) && ( crt_rtpp->rn_recheck_ticks == MI_MAX_RECHECK_TICKS)) {
+				if( !(child = add_mi_node_child(crt_node, MI_DUP_VALUE, MI_DISABLED, MI_DISABLED_LEN,
+								MI_DISABLED_PERMANENT, MI_DISABLED_PERMANENT_LEN))) {
+					LM_ERR("cannot add disabled (permanent) message\n");
+					goto error;
+				}
+			}
+			else {
+				add_rtpp_node_int_info(crt_node, MI_DISABLED, MI_DISABLED_LEN,
+					crt_rtpp->rn_disabled, child, len,string,error);
+			}
+
 			add_rtpp_node_int_info(crt_node, MI_WEIGHT, MI_WEIGHT_LEN,
 				crt_rtpp->rn_weight,  child, len, string,error);
 			add_rtpp_node_int_info(crt_node, MI_RECHECK_TICKS,MI_RECHECK_T_LEN,




More information about the sr-dev mailing list