<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello Michael<br>
      <br>
      I'm still a freeswitch newbie but i have to deal with a similar
      issue ( not yet implemented ) I believe that the proper solution
      is using a sip proxy like opensips but it seems difficult to
      implement.<br>
      <br>
      My idea is to detect if a particular extension is registered
      locally and try to transmit the call to the second server if the
      extensions is not registered<br>
      <br>
      I added something like this in the beginning of my domain dialplan
      on freeswitch1<br>
      <br>
      <tt>&lt;extension name="user_registered" continue="true"&gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp; &lt;condition &gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set"
        data="user_registered=${sofia_contact
        ${destination_number}@${domain_name}}" inline="true"/&gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp;&nbsp; &lt;action application="set"
        data="user_exists=${user_exists id ${destination_number}
        ${domain_name}}" inline="true"/&gt;</tt><tt><br>
      </tt><tt><br>
      </tt><tt>&nbsp;&nbsp; &lt;/condition&gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp; &lt;condition field="${user_exists}"
        expression="^true$" /&gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp; &lt;condition field="${user_registered}"
        expression="^error/user_not_registered$" &gt;</tt><tt><br>
      </tt><tt>&nbsp;&nbsp;&nbsp; &lt;action application="bridge"
        data="{sip_invite_to_uri=&lt;sip:${destination_number}@${domain_name}&gt;}sofia/internal/${<a class="moz-txt-link-abbreviated" href="mailto:destination_number}@freeswitch2.company.com">destination_number}@freeswitch2.company.com</a>"
        /&gt;</tt><tt><br>
      </tt><tt><br>
      </tt><tt>&nbsp;&nbsp;&nbsp; </tt><tt><br>
      </tt><tt>&nbsp;&nbsp; &lt;/condition&gt;</tt><tt><br>
      </tt><tt>&lt;/extension&gt;</tt><br>
      <br>
      <br>
      I added this the public dialplan on freeswitch2<br>
      <br>
      &lt;include&gt;<br>
      &lt;extension name="ha_transfert" continue="false"&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field="${sip_h_X-CallType}"
      expression="^ha_transfert$" &gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set"
      data="call_direction=inbound"/&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set"
      data="domain_name=${sip_to_host}"/&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="set"
      data="domain=${sip_to_host}"/&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="transfer"
      data="${sip_to_user} XML ${sip_to_host}" /&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
      <br>
      &lt;/extension&gt;<br>
      &lt;/include&gt;<br>
      <br>
      <br>
      Please note that my sample dialplan on freeswitch2 is not secure (
      hopefully not yet in production and a restrictive firewall ), you
      may interested by a topic between me and a freeswitch power user (
      not like me :-) )<br>
      <br>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115900.html">http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115900.html</a><br>
      <br>
      Please look the Sergey advice about dialplan security, i hope i
      will have the time to implement theses advises in a near future.<br>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115978.html">http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115978.html</a><br>
      <br>
      <br>
      <br>
      ~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      On 15/10/2015 08:56, Michael Nielsen wrote:<br>
    </div>
    <blockquote
cite="mid:CAKLKb5=tnJZ48Hgn4HTQTHpMCEL86ntLm8TYmz8xH-G250zjig@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hello everyone,<br>
                  <br>
                </div>
                I've got a FreeSWITCH installation and made my directory
                dynamically generated via LUA from a PostgreSQL
                database.<br>
              </div>
              <div>CDR's are also saved to a PostgreSQL.<br>
              </div>
              <div><br>
              </div>
              This makes my FreeSWITCH installation somewhat stateless I
              guess?<br>
              <br>
            </div>
            I would like to setup another FreeSWITCH and then having my
            domain "load-balance" via DNS between those two.<br>
            <br>
          </div>
          The DNS part I do know how to do.<br>
          <br>
        </div>
        Should I do more to my FreeSWITCH's for this to work? Or is this
        enough for everything, and can would they know if one subscriber
        is connected to one FS and another to the other FS etc.?<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services: 
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>