<div dir="ltr"><div><div>Now i am seeing other issue, My opensip is registered to up stream SIP provide Trunk using UAC but now if i call outside my Opensips sending INVITE to SIP Provide and SIP provider sending back 407 Proxy Auth challenge and and my Opensips sending ACK 200 to SIP provide and then Opensips sending 407 Auth proxy challenge to my SIP phone.. that is very strange..<br>
<br></div>How do i solve this problem? I want my Opensip behave like B2BU, i don&#39;t want it to be proxy so sending message from here to there..   Anyone have any suggestion or am i doing something wrong? following is my Senior. <br>
<br><br></div>[SIP_phone] -------------&gt;[Opensips]---------------&gt;[SIP Provider] <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 7:21 AM, Satish Patel <span dir="ltr">&lt;<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I think you got it right, thanks a lot. <br><br>Sent from my iPhone</div><div><div class="h5"><div>
<br>On Aug 22, 2014, at 5:02 AM, Răzvan Crainea &lt;<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>
  
    
  
  
    <div><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 cols="72">Răzvan Crainea
OpenSIPS Solutions
<a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre>
      On 08/21/2014 11:56 PM, Satish Patel wrote:<br>
    </div>
    <blockquote 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 &quot;uac_auth.so&quot;<br>
              loadmodule &quot;uac_registrant.so&quot;<br>
              modparam(&quot;uac_registrant&quot;, &quot;hash_size&quot;, 2)<br>
              modparam(&quot;uac_registrant&quot;, &quot;timer_interval&quot;, 100)<br>
              modparam(&quot;uac_registrant&quot;, &quot;db_url&quot;,
              &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)<br>
              modparam(&quot;uac_registrant&quot;, &quot;table_name&quot;, &quot;registrant&quot;)<br>
              <br>
              <br>
            </div>
            My Opensip successfully register on their Trunk<br>
            <br>
            # opensipsctl registrant dump<br>
            AOR:: <a href="mailto:sip:testtrunk@65.xxx.xxx.xxx:5065" target="_blank">sip:testtrunk@65.xxx.xxx.xxx:5065</a> expires=300<br>
                    state:: REGISTERED_STATE<br>
                    last_register_sent:: Fri Aug 22 02:18:14 2014<br>
                    registration_t_out:: Fri Aug 22 02:21:35 2014<br>
                    registrar:: sip:65.xxx.xxx.xxx.xxx:5065<br>
                    binding:: <a href="mailto:sip:testtrunk@65.xxx.xxx.xxx:5065" target="_blank">sip:testtrunk@65.xxx.xxx.xxx:5065</a><br>
                    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>
           # account only INVITEs<br>
                  if (is_method(&quot;INVITE&quot;)) {<br>
          <br>
                          setflag(ACC_DO); # do accounting<br>
                          $avp(can_uri) = $ru;<br>
                       <br>
                                };<br>
          <br>
                  }<br>
                  # PSTN Testing<br>
                  if  ( uri=~<a href="mailto:%5Esip:16465352727@.*" target="_blank">&quot;^sip:16465352727@.*&quot;</a>) {<br>
                  route(3);<br>
                  exit;<br>
                  };<br>
          <br>
          ...<br>
          ...<br>
        </div>
        route[3] {<br>
        <br>
        if (method==&quot;INVITE&quot;)<br>
         {<br>
          if (uri=~<a href="mailto:%5Esip:16465352727@.*" target="_blank">&quot;^sip:16465352727@.*&quot;</a>) {<br>
        <br>
                rewritehostport(&quot;65.xxx.xxx.xxx:5065&quot;);<br>
                xlog(&quot;Redirecting to SIP Provider.. $ru\n&quot;);<br>
            exit;<br>
          };<br>
        };<br>
        }<br>
        <br>
        <div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">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" target="_blank">Users@lists.opensips.org</a></span><br>
<span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></span><br></div></blockquote></div></div></div></blockquote></div><br></div>