Module: kamailio
Branch: master
Commit: cfc0ecaa8391cf9ac17f5a33ede77bc03beb8cc9
URL:
https://github.com/kamailio/kamailio/commit/cfc0ecaa8391cf9ac17f5a33ede77bc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-08-27T13:03:09+02:00
rtpengine: aliased $rtpestat to $rtpstat
- can be useful when playing with rtpproxy in same config
- show an example of content for variable
---
Modified: src/modules/rtpengine/doc/rtpengine_admin.xml
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/cfc0ecaa8391cf9ac17f5a33ede77bc…
Patch:
https://github.com/kamailio/kamailio/commit/cfc0ecaa8391cf9ac17f5a33ede77bc…
---
diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml
b/src/modules/rtpengine/doc/rtpengine_admin.xml
index 74a6002774..6faf39c845 100644
--- a/src/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/src/modules/rtpengine/doc/rtpengine_admin.xml
@@ -3223,23 +3223,31 @@ play_dtmf("code=1 volume=5 duration=300 pause=150");
<section>
<title>Exported Pseudo Variables</title>
- <section>
- <title><function
moreinfo="none">$rtpstat</function></title>
+ <section id="rtpengine.pv.rtpestat">
+ <title><function
moreinfo="none">$rtpestat</function></title>
<para>
- Returns the &rtp; statistics from the &rtp; proxy. The &rtp; statistics
from the &rtp; proxy
+ Returns the &rtp; statistics from the &rtp; relay. The &rtp; statistics
from the &rtp; relay
are provided as a string and it does contain several packet counters. The statistics
must be retrieved before the session is deleted (before
<function>rtpengine_delete()</function>).
</para>
<example>
- <title>$rtpstat Usage</title>
+ <title>$rtpestat Usage</title>
<programlisting format="linespecific">
...
- append_hf("X-RTP-Statistics: $rtpstat\r\n");
+ append_hf("X-RTP-Statistics: $rtpestat\r\n");
+...
+ # $rtpestat = RTP: 54846 bytes, 1447 packets, 0 errors; RTCP: 336 bytes, 3 packets, 0
errors
...
</programlisting>
</example>
</section>
+ <section id="rtpengine.pv.rtpstat">
+ <title><function
moreinfo="none">$rtpstat</function></title>
+ <para>
+ Same as $rtpestat.
+ </para>
+ </section>
</section>
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index c75caec078..989af05e56 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -245,7 +245,7 @@ static int add_rtpp_node_info(void *ptrs, struct rtpp_node *crt_rtpp,
struct rtp
static int rtpp_test_ping(struct rtpp_node *node);
/* Pseudo-Variables */
-static int pv_get_rtpstat_f(struct sip_msg *, pv_param_t *, pv_value_t *);
+static int pv_get_rtpestat_f(struct sip_msg *, pv_param_t *, pv_value_t *);
static int set_rtp_inst_pvar(struct sip_msg *msg, const str * const uri);
static int pv_parse_var(str *inp, pv_elem_t **outp, int *got_any);
static int mos_label_stats_parse(struct minmax_mos_label_stats *mmls);
@@ -448,7 +448,9 @@ static cmd_export_t cmds[] = {
static pv_export_t mod_pvs[] = {
{{"rtpstat", (sizeof("rtpstat")-1)}, /* RTP-Statistics */
- PVT_OTHER, pv_get_rtpstat_f, 0, 0, 0, 0, 0},
+ PVT_OTHER, pv_get_rtpestat_f, 0, 0, 0, 0, 0},
+ {{"rtpestat", (sizeof("rtpestat")-1)}, /* RTP-Statistics */
+ PVT_OTHER, pv_get_rtpestat_f, 0, 0, 0, 0, 0},
{{0, 0}, 0, 0, 0, 0, 0, 0, 0}
};
@@ -4153,7 +4155,7 @@ static int rtpengine_rtpstat_wrap(struct sip_msg *msg, void *d, int
more, enum r
* Returns the current RTP-Statistics from the RTP-Proxy
*/
static int
-pv_get_rtpstat_f(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
+pv_get_rtpestat_f(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
{
void *parms[2];