Module sipuserdb

YXA user database.

Introduced in: 30 Sep 2003 by Fredrik Thulin <ft@it.su.se>

Authors: Fredrik Thulin (ft@it.su.se).

Description

YXA user database. Implemented to be easy to extend with new backend modules. Which backends we use is managed through configuration (parameter 'userdb_modules'). We query the backends in the specified order and stop when a module returns something other than 'nomatch' or 'error', or there are no more backends to query.

Function Index

get_addresses_for_user/1 Get all possible addresses of a user.
get_addresses_for_users/1 Iterate over a list of users, return all their addresses without duplicates.
get_classes_for_user/1 Return a list of classes for this Username.
get_forward_for_user/1 Return the forward entry for a user.
get_forwards_for_users/1 Return a list of forwards for this user.
get_password_for_user/1 Returns the password for a user.
get_telephonenumber_for_user/1 Return the telephone number for a user.
get_user_with_address/1 Looks up exactly one user with an Address.
get_users_for_address_of_record/1 Get all usernames of users matching an address.
get_users_for_addresses_of_record/1 Iterate over a list of addresses of record, return all users matching one or more of the addresses, without duplicates.
get_users_for_url/1 Given an URL that is typically the Request-URI of an incoming request, make a list of implicit user addresses and return a list of all users matching any of these addresses.

Function Details

get_addresses_for_user/1

get_addresses_for_user(User) -> Addresses | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Get all possible addresses of a user. Both configured ones, and implicit ones. Used for example to check if a request from a user has an acceptable From: header.

get_addresses_for_users/1

get_addresses_for_users(Users::UserList) -> Addresses | nomatch | error

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Iterate over a list of users, return all their addresses without duplicates.

get_classes_for_user/1

get_classes_for_user(User::Username) -> Classes | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Return a list of classes for this Username. Classes are 'free-form' atoms of types of PSTN destinations this user is allowed to call to, through a pstnproxy. What class a PSTN number is in is determined through pstnproxy configuration.

get_forward_for_user/1

get_forward_for_user(User::Username) -> ForwardList | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Return the forward entry for a user. Forwards are currently not in the main YXA CVS repository - Magnus has some CVS merging to do.

get_forwards_for_users/1

get_forwards_for_users(Users::Usernames) -> ForwardList | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Return a list of forwards for this user. Forwards are currently not in the main YXA CVS repository - Magnus has some CVS merging to do.

get_password_for_user/1

get_password_for_user(User::Username) -> Password | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Returns the password for a user.

get_telephonenumber_for_user/1

get_telephonenumber_for_user(User) -> Number | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Return the telephone number for a user. We do this by fetching all addresses for the user and then examining them to see if any of them is a tel: URL, or has a user part which is all numeric or is an E.164 number. The numbering plan in the number return is not specified.

get_user_with_address/1

get_user_with_address(Address) -> Username | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Looks up exactly one user with an Address. Used for example in REGISTER. If there are multiple users with this address in our database, this function returns 'error'.

get_users_for_address_of_record/1

get_users_for_address_of_record(Address) -> Users | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Get all usernames of users matching an address. Used to find out to which users we should send a request.

get_users_for_addresses_of_record/1

get_users_for_addresses_of_record(Addresses) -> Users | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Iterate over a list of addresses of record, return all users matching one or more of the addresses, without duplicates.

get_users_for_url/1

get_users_for_url(URL) -> Usernames | nomatch

throws {siperror, Status, Reason} | {siperror, Status, Reason, ExtraHeaders}

Given an URL that is typically the Request-URI of an incoming request, make a list of implicit user addresses and return a list of all users matching any of these addresses. This is located in here since user database backends can have their own way of deriving addresses from a Request-URI.


Generated by EDoc, Oct 17 2007, 16:48:17.