sipxtacklib
Version 3.3
|
#include <SipContactDb.h>
Public Member Functions | |
SipContactDb () | |
virtual | ~SipContactDb () |
const bool | addContact (SIPX_CONTACT_ADDRESS &contact) |
Inserts a contact into the contact table. More... | |
const bool | updateContact (SIPX_CONTACT_ADDRESS &contact) |
Searches for a similar contact and the datebase and updates the address/port. More... | |
const bool | deleteContact (const SIPX_CONTACT_ID id) |
Removes a contact record from the DB. More... | |
SIPX_CONTACT_ADDRESS * | find (SIPX_CONTACT_ID id) |
Finds a contact in the DB, by SIPX_CONTACT_ID. More... | |
SIPX_CONTACT_ADDRESS * | find (const UtlString szIpAddress, const int port, SIPX_CONTACT_TYPE type) |
Finds a contact in the DB, by IP address. More... | |
SIPX_CONTACT_ADDRESS * | findByType (SIPX_CONTACT_TYPE type, SIPX_TRANSPORT_TYPE transportType, UtlString sCustomTransport="") |
Finds the first contact by a given contact type. More... | |
SIPX_TRANSPORT_TYPE | findTransportType (const char *transportName) |
Return a transport type given the specified transport name. More... | |
SIPX_CONTACT_ADDRESS * | getLocalContact (SIPX_CONTACT_ID id) |
void | getAll (SIPX_CONTACT_ADDRESS *contacts[], int &actualNum) const |
Populates a CONTACT_ADDRESS array with all of the contacts stored in this DB. More... | |
void | getAllForAdapter (const SIPX_CONTACT_ADDRESS *contacts[], const char *szAdapter, int &actualNum, SIPX_CONTACT_TYPE typeFilter=CONTACT_ALL) const |
Populates a CONTACT_ADDRESS array with all of the contacts stored in this DB that match a particular adapter name. More... | |
const bool | getRecordForAdapter (SIPX_CONTACT_ADDRESS &contact, const char *szAdapter, const SIPX_CONTACT_TYPE contactFilter) const |
const bool | getRecordForAdapter (SIPX_CONTACT_ADDRESS &contact, const char *szAdapter, const SIPX_CONTACT_TYPE contactFilter, const SIPX_TRANSPORT_TYPE transportFilter) const |
void | replicateForTransport (const SIPX_TRANSPORT_TYPE originalTransport, const SIPX_TRANSPORT_TYPE newTransport, const char *szTransport, const char *szRoutingID) |
void | removeForTransport (const SIPX_TRANSPORT_TYPE transport) |
void | dump (UtlString &output) |
void | enableTurn (bool bEnable) |
SipContactDb | ( | ) |
|
virtual |
const bool addContact | ( | SIPX_CONTACT_ADDRESS & | contact | ) |
Inserts a contact into the contact table.
Fails if there is already an entry with the same port and IP address. If the ID of the incoming CONTACT_ADDRESS is less that 1, which it should be, then this method will assign a contact id.
contact | Reference to a contact structure, which will be copied, and the copy will be added to the DB. |
const bool updateContact | ( | SIPX_CONTACT_ADDRESS & | contact | ) |
Searches for a similar contact and the datebase and updates the address/port.
contact | Reference to a contact structure |
const bool deleteContact | ( | const SIPX_CONTACT_ID | id | ) |
Removes a contact record from the DB.
id | Key value (the contact id) used to find a matching record for deletion. |
SIPX_CONTACT_ADDRESS * find | ( | SIPX_CONTACT_ID | id | ) |
Finds a contact in the DB, by SIPX_CONTACT_ID.
id | The SIPX_CONTACT_ID of the record to find. |
SIPX_CONTACT_ADDRESS * find | ( | const UtlString | szIpAddress, |
const int | port, | ||
SIPX_CONTACT_TYPE | type | ||
) |
Finds a contact in the DB, by IP address.
id | The IP Address of the record to find. |
SIPX_CONTACT_ADDRESS * findByType | ( | SIPX_CONTACT_TYPE | type, |
SIPX_TRANSPORT_TYPE | transportType, | ||
UtlString | sCustomTransport = "" |
||
) |
Finds the first contact by a given contact type.
SIPX_TRANSPORT_TYPE findTransportType | ( | const char * | transportName | ) |
Return a transport type given the specified transport name.
The name could be tls, tcp, udp, or a custom transport type.
SIPX_CONTACT_ADDRESS * getLocalContact | ( | SIPX_CONTACT_ID | id | ) |
void getAll | ( | SIPX_CONTACT_ADDRESS * | contacts[], |
int & | actualNum | ||
) | const |
Populates a CONTACT_ADDRESS array with all of the contacts stored in this DB.
contacts | Pre-allocated array of CONTACT_ADDRESS pointers. Should be allocated using the MAX_IP_ADDRESSES for the size. |
actualNum | The number of contacts. |
void getAllForAdapter | ( | const SIPX_CONTACT_ADDRESS * | contacts[], |
const char * | szAdapter, | ||
int & | actualNum, | ||
SIPX_CONTACT_TYPE | typeFilter = CONTACT_ALL |
||
) | const |
Populates a CONTACT_ADDRESS array with all of the contacts stored in this DB that match a particular adapter name.
contacts | Pre-allocated array of CONTACT_ADDRESS pointers. Should be allocated using the MAX_IP_ADDRESSES for the size. |
szAdapter | Adapter name for which to look-up contacts. |
actualNum | The number of contacts. |
const bool getRecordForAdapter | ( | SIPX_CONTACT_ADDRESS & | contact, |
const char * | szAdapter, | ||
const SIPX_CONTACT_TYPE | contactFilter | ||
) | const |
const bool getRecordForAdapter | ( | SIPX_CONTACT_ADDRESS & | contact, |
const char * | szAdapter, | ||
const SIPX_CONTACT_TYPE | contactFilter, | ||
const SIPX_TRANSPORT_TYPE | transportFilter | ||
) | const |
void replicateForTransport | ( | const SIPX_TRANSPORT_TYPE | originalTransport, |
const SIPX_TRANSPORT_TYPE | newTransport, | ||
const char * | szTransport, | ||
const char * | szRoutingID | ||
) |
void removeForTransport | ( | const SIPX_TRANSPORT_TYPE | transport | ) |
void dump | ( | UtlString & | output | ) |
void enableTurn | ( | bool | bEnable | ) |