sipxtacklib
Version 3.3
|
A class (with no members) whose 'servers' method implements the RFC 3263 process for determining a list of server entries for a SIP domain name. More...
#include <SipSrvLookup.h>
Public Types | |
enum | OptionCode { OptionCodeNone = 0, OptionCodeFirst, OptionCodeIgnoreSRV, OptionCodeIgnoreNAPTR, OptionCodeSortAnswers, OptionCodePrintAnswers, OptionCodeCNAMELimit, OptionCodeNoDefaultTCP, OptionCodeLast } |
Option codes for server lookup. More... | |
Static Public Member Functions | |
static server_t * | servers (const char *domain, const char *service, OsSocket::IpProtocolSocketType socketType, int port, const char *srcIp) |
Get the list of server entries for SIP domain name 'domain'. More... | |
static int | getOption (OptionCode option) |
Get an option value. More... | |
static void | setOption (OptionCode option, int value) |
Set an option value. More... | |
static void | setDnsSrvTimeouts (int initialTimeoutInSecs, int retries) |
setOption can be called at any time from any thread without causing harm to any requests that may be being processed. More... | |
static void | getDnsSrvTimeouts (int &initialTimeoutInSecs, int &retries) |
Gets the timing paramters for DSN SRV queries. More... | |
static void | res_query_and_parse (const char *in_name, int type, res_response *in_response, const char *&out_name, res_response *&out_response) |
Perform a DNS query and parse the results. Follows CNAME records. More... | |
Static Protected Attributes | |
static OsMutex | sMutex |
Mutex to keep the routines thread-safe. More... | |
static int | options [OptionCodeLast+1] |
The array of option values. More... | |
A class (with no members) whose 'servers' method implements the RFC 3263 process for determining a list of server entries for a SIP domain name.
enum OptionCode |
Option codes for server lookup.
|
static |
Get the list of server entries for SIP domain name 'domain'.
Returns the list of server entries for SIP domain name 'domain'. Implements the processes of RFC 2543. The search process is modified by the parameters:
The 'service' is the URI scheme, "sip" or "sips".
The 'port' argument is the port number supplied in the URI, or a negative number if none was supplied. If none was supplied, SRV records are consulted. If no SRV records are found, port defaults to 5060 for "sip" service and 5061 for "sips" service.
The 'socketType' restricts the search to that sort of transport, and may have the values (within IpProtocolSocketType): TCP UDP SSL_SOCKET UNKNOWN (all of the above are acceptable) It is used if the URI or other context information specifies a transport. If UNKNOWN is specified, servers() attempts to return addresses for all transports that it knows about that are compatible with the service. (If socketType is incompatible with service, no addresses will be returned.)
domain | SIP domain name or host name |
service | "sip" or "sips" |
socketType | types of transport |
port | port number from URI, or PORT_NONE |
srcIp | the outgoing interface ip to send the request on |
|
inlinestatic |
Get an option value.
|
static |
Set an option value.
|
static |
setOption can be called at any time from any thread without causing harm to any requests that may be being processed.
Sets the DNS SRV times. Defaults: timeout=5, retries=4.
It may, however, block until all current requests are processed before returning to the caller, and current requests may be processed partly under the old configuration and partly under the new configuration.Sets the timing parameters for DNS SRV queries.
initialTimeoutInSecs | Timeout in seconds for first query, or 0 for no change. |
retries | Number of retries to attempt, or 0 for no change. |
|
static |
Gets the timing paramters for DSN SRV queries.
Defaults are: timeout = 5, retries = 4.
|
static |
Perform a DNS query and parse the results. Follows CNAME records.
Performs a DNS query for a particular type of RR on a given name, doing all the work to follow CNAMEs. The 'in_name' and 'type' arguments specify the RRs to look for. If 'in_response' is not NULL, it is the results of some previous search for the same name, for a different type of RR, which might contain RRs for this search.
The caller is responsible for freeing out_name if it is non-NULL and != in_name. The caller is responsible for freeing out_response if it is non-NULL and != in_response.
in_name | domain name to look up |
type | RR type to look up |
in_response | response structure to look in before calling res_query, or NULL |
out_name | canonical name for in_name |
out_response | response structure containing RRs |
|
staticprotected |
Mutex to keep the routines thread-safe.
|
staticprotected |
The array of option values.
Set the initial values.