Module phone

This function is a mix of location database and Mnesia user database functions.

Introduced in: 15 Nov 2002 by Magnus Ahltorp <ahltorp@nada.kth.se>

Authors: Magnus Ahltorp (ahltorp@nada.kth.se).

Description

This function is a mix of location database and Mnesia user database functions. It pre-dates the modular sipuserdb system (but sipuserdb_mnesia uses these functions), and the location database has not yet been made modular.

Note: the #phone.requristr field must always be created with url_to_requristr/1, otherwise functions that match againts requristr, like get_sipuser_location_binding/2 will fail.

Data Types

transaction_result()

transaction_result() = {atomic, Result} | {aborted, Reason}

The result of a Mnesia transaction. Result is a term().

Function Index

delete_location/3 Delete a specific location from the location database.
delete_phone/3 Removes all entrys matching a user (SIP user), class and address from the location database.
delete_phone_for_user/2 Removes all registered locations of a specific Class for a SipUser.
delete_record/1 remove a single phone record Obj in a bag table.
delete_user/1 Delete user User and all numbers for that user from the database.
expired_phones/0 Finds all expired entrys from the location database.
get_locations_using_contact/1 Fetch the complete siplocationdb_e records for all registrations of a specific concact (location database binding).
get_numbers_for_user/1 Get numbers for User.
get_phone/1 Fetches all locations for a given user (SIP user) from the location database.
get_sipuser_location_binding/2 Look for a phone record() that maps SipUser to Location.
get_sipuser_locations/1 Fetches all locations for a given user (SIP user) from the location database.
get_sipusers_using_contact/1 Find all users (#phone.user) that have registered a specific concact (location database binding).
get_user/1 Get password, flags and classes for User.
get_users_for_number/1 Fetch all users having an address matchig Number.
insert_purge_phone/8 Remove a certain SipUser -> location mapping.
insert_user/4 Create a new user.
insert_user_or_password/2 Create a user, or set existing user's password.
list_numbers/0 Return database contents of the table named 'numbers' as a list.
list_phones/0 Return database contents of the table named 'phone' as a list.
list_users/0 Return database contents of the table named 'user' as a list.
purge_class_phone/2 Removes all entrys matching User (SIP user), and class from the location database.
remove_expired_phones/0 remove phone entries in DB that should no longer be present.
set_user_classes/2 Set classes for User.
set_user_flags/2 Set flags for User.
set_user_numbers/2 Set numbers for User.
set_user_password/2 Set password for User.

Function Details

delete_location/3

delete_location(User, Class, Address) -> transaction_result()

Delete a specific location from the location database.

delete_phone/3

delete_phone(SipUser, Address, Class) -> transaction_result()

Removes all entrys matching a user (SIP user), class and address from the location database. Address can be whatever - this function should not be depending on being able to understand Address to remove old records from the database. Note : used by remove_phones (and remove_expired_phones) XXX Redundant with delete_location/3???

delete_phone_for_user/2

delete_phone_for_user(SipUser, Class) -> transaction_result()

Removes all registered locations of a specific Class for a SipUser.

delete_record/1

delete_record(Obj) -> transaction_result()

remove a single phone record Obj in a bag table

delete_user/1

delete_user(User) -> transaction_result()

Delete user User and all numbers for that user from the database.

expired_phones/0

expired_phones() -> {ok, Entries} | transaction_result()

Finds all expired entrys from the location database.

get_locations_using_contact/1

get_locations_using_contact(URI) -> {ok, LDBEs}

Fetch the complete siplocationdb_e records for all registrations of a specific concact (location database binding).

get_numbers_for_user/1

get_numbers_for_user(User) -> {atomic, Result}

Get numbers for User.

get_phone/1

get_phone(SipUser) -> transaction_result()

Fetches all locations for a given user (SIP user) from the location database. Return raw phone record()s. Note : Only use this for testing, use get_sipuser_locations/1 in your applications! (The exception to this rule is siplocation:process_register_wildcard_isauth/4 which needs the Call-Id and CSeq information).

get_sipuser_location_binding/2

get_sipuser_location_binding(SipUser, Location) -> transaction_result()

Look for a phone record() that maps SipUser to Location. Returns a list of phone records.

get_sipuser_locations/1

get_sipuser_locations(SipUser) -> {ok, Entries}

Fetches all locations for a given user (SIP user) from the location database.

get_sipusers_using_contact/1

get_sipusers_using_contact(URI) -> {atomic, Users}

Find all users (#phone.user) that have registered a specific concact (location database binding).

get_user/1

get_user(User) -> {atomic, Result}

Get password, flags and classes for User.

get_users_for_number/1

get_users_for_number(Number) -> {atomic, Users}

Fetch all users having an address matchig Number.

insert_purge_phone/8

insert_purge_phone(SipUser, Flags, Class, Expire, Address, CallId, CSeq, Instance) -> {atomic, term()}

returns: The result of the mnesia:transaction()

Remove a certain SipUser -> location mapping. Then create a new entry with a new Expire value

insert_user/4

insert_user(User, Password, Flags, Classes) -> transaction_result()

Create a new user.

insert_user_or_password/2

insert_user_or_password(User, Password) -> transaction_result()

Create a user, or set existing user's password.

list_numbers/0

list_numbers() -> [#numbers{}]

Return database contents of the table named 'numbers' as a list. NOTE: this code is mainly intended for debugging.

list_phones/0

list_phones() -> [#phone{}]

Return database contents of the table named 'phone' as a list. NOTE: this code is mainly intended for debugging.

list_users/0

list_users() -> [#user{}]

Return database contents of the table named 'user' as a list. NOTE: this code is mainly intended for debugging.

purge_class_phone/2

purge_class_phone(User, Class) -> transaction_result()

Removes all entrys matching User (SIP user), and class from the location database.

remove_expired_phones/0

remove_expired_phones() -> true | error

remove phone entries in DB that should no longer be present

set_user_classes/2

set_user_classes(User, Classes) -> transaction_result()

Set classes for User.

set_user_flags/2

set_user_flags(User, Flags) -> transaction_result()

Set flags for User.

set_user_numbers/2

set_user_numbers(User, Numbers) -> transaction_result()

Set numbers for User.

set_user_password/2

set_user_password(User, Password) -> {atomic, ok} | {aborted, Reason}

Set password for User.


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