USRLOC - Usrloc record structure.
More...
#include <stdio.h>
#include <time.h>
#include "hslot.h"
#include "../../str.h"
#include "../../qvalue.h"
#include "ucontact.h"
#include "../usrloc/usrloc.h"
#include "hslot.h"
#include "ucontact.h"
Go to the source code of this file.
Functions
- int db_delete_urecord (struct udomain *_d, urecord_t *_r)
- Delete a record from the database.
- int delete_ucontact (urecord_t *_r, struct ucontact *_c)
- Delete ucontact from urecord.
- void free_urecord (urecord_t *_r)
- Free all memory used by the given structure.
- int get_ucontact (urecord_t *_r, str *_c, str *_callid, str *_path, int _cseq, struct ucontact **_co)
- Get pointer to ucontact with given contact.
- int insert_ucontact (urecord_t *_r, str *_contact, ucontact_info_t *_ci, ucontact_t **_c)
- Create and insert new contact into urecord.
- void mem_delete_ucontact (urecord_t *_r, ucontact_t *_c)
- Remove contact in memory from the list and delete it.
- ucontact_t * mem_insert_ucontact (urecord_t *_r, str *_c, ucontact_info_t *_ci)
- Add a new contact in memory.
- void mem_remove_ucontact (urecord_t *_r, ucontact_t *_c)
- Remove the contact from lists in memory.
- int new_urecord (str *_dom, str *_aor, urecord_t **_r)
- Create and initialize new record structure.
- void print_urecord (FILE *_f, urecord_t *_r)
- Print a record, useful for debugging.
- void release_urecord (urecord_t *_r)
- Release urecord previously obtained through get_urecord.
- void timer_urecord (urecord_t *_r)
- Run timer functions depending on the db_mode setting.
Detailed Description
Definition in file modules_k/p_usrloc/urecord.h.
Function Documentation
- Parameters:
-
- Returns:
- 0 on success, -1 on failure
Definition at line 398 of file modules_k/p_usrloc/urecord.c.
References urecord::aor, domain_col, _str::len, db_val_t::nul, _str::s, db_val_t::str_val, db_val_t::type, use_domain, user_col, and db_val_t::val.
Referenced by delete_urecord().
- Parameters:
-
| _r | record where the contact belongs to |
| _c | deleted contact |
- Returns:
- 0 on success, -1 on failure
Definition at line 486 of file modules_k/p_usrloc/urecord.c.
Free all memory used by the given structure. The structure must be removed from all linked lists first
- Parameters:
-
Definition at line 94 of file modules_k/p_usrloc/urecord.c.
- Parameters:
-
| _r | record where to search the contacts |
| _c | contact string |
| _callid | callid |
| _path | path |
| _cseq | CSEQ number |
| _co | found contact |
- Returns:
- 0 - found, 1 - not found, -1 - invalid found, -2 - found, but to be skipped (same cseq)
- Parameters:
-
| _r | record where to search the contacts |
| _c | contact string |
| _callid | callid |
| _cseq | CSEQ number |
| _co | found contact |
- Returns:
- 0 - found, 1 - not found, -1 - invalid found, -2 - found, but to be skipped (same cseq)
Definition at line 588 of file modules_k/p_usrloc/urecord.c.
- Parameters:
-
| _r | record into the new contact should be inserted |
| _contact | contact string |
| _ci | contact information |
| _c | new created contact |
- Returns:
- 0 on success, -1 on failure
Definition at line 455 of file modules_k/p_usrloc/urecord.c.
Add a new contact in memory, contacts are ordered by: 1) q value, 2) descending modification time
- Parameters:
-
| _r | record this contact belongs to |
| _c | contact |
| _ci | contact information |
- Returns:
- pointer to new created contact on success, 0 on failure
Definition at line 149 of file modules_k/p_usrloc/urecord.c.
- Parameters:
-
| _dom | domain name |
| _aor | address of record |
| _r | pointer to the new record |
- Returns:
- 0 on success, negative on failure
Definition at line 62 of file modules_k/p_usrloc/urecord.c.
| void print_urecord |
( |
FILE * |
_f, |
|
|
urecord_t * |
_r | |
|
) |
| | |
- Warning:
- Failing to calls this function after get_urecord will result in a memory leak when the DB_ONLY mode is used. When the records is later deleted, e.g. with delete_urecord, then its not necessary, as this function already releases the record.
- Parameters:
-
Definition at line 437 of file modules_k/p_usrloc/urecord.c.
Helper function that run the appropriate timer function, depending on the db_mode setting.
- Parameters:
-
Definition at line 378 of file modules_k/p_usrloc/urecord.c.