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><!-- If the user doesn't exist, reject the call --><br><extension name="user_not_found"><br>
<condition field="${user_exists(id ${destination_number} $${domain})}" expression="false"><br> <action application="hangup" data="<i>UNALLOCATED_NUMBER</i>" /><br>
</condition><br>
</extension><br><!-- If the user is registered, forward the call to them --><br>
<extension name="user_registered"><br>
<condition field="${sofia_contact(profile/${destination_number}@$${domain})}" expression="(.+)"><br> <action application="set" data="hangup_on_bridge=true" /><br> <action application="bridge" data="$1" /><br>
</condition><br>
</extension><br><!-- If the bridge fails, or the user wasn't registered, fall back to voicemail --><br>
<extension name="voicemail"><br>
<condition field="destination_number" expression=".*"><br> <action application="voicemail" data="profile $${domain} ${destination_number}" /><br>
</condition><br>
</extension><br><br>-Steve<br><br><br><div class="gmail_quote">On 10 September 2010 05:20, Boris Kovalenko <span dir="ltr"><<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>></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't in directory? I want to call voicemail in<br>
first case and play 'invalid number' 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>