<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <br>
    On 12/23/11 12:58 PM, Arif Tuhin wrote:
    <blockquote cite="mid:COL104-W47C39BAFC5E8E8A731419CAEAB0@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
      <div dir="ltr">
        Hi,<br>
        I'm using the new kamailio 3.2 which has some changes in
        rtpproxy module. And i'm finding it hard to implement a certain
        configuration.<br>
        &nbsp;<br>
        Because of our network infrastructure i have to repackage rtp
        streams in one direction. Now in kamailio 3.1.5 i used to do
        this in this way:<br>
        <strong>In main route</strong><br>
        route[RTPPROXY]{<br>
        if(is_method("BYE"){<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unforce_rtp_proxy();<br>
        else if(is_method("INVITE")){<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; force_rtp_proxy();<br>
        }<br>
        <strong>in onreply_route</strong><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; force_rtp_proxy("z160");<br>
        &nbsp;<br>
        Now in kamailio 3.2 the <strong>force_rtp_proxy()</strong> is
        replaced by <strong>rtpproxy_manage(). </strong>Here the
        script reads like:<br>
        <strong>main route</strong><br>
        route[NATMANAGE] {<br>
        #!ifdef WITH_NAT<br>
        &nbsp;if (is_request()) {<br>
        &nbsp;&nbsp;if(has_totag()) {<br>
        &nbsp;&nbsp;&nbsp;if(check_route_param("nat=yes")) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;setbflag(FLB_NATB);<br>
        &nbsp;&nbsp;&nbsp;}<br>
        &nbsp;&nbsp;}<br>
        &nbsp;}<br>
        &nbsp;if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))<br>
        &nbsp;&nbsp;return;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rtpproxy_manage("z150");<br>
        &nbsp;if (is_request()) {<br>
        &nbsp;&nbsp;if (!has_totag()) {<br>
        &nbsp;&nbsp;&nbsp;add_rr_param(";nat=yes");<br>
        &nbsp;&nbsp;}<br>
        &nbsp;}<br>
        &nbsp;if (is_reply()) {<br>
        &nbsp;&nbsp;if(isbflagset(FLB_NATB)) {<br>
        &nbsp;&nbsp;&nbsp;fix_nated_contact();<br>
        &nbsp;&nbsp;}<br>
        &nbsp;}<br>
        #!endif<br>
        &nbsp;return;<br>
        <br>
        <strong>onreply_route</strong><br>
        this block is called route[NATMANAGE]. <br>
        &nbsp;<br>
        Now if i put rtpproxy_manage("z150"), it tries to repackage in
        both direction which i do not want. So i need to write a
        separate block for onreply_route instead of calling
        route[NATMANAGE]. <br>
        So please help me to write a block for onreply_route.<br>
        Thanks in advance.
      </div>
    </blockquote>
    just copy&amp;paste route[NATMANGE] to a new name like
    route[NATMANGEREPLY], update it to fit your needs and call it from
    the reply route.<br>
    <br>
    Also, as you can see, there is an is_reply() function that you can
    use in route[NATMANGE] to make an IF condition around
    rtpproxy_mange() function to call it with different parameters.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>