$Revision: 1.2 $
$Date: 2005/08/24 13:24:33 $

# Functions

## `save(domain)`

The function processes a REGISTER message. It can add, remove or modify usrloc records depending on Contact and Expires HFs in the REGISTER message. On success, 200 OK will be returned listing all contacts that are currently in usrloc. On an error, error message will be send with a short description in reason phrase.

Meaning of the parameters is as follows:

- domain - Logical domain within registrar. If database is used then this must be name of the table which stores the contacts.

### `save` usage

    ...
    save("location");
    ...

## `save_noreply(domain)`

Same as `save()` but it doesn't send a reply.

Meaning of the parameters is as follows:

- domain - Logical domain within registrar. If database is used then this must be na e of the table which stores the contacts.

### `save_noreply` usage

    ...
    save_noreply("location");
    ...

## `lookup(domain)`

The functions extracts username from Request-URI and tries to find all contacts for the username in usrloc. If there are no such contacts, -1 will be returned. If there are such contacts, Request-URI will be overwritten with the contact that has the highest q value and optionally the rest will be appended to the message (depending on append_branches parameter value).

Meaning of the parameters is as follows:

- domain - Name of table that should be used for the lookup.

### `lookup` usage

    ...
    lookup("location");
    ...

## `registered(domain)`

The function returns true if the AOR in the Request-URI is registered, false otherwise. The function does not modify the message being process, it neither rewrites the Request-URI if a contact is found not append branches.

Meaning of the parameters is as follows:

- domain - Name of table that should be used for the lookup.

### `registered` usage

    ...
    if (registered("location")) {
        sl_send_reply("100", "Trying");
        ...
    };
    ...