Skip to content

Commit

Permalink
rtpproxy: add rtpproxy_all_stats() command docs
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Feb 13, 2017
1 parent 386072d commit 200bda2
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 6 deletions.
51 changes: 45 additions & 6 deletions modules/rtpproxy/README
Expand Up @@ -72,6 +72,9 @@ Razvan Crainea
1.6.8. rtpproxy_stats(up_pvar, down_pvar, sent_pvar,
fail_pvar [, set_id [, sock_pvar]])

1.6.9. rtpproxy_all_stats(stats_avp [, set_id [,
sock_pvar]])

1.7. MI Commands

1.7.1. rtpproxy_enable
Expand Down Expand Up @@ -104,9 +107,10 @@ Razvan Crainea
1.16. rtpproxy_stream2xxx usage
1.17. rtpproxy_start_recording usage
1.18. rtpproxy_stats usage
1.19. rtpproxy_enable usage
1.20. rtpproxy_show usage
1.21. rtpproxy_reload usage
1.19. rtpproxy_all_stats usage
1.20. rtpproxy_enable usage
1.21. rtpproxy_show usage
1.22. rtpproxy_reload usage

Chapter 1. Admin Guide

Expand Down Expand Up @@ -683,6 +687,41 @@ xlog("RTP statistics for $ci: up=$var(up) down=$var(down) sent=$var(sent
) fail=$var(fail)\n");
...

1.6.9. rtpproxy_all_stats(stats_avp [, set_id [, sock_pvar]])

This command gathers all RTP statistics available from
RTP-Proxy. All the returned values stored in an AVP that can be
further read by indexing the AVP.

Meaning of the parameters is as follows:
* stats_avp - an AVP where the statistics will be stored.
This AVP can be further indexed to get a specific
statistic.
* set_id(optional) - the set used for this call.
* sock_pvar(optional) - pvar used to store the RTPProxy
socket chosen for this call.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
ONREPLY_ROUTE, BRANCH_ROUTE and LOCAL_ROUTE.

Each statistic is stored at a specific index as it follows:
* ttl - $avp(ret) / $(avp(ret)[0])
* pkts_ia - $(avp(ret)[1])
* pkts_io - $(avp(ret)[2])
* relayed - $(avp(ret)[3])
* dropped - $(avp(ret)[4])
* rtpa_set - $(avp(ret)[5])
* rtpa_rcvd - $(avp(ret)[6])
* rtpa_dups - $(avp(ret)[7])
* rtpa_lost - $(avp(ret)[8])
* rtpa_perrs - $(avp(ret)[9])

Example 1.19. rtpproxy_all_stats usage
...
rtpproxy_all_stats("$avp(stats)");
xlog("RTP statistics for $ci: dropped=$(avp(stats)[4])\n");
...

1.7. MI Commands

1.7.1. rtpproxy_enable
Expand All @@ -704,7 +743,7 @@ xlog("RTP statistics for $ci: up=$var(up) down=$var(down) sent=$var(sent
diferente sete), all its instances will be enables/disabled IF
no set ID provided (as second param).

Example 1.19. rtpproxy_enable usage
Example 1.20. rtpproxy_enable usage
...
## disable a RTPProxy by URL only
$ opensipsctl fifo rtpproxy_enable udp:192.168.2.133:8081 0
Expand All @@ -719,7 +758,7 @@ $ opensipsctl fifo rtpproxy_enable udp:192.168.2.133:8081 3 0

No parameter.

Example 1.20. rtpproxy_show usage
Example 1.21. rtpproxy_show usage
...
$ opensipsctl fifo rtpproxy_show
...
Expand All @@ -733,7 +772,7 @@ $ opensipsctl fifo rtpproxy_show

No parameter.

Example 1.21. rtpproxy_reload usage
Example 1.22. rtpproxy_reload usage
...
$ opensipsctl fifo rtpproxy_reload
...
Expand Down
74 changes: 74 additions & 0 deletions modules/rtpproxy/doc/rtpproxy_admin.xml
Expand Up @@ -878,6 +878,80 @@ rtpproxy_start_recording();
...
rtpproxy_stats("$var(up)","$var(down)","$var(sent)","$var(fail)");
xlog("RTP statistics for $ci: up=$var(up) down=$var(down) sent=$var(sent) fail=$var(fail)\n");
...
</programlisting>
</example>
</section>
<section>
<title>
<function moreinfo="none">rtpproxy_all_stats(stats_avp [, set_id [, sock_pvar]])</function>
</title>
<para>
This command gathers all RTP statistics available from RTP-Proxy.
All the returned values stored in an AVP that can be further read by
indexing the AVP.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem><para>
<emphasis>stats_avp</emphasis> - an AVP where the
statistics will be stored. This AVP can be further
indexed to get a specific statistic.
</para></listitem>
<listitem><para>
<emphasis>set_id(optional)</emphasis> - the set used for this call.
</para></listitem>
<listitem><para>
<emphasis>sock_pvar(optional)</emphasis> - pvar used to store the RTPProxy
socket chosen for this call.
</para></listitem>
</itemizedlist>
<para>
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE,
BRANCH_ROUTE and LOCAL_ROUTE.
</para>
<para>
Each statistic is stored at a specific index as it follows:
<itemizedlist>
<listitem><para><emphasis>ttl</emphasis> -
<emphasis>$avp(ret)</emphasis> /
<emphasis>$(avp(ret)[0])</emphasis>
</para></listitem>
<listitem><para><emphasis>pkts_ia</emphasis> -
<emphasis>$(avp(ret)[1])</emphasis>
</para></listitem>
<listitem><para><emphasis>pkts_io</emphasis> -
<emphasis>$(avp(ret)[2])</emphasis>
</para></listitem>
<listitem><para><emphasis>relayed</emphasis> -
<emphasis>$(avp(ret)[3])</emphasis>
</para></listitem>
<listitem><para><emphasis>dropped</emphasis> -
<emphasis>$(avp(ret)[4])</emphasis>
</para></listitem>
<listitem><para><emphasis>rtpa_set</emphasis> -
<emphasis>$(avp(ret)[5])</emphasis>
</para></listitem>
<listitem><para><emphasis>rtpa_rcvd</emphasis> -
<emphasis>$(avp(ret)[6])</emphasis>
</para></listitem>
<listitem><para><emphasis>rtpa_dups</emphasis> -
<emphasis>$(avp(ret)[7])</emphasis>
</para></listitem>
<listitem><para><emphasis>rtpa_lost</emphasis> -
<emphasis>$(avp(ret)[8])</emphasis>
</para></listitem>
<listitem><para><emphasis>rtpa_perrs</emphasis> -
<emphasis>$(avp(ret)[9])</emphasis>
</para></listitem>
</itemizedlist>
</para>
<example>
<title><function>rtpproxy_all_stats</function> usage</title>
<programlisting format="linespecific">
...
rtpproxy_all_stats("$avp(stats)");
xlog("RTP statistics for $ci: dropped=$(avp(stats)[4])\n");
...
</programlisting>
</example>
Expand Down

0 comments on commit 200bda2

Please sign in to comment.