<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span><div><span>Thanks for quick reply,</span></div><div style="background-color: transparent; "><br></div><div style="background-color: transparent; ">Can you please suggest me, if there are any alternatives to get rtp/rtcp stream for each call. I actually need to parse the RTCPs passing from media-proxy and just implement my custom logic to store them in DB.</div><div>&nbsp;</div><div><br></div><div>Muhammad Faheem</div></span></div><div>&nbsp;</div><div><div><br></div></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Saúl Ibarra Corretgé &lt;saul@ag-projects.com&gt;<br> <b><span
 style="font-weight: bold;">To:</span></b> OpenSIPS users mailling list &lt;users@lists.opensips.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, September 13, 2012 3:47 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] Mediaproxy customization<br> </font> </div> <br>
<br>On Sep 13, 2012, at 12:37 PM, Faheem wrote:<br><br>&gt; <br>&gt; Hi, <br>&gt; I'm trying to develop a QoS tool with the help of mediaproxy module and RTCP Packets.<br>&gt; I did a hook in the mediaproxy code in <a target="_blank" href="http://mediacontrol.py/">mediacontrol.py</a> file. <br>&gt; When I try to print the "RTCP" packets, I am getting exceptions.<br>&gt; <br>&gt; #mediacontrol.py <br>&gt;&nbsp; &nbsp;  def got_data(self, host, port, data):&nbsp; # standard function of mediaproxy ..<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  if ((port % 2) == 1):<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  log.debug("Got RTCP from %s:%d" % (host, port))<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  try:<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log.debug("RTCP Stream") <br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log.debug("RTCP Stream Length %i" % len(data))<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log.debug("RTCP Data %s" % data
 )&nbsp;  #exception come here....<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  except TypeError:<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  log.debug("Exception in accesing rtcp data variable")<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  pass<br>&gt; <br>&gt; The above red line code throws exception.<br>&gt; Can any one please help me over it?<br>&gt; <br><br>MediaProxy will insert a conntrack rule as soon as it receives a single RTP packet from each side, so the got_data function will be called a couple of times and never again (unless there are changes in the stream that require destroying the conntrack rule).<br><br>You will not get the RTCP packets in your hook as they will be handled by the kernel.<br><br><br>Regards,<br><br>--<br>Saúl Ibarra Corretgé<br>AG Projects<br><br><br><br><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opensips.org"
 href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br><br><br> </div> </div>  </div></body></html>