[Freeswitch-users] How to check user in directory
Yuriy Nasida
nasida at live.ru
Mon Sep 13 09:59:54 PDT 2010
Steve, I think, you not absolutely correctly have understood me or I have written not clearly =)
"Or mod_xml_cdr".
I have not understood why you mentioned about this module
"But regardless of the method, you'll still want to use sofia_contact at least to see if the user is currently registered."
FS can store the information on the registered users in a database through odbc.
http:// wiki.freeswitch.org/wiki/Using_ODBC_in_the_core
Thus, we can not use sofia_contact for definition the user is registered or not. Instead of sofia_contact we do simple check in our database of an operating script.
Such method is especially useful at work of several FS with a share database.
If you use sofia_contact, check the user is registered or not occurs particularly on it FS.
If check occurs in a shared database, we receive the information on that the user on one of our several FS is registered
Regards,
Nasida Yuriy
Date: Mon, 13 Sep 2010 15:05:11 +0100
From: steveayre at gmail.com
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to check user in directory
Or mod_xml_cdr. But regardless of the method, you'll still want to use sofia_contact at least to see if the user is currently registered.
There'll probably be lower overhead to static XML if you don't need your dialplan generated dynamically.
It doesn't matter what method is used to serve the user directory - user_exists and sofia_contact will work with them all.
-Steve
2010/9/12 Yuriy Nasida <nasida at live.ru>
I think it is better not to use the static xml config files (inside folders directiry\dialplan). Instead, use one of the available programming languages (e.g. lua) for realization realtime directory\dialplan. Thus you will be given all the information you want (user registered\exists or not) from a database by your management script.
for help
http://wiki.freeswitch.org/wiki/Mod_lua/Serving_Configuration
Regards,
Nasida Yuriy
Date: Fri, 10 Sep 2010 09:07:43 +0100
From: steveayre at gmail.com
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] How to check user in directory
Does user exist in user directory?
http://wiki.freeswitch.org/wiki/Mod_commands#user_exists
Is the user registered?
http://wiki.freeswitch.org/wiki/Function_sofia_contact
Quick example (untested but would probably work):
<!-- If the user doesn't exist, reject the call -->
<extension name="user_not_found">
<condition field="${user_exists(id ${destination_number} $${domain})}" expression="false">
<action application="hangup" data="UNALLOCATED_NUMBER" />
</condition>
</extension>
<!-- If the user is registered, forward the call to them -->
<extension name="user_registered">
<condition field="${sofia_contact(profile/${destination_number}@$${domain})}" expression="(.+)">
<action application="set" data="hangup_on_bridge=true" />
<action application="bridge" data="$1" />
</condition>
</extension>
<!-- If the bridge fails, or the user wasn't registered, fall back to voicemail -->
<extension name="voicemail">
<condition field="destination_number" expression=".*">
<action application="voicemail" data="profile $${domain} ${destination_number}" />
</condition>
</extension>
-Steve
On 10 September 2010 05:20, Boris Kovalenko <boris at tagnet.ru> wrote:
Hello!
I have a set of local users registered to freeswitch. So, when user
is not registered with switch I get USER_NOT_REGISTERED when route call
to it. But is there a way to know is user present in directory and not
registered, or even isn't in directory? I want to call voicemail in
first case and play 'invalid number' message in second. Is this possible?
--
Regards,
Boris
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users at lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users at lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100913/8d8a8e86/attachment-0001.html
More information about the FreeSWITCH-users
mailing list