소스 검색

rtpengine: aliased $rtpestat to $rtpstat

- can be useful when playing with rtpproxy in same config
- show an example of content for variable
Daniel-Constantin Mierla 4 년 전
부모
커밋
cfc0ecaa83
2개의 변경된 파일18개의 추가작업 그리고 8개의 파일을 삭제
  1. 13 5
      src/modules/rtpengine/doc/rtpengine_admin.xml
  2. 5 3
      src/modules/rtpengine/rtpengine.c

+ 13 - 5
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>
 

+ 5 - 3
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 @@ error:
  * 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];