<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <span id="result_box" class="" lang="en"><span class="hps">Here is
        an example</span> <span class="hps atn">CFG-</span><span
        class="">file that</span> <span class="hps">works now</span><span
        class="">:</span> <br class="">
      <span class="hps">The message</span> <span class="hps atn">"</span><span
        class="">183</span><span class="">"</span> <span class="hps">prefix
        and</span> <span class="hps">visible</span> <span class="hps">IP</span>
      <span class="hps">gateway.</span> <span class="hps">And that
        could</span> <span class="hps">be a threat</span> <span
        class="hps">of fraud</span><span class="">.</span> <br class="">
      <span class="hps">Here:</span> <span class="hps">if you use the</span>
      <span class="hps">function</span> <span class="hps">topology_hiding
        ();</span> <span class="hps">it</span> <span class="hps">does
        not happen</span> <span class="hps">a fair exchange</span><span
        class="">:</span> <br class="">
      <span class="hps"></span></span><span id="result_box" class=""
      lang="en"><span class="hps">"BYE"</span> <span class="hps">comes</span>
      <span class="hps">to the message</span> <span class="hps">"404</span><span
        class="">", "Not here"</span> <span class="hps atn">rather than
        "</span><span class="">200</span> <span class="hps">OK"</span>
      <br class="">
      <span class="hps">I use</span> <span class="hps">client_nat_test</span>
      <span class="hps">to</span> <span class="hps">cut off</span> <span
        class="hps">all requests for</span> <span class="hps">registration</span>
      <span class="hps">are NAT</span><span class=""></span></span><span
      id="result_box" class="" lang="en"><span class=""><span
          id="result_box" class="" lang="en"><span class="">, but</span>
          <span class="hps">it does not work</span></span>!<br>
        <br>
        <br>
      </span></span>port=5060<br>
    listen=udp:85.85.85.85:5060 #Opensips-server<br>
    route{<br>
    if (has_totag()) {<br>
        if (loose_route()) {<br>
        if (is_method("BYE")) {<br>
        setflag(1);<br>
        setflag(3);}<br>
        else if (is_method("INVITE")) {<br>
        #topology_hiding();<br>
        record_route();    }<br>
        route(1);}<br>
        else {<br>
        if ( is_method("ACK") ) {<br>
        if ( t_check_trans() ) {<br>
        t_relay();<br>
        exit;}<br>
        else {<br>
        exit;<br>
        }}<br>
        sl_send_reply("404","Not here");<br>
        }<br>
        exit;<br>
    }<br>
    <br>
    #initial requests<br>
    if (is_method("CANCEL")){<br>
    if (t_check_trans())<br>
    t_relay();<br>
    exit;}<br>
    <br>
    t_check_trans();<br>
    <br>
    # authenticate if from local subscriber (uncomment to enable auth)<br>
    # authenticate all initial non-REGISTER request that pretend to be<br>
    # generated by local subscriber (domain from FROM URI is local)<br>
    <br>
    if (!(method=="REGISTER") &amp;&amp; from_uri==myself) #/*no
    multidomain version*/<br>
    {if (!proxy_authorize("", "subscriber")) <br>
    {proxy_challenge("", "0");<br>
    exit;}<br>
    if (!db_check_from()) <br>
    {sl_send_reply("403","Forbidden auth ID");<br>
    exit;}<br>
    consume_credentials();<br>
    }<br>
    <br>
    # preloaded route checking<br>
    if (loose_route()) <br>
    {xlog("L_ERR","Attempt to route with preloaded Route's
    [$fu/$tu/$ru/$ci]");<br>
    if (!is_method("ACK"))    sl_send_reply("403","Preload Route
    denied");<br>
    exit;<br>
    }<br>
    <br>
    # record routing<br>
    if (!is_method("REGISTER|MESSAGE")) record_route();<br>
    <br>
    # account only INVITEs    if (is_method("INVITE"))<br>
    {<br>
    # if (!src_ip=="85.85.85.11") #CISCO MGW IP<br>
    #{<br>
    #        topology_hiding();<br>
    #        }<br>
    setflag(1); # do accounting<br>
    }<br>
    <br>
    if (!uri==myself)    ## replace with following line if multi-domain
    support is used<br>
    {<br>
    route(1);}<br>
    <br>
    # requests for my domain<br>
    if (is_method("PUBLISH")){<br>
    sl_send_reply("503", "Service Unavailable");<br>
    exit;}<br>
    <br>
    if (is_method("REGISTER")){<br>
    #        if(client_nat_test("3"))<br>
    #        {<br>
    #            sl_send_reply("403", "Not working NAT");<br>
    #            exit;<br>
    #        }<br>
    <br>
    # authenticate the REGISTER requests (uncomment to enable auth)<br>
    if (!www_authorize("", "subscriber"))    {<br>
    www_challenge("", "0");<br>
    exit;}<br>
    if (!db_check_to()) {<br>
    sl_send_reply("403","Forbidden auth ID");<br>
    exit;}<br>
    if (!save("location"))<br>
    sl_reply_error();<br>
    exit;<br>
    }<br>
    <br>
    if ($rU==NULL) {<br>
    # request with no Username in RURI<br>
    sl_send_reply("484","Address Incomplete");<br>
    exit;<br>
    }<br>
    <br>
    # do lookup with method filtering<br>
    if ((src_ip=="85.85.85.11") &amp;&amp; (!lookup("location")))<br>
    {<br>
    switch ($retcode) {<br>
    case -1:<br>
    case -3:<br>
    t_newtran();<br>
    t_reply("404", "Not Found");<br>
    exit;<br>
    case -2:<br>
    sl_send_reply("405", "Method Not Allowed");<br>
    exit;<br>
    }}<br>
    <br>
    # when routing via usrloc, log the missed calls also<br>
    setflag(2);<br>
    <br>
    if (src_ip=="85.85.85.11") {<br>
    route(1);}<br>
    route(3);<br>
    }<br>
    <br>
    route[1] {<br>
    # for INVITEs enable some additional helper routes<br>
    if (is_method("INVITE")) {<br>
    t_on_branch("2");<br>
    t_on_reply("2");<br>
    t_on_failure("1");}<br>
    if (!t_relay()) {<br>
    sl_reply_error();};<br>
    exit;}<br>
    ####################################################<br>
    route[3] {<br>
    prefix("9999");<br>
    rewritehostport("85.85.85.11:5060");<br>
    if (!t_relay()) {<br>
    sl_reply_error();<br>
    };exit;<br>
    }<br>
    ####################################################<br>
    branch_route[2] { xlog("new branch at $ru\n");}<br>
    onreply_route[2] { xlog("incoming reply\n"); }<br>
    <br>
    failure_route[1] {<br>
    if (t_was_cancelled()) {exit;}}<br>
    <br>
    <br>
    <div class="moz-cite-prefix">27.02.2014 9:09,
      pavel@................:<br>
    </div>
    <blockquote
cite="mid:CAF3UBt2v7RFJhY4aQHdePmb4BnOh7Ba-FJJd7YD-JPoU9++p5Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Ok, i try to post some config lines today.</div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2014-02-27 11:05 GMT+06:00 LAVer:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">not yet.
            Has not yet received ...<br>
            27.02.2014 6:57, pavel@.... :
            <div class="im HOEnZb"><br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                Did you get answer or example?<br>
              </blockquote>
              <br>
              <br>
              <br>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                _______________________________________________<br>
                Users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>