<html>
<head><title></title></head>
<body><div class="iw_mail" dir="ltr">
<p>Hello:</p>
<p><br></p>
<p>I am using opensips 2.4.2, working with the rtpengine module trying to get stats per call leg.  I have tried using the $rtpstat(STAT)[index] function with to-tag/from-tag but it seems to only return the first called stat... with subsequent calls returning an empty string.</p>
<p><br></p>
<p><b><u>Example 1:</u></b></p>
<p><b>Script:</b></p>
<div>
<div>xlog("L_INFO", "Caller MOS-Avg: $(rtpstat(MOS-average)[$ft])");</div>
<div>xlog("L_INFO", "Caller MOS-Max: $(rtpstat(MOS-max)[$ft])");</div>
<div>xlog("L_INFO", "Caller MOS-Min: $(rtpstat(MOS-min)[$ft])");</div>
</div>
<div>xlog("L_INFO", "Callee MOS-Avg: $(rtpstat(MOS-average)[$tt])");</div>
<div>xlog("L_INFO", "Callee MOS-Max: $(rtpstat(MOS-max)[$tt])");</div>
<div>xlog("L_INFO", "Callee MOS-Min: $(rtpstat(MOS-min)[$tt])");</div>
<div><br></div>
<div><b>Output:</b></div>
<div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Caller MOS-Avg: 43</div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Caller MOS-Max:</div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Caller MOS-Min:</div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Callee MOS-Avg:</div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Callee MOS-Max:</div>
<div>Oct  2 10:39:08 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27058]: Callee MOS-Min:</div>
</div>
<div><br></div>
<div><b><u>Example 2:</u></b></div>
<div><b>Script:</b></div>
<div>
<div>xlog("L_INFO", "Callee MOS-Avg: $(rtpstat(MOS-average)[$tt])");</div>
<div>xlog("L_INFO", "Callee MOS-Max: $(rtpstat(MOS-max)[$tt])");</div>
<div>xlog("L_INFO", "Callee MOS-Min: $(rtpstat(MOS-min)[$tt])");</div>
<div>xlog("L_INFO", "Caller MOS-Avg: $(rtpstat(MOS-average)[$ft])");</div>
<div>xlog("L_INFO", "Caller MOS-Max: $(rtpstat(MOS-max)[$ft])");</div>
<div>xlog("L_INFO", "Caller MOS-Min: $(rtpstat(MOS-min)[$ft])");</div>
</div>
<div><br></div>
<div><b>Output:</b></div>
<div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Callee MOS-Avg: 42</div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Callee MOS-Max:</div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Callee MOS-Min:</div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Caller MOS-Avg:</div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Caller MOS-Max:</div>
<div>Oct  2 10:40:48 wahoo-osips3Core01 /usr/local/opensips_proxy/sbin/opensips[27172]: Caller MOS-Min:</div>
</div>
<div><br></div>
<p>Likewise, a call to $rtpquery after making a call to $rtpstat(STAT) results in an empty string.  I have also tried using $rtpquery to get call leg stats,  but am having a difficult time correlating to-tag/from-tag with the assigned SSRC.</p>
<p><br></p>
<p>Just listening on rtpengine's ng port, it appears that opensips is only sending one "<i>query"</i> command for the above examples.  Does opensips cache the 1st query or should it be sending 1 query per command?</p>
<p><br></p>
<p>Any help would be appreciated, and as always thanks for the help / time!</p>
<p><br></p>
<p>Thanks,</p>
<p>John</p>
</div></body>
</html>