[Freeswitch-users] How to check user in directory
Steven Ayre
steveayre at gmail.com
Mon Sep 13 07:05:11 PDT 2010
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100913/ad11c07b/attachment.html
More information about the FreeSWITCH-users
mailing list