<div dir="ltr"><div dir="ltr">Thanks for sharing the script! Always helps avoid <a href="https://xkcd.com/979/">https://xkcd.com/979/</a></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 25 Sep 2018 at 15:44, Bipin Patel <<a href="mailto:bipin@xbipin.com">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>
        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="m_-27642126696168407moz-signature">
      Regards,<br>
      Bipin<br>
      <br>
      <br>
      <hr>
    </div>
    <div class="m_-27642126696168407moz-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="m_-27642126696168407moz-txt-link-rfc2396E" href="mailto:steveayre@gmail.com" target="_blank"><steveayre@gmail.com></a><br>
      To: FreeSWITCH Users Help
      <a class="m_-27642126696168407moz-txt-link-rfc2396E" href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank"><freeswitch-users@lists.freeswitch.org></a><br>
      Date: 9/24/2018, 4:19:20 PM<br>
    </div>
    <blockquote type="cite">
      
      <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" target="_blank">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_-27642126696168407m_4869643355333508590moz-signature">-- <br>
              Regards,<br>
              Bipin<br>
              <br>
              <br>
            </div>
          </div>
_________________________________________________________________________<br>
          Professional FreeSWITCH Services<br>
          <a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
          <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
          <br>
          Official FreeSWITCH Sites<br>
          <a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
          <a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
          <a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
          <br>
          FreeSWITCH-users mailing list<br>
          <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
          <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">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">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
          <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote>
      </div>
      <br>
      <fieldset class="m_-27642126696168407mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_________________________________________________________________________
Professional FreeSWITCH Services
<a class="m_-27642126696168407moz-txt-link-abbreviated" href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a>
<a class="m_-27642126696168407moz-txt-link-freetext" href="https://freeswitch.com" target="_blank">https://freeswitch.com</a>

Official FreeSWITCH Sites
<a class="m_-27642126696168407moz-txt-link-freetext" href="https://freeswitch.com/oss" target="_blank">https://freeswitch.com/oss</a>
<a class="m_-27642126696168407moz-txt-link-freetext" href="https://freeswitch.org/confluence" target="_blank">https://freeswitch.org/confluence</a>
<a class="m_-27642126696168407moz-txt-link-freetext" href="https://cluecon.com" target="_blank">https://cluecon.com</a>

FreeSWITCH-users mailing list
<a class="m_-27642126696168407moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="m_-27642126696168407moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="m_-27642126696168407moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="m_-27642126696168407moz-txt-link-freetext" href="https://freeswitch.com" target="_blank">https://freeswitch.com</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div>