Does user exist in user directory?<br><a href="http://wiki.freeswitch.org/wiki/Mod_commands#user_exists">http://wiki.freeswitch.org/wiki/Mod_commands#user_exists</a><br><br>Is the user registered?<br><a href="http://wiki.freeswitch.org/wiki/Function_sofia_contact">http://wiki.freeswitch.org/wiki/Function_sofia_contact</a><br>
<br>Quick example (untested but would probably work):<br><br>&lt;!-- If the user doesn&#39;t exist, reject the call --&gt;<br>&lt;extension name=&quot;user_not_found&quot;&gt;<br>
  &lt;condition field=&quot;${user_exists(id ${destination_number} $${domain})}&quot; expression=&quot;false&quot;&gt;<br>    &lt;action application=&quot;hangup&quot; data=&quot;<i>UNALLOCATED_NUMBER</i>&quot; /&gt;<br>

  &lt;/condition&gt;<br>
&lt;/extension&gt;<br>&lt;!-- If the user is registered, forward the call to them --&gt;<br>
&lt;extension name=&quot;user_registered&quot;&gt;<br>

  &lt;condition field=&quot;${sofia_contact(profile/${destination_number}@$${domain})}&quot; expression=&quot;(.+)&quot;&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;hangup_on_bridge=true&quot; /&gt;<br>    &lt;action application=&quot;bridge&quot; data=&quot;$1&quot; /&gt;<br>
  &lt;/condition&gt;<br>

&lt;/extension&gt;<br>&lt;!-- If the bridge fails, or the user wasn&#39;t registered, fall back to voicemail --&gt;<br>
&lt;extension name=&quot;voicemail&quot;&gt;<br>

  &lt;condition field=&quot;destination_number&quot; expression=&quot;.*&quot;&gt;<br>    &lt;action application=&quot;voicemail&quot; data=&quot;profile $${domain} ${destination_number}&quot; /&gt;<br>

  &lt;/condition&gt;<br>

&lt;/extension&gt;<br><br>-Steve<br><br><br><div class="gmail_quote">On 10 September 2010 05:20, Boris Kovalenko <span dir="ltr">&lt;<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
  Hello!<br>
<br>
     I have a set of local users registered to freeswitch. So, when user<br>
is not registered with switch I get USER_NOT_REGISTERED when route call<br>
to it. But is there a way to know is user present in directory and not<br>
registered, or even isn&#39;t in directory? I want to call voicemail in<br>
first case and play &#39;invalid number&#39; message in second. Is this possible?<br>
<br>
--<br>
Regards,<br>
Boris<br>
<br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>