Skip to content

Commit

Permalink
rtpengine: small addition to nh_show_rtpp
Browse files Browse the repository at this point in the history
- if a RTP proxy has been disabled by a mi command
a "(permanent)" quote will appear when printing the disabled
status.
  • Loading branch information
lucian balanceanu committed Mar 16, 2015
1 parent 7f55064 commit d2db222
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/rtpengine/doc/rtpengine_admin.xml
Expand Up @@ -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.
Expand Down
17 changes: 15 additions & 2 deletions modules/rtpengine/rtpengine.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d2db222

Please sign in to comment.