How to check user in directory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to check user in directory

Boris Kovalenko
  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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Steven Ayre
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 <[hidden email]> 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
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Yuriy Nasida
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: [hidden email]
To: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Steven Ayre
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 <[hidden email]>
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: [hidden email]
To: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Yuriy Nasida
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: [hidden email]
To: [hidden email]
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 <[hidden email]>
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: [hidden email]
To: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
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 [hidden email] 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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Phillip Jones-2
mod_xml_curl - I think Steve meant to say.

2010/9/13 Yuriy Nasida <[hidden email]>
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: [hidden email]
To: [hidden email]
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 <[hidden email]>
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: [hidden email]
To: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
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 [hidden email] 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
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: How to check user in directory

Steven Ayre
In reply to this post by Yuriy Nasida
I meant to say mod_xml_curl - Sorry, been working with _cdr a lot today so when I thought curl I typed cdr. :)

Steve on iPhone

On 13 Sep 2010, at 17:59, Yuriy Nasida <[hidden email]> wrote:

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: [hidden email]
To: [hidden email]
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 <[hidden email]>
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: [hidden email]
To: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
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 [hidden email] 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
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org