<div dir="ltr">Hi Bogdan<div><br></div><div style>Thanks for the suggestion. If I understand you right, I should have rule to try the subscriber locally first before sending it to the LB.</div><div style>I&#39;ll try and figure it out. I&#39;m still trying to wrap my head around the routing concept in Opensips, coming from Asterisk diaplan syntax background.</div>

<div style><br></div><div style>Regards</div><div style>Stephen</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 11:18 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div text="#000000" bgcolor="#ffffff">
    Hello Stephen,<br>
    <br>
    When receiving a call in opensips you need (by looking at the dialed
    number) to make difference between subscribers (extensions) and call
    to be sent to LB. Can you do that ?<br>
    <br>
    Regards,<br>
    <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre><div><div class="h5">
    <br>
    On 06/28/2013 09:36 AM, Stephen Vigus wrote:
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hi guys
        <div><br>
        </div>
        <div>First time posting to the list.</div>
        <div><br>
        </div>
        <div>I am investigating the use of Opensips to load
          balance between Asterisk boxes. I have a running testing
          environment, where Opensips successfully load balances between
          the Asterisk boxes. However, after a few days of reading and
          struggling, I came to a dead end with a specific test.</div>
        <div><br>
        </div>
        <div>I have my extensions registered to Opensips and
          want them to be able to phone each other, but I cannot seem to
          get this working. Every time I attempt to dial another
          extension, I see the dialplan triggered on one of the Asterisk
          boxes and then it fails.</div>
        <div>Calls coming in over a trunk are load balanced
          fine and reaches an IVR I configured on both Asterisk boxes.</div>
        <div><br>
        </div>
        <div>What am I missing or doing wrong?</div>
        <div><br>
        </div>
        <div>
          Below are my routing in opensips.cfg:</div>
        <div>
          <div>route{</div>
          <div><br>
          </div>
          <div>        if (!mf_process_maxfwd_header(&quot;10&quot;)) {</div>
          <div>                sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</div>
          <div>                exit;</div>
          <div>        }</div>
          <div><br>
          </div>
          <div>        if (!has_totag()) {</div>
          <div>                # initial request</div>
          <div>                record_route();</div>
          <div>        }</div>
          <div>        else {</div>
          <div>                # sequential request - obey the indicated
            route</div>
          <div>                lookup(&quot;location&quot;);</div>
          <div>                loose_route();</div>
          <div>                t_relay();</div>
          <div>                exit;</div>
          <div>        }</div>
          <div><br>
          </div>
          <div>        # handle cancel and re-transmissions</div>
          <div>        if ( is_method(&quot;CANCEL&quot;) ) {</div>
          <div>                if ( t_check_trans() )</div>
          <div>                        t_relay();</div>
          <div>                exit;</div>
          <div>        }</div>
          <div><br>
          </div>
          <div>       # record routing</div>
          <div>        if (!is_method(&quot;REGISTER|MESSAGE&quot;))</div>
          <div>                record_route();</div>
          <div><br>
          </div>
          <div>       if (is_method(&quot;REGISTER&quot;))</div>
          <div>        {</div>
          <div>                if (!save(&quot;location&quot;))</div>
          <div>                        sl_reply_error();</div>
          <div>                exit;</div>
          <div>
                    }</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>        # from now on we have only the initial requests</div>
          <div><br>
          </div>
          <div>        # select the node that&#39;ll handle the call (load
            balanced)</div>
          <div>        # the method used is different for
            invite/register requests</div>
          <div>        # unknown methods are rejected here</div>
          <div>        if (is_method(&quot;INVITE&quot;)) {</div>
          <div>                if (!load_balance(&quot;1&quot;,&quot;pstn&quot;,&quot;1&quot;)) {</div>
          <div>                        send_reply(&quot;503&quot;,&quot;Service
            Unavailable&quot;);</div>
          <div>                        exit;</div>
          <div>                }</div>
          <div>        }</div>
          <div><br>
          </div>
          <div>        else {</div>
          <div>                send_reply(&quot;405&quot;,&quot;Method Not Allowed&quot;);</div>
          <div>                exit;</div>
          <div>        }</div>
          <div><br>
          </div>
          <div>        # route the request</div>
          <div>        if (!t_relay()) {</div>
          <div>                sl_reply_error();</div>
          <div>        }</div>
          <div>}</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>
            Please excuse me if this comes off as daft, this week was my
            first look into Opensips.</div>
          <div><br>
          </div>
          <div>Regards</div>
          <div>Stephen</div>
        </div>
      </div>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
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>
  </div>

</blockquote></div><br></div>