<br />
Thanks for the information, I have explored the sofia_contact option and it is promising, but I am unsure of how to make it work in my dialplan.<br />
<br />
I think I need to elaborate on the indended behavior some more. A user will have three possible routes by which they can be reached. Two SIP accounts and a POTS number. Each user has three routes but only two devices, a desk phone and a cell phone. The cell phone is a target of the POTS number and is also one of the SIP clients. I am afraid I did not mention the desk phone initially, and I apologize for my question being incomplete.<br />
<br />
Given this setup I want to select one of these two dialplans:<br />
<br />
1. If SIP on cell phone is registered, ring &lt;DESK SIP&gt; &amp;&amp; &lt;CELL SIP&gt;.<br />
<br />
2. If SIP on cell is not registered, ring &lt;DESK SIP&gt; &amp;&amp; &lt;CELL POTS&gt;<br />
<br />
sofia_contact looks promising, however it returns a string indicating that a user is registered long after they have become unavailable. Example: User walks out of building and cell phone loses the Wifi connection. The SIP client did not un-register, it just went away. I have found that &quot;sofia check_sync&quot; will check all registrations and correctly identify clients that have gone off the network as no longer being registered.<br />
<br />
However, I cannot figure out how to run sofia_check sync before testing the output of sofia_contact in my dialplan, any thoughts on how to do this? Or is there a better way to get my above listed call routing to occur based on the availability of a SIP client?<br />
<br />
Also, I did investigate using continue_on_fail to check for hangup causes that did involve the SIP client being unreachable, but I could not make the above logic occur using only that setting. That is, I always want to ring &lt;DESK SIP&gt;, but only one of &lt;CELL POTS&gt; or &lt;CELL SIP&gt;, and never both simultaneously or in sequence.<br />
<br />
Might I need to go into a Lua script for this kind of logic?<br />
<br />
Thanks again for your responses!<br />
<br />
-- Thaddeus<br />
<br />
<br />
On Friday, May 4, 2012 12:34 PM CDT, Michael Collins &lt;msc@freeswitch.org&gt; wrote:<br />
<br />
<blockquote cite="CAKzWOxVYv_e3oPmyR+zwjv54zMK3shfQ6q5utXC9XBrwprKD3w@mail.gmail.com" type="cite">
        Hi Thaddeus,<br />
        <br />
        You definitely have several options here. While you could use the<br />
        sofia_contact API, I&#39;m wondering if perhaps you could let the dialplan and<br />
        the bridge app do the work for you.<br />
        <br />
        You could bridge directly to the Android user and then if it fails it could<br />
        then continue in the dialplan and ring the mobile number. This is covered<br />
        briefly on the wiki<http: implementing_failover="" wiki="" wiki.freeswitch.org="">,<br />
        however <shameless_plug>it is covered very nicely in the new FreeSWITCH<br />
        Cookbook</shameless_plug> in chapter 1.<br />
        <br />
        Try out the basic failover (pipe-separated list of endpoints) and if that<br />
        doesn&#39;t work let us know. Maybe you could hop on IRC and talk live with<br />
        other community members. Of course, it can&#39;t hurt to raise your karma by<br />
        getting the FreeSWITCH books. :) (See freeswitch.org, upper left corner.)<br />
        <br />
        Thanks,<br />
        Michael<br />
        <br />
        On Fri, May 4, 2012 at 10:10 AM, thaddeus@thogan.com <thaddeus@thogan.com>wrote:<br />
        <br />
        &gt; I was wondering if there is a way to tell if a SIP client is registered<br />
        &gt; with a dialplan condition? Or maybe a better way to accomplish the<br />
        &gt; following?:<br />
        &gt;<br />
        &gt; The users&#39; cell phones (Android) are running a SIP client and connect to<br />
        &gt; freeswitch via Wifi when in the office. I want calls destined for a given<br />
        &gt; user to ring only their extension if they are connected via SIP, and ring<br />
        &gt; only their mobile number when they are not connected.<br />
        &gt;<br />
        &gt; Currently I just take every incoming call and bridge it back out to their<br />
        &gt; mobile number, but 95% of the time these users are on the Wifi network, and<br />
        &gt; I could just pass the call to their phones via SIP.<br />
        &gt;<br />
        &gt; I have tested hunt groups but the callers hear ringing for far too long.<br />
        &gt; Ring groups don&#39;t work because it is confusing when the user simultaneously<br />
        &gt; receiving the same call via SIP and mobile on the same phone.<br />
        &gt;<br />
        &gt; Thanks in advance for any insights and help!<br />
        &gt;<br />
        &gt; -- Thaddeus<br />
        &gt; _________________________________________________________________________<br />
        &gt; Professional FreeSWITCH Consulting Services:<br />
        &gt; consulting@freeswitch.org<br />
        &gt; http://www.freeswitchsolutions.com<br />
        &gt;<br />
        &gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br />
        &gt; http://www.cudatel.com<br />
        &gt;<br />
        &gt; Official FreeSWITCH Sites<br />
        &gt; http://www.freeswitch.org<br />
        &gt; http://wiki.freeswitch.org<br />
        &gt; http://www.cluecon.com<br />
        &gt;<br />
        &gt; FreeSWITCH-users mailing list<br />
        &gt; FreeSWITCH-users@lists.freeswitch.org<br />
        &gt; http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br />
        &gt; UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br />
        &gt; http://www.freeswitch.org<br />
        &gt;<br />
        &gt;</thaddeus@thogan.com></http:></blockquote>
<br />
<br />