<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I think you got it right, thanks a lot.&nbsp;<br><br>Sent from my iPhone</div><div><br>On Aug 22, 2014, at 5:02 AM, Răzvan Crainea &lt;<a href="mailto:razvan@opensips.org">razvan@opensips.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>
  
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  
  
    <div class="moz-cite-prefix"><tt>Hi, Satish!</tt><tt><br>
      </tt><tt><br>
      </tt><tt>The problem is that in your route[3] you are not relaying
        the request. You just change the URI and exit. You should call
        t_relay() just before the exit statement.<br>
      </tt><tt></tt><tt><br>
      </tt><tt>Best regards,</tt><br>
      <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
      On 08/21/2014 11:56 PM, Satish Patel wrote:<br>
    </div>
    <blockquote cite="mid:CAPgF-fq-tj-Gpu_sa+VZ4me4dvsRRQWxuiYCrObiUn0RL9YrNQ@mail.gmail.com" type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>We have opensip running with multidomain
                  authentication, now we have purchases SIP trunk from
                  provide to send call to put side country (PSTN)<br>
                  <br>
                </div>
                They gave me Username/Password and IP address of their
                SIP server<br>
                <br>
              </div>
              I have did following configuration to configure my opensip
              as UAC<br>
              <br>
              #### Opensips UAC<br>
              loadmodule "uac_auth.so"<br>
              loadmodule "uac_registrant.so"<br>
              modparam("uac_registrant", "hash_size", 2)<br>
              modparam("uac_registrant", "timer_interval", 100)<br>
              modparam("uac_registrant", "db_url",
              "mysql://opensips:opensipsrw@localhost/opensips")<br>
              modparam("uac_registrant", "table_name", "registrant")<br>
              <br>
              <br>
            </div>
            My Opensip successfully register on their Trunk<br>
            <br>
            # opensipsctl registrant dump<br>
            AOR:: <a class="moz-txt-link-abbreviated" href="mailto:sip:testtrunk@65.xxx.xxx.xxx:5065">sip:testtrunk@65.xxx.xxx.xxx:5065</a> expires=300<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; state:: REGISTERED_STATE<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last_register_sent:: Fri Aug 22 02:18:14 2014<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; registration_t_out:: Fri Aug 22 02:21:35 2014<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; registrar:: sip:65.xxx.xxx.xxx.xxx:5065<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; binding:: <a class="moz-txt-link-abbreviated" href="mailto:sip:testtrunk@65.xxx.xxx.xxx:5065">sip:testtrunk@65.xxx.xxx.xxx:5065</a><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dst_IP:: IPv4 ip=xxx.xxx.xxx.xxx<br>
            <br>
            <br>
          </div>
          Now big question is how do i use this trunk in my routing
          script, After google i came up with following configuration
          but it is not working, It is not rewriting host part. <br>
          <br>
          &nbsp;# account only INVITEs<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (is_method("INVITE")) {<br>
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(ACC_DO); # do accounting<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $avp(can_uri) = $ru;<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # PSTN Testing<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if&nbsp; ( uri=~<a class="moz-txt-link-rfc2396E" href="mailto:^sip:16465352727@.*">"^sip:16465352727@.*"</a>) {<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(3);<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
          <br>
          ...<br>
          ...<br>
        </div>
        route[3] {<br>
        <br>
        if (method=="INVITE")<br>
        &nbsp;{<br>
        &nbsp; if (uri=~<a class="moz-txt-link-rfc2396E" href="mailto:^sip:16465352727@.*">"^sip:16465352727@.*"</a>) {<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rewritehostport("65.xxx.xxx.xxx:5065");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("Redirecting to SIP Provider.. $ru\n");<br>
        &nbsp;&nbsp;&nbsp; exit;<br>
        &nbsp; };<br>
        };<br>
        }<br>
        <br>
        <div>
          <div><br>
          </div>
        </div>
      </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>
  

</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></span><br><span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></span><br></div></blockquote></body></html>