<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="-1"><font face="Arial">hi,<br>
        <br>
        after day of readings docs etc i wasnt able to find anything
        useful so ended up writing a lua script (first time working with
        lua), i had figured by then there was no other way without
        writing a script.<br>
        <br>
        below is the script if it helps any1 else, its not perfect but
        works. I pass the calling party's username and his contact
        ip:port <br>
        <br>
        function string:split(delimiter)<br>
            local result = { }<br>
            local from = 1<br>
            local delim_from, delim_to = string.find( self, delimiter,
        from )<br>
            while delim_from do<br>
                table.insert( result, string.sub( self, from ,
        delim_from-1 ) )<br>
                from = delim_to + 1<br>
                delim_from, delim_to = string.find( self, delimiter,
        from )<br>
            end<br>
            table.insert( result, string.sub( self, from ) )<br>
            return result<br>
        end<br>
        <br>
        function isempty(s)<br>
            return s == nil or s == ''<br>
        end<br>
        <br>
        vps_id = argv[1]<br>
        vps_ip = argv[2]<br>
        check_ip = vps_ip:match("(%d+%.%d+%.%d+%.%d+%:%d+)")<br>
        api = freeswitch.API();<br>
        result = api:execute("sofia_contact",vps_id);<br>
        if (result == "error/user_not_registered") then<br>
            session:execute("bridge","error/user_not_registered");<br>
        else<br>
            t = {}<br>
            array_list = string.split(result,",")<br>
            if (#(array_list) > 1) then<br>
                for x,y in pairs(array_list) do<br>
                    if isempty(string.find(y,check_ip)) then<br>
                        t[#t+1] = tostring(y)<br>
                    end<br>
                end<br>
                out_myvar = table.concat(t,",")<br>
            else<br>
                for x,y in pairs(array_list) do<br>
                    if isempty(string.find(y,check_ip)) then<br>
                        out_myvar = tostring(y)<br>
                    end<br>
                end<br>
            end<br>
            if isempty(out_myvar) then<br>
                session:execute("bridge","error/user_not_registered");<br>
            else<br>
                session:execute("bridge", out_myvar);<br>
            end<br>
        end<br>
        <br>
        <br>
      </font></font>
    <div class="moz-signature">
      <style>
body {
  font-family: Verdana, sans-serif;
  font-size: 0.8em;
  color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; }
p.footr { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
hr {
  width: 100%;
  height: 1px;
  background: #ccc;
  border: 0;
}
</style>Regards,<br>
      Bipin<br>
      <br>
      <br>
      <hr>
    </div>
    <div class="moz-cite-prefix">-------- Original Message --------<br>
      Subject: Re: [Freeswitch-users] ring all devices other than self
      with registration id as same<br>
      From: Steven Ayre <a class="moz-txt-link-rfc2396E" href="mailto:steveayre@gmail.com"><steveayre@gmail.com></a><br>
      To: FreeSWITCH Users Help
      <a class="moz-txt-link-rfc2396E" href="mailto:freeswitch-users@lists.freeswitch.org"><freeswitch-users@lists.freeswitch.org></a><br>
      Date: 9/24/2018, 4:19:20 PM<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFiqYunUVx5Hmy-PewocFDmOU_NMbxEdidjmm-i970t7U1ByQw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">You could write and call a script that calls
        sofia_contact and filters out their device.</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Wed, 19 Sep 2018 at 21:49, Bipin Patel <<a
            href="mailto:bipin@xbipin.com" moz-do-not-send="true">bipin@xbipin.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"> <font size="-1"><font
                face="Arial">hi,<br>
                <br>
                i have a client registered to FS using same id on 2
                devices and i created a dialplan entry such that if he
                calls 000 then it can ring all devices registered with
                same id, problem is the call also comes to himself on
                the device he calls 000 from, is there a way to ring all
                other devices registered other than his (multiple
                registration is enabled on profile)<br>
                <br>
                the bridge statement im using is as below currently
                where 5656 is his registered userid<br>
                <br>
                <action application="bridge"
                data="${sofia_contact(5656)}"/><br>
                <br>
                <br>
              </font></font>
            <div class="m_4869643355333508590moz-signature">-- <br>
              Regards,<br>
              Bipin<br>
              <br>
              <br>
            </div>
          </div>
_________________________________________________________________________<br>
          Professional FreeSWITCH Services<br>
          <a href="mailto:sales@freeswitch.com" target="_blank"
            moz-do-not-send="true">sales@freeswitch.com</a><br>
          <a href="https://freeswitch.com" rel="noreferrer"
            target="_blank" moz-do-not-send="true">https://freeswitch.com</a><br>
          <br>
          Official FreeSWITCH Sites<br>
          <a href="https://freeswitch.com/oss" rel="noreferrer"
            target="_blank" moz-do-not-send="true">https://freeswitch.com/oss</a><br>
          <a href="https://freeswitch.org/confluence" rel="noreferrer"
            target="_blank" moz-do-not-send="true">https://freeswitch.org/confluence</a><br>
          <a href="https://cluecon.com" rel="noreferrer" target="_blank"
            moz-do-not-send="true">https://cluecon.com</a><br>
          <br>
          FreeSWITCH-users mailing list<br>
          <a href="mailto:FreeSWITCH-users@lists.freeswitch.org"
            target="_blank" moz-do-not-send="true">FreeSWITCH-users@lists.freeswitch.org</a><br>
          <a
            href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
          UNSUBSCRIBE:<a
            href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
          <a href="https://freeswitch.com" rel="noreferrer"
            target="_blank" moz-do-not-send="true">https://freeswitch.com</a></blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Services
<a class="moz-txt-link-abbreviated" href="mailto:sales@freeswitch.com">sales@freeswitch.com</a>
<a class="moz-txt-link-freetext" href="https://freeswitch.com">https://freeswitch.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="https://freeswitch.com/oss">https://freeswitch.com/oss</a>
<a class="moz-txt-link-freetext" href="https://freeswitch.org/confluence">https://freeswitch.org/confluence</a>
<a class="moz-txt-link-freetext" href="https://cluecon.com">https://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="https://freeswitch.com">https://freeswitch.com</a></pre>
    </blockquote>
    <br>
  </body>
</html>