sipxtacklib
Version 3.3
|
Transaction and Transport manager for SIP stack. More...
#include <SipUserAgent.h>
Public Types | |
enum | EventSubTypes { UNSPECIFIED = 0, SHUTDOWN_MESSAGE = 10, KEEPALIVE_MESSAGE } |
Public Member Functions | |
SipUserAgent (int sipTcpPort=SIP_PORT, int sipUdpPort=SIP_PORT, int sipTlsPort=SIP_PORT+1, const char *publicAddress=NULL, const char *defaultUser=NULL, const char *defaultSipAddress=NULL, const char *sipProxyServers=NULL, const char *sipDirectoryServers=NULL, const char *sipRegistryServers=NULL, const char *authenticationScheme=NULL, const char *authenicateRealm=NULL, OsConfigDb *authenticateDb=NULL, OsConfigDb *authorizeUserIds=NULL, OsConfigDb *authorizePasswords=NULL, SipLineMgr *lineMgr=NULL, int sipFirstResendTimeout=SIP_DEFAULT_RTT, UtlBoolean defaultToUaTransactions=TRUE, int readBufferSize=-1, int queueSize=OsServerTask::DEF_MAX_MSGS, UtlBoolean bUseNextAvailablePort=FALSE, UtlString certNickname="", UtlString certPassword="", UtlString dbLocation=".", UtlBoolean doUaMessageChecks=TRUE) | |
Constructor. More... | |
virtual | ~SipUserAgent () |
Destructor. More... | |
void | shutdown (UtlBoolean blockingShutdown=TRUE) |
Cleanly shuts down SipUserAgent. More... | |
virtual void | enableStun (const char *szStunServer, int iStunPort, int refreshPeriodInSecs, OsNotification *pNotification=NULL, const char *szIp=NULL) |
Enable stun lookups for UDP signaling. Use a NULL szStunServer to disable. More... | |
virtual UtlBoolean | handleMessage (OsMsg &eventMessage) |
For internal use only. More... | |
virtual void | addMessageConsumer (OsServerTask *messageConsumer) |
Deprecated (Add a SIP message recipient) More... | |
void | addMessageObserver (OsMsgQ &messageQueue, const char *sipMethod=NULL, UtlBoolean wantRequests=TRUE, UtlBoolean wantResponses=TRUE, UtlBoolean wantIncoming=TRUE, UtlBoolean wantOutGoing=FALSE, const char *eventName=NULL, SipSession *pSession=NULL, void *observerData=NULL) |
Add a SIP message observer for receiving SIP messages meeting the given filter criteria. More... | |
UtlBoolean | removeMessageObserver (OsMsgQ &messageQueue, void *pObserverData=NULL) |
Removes all SIP message observers for the given message/queue observer. More... | |
virtual UtlBoolean | send (SipMessage &message, OsMsgQ *responseListener=NULL, void *responseListenerData=NULL, SIPX_TRANSPORT_DATA *pTransport=NULL) |
Send a SIP message over the net. More... | |
virtual void | dispatch (SipMessage *message, int messageType=SipMessageEvent::APPLICATION, SIPX_TRANSPORT_DATA *pData=NULL) |
Dispatch the SIP message to the message consumer(s) More... | |
void | allowMethod (const char *methodName, const bool bAllow=true) |
void | allowExtension (const char *extension) |
void | getSupportedExtensions (UtlString &extensionsString) |
void | setProxyServers (const char *sipProxyServers) |
Set the SIP proxy servers for the user agent. More... | |
UtlBoolean | addCrLfKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeCrLfKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort) |
UtlBoolean | addStunKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeStunKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort) |
OsTimer * | getTimer () |
UtlBoolean | addSipKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const char *szMethod, const int keepAliveSecs, OsNatKeepaliveListener *pListener) |
UtlBoolean | removeSipKeepAlive (const char *szLocalIp, const char *szRemoteIp, const int remotePort, const char *szMethod) |
UtlBoolean | setUseRport (UtlBoolean bEnable) |
Enable or disable the outbound use of rport (send packet to actual port – not advertised port). More... | |
UtlBoolean | getUseRport () const |
Is use report set? More... | |
void | setUseRportMapping (UtlBoolean bEnable) |
Enable or disable use of rport IP and port in response via for contact mapping database. More... | |
UtlBoolean | getUseRportMapping () const |
Get if use of rport IP and port in response via for contact mapping database is enabled. More... | |
UtlBoolean | getConfiguredPublicAddress (UtlString *pIpAddress, int *pPort) |
Get the manually configured public address. More... | |
UtlBoolean | getLocalAddress (UtlString *pIpAddress, int *pPort, SIPX_TRANSPORT_TYPE protocol=TRANSPORT_UDP) |
Get the local address and port. More... | |
UtlBoolean | getNatMappedAddress (UtlString *pIpAddress, int *pPort) |
Get the NAT mapped address and port. More... | |
void | setIsUserAgent (UtlBoolean isUserAgent) |
void | setUserAgentHeaderProperty (const char *property) |
Provides a string to be appended to the standard User-Agent header. More... | |
void | setMaxForwards (int maxForwards) |
Set the limit of allowed hops a message can make. More... | |
int | getMaxForwards () |
Get the limit of allowed hops a message can make. More... | |
void | setForking (UtlBoolean enabled) |
Allow or disallow recursion and forking of 3xx class requests. More... | |
void | getFromAddress (UtlString *address, int *port, UtlString *protocol) |
void | getViaInfo (int protocol, UtlString &address, int &port, const char *pszTargetAddress, const int *piTargetPort) |
void | getDirectoryServer (int index, UtlString *address, int *port, UtlString *protocol) |
void | getProxyServer (int index, UtlString *address, int *port, UtlString *protocol) |
void | printStatus () |
Print diagnostics. More... | |
void | startMessageLog (int newMaximumLogSize=0) |
void | stopMessageLog () |
void | clearMessageLog () |
virtual void | logMessage (const char *message, int messageLength) |
void | getMessageLog (UtlString &logData) |
int | getSipStateTransactionTimeout () |
int | getDefaultExpiresSeconds () const |
const int | getRegisterResponseTimeout () const |
void | setRegisterResponseTimeout (const int seconds) |
void | setDefaultExpiresSeconds (int expiresSeconds) |
int | getDefaultSerialExpiresSeconds () const |
void | setLocationHeader (const char *szHeader) |
void | setIncludePlatformInUserAgentName (const bool bInclude) |
Tells the User Agent whether or not to append the platform name onto the User Agent string. More... | |
void | setDefaultSerialExpiresSeconds (int expiresSeconds) |
void | setMaxTcpSocketIdleTime (int idleTimeSeconds) |
Period of time a TCP socket can remain idle before it is removed. More... | |
int | getMaxSrvRecords () const |
Get the maximum number of DNS SRV records to pursue in the case of failover. More... | |
void | setMaxSrvRecords (int numRecords) |
Set the maximum number of DNS SRV records to pursue in the case of failover. More... | |
int | getDnsSrvTimeout () |
Get the number of seconds to wait before trying the next DNS SRV record. More... | |
void | setDnsSrvTimeout (int timeout) |
Set the number of seconds to wait before trying the next DNS SRV record. More... | |
void | setHostAliases (UtlString &aliases) |
Set other DNS names or IP addresses which are considered to refer to this SipUserAgent. More... | |
void | setRecurseOnlyOne300Contact (UtlBoolean recurseOnlyOne) |
Flag to recurse only one contact in a 300 response. More... | |
void | setReturnViasForMaxForwards (UtlBoolean returnVias) |
Flag to return Vias in too many hops response to request with max-forwards == 0. More... | |
SipMessage * | getRequest (const SipMessage &response) |
Get a copy of the original request that was sent corresponding to this incoming response. More... | |
int | getUdpPort () const |
int | getTcpPort () const |
Get the local UDP port number (or PORT_NONE if disabled) More... | |
int | getTlsPort () const |
Get the local TCP port number (or PORT_NONE if disabled) More... | |
void | setUserAgentName (const UtlString &name) |
Get the local Tls port number (or PORT_NONE if disabled) More... | |
const UtlString & | getUserAgentName () const |
Sets the User Agent name sent with outgoing sip messages. More... | |
void | setHeaderOptions (const bool bAllowHeader, const bool bDateHeader, const bool bShortNames, const UtlString &acceptLanguage) |
Sets the User Agent name sent with outgoing sip messages. More... | |
bool | getEnabledShortNames () |
Sets header options - send or not send. More... | |
void | setEnableLocationHeader (const bool bLocationHeader) |
void | stopTransactionTimers () |
void | startTransactionTimers () |
virtual UtlBoolean | isMessageLoggingEnabled () |
virtual UtlBoolean | isReady () |
virtual UtlBoolean | waitUntilReady () |
UtlBoolean | isMethodAllowed (const char *method) |
UtlBoolean | isExtensionAllowed (const char *extension) const |
UtlBoolean | isForkingEnabled () |
UtlBoolean | isMyHostAlias (Url &route) const |
UtlBoolean | recurseOnlyOne300Contact () |
UtlBoolean | isOk (OsSocket::IpProtocolSocketType socketType) |
UtlBoolean | isShutdownDone () |
Find out if SipUserAgent has finished shutting down. More... | |
void | setUserAgentHeader (SipMessage &message) |
void | setServerHeader (SipMessage &message) |
void | setSelfHeader (SipMessage &message) |
Add either Server or User-Agent header, as appropriate based on isUserAgent. More... | |
SipContactDb & | getContactDb () |
const bool | addContactAddress (SIPX_CONTACT_ADDRESS &contactAddress) |
Adds a contact record to the contact db. More... | |
void | getContactAddresses (SIPX_CONTACT_ADDRESS *pContacts[], int &numContacts) |
Gets all contact addresses for this user agent. More... | |
void | prepareVia (SipMessage &message, UtlString &branchId, OsSocket::IpProtocolSocketType &toProtocol, const char *szTargetAddress, const int *piTargetPort, SIPX_TRANSPORT_DATA *pTransport=NULL) |
void | addExternalTransport (const UtlString tranportName, const SIPX_TRANSPORT_DATA *const pTransport) |
void | removeExternalTransport (const UtlString transportName, const SIPX_TRANSPORT_DATA *const pTransport) |
const SIPX_TRANSPORT_DATA *const | lookupExternalTransport (const UtlString transportName, const UtlString ipAddress) const |
Public Member Functions inherited from SipUserAgentBase | |
SipUserAgentBase (int sipTcpPort=SIP_PORT, int sipUdpPort=SIP_PORT, int sipTlsPort=SIP_TLS_PORT, int queueSize=OsServerTask::DEF_MAX_MSGS) | |
virtual | ~SipUserAgentBase () |
void | addConfigChangeConsumer (OsMsgQ &messageQueue) |
virtual void | getContactUri (UtlString *contactUri) |
Protected Member Functions | |
void | prepareContact (SipMessage &message, const char *szTargetAddress, const int *piTargetPort) |
void | selfHeaderValue (UtlString &self) |
constuct the value to be used in either user-agent or server header. More... | |
void | getAllowedMethods (UtlString *allowedMethods) |
void | whichExtensionsNotAllowed (const SipMessage *message, UtlString *disallowedExtensions) const |
UtlBoolean | checkMethods (SipMessage *message) |
UtlBoolean | checkExtensions (SipMessage *message) |
UtlBoolean | sendStatelessResponse (SipMessage &response) |
UtlBoolean | sendStatelessRequest (SipMessage &request, UtlString &address, int port, OsSocket::IpProtocolSocketType protocol, UtlString &branchId) |
UtlBoolean | sendTls (SipMessage *message, const char *serverAddress, int port) |
UtlBoolean | sendTcp (SipMessage *message, const char *serverAddress, int port) |
UtlBoolean | sendUdp (SipMessage *message, const char *serverAddress, int port) |
UtlBoolean | sendCustom (SIPX_TRANSPORT_DATA *pTransport, SipMessage *message, const char *sendAddress, const int sendPort) |
UtlBoolean | sendSymmetricUdp (SipMessage &message, const char *serverAddress, int port) |
void | lookupSRVSipAddress (UtlString protocol, UtlString &sipAddress, int &port, UtlString &srcIp) |
DNS SRV lookup for to address. More... | |
int | getReliableTransportTimeout () |
int | getFirstResendTimeout () |
int | getLastResendTimeout () |
UtlBoolean | shouldAuthenticate (SipMessage *message) const |
UtlBoolean | authorized (SipMessage *request, const char *uri=NULL) const |
void | addAuthentication (SipMessage *message) const |
UtlBoolean | resendWithAuthorization (SipMessage *response, SipMessage *request, int *messageType, int authorizationEntity) |
Friends | |
class | SipTransaction |
class | SipUdpServer |
int | SipUdpServer::run (void *runArg) |
Additional Inherited Members | |
Protected Attributes inherited from SipUserAgentBase | |
int | mTcpPort |
int | mUdpPort |
int | mTlsPort |
UtlBoolean | mMessageLogEnabled |
UtlString | mContactAddress |
OsRWMutex | mObserverMutex |
UtlHashBag | mConfigChangeObservers |
SipContactDb | mContactDb |
Transaction and Transport manager for SIP stack.
Note SipUserAgent is perhaps not the best name for this class. It is really the transaction and transport layers of of a SIP stack which may be used in a User Agent or server context.
The SipUserAgent is the primary interface for incoming and out going SIP messages. It handles all of the reliability, resending, canceling and IP layer protocol details. Application developers that wish to send or recieve SIP messages can use SipUserAgent without having to worry about the transaction and transport details.
In the asynchronous cases where a message is put in the message queue to indicate the failure, the original SIP message is attached so that the application can determine which SIP message send failed.
All state information will be contained in transactions and/or the messages contained by a transaction. The transaction will keep track of what protocols to use and when as well as when to schedule timers. send() will no longer be used for resending. It will only be used for the first time send.
The flow for outgoing messages is something like the following:
Timeouts are handled by handle message in the following flow:
Inbound messages are still sent via dispatch. The flow is now a little different due to the use of transaction objects
enum EventSubTypes |
SipUserAgent | ( | int | sipTcpPort = SIP_PORT , |
int | sipUdpPort = SIP_PORT , |
||
int | sipTlsPort = SIP_PORT+1 , |
||
const char * | publicAddress = NULL , |
||
const char * | defaultUser = NULL , |
||
const char * | defaultSipAddress = NULL , |
||
const char * | sipProxyServers = NULL , |
||
const char * | sipDirectoryServers = NULL , |
||
const char * | sipRegistryServers = NULL , |
||
const char * | authenticationScheme = NULL , |
||
const char * | authenicateRealm = NULL , |
||
OsConfigDb * | authenticateDb = NULL , |
||
OsConfigDb * | authorizeUserIds = NULL , |
||
OsConfigDb * | authorizePasswords = NULL , |
||
SipLineMgr * | lineMgr = NULL , |
||
int | sipFirstResendTimeout = SIP_DEFAULT_RTT , |
||
UtlBoolean | defaultToUaTransactions = TRUE , |
||
int | readBufferSize = -1 , |
||
int | queueSize = OsServerTask::DEF_MAX_MSGS , |
||
UtlBoolean | bUseNextAvailablePort = FALSE , |
||
UtlString | certNickname = "" , |
||
UtlString | certPassword = "" , |
||
UtlString | dbLocation = "." , |
||
UtlBoolean | doUaMessageChecks = TRUE |
||
) |
Constructor.
Sets up listeners on the defined ports and IP layer protocols for incoming SIP messages.
sipTcpPort | - port to listen on for SIP TCP messages. Specify PORT_DEFAULT to automatically select a port, or PORT_NONE to disable. |
sipUdpPort | - port to listen on for SIP UDP messages. Specify PORT_DEFAULT to automatically select a port, or PORT_NONE to disable. |
sipTlsPort | - port to listen on for SIP TLS messages. Specify PORT_DEFAULT to automatically select a port, or PORT_NONE to disable. |
publicAddress | - use this address in Via and Contact headers instead of the actual adress. This is useful for address spoofing in a UA when behind a NAT |
defaultUser | - default user ID to use in Contacts which get inserted when missing on a UA. |
defaultSipAddress | - deprecated |
sipProxyServers | - server to which non-routed requests should be sent for next hop before going to the final destination |
sipDirectoryServers | - deprecated |
sipRegistryServers | - deprecated |
authenticationScheme | - authentication scheme to use when challenging on behalf of the UA (i.e. 401). Valid values are NONE and DIGEST. |
authenicateRealm | - The authentication realm to use when sending 401 challenges. |
authenticateDb | - the authentication DB to use when authenticating incoming requests on behalf of the UA application (as a result of locally generated 401 challenges |
authorizeUserIds | - depricated by the SipLineMgr |
authorizePasswords | - depricated by the SipLineMgr |
lineMgr | - SipLinMgr object which is container for user definitions and their credentials. This is used to authenticate incoming requests to the UA application. |
sipFirstResendTimeout | - T1 in RFC 3261 |
defaultToUaTransactions | - default transactions to be UA or PROXY. TRUE means that this is a UA and associated validation should occur. FALSE means that this is a PROXY and that minimal validation should occur. |
readBufferSize | - the default IP socket buffer size to use for the listener sockets. |
queueSize | - Size of the OsMsgQ to use for the queues internal to the SipUserAgent and subsystems. |
bUseNextAvailablePort | - When setting up the sip user agent using the designated sipTcp, sipUdp, and sipTls ports, select the next available port if the supplied port is busy. If enable, this will attempt at most 10 sequential ports. |
doUaMessageChecks | - check the acceptability of method, extensions, and encoding. The default is TRUE; it may be set to false in applications such as a redirect server that will never actually send a 2xx response, so the checks might cause errors that the application should never generate. |
|
virtual |
Destructor.
void shutdown | ( | UtlBoolean | blockingShutdown = TRUE | ) |
Cleanly shuts down SipUserAgent.
This method can block until the shutdown is complete, or it can be non-blocking. When complete, the SipUserAgent can be deleted.
blockingShutdown | - TRUE if this method should block until the shutdown is complete, FALSE if this method should be non-blocking. |
|
virtual |
Enable stun lookups for UDP signaling. Use a NULL szStunServer to disable.
|
virtual |
For internal use only.
Implements SipUserAgentBase.
|
virtual |
Deprecated (Add a SIP message recipient)
Implements SipUserAgentBase.
void addMessageObserver | ( | OsMsgQ & | messageQueue, |
const char * | sipMethod = NULL , |
||
UtlBoolean | wantRequests = TRUE , |
||
UtlBoolean | wantResponses = TRUE , |
||
UtlBoolean | wantIncoming = TRUE , |
||
UtlBoolean | wantOutGoing = FALSE , |
||
const char * | eventName = NULL , |
||
SipSession * | pSession = NULL , |
||
void * | observerData = NULL |
||
) |
Add a SIP message observer for receiving SIP messages meeting the given filter criteria.
SIP messages will be added to the messageQueue if they meet the given filter criteria.
messageQueue | - the queue on which an SipMessageEvent is dispatched |
sipMethod | - the specific method type of the requests or responses to be observed. NULL or a null string indicates all methods. |
wantRequests | - want to observe SIP requests |
wantResponses | - want to observe SIP responses |
wantIncoming | - want to observe SIP messages originating from the network. |
wantOutGoing | - (not implemented) want to observe SIP messages originating from locally. |
eventName | - want to observer SUBSCRIBE or NOTIFY requests having the given event type |
pSession | - want to observe SIP message with the specified session (call-id, to url, from url) |
observerData | - data to be attached to SIP messages queued on the observer |
UtlBoolean removeMessageObserver | ( | OsMsgQ & | messageQueue, |
void * | pObserverData = NULL |
||
) |
Removes all SIP message observers for the given message/queue observer.
This undoes what addMessageObserver() does.
messageQueue | - All observers dispatching to this message queue will be removed if the pObserverData is NULL or matches. |
pObserverData | - If null, all observers that match the message queue will be removed. Otherwise, only observers that match both the message queue and observer data will be removed. |
|
virtual |
Send a SIP message over the net.
This method sends the SIP message via a SIP UDP or TCP client as dictated by policy and the address specified in the message. Most applications will register a OsMsgQ via addMessageObserver() prior to calling send and so should call send with only one argument.
message | - the sip message to be sent |
responseListener | - the optional queue on which to place SipMessageEvents containing SIP responses from the same transaction as the request sent in message |
responseListenerData | - optional data to be passed back with responses |
Implements SipUserAgentBase.
|
virtual |
Dispatch the SIP message to the message consumer(s)
This is typically only used by the SipUserAgent and its sub-system. So unless you know what you are doing you should not be using this method. All incoming SIP message need to be dispatched via the user agent server so that it can provide the reliablity for UDP (i.e. resend requests when no response is received)
messageType | - is as define by SipMessageEvent::MessageStatusTypes APPLICATION type are normal incoming messages TRANSPORT_ERROR type are notification of failures to send messages |
Implements SipUserAgentBase.
void allowMethod | ( | const char * | methodName, |
const bool | bAllow = true |
||
) |
void allowExtension | ( | const char * | extension | ) |
void getSupportedExtensions | ( | UtlString & | extensionsString | ) |
void setProxyServers | ( | const char * | sipProxyServers | ) |
Set the SIP proxy servers for the user agent.
This method will clear any existing proxy servers before resetting this list. NOTE: As for 12/2004, only the first proxy server is used. Please consider using DNS SRV in until fully implemented.
UtlBoolean addCrLfKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeCrLfKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort | ||
) |
UtlBoolean addStunKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeStunKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort | ||
) |
|
inline |
UtlBoolean addSipKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szMethod, | ||
const int | keepAliveSecs, | ||
OsNatKeepaliveListener * | pListener | ||
) |
UtlBoolean removeSipKeepAlive | ( | const char * | szLocalIp, |
const char * | szRemoteIp, | ||
const int | remotePort, | ||
const char * | szMethod | ||
) |
UtlBoolean setUseRport | ( | UtlBoolean | bEnable | ) |
Enable or disable the outbound use of rport (send packet to actual port – not advertised port).
UtlBoolean getUseRport | ( | ) | const |
Is use report set?
void setUseRportMapping | ( | UtlBoolean | bEnable | ) |
Enable or disable use of rport IP and port in response via for contact mapping database.
UtlBoolean getUseRportMapping | ( | ) | const |
Get if use of rport IP and port in response via for contact mapping database is enabled.
UtlBoolean getConfiguredPublicAddress | ( | UtlString * | pIpAddress, |
int * | pPort | ||
) |
Get the manually configured public address.
UtlBoolean getLocalAddress | ( | UtlString * | pIpAddress, |
int * | pPort, | ||
SIPX_TRANSPORT_TYPE | protocol = TRANSPORT_UDP |
||
) |
Get the local address and port.
UtlBoolean getNatMappedAddress | ( | UtlString * | pIpAddress, |
int * | pPort | ||
) |
Get the NAT mapped address and port.
void setIsUserAgent | ( | UtlBoolean | isUserAgent | ) |
void setUserAgentHeaderProperty | ( | const char * | property | ) |
Provides a string to be appended to the standard User-Agent header.
The property is added between "<product>/<version>" and the platform (eg "(VxWorks)") The value should be formated either as "token/token", "token", or "(string)" with no leading or trailing space.
void setMaxForwards | ( | int | maxForwards | ) |
Set the limit of allowed hops a message can make.
int getMaxForwards | ( | ) |
Get the limit of allowed hops a message can make.
void setForking | ( | UtlBoolean | enabled | ) |
Allow or disallow recursion and forking of 3xx class requests.
void getFromAddress | ( | UtlString * | address, |
int * | port, | ||
UtlString * | protocol | ||
) |
void getViaInfo | ( | int | protocol, |
UtlString & | address, | ||
int & | port, | ||
const char * | pszTargetAddress, | ||
const int * | piTargetPort | ||
) |
void getDirectoryServer | ( | int | index, |
UtlString * | address, | ||
int * | port, | ||
UtlString * | protocol | ||
) |
void getProxyServer | ( | int | index, |
UtlString * | address, | ||
int * | port, | ||
UtlString * | protocol | ||
) |
void printStatus | ( | ) |
Print diagnostics.
void startMessageLog | ( | int | newMaximumLogSize = 0 | ) |
void stopMessageLog | ( | ) |
void clearMessageLog | ( | ) |
|
virtual |
Implements SipUserAgentBase.
void getMessageLog | ( | UtlString & | logData | ) |
int getSipStateTransactionTimeout | ( | ) |
int getDefaultExpiresSeconds | ( | ) | const |
|
inline |
|
inline |
void setDefaultExpiresSeconds | ( | int | expiresSeconds | ) |
int getDefaultSerialExpiresSeconds | ( | ) | const |
void setLocationHeader | ( | const char * | szHeader | ) |
void setIncludePlatformInUserAgentName | ( | const bool | bInclude | ) |
Tells the User Agent whether or not to append the platform name onto the User Agent string.
void setDefaultSerialExpiresSeconds | ( | int | expiresSeconds | ) |
void setMaxTcpSocketIdleTime | ( | int | idleTimeSeconds | ) |
Period of time a TCP socket can remain idle before it is removed.
int getMaxSrvRecords | ( | ) | const |
Get the maximum number of DNS SRV records to pursue in the case of failover.
void setMaxSrvRecords | ( | int | numRecords | ) |
Set the maximum number of DNS SRV records to pursue in the case of failover.
int getDnsSrvTimeout | ( | ) |
Get the number of seconds to wait before trying the next DNS SRV record.
void setDnsSrvTimeout | ( | int | timeout | ) |
Set the number of seconds to wait before trying the next DNS SRV record.
void setHostAliases | ( | UtlString & | aliases | ) |
Set other DNS names or IP addresses which are considered to refer to this SipUserAgent.
Used with routing decisions to determine whether routes are targeted to this SIP server or not.
aliases | - space or comma separated of the format: "sip:host:port" or "host:port" |
void setRecurseOnlyOne300Contact | ( | UtlBoolean | recurseOnlyOne | ) |
Flag to recurse only one contact in a 300 response.
void setReturnViasForMaxForwards | ( | UtlBoolean | returnVias | ) |
Flag to return Vias in too many hops response to request with max-forwards == 0.
SipMessage * getRequest | ( | const SipMessage & | response | ) |
Get a copy of the original request that was sent corresponding to this incoming response.
int getUdpPort | ( | ) | const |
int getTcpPort | ( | ) | const |
Get the local UDP port number (or PORT_NONE if disabled)
int getTlsPort | ( | ) | const |
Get the local TCP port number (or PORT_NONE if disabled)
void setUserAgentName | ( | const UtlString & | name | ) |
Get the local Tls port number (or PORT_NONE if disabled)
const UtlString & getUserAgentName | ( | ) | const |
Sets the User Agent name sent with outgoing sip messages.
void setHeaderOptions | ( | const bool | bAllowHeader, |
const bool | bDateHeader, | ||
const bool | bShortNames, | ||
const UtlString & | acceptLanguage | ||
) |
Sets the User Agent name sent with outgoing sip messages.
|
inline |
Sets header options - send or not send.
|
inline |
|
inline |
|
inline |
|
virtual |
Implements SipUserAgentBase.
|
virtual |
Reimplemented from SipUserAgentBase.
|
virtual |
Reimplemented from SipUserAgentBase.
UtlBoolean isMethodAllowed | ( | const char * | method | ) |
UtlBoolean isExtensionAllowed | ( | const char * | extension | ) | const |
UtlBoolean isForkingEnabled | ( | ) |
UtlBoolean isMyHostAlias | ( | Url & | route | ) | const |
UtlBoolean recurseOnlyOne300Contact | ( | ) |
UtlBoolean isOk | ( | OsSocket::IpProtocolSocketType | socketType | ) |
UtlBoolean isShutdownDone | ( | ) |
Find out if SipUserAgent has finished shutting down.
Useful when using the non-blocking form of shutdown.
void setUserAgentHeader | ( | SipMessage & | message | ) |
void setServerHeader | ( | SipMessage & | message | ) |
void setSelfHeader | ( | SipMessage & | message | ) |
Add either Server or User-Agent header, as appropriate based on isUserAgent.
Add either Server or User-Agent header, as appropriate.
|
inline |
const bool addContactAddress | ( | SIPX_CONTACT_ADDRESS & | contactAddress | ) |
Adds a contact record to the contact db.
void getContactAddresses | ( | SIPX_CONTACT_ADDRESS * | pContacts[], |
int & | numContacts | ||
) |
Gets all contact addresses for this user agent.
void prepareVia | ( | SipMessage & | message, |
UtlString & | branchId, | ||
OsSocket::IpProtocolSocketType & | toProtocol, | ||
const char * | szTargetAddress, | ||
const int * | piTargetPort, | ||
SIPX_TRANSPORT_DATA * | pTransport = NULL |
||
) |
void addExternalTransport | ( | const UtlString | tranportName, |
const SIPX_TRANSPORT_DATA *const | pTransport | ||
) |
void removeExternalTransport | ( | const UtlString | transportName, |
const SIPX_TRANSPORT_DATA *const | pTransport | ||
) |
const SIPX_TRANSPORT_DATA *const lookupExternalTransport | ( | const UtlString | transportName, |
const UtlString | ipAddress | ||
) | const |
|
protected |
|
protected |
constuct the value to be used in either user-agent or server header.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
DNS SRV lookup for to address.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
friend |
|
friend |
|
friend |