sipxtacklib  Version 3.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
SipMessage Class Reference

Specialization of HttpMessage to contain and manipulate SIP messages. More...

#include <SipMessage.h>

Inheritance diagram for SipMessage:
Inheritance graph
[legend]
Collaboration diagram for SipMessage:
Collaboration graph
[legend]

Public Types

enum  EventSubTypes {
  NET_UNSPECIFIED = 0,
  NET_SIP_MESSAGE
}
 
- Public Types inherited from HttpMessage
enum  HttpEndpointEnum {
  SERVER = 0,
  PROXY
}
 

Public Member Functions

 SipMessage (const char *messageBytes=NULL, int byteCount=-1)
 Construct from a buffer. More...
 
 SipMessage (OsSocket *inSocket, int bufferSize=HTTP_DEFAULT_SOCKET_BUFFER_SIZE)
 Construct from bytes read from a socket. More...
 
 SipMessage (const SipMessage &rSipMessage)
 Copy constructor. More...
 
SipMessageoperator= (const SipMessage &rhs)
 Assignment operator. More...
 
virtual ~SipMessage ()
 
void replaceShortFieldNames ()
 
void replaceLongFieldNames ()
 
void addSdpBody (int nRtpContacts, UtlString hostAddresses[], int rtpAudioPorts[], int rtcpAudiopPorts[], int rtpVideoPorts[], int rtcpVideoPorts[], RTP_TRANSPORT transportTypes[], int numRtpCodecs, SdpCodec *rtpCodecs[], SdpSrtpParameters *srtpParams, int videoBandwidth, int videoFramerate, const SipMessage *pRequest=NULL, const RTP_TRANSPORT rtpTransportOptions=RTP_TRANSPORT_UDP)
 There are some special rules implemented by this routine: More...
 
void setSecurityAttributes (const SIPXTACK_SECURITY_ATTRIBUTES *const pSecurity)
 
SIPXTACK_SECURITY_ATTRIBUTES *const getSecurityAttributes () const
 
bool fireSecurityEvent (const void *pEventData, const enum SIPX_SECURITY_EVENT, const enum SIPX_SECURITY_CAUSE, SIPXTACK_SECURITY_ATTRIBUTES *const pSecurity, void *pCert=NULL, char *szSubjectAltName=NULL) const
 
bool smimeEncryptSdp (const void *pEventData)
 
const SdpBodygetSdpBody (SIPXTACK_SECURITY_ATTRIBUTES *const pSecurity=NULL, const void *pEventData=NULL) const
 Accessor to get SDP body, optionally decrypting it if key info. is provided. More...
 
UtlBoolean verifyMd5Authorization (const char *userId, const char *password, const char *nonce, const char *realm, const char *uri=NULL, enum HttpEndpointEnum authEntity=SERVER) const
 
void setTransaction (SipTransaction *transaction)
 Accessor to store transaction reference. More...
 
SipTransactiongetSipTransaction () const
 Accessor to get transaction reference. More...
 
const UtlString getTransportName (bool &bCustom) const
 Accessor to retrieve any transport string from. More...
 
void setUseShortFieldNames (UtlBoolean bUseShortNames)
 
UtlBoolean getUseShortFieldNames () const
 
UtlBoolean isResponse () const
 Returns TRUE if this a SIP response as opposed to a request. More...
 
UtlBoolean isRequestDispositionSet (const char *dispositionToken) const
 
UtlBoolean isRequireExtensionSet (const char *extension) const
 
void OnError (SIPX_SECURITY_EVENT event, SIPX_SECURITY_CAUSE cause)
 
bool OnSignature (void *pCert, char *szSubjAltName)
 
bool getFromThisSide () const
 
void setFromThisSide (const bool bFromThisSide)
 
- Public Member Functions inherited from HttpMessage
 HttpMessage (const char *messageBytes=NULL, int byteCount=-1)
 Construct from a string. More...
 
 HttpMessage (OsSocket *inSocket, int bufferSize=HTTP_DEFAULT_SOCKET_BUFFER_SIZE)
 Construct from reading from the given socket. More...
 
 HttpMessage (const HttpMessage &rHttpMessage)
 Copy constructor. More...
 
HttpMessageoperator= (const HttpMessage &rhs)
 Assignment operator. More...
 
virtual ~HttpMessage ()
 Destructor. More...
 
int get (Url &httpUrl, int maxWaitMilliSeconds, bool bPersistent=true)
 Do an HTTP GET on the given URL. More...
 
int get (Url &httpUrl, HttpMessage &request, int maxWaitMilliSeconds, bool bPersistent=false)
 Do an HTTP GET on the given URL. More...
 
OsStatus get (Url &httpUrl, int maxWaitMilliSeconds, GetDataCallbackProc callbackProc, void *optionalData=NULL, OsConnectionSocket **socket=NULL)
 Perform an HTTP GET on the specified URL and pass data to the specified callbackProc. More...
 
int read (OsSocket *inSocket, int bufferSize=HTTP_DEFAULT_SOCKET_BUFFER_SIZE, UtlString *externalBuffer=NULL, int maxContentLength=6000000)
 Read HTTP message from socket. More...
 
int readHeader (OsSocket *inSocket, UtlString &buffer)
 Will read bytes off the socket until the header of the message is believed received. More...
 
int readBody (OsSocket *inSocket, int length, GetDataCallbackProc callbackProc, void *optionalData)
 Read the body of the specified data and deliever via the callback proc. More...
 
UtlBoolean write (OsSocket *outSocket) const
 Write message to socket. More...
 
const char * getFirstHeaderLine () const
 
void setFirstHeaderLine (const char *newHeaderLine)
 Set the header line. More...
 
void setFirstHeaderLine (const char *subfields0, const char *subfield1, const char *subfield2)
 
void getFirstHeaderLinePart (int partIndex, UtlString *part, char separator=HEADER_LINE_PART_DELIMITER) const
 Get part of header line. More...
 
void getBytes (UtlString *bytes, int *length) const
 Get the bytes for the compete message. More...
 
void logTimeEvent (const char *eventName)
 
void dumpTimeLog () const
 
UtlBoolean isFirstSend () const
 
void setTransportTime (long timeStamp)
 
void touchTransportTime ()
 
long getTransportTime () const
 
void setResendDuration (int resendMSec)
 Used for transport to track reliably the last duration waited before resending. More...
 
int getResendDuration () const
 
int getTimesSent () const
 
void incrementTimesSent ()
 
void setTimesSent (int times=0)
 
void setSendProtocol (OsSocket::IpProtocolSocketType protocol=OsSocket::TCP)
 
OsSocket::IpProtocolSocketType getSendProtocol () const
 
void setFirstSent ()
 
void setSendAddress (const char *address, int port)
 
void getSendAddress (UtlString *address, int *port) const
 
void resetTransport ()
 
OsMsgQ * getResponseListenerQueue () const
 Gets the queue on which responses from the same transaction are deposited. More...
 
void setResponseListenerQueue (OsMsgQ *requestListenerQueue)
 Sets the queue on which responses from the same transaction are deposited. More...
 
void * getResponseListenerData () const
 Gets the data item to pass to the request listener. More...
 
void setResponseListenerData (void *requestListenerData)
 Sets the data item to pass to the request listener. More...
 
int getCountHeaderFields (const char *name=NULL) const
 Find the number of occurrences of header fields with the given name. More...
 
const char * getHeaderValue (int index, const char *name=NULL) const
 Get the value of the header field (i.e. second header line). More...
 
void setHeaderValue (const char *name, const char *newValue, int index=0)
 Sets the value of an existing header field. More...
 
void addHeaderField (const char *name, const char *value)
 Adds a new header line. More...
 
void insertHeaderField (const char *name, const char *value, int index=0)
 Inserts a new header line, shifting existing headers at and after the secified location down by one. More...
 
UtlBoolean removeHeader (const char *name, int index)
 
void setContentType (const char *contentTypeString, const char *accessType=NULL, const char *expirationDate=NULL, const char *url=NULL, int size=-1, const char *hash=NULL)
 
UtlBoolean getContentType (UtlString *contentType, UtlHashMap *parameters=NULL) const
 
void setContentLength (int contentLength)
 
int getContentLength () const
 
void setUserAgentField (const char *userAgentFieldValue)
 
void getUserAgentField (UtlString *userAgentFieldValue) const
 
void setRefresh (int seconds, const char *refreshUrl=NULL)
 
UtlBoolean getDateField (long *epochDate) const
 
void setDateField ()
 Sets the date field to the current time. More...
 
void setAcceptLanguageField (const char *acceptLanaguageFieldValue)
 
void getAcceptLanguageField (UtlString *acceptLanaguageFieldValue) const
 
UtlBoolean getAcceptField (UtlString &acceptValue) const
 
void setLocationField (const char *locationField)
 
const HttpBodygetBody () const
 Get the body section of the message. More...
 
void setBody (HttpBody *newBody)
 Attach the body section of the message. More...
 
void setResponseFirstHeaderLine (const char *protocol, int statusCode, const char *statusText)
 
void getResponseProtocol (UtlString *protocol) const
 Get this response's message protocol. More...
 
int getResponseStatusCode () const
 Get this response's status code. More...
 
void getResponseStatusText (UtlString *text) const
 Get this response's status code text. More...
 
void setRequestFirstHeaderLine (const char *method, const char *uri, const char *protocol)
 
void getRequestMethod (UtlString *method) const
 Get this request's method. More...
 
void getRequestUri (UtlString *uri) const
 Get this request's URI. More...
 
void getRequestProtocol (UtlString *protocol) const
 Get this request's application layer protocol type. More...
 
void changeRequestUri (const char *newUri)
 Change this request's URI. More...
 
int parseFirstLine (const char *messageBytes, int byteCount)
 Parse the first line of the request or response. More...
 
void parseMessage (const char *messageBytes, int byteCount)
 Parse the message from a byte buffer. More...
 
void parseBody (const char *messageBodyBytes, int byteCount)
 Parses the bytes into a single or multipart body. More...
 
UtlBoolean getAuthenticationScheme (UtlString *scheme, int authorizationEntity) const
 
UtlBoolean getAuthenticationData (UtlString *scheme, UtlString *realm, UtlString *nonce, UtlString *opaque, UtlString *algorithm, UtlString *qop, int authorizationEntity) const
 
void setAuthenticationData (const char *scheme, const char *realm, const char *nonce, const char *opaque, const char *domain=NULL, enum HttpEndpointEnum authEntity=SERVER)
 
void addAuthenticationField (const char *authenticationField, enum HttpEndpointEnum authType)
 
UtlBoolean getAuthenticationField (int index, enum HttpEndpointEnum authEntity, const char *authenticationField) const
 
void addAuthenticationField (const char *AuthorizeField, const char *AuthorizeValue, UtlBoolean otherAuthentications=TRUE)
 
virtual void setRequestUnauthorized (const HttpMessage *request, const char *authenticationScheme, const char *authenticationRealm, const char *authenticationNonce=NULL, const char *authenticationOpaque=NULL, const char *authenticationDomain=NULL)
 
UtlBoolean getAuthorizationUser (UtlString *userId) const
 
UtlBoolean getAuthorizationScheme (UtlString *scheme) const
 
UtlBoolean getAuthorizationField (UtlString *authenticationField, int authorizationEntity) const
 
void setBasicAuthorization (const char *user, const char *password, int authorizationEntity)
 
UtlBoolean getBasicAuthorizationData (UtlString *encodedCookie) const
 
UtlBoolean getBasicAuthorizationData (UtlString *userId, UtlString *password) const
 
UtlBoolean verifyBasicAuthorization (const char *user, const char *password) const
 
void setDigestAuthorizationData (const char *user, const char *realm, const char *nonce, const char *uri, const char *response, const char *algorithm, const char *cnonce, const char *opaque, const char *qop, int nonceCount, int authorizationEntity)
 
UtlBoolean getDigestAuthorizationData (UtlString *user, UtlString *realm=NULL, UtlString *nonce=NULL, UtlString *opaque=NULL, UtlString *response=NULL, UtlString *uri=NULL, int authorizationEntity=HttpMessage::PROXY, int index=0) const
 
UtlBoolean verifyMd5Authorization (const char *userId, const char *password, const char *nonce, const char *realm, const char *thisMessageMethod=NULL, const char *thisMessageUri=NULL, enum HttpEndpointEnum authEntity=SERVER) const
 
UtlBoolean verifyMd5Authorization (const char *userPasswordDigest, const char *nonce, const char *thisMessageMethod=NULL, const char *thisMessageUri=NULL) const
 
- Public Member Functions inherited from ISmimeNotifySink
virtual ~ISmimeNotifySink ()
 

Static Public Member Functions

static UtlBoolean getShortName (const char *longFieldName, UtlString *shortFieldName)
 
static UtlBoolean getLongName (const char *shortFieldName, UtlString *longFieldName)
 
static UtlBoolean isUrlHeaderAllowed (const char *)
 Is this a header parameter we want to allow users or apps. to. More...
 
static UtlBoolean isUrlHeaderUnique (const char *)
 Does this header allow multiple values, or only one. More...
 
static void parseViaParameters (const char *viaField, UtlContainer &viaParameterList)
 Get the name/value pairs for a Via field. More...
 
- Static Public Member Functions inherited from HttpMessage
static void cannonizeToken (UtlString &token)
 Converts the given token to initial cap capitialization in the style used in RFC 822 header names. More...
 
static void unescape (UtlString &escapedText)
 URL unescape the text to human readable form. More...
 
static void escapeChars (UtlString &unEscapedText, UtlString &tobeEscapedChars)
 Selectively URL escape the text if they are contained in tobeEscapedChars. More...
 
static void escape (UtlString &unEscapedText)
 URL sscape the text. More...
 
static void escapeOneChar (UtlString &unEscapedText, char tobeEscapedChar)
 Selectively URL escape the text if the char is tobeEscapedChar. More...
 
static int getHttpMessageCount ()
 
static UtlBoolean isWholeMessage (const char *messageBuffer, int bufferLength, int &numberBytesChecked, int &contentLength)
 
static int parseHeaders (const char *headerBytes, int messageLength, UtlDList &headerNameValues)
 returns: the number of bytes parsed More...
 
static int findHeaderEnd (const char *messageBytes, int messageLength)
 returns: the number of bytes in the message buffer which constitue the message header More...
 
static void buildBasicAuthorizationCookie (const char *user, const char *password, UtlString *cookie)
 
static void buildMd5UserPasswordDigest (const char *user, const char *realm, const char *password, UtlString &userPasswordDigest)
 
static void buildMd5Digest (const char *userPasswordDigest, const char *algorithm, const char *nonce, const char *cnonce, int nonceCount, const char *qop, const char *method, const char *uri, const char *bodyDigest, UtlString *responseToken)
 

SIP URL manipulators

static void buildSipUrl (UtlString *url, const char *address, int port=PORT_NONE, const char *protocol=NULL, const char *user=NULL, const char *userLabel=NULL, const char *tag=NULL)
 
static void buildReplacesField (UtlString &replacesField, const char *callId, const char *fromField, const char *toFIeld)
 
static UtlBoolean parseParameterFromUri (const char *uri, const char *parameterName, UtlString *parameterValue)
 
static void setUriParameter (UtlString *uri, const char *parameterName, const char *parameterValue)
 
static void parseAddressFromUri (const char *uri, UtlString *address, int *port, UtlString *protocol, UtlString *user=NULL, UtlString *userLabel=NULL, UtlString *tag=NULL)
 
static void ParseContactFields (const SipMessage *sipResponse, const SipMessage *ipRequest, const UtlString &subFieldName, int &subFieldValue)
 
static void setUriTag (UtlString *uri, const char *tagValue)
 
static UtlBoolean getViaTag (const char *viaField, const char *tagName, UtlString &tagValue)
 

SIP specific first header line accessors

void setSipRequestFirstHeaderLine (const char *method, const char *uri, const char *protocolVersion=SIP_PROTOCOL_VERSION)
 
void changeUri (const char *uri)
 
void getUri (UtlString *address, int *port, UtlString *protocol, UtlString *user=NULL) const
 

Request builder methods

void setAckData (const char *uri, const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber=1)
 
void setAckData (const SipMessage *inviteResponse, const SipMessage *inviteRequest, const char *contactUri=NULL, int sessionExpiresSeconds=0)
 
void setAckErrorData (const SipMessage *inviteResponse)
 
void setByeData (const char *uri, const char *fromAddress, const char *toAddress, const char *callId, const char *localContact, int sequenceNumber=1)
 
void setByeData (const SipMessage *inviteResponse, const char *lastRespContact, UtlBoolean byeToCallee, int localSequenceNumber, const char *routeField, const char *alsoInviteUri, const char *localContact)
 
void setCancelData (const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber=1, const char *localContact=NULL)
 
void setCancelData (const SipMessage *inviteResponse, const char *localContact=NULL)
 
void setInviteData (const char *fromAddress, const char *toAddress, const char *farEndContact, const char *contactUrl, const char *callId, int sequenceNumber=1, int sessionReinviteTimer=0)
 
void setInviteData (const SipMessage *previousInvite, const char *newUri)
 
void setReinviteData (SipMessage *invite, const char *farEndContact, const char *contactUrl, UtlBoolean inviteFromThisSide, const char *routeField, int sequenceNumber, int sessionReinviteTimer)
 
void setOptionsData (const SipMessage *inviteRequest, const char *LastRespContact, UtlBoolean optionsToCallee, int localCSequenceNumber, const char *routeField, const char *localContact)
 
void setNotifyData (SipMessage *subscribeRequest, int lastLocalSequenceNumber, const char *route, const char *stateField=NULL, const char *eventField=NULL, const char *id=NULL)
 
void setNotifyData (const char *uri, const char *fromField, const char *toField, const char *callId, int lastNotifyCseq, const char *eventtype, const char *id, const char *state, const char *contact, const char *routeField)
 
void setSubscribeData (const char *uri, const char *fromField, const char *toField, const char *callId, int cseq, const char *eventField, const char *acceptField, const char *id, const char *contact, const char *routeField, int expiresInSeconds)
 
void setEnrollmentData (const char *uri, const char *fromField, const char *toField, const char *callId, int CSequenceNum, const char *contactUrl, const char *protocolField, const char *profileField, int expiresInSeconds=-1)
 
void setMessageSummaryData (UtlString &msgSummaryData, const char *msgAccountUri, UtlBoolean bNewMsgs=FALSE, UtlBoolean bVoiceMsgs=FALSE, UtlBoolean bFaxMsgs=FALSE, UtlBoolean bEmailMsgs=FALSE, int numNewMsgs=-1, int numOldMsgs=-1, int numFaxNewMsgs=-1, int numFaxOldMsgs=-1, int numEmailNewMsgs=-1, int numEmailOldMsgs=-1)
 
void setMWIData (const char *method, const char *fromField, const char *toField, const char *uri, const char *contactUrl, const char *callId, int CSeq, UtlString bodyString)
 
void setRegInfoData (const char *method, const char *fromField, const char *toField, const char *uri, const char *contactUrl, const char *callId, int CSeq, SipRegInfoBody &regInfoBody)
 
void setVoicemailData (const char *fromField, const char *toField, const char *Uri, const char *contactUrl, const char *callId, int CSeq, int subscribePeriod=-1)
 
void setReferData (const SipMessage *inviteResponse, UtlBoolean byeToCallee, int localSequenceNumber, const char *routeField, const char *contactUrl, const char *remoteContactUrl, const char *transferTargetAddress, const char *targetCallId)
 
void setRegisterData (const char *registererUri, const char *registerAsUri, const char *registrarServerUri, const char *takeCallsAtUri, const char *callId, int sequenceNumber, int expiresInSeconds=-1)
 
void setRequestData (const char *method, const char *uri, const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber=1, const char *contactUrl=NULL)
 
void setPublishData (const char *uri, const char *fromField, const char *toField, const char *callId, int cseq, const char *eventField, const char *id, const char *sipIfMatchField, int expiresInSeconds, const char *contact)
 Set a PUBLISH request. More...
 
void applyTargetUriHeaderParams ()
 Apply any header parameters in the request uri to the message. More...
 

Response builders

void setResponseData (const SipMessage *request, int responseCode, const char *responseText, const char *localContact=NULL)
 
void setResponseData (int statusCode, const char *statusText, const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber, const char *sequenceMethod, const char *localContact=NULL)
 
void setOkResponseData (const SipMessage *request, const char *localContact=NULL)
 
void setRequestTerminatedResponseData (const SipMessage *request)
 
virtual void setRequestUnauthorized (const SipMessage *request, const char *authenticationScheme, const char *authenticationRealm, const char *authenticationNonce=NULL, const char *authenticationOpaque=NULL, enum HttpEndpointEnum authEntity=SERVER)
 
void setTryingResponseData (const SipMessage *request)
 
void setInviteBadCodecs (const SipMessage *inviteRequest, SipUserAgent *ua)
 Generate a 488 response (no compatible codecs). More...
 
void setInviteForbidden (const SipMessage *request)
 
void setRequestBadMethod (const SipMessage *request, const char *allowedMethods)
 
void setRequestUnimplemented (const SipMessage *request)
 
void setRequestBadExtension (const SipMessage *request, const char *unsuportedExtensions)
 
void setRequestBadAddress (const SipMessage *request)
 
void setRequestBadVersion (const SipMessage *request)
 
void setRequestBadRequest (const SipMessage *request)
 
void setRequestBadUrlType (const SipMessage *request)
 
void setRequestBadContentEncoding (const SipMessage *request, const char *allowedEncodings)
 
void setInviteRingingData (const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber=1)
 
void setInviteRingingData (const SipMessage *inviteRequest)
 
void setQueuedResponseData (const SipMessage *inviteRequest)
 
void setRequestPendingData (const SipMessage *inviteRequest)
 
void setForwardResponseData (const SipMessage *inviteRequest, const char *forwardAddress)
 
void setInviteBusyData (const char *fromAddress, const char *toAddress, const char *callId, int sequenceNumber=1)
 
void setBadTransactionData (const SipMessage *inviteRequest)
 
void setLoopDetectedData (const SipMessage *inviteRequest)
 
void setInviteBusyData (const SipMessage *inviteRequest)
 
void setInviteErrorData (const SipMessage *inviteRequest, int errorCode, const UtlString &errorText)
 
void setInviteOkData (const SipMessage *inviteRequest, int maxSessionExpiresSeconds, const char *localContact=NULL)
 
int setInviteOkRoutes (const SipMessage &inviteRequest)
 
void setByeErrorData (const SipMessage *byeRequest)
 
void setReferOkData (const SipMessage *referRequest)
 
void setReferDeclinedData (const SipMessage *referRequest)
 
void setReferFailedData (const SipMessage *referRequest)
 
void setEventData (void *pEventData)
 

Specialized header field accessors

UtlBoolean getFieldSubfield (const char *fieldName, int subfieldIndex, UtlString *subfieldValue) const
 
UtlBoolean getContactUri (int addressIndex, UtlString *uri) const
 
UtlBoolean getContactField (int addressIndex, UtlString &contactField) const
 
UtlBoolean getContactEntry (int addressIndex, UtlString *uriAndParameters) const
 
UtlBoolean getContactAddress (int addressIndex, UtlString *contactAddress, int *contactPort, UtlString *protocol, UtlString *user=NULL, UtlString *userLabel=NULL) const
 
void setViaFromRequest (const SipMessage *request)
 
void setReceivedViaParams (const UtlString &fromIpAddress, int fromPort)
 fills in parameters in topmost via based on actual received information. More...
 
void addVia (const char *domainName, int port, const char *protocol, const char *branchId=NULL, const bool bIncludeRport=false, const char *customRouteId=NULL)
 
void addViaField (const char *viaField, UtlBoolean afterOtherVias=TRUE)
 
void setLastViaTag (const char *tagValue, const char *tagName="received")
 
void setCallIdField (const char *callId=NULL)
 
void setCSeqField (int sequenceNumber, const char *method)
 
void incrementCSeqNumber ()
 
void setFromField (const char *fromField)
 
void setFromField (const char *fromAddress, int fromPort, const char *fromProtocol=NULL, const char *fromUser=NULL, const char *fromLabel=NULL)
 
void setRawToField (const char *toField)
 
void setRawFromField (const char *toField)
 
void setToField (const char *toAddress, int toPort, const char *fromProtocol=NULL, const char *toUser=NULL, const char *toLabel=NULL)
 
void setToFieldTag (const char *tagValue)
 
void setToFieldTag (int tagValue)
 
void removeToFieldTag ()
 Remove the To field tag and value. More...
 
void setExpiresField (int expiresInSeconds)
 
void setMinExpiresField (int minimumExpiresInSeconds)
 
void setContactField (const char *contactField, int index=0)
 
void setRequestDispositionField (const char *dispositionField)
 
void addRequestDisposition (const char *dispositionToken)
 
void setWarningField (int code, const char *hostname, const char *text)
 
void getFromLabel (UtlString *fromLabel) const
 
void getToLabel (UtlString *toLabel) const
 
void getFromField (UtlString *fromField) const
 
void getFromUri (UtlString *uri) const
 
void getFromUrl (Url &url) const
 
void getFromAddress (UtlString *fromAddress, int *fromPort, UtlString *protocol, UtlString *user=NULL, UtlString *userLabel=NULL, UtlString *tag=NULL) const
 
UtlBoolean getPAssertedIdentityField (UtlString &identity, int index=0) const
 Get the identity value from the P-Asserted-Identity header field. More...
 
void removePAssertedIdentityFields ()
 Remove all of the P-Asserted-Identity header fields. More...
 
void addPAssertedIdentityField (const UtlString &identity)
 Add the P-Asserted-Identity value. More...
 
UtlBoolean getResponseSendAddress (UtlString &address, int &port, UtlString &protocol) const
 
UtlBoolean getWarningCode (int *warningCode, int index=0) const
 
UtlBoolean getViaField (UtlString *viaField, int index) const
 
UtlBoolean getViaFieldSubField (UtlString *viaSubField, int subFieldIndex) const
 
void getLastVia (UtlString *viaAddress, int *viaPort, UtlString *protocol, int *recievedPort=NULL, UtlBoolean *receivedSet=NULL, UtlBoolean *maddrSet=NULL, UtlBoolean *receivedPortSet=NULL) const
 
UtlBoolean removeLastVia ()
 
void getToField (UtlString *toField) const
 
void getToUri (UtlString *uri) const
 
void getToUrl (Url &url) const
 
void getToAddress (UtlString *toAddress, int *toPort, UtlString *protocol, UtlString *user=NULL, UtlString *userLabel=NULL, UtlString *tag=NULL) const
 
void getCallIdField (UtlString *callId) const
 
void getDialogHandle (UtlString &dialogHandle) const
 
UtlBoolean getCSeqField (int *sequenceNum, UtlString *sequenceMethod) const
 
UtlBoolean getRequireExtension (int extensionIndex, UtlString *extension) const
 
UtlBoolean getProxyRequireExtension (int extensionIndex, UtlString *extension) const
 
void addRequireExtension (const char *extension)
 
UtlBoolean getContentEncodingField (UtlString *contentEncodingField) const
 
UtlBoolean getEventField (UtlString *eventType, UtlString *eventId=NULL, UtlHashMap *params=NULL) const
 Retrieve the event type, id, and other params from the Event Header. More...
 
UtlBoolean getEventField (UtlString &eventField) const
 
void setEventField (const char *eventField)
 
UtlBoolean getExpiresField (int *expiresInSeconds) const
 
UtlBoolean getRequestDispositionField (UtlString *dispositionField) const
 
UtlBoolean getRequestDisposition (int tokenIndex, UtlString *dispositionToken) const
 
UtlBoolean getSessionExpires (int *sessionExpiresSeconds, UtlString *refresher) const
 
void setSessionExpires (int sessionExpiresSeconds, const char *refresher=NULL)
 
UtlBoolean getSupportedField (UtlString &supportedField) const
 
void setSupportedField (const char *supportedField)
 
UtlBoolean isInSupportedField (const char *token) const
 Test whether "token" is present in the Supported: header. More...
 
UtlBoolean getSipIfMatchField (UtlString &sipIfMatchField) const
 Get the SIP-IF-MATCH field from the PUBLISH request. More...
 
void setSipIfMatchField (const char *sipIfMatchField)
 Set the SIP-IF-MATCH field for a PUBLISH request. More...
 
UtlBoolean getSipETagField (UtlString &sipETagField) const
 Get the SIP-ETAG field from the response to a PUBLISH request. More...
 
void setSipETagField (const char *sipETagField)
 Set the SIP-ETAG field in a response to the PUBLISH request. More...
 
const UtlString & getLocalIp () const
 
void setLocalIp (const UtlString &localIp)
 
void setTransportInfo (const SipMessage *pMsg)
 
static void convertProtocolStringToEnum (const char *protocolString, OsSocket::IpProtocolSocketType &protocolEnum)
 
static void convertProtocolEnumToString (OsSocket::IpProtocolSocketType protocolEnum, UtlString &protocolString)
 

SIP Routing header field accessors and manipulators

UtlBoolean getMaxForwards (int &maxForwards) const
 
void setMaxForwards (int maxForwards)
 
void decrementMaxForwards ()
 
UtlBoolean getRecordRouteField (int index, UtlString *recordRouteField) const
 
UtlBoolean getRecordRouteUri (int index, UtlString *recordRouteUri) const
 
void setRecordRouteField (const char *recordRouteField, int index)
 
void addRecordRouteUri (const char *recordRouteUri)
 
UtlBoolean isClientMsgStrictRouted () const
 
UtlBoolean getRouteField (UtlString *routeField) const
 
UtlBoolean getRouteUri (int index, UtlString *routeUri) const
 
void addRouteUri (const char *routeUri)
 
void addLastRouteUri (const char *routeUri)
 
UtlBoolean getLastRouteUri (UtlString &routeUri, int &lastIndex)
 
UtlBoolean removeRouteUri (int index, UtlString *routeUri)
 
void setRouteField (const char *routeField)
 
UtlBoolean buildRouteField (UtlString *routeField) const
 
void normalizeProxyRoutes (const SipUserAgent *sipUA, Url &requestUri, UtlSList *removedRoutes=NULL)
 Adjust route values as required when receiving at a proxy. More...
 

Call control header field accessors

UtlBoolean getAlsoUri (int index, UtlString *alsoUri) const
 Deprecated. More...
 
UtlBoolean getAlsoField (UtlString *alsoField) const
 Deprecated. More...
 
void setAlsoField (const char *alsoField)
 Deprecated. More...
 
void addAlsoUri (const char *alsoUri)
 Deprecated. More...
 
void setRequestedByField (const char *requestedByUri)
 
UtlBoolean getRequestedByField (UtlString &requestedByField) const
 
void setReferToField (const char *referToField)
 
UtlBoolean getReferToField (UtlString &referToField) const
 
void setReferredByField (const char *referredByField)
 
UtlBoolean getReferredByField (UtlString &referredByField) const
 
UtlBoolean getReferredByUrls (UtlString *referrerUrl=NULL, UtlString *referredToUrl=NULL) const
 
void setAllowField (const char *referToField)
 
UtlBoolean getAllowField (UtlString &referToField) const
 
UtlBoolean getReplacesData (UtlString &callId, UtlString &toTag, UtlString &fromTag) const
 
bool hasSelfHeader () const
 
void getServerField (UtlString *serverFieldValue) const
 
void setServerField (const char *serverField)
 
void setAcceptField (const char *acceptField)
 
void setAuthField (const char *authField)
 
void setReasonField (const char *reasonField)
 
UtlBoolean getReasonField (UtlString &reasonField) const
 
void addDiversionField (const char *addr, const char *reasonParam, UtlBoolean afterOtherDiversions=FALSE)
 
void addDiversionField (const char *diversionField, UtlBoolean afterOtherDiversions=FALSE)
 
UtlBoolean getLastDiversionField (UtlString &diversionField, int &lastIndex)
 
UtlBoolean getDiversionField (int index, UtlString &diversionField)
 
UtlBoolean getDiversionField (int index, UtlString &addr, UtlString &reasonParam)
 

DNS SRV state accessors

UtlBoolean getDNSField (UtlString *Protocol, UtlString *Address, UtlString *Port) const
 
void setDNSField (const char *Protocol, const char *Address, const char *Port)
 
void clearDNSField ()
 
UtlBoolean isSameMessage (const SipMessage *message, UtlBoolean responseCodesMustMatch=FALSE) const
 @ Transaction and session related inquiry methods More...
 
UtlBoolean isServerTransaction (UtlBoolean isOutgoing) const
 Is message part of a server or client transaction? More...
 
UtlBoolean isSameSession (const SipMessage *message) const
 
UtlBoolean isResponseTo (const SipMessage *message) const
 
UtlBoolean isAckFor (const SipMessage *inviteResponse) const
 
UtlBoolean isInviteFor (const SipMessage *inviteRequest) const
 
UtlBoolean isSameTransaction (const SipMessage *message) const
 
static UtlBoolean isSameSession (Url &previousUrl, Url &newUrl)
 

Additional Inherited Members

- Static Public Attributes inherited from HttpMessage
static OsAtomicInt smHttpMessageCount
 
- Protected Attributes inherited from HttpMessage
UtlDList mNameValues
 
UtlString mFirstHeaderLine
 
UtlBoolean mHeaderCacheClean
 

Detailed Description

Specialization of HttpMessage to contain and manipulate SIP messages.

See also
HttpMessage for the descriptions of the general constructs manipulators and accessors for the three basic parts of a SIP message. A message can be queried as to whether it is a request or a response via the isResponse method.

Member Enumeration Documentation

Enumerator
NET_UNSPECIFIED 
NET_SIP_MESSAGE 

Constructor & Destructor Documentation

SipMessage ( const char *  messageBytes = NULL,
int  byteCount = -1 
)

Construct from a buffer.

SipMessage ( OsSocket *  inSocket,
int  bufferSize = HTTP_DEFAULT_SOCKET_BUFFER_SIZE 
)

Construct from bytes read from a socket.

SipMessage ( const SipMessage rSipMessage)

Copy constructor.

~SipMessage ( )
virtual

Member Function Documentation

SipMessage & operator= ( const SipMessage rhs)

Assignment operator.

UtlBoolean getShortName ( const char *  longFieldName,
UtlString *  shortFieldName 
)
static
UtlBoolean getLongName ( const char *  shortFieldName,
UtlString *  longFieldName 
)
static
void replaceShortFieldNames ( )
void replaceLongFieldNames ( )
void buildSipUrl ( UtlString *  url,
const char *  address,
int  port = PORT_NONE,
const char *  protocol = NULL,
const char *  user = NULL,
const char *  userLabel = NULL,
const char *  tag = NULL 
)
static
void buildReplacesField ( UtlString &  replacesField,
const char *  callId,
const char *  fromField,
const char *  toFIeld 
)
static
UtlBoolean parseParameterFromUri ( const char *  uri,
const char *  parameterName,
UtlString *  parameterValue 
)
static
void setUriParameter ( UtlString *  uri,
const char *  parameterName,
const char *  parameterValue 
)
static
void parseAddressFromUri ( const char *  uri,
UtlString *  address,
int *  port,
UtlString *  protocol,
UtlString *  user = NULL,
UtlString *  userLabel = NULL,
UtlString *  tag = NULL 
)
static
void ParseContactFields ( const SipMessage sipResponse,
const SipMessage ipRequest,
const UtlString &  subFieldName,
int &  subFieldValue 
)
static
void setUriTag ( UtlString *  uri,
const char *  tagValue 
)
static
UtlBoolean getViaTag ( const char *  viaField,
const char *  tagName,
UtlString &  tagValue 
)
static
void setSipRequestFirstHeaderLine ( const char *  method,
const char *  uri,
const char *  protocolVersion = SIP_PROTOCOL_VERSION 
)
void changeUri ( const char *  uri)
void getUri ( UtlString *  address,
int *  port,
UtlString *  protocol,
UtlString *  user = NULL 
) const
void setAckData ( const char *  uri,
const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber = 1 
)

The following set of methods are used for building requests in this message

void setAckData ( const SipMessage inviteResponse,
const SipMessage inviteRequest,
const char *  contactUri = NULL,
int  sessionExpiresSeconds = 0 
)
void setAckErrorData ( const SipMessage inviteResponse)
void setByeData ( const char *  uri,
const char *  fromAddress,
const char *  toAddress,
const char *  callId,
const char *  localContact,
int  sequenceNumber = 1 
)
void setByeData ( const SipMessage inviteResponse,
const char *  lastRespContact,
UtlBoolean  byeToCallee,
int  localSequenceNumber,
const char *  routeField,
const char *  alsoInviteUri,
const char *  localContact 
)
void setCancelData ( const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber = 1,
const char *  localContact = NULL 
)
void setCancelData ( const SipMessage inviteResponse,
const char *  localContact = NULL 
)
void setInviteData ( const char *  fromAddress,
const char *  toAddress,
const char *  farEndContact,
const char *  contactUrl,
const char *  callId,
int  sequenceNumber = 1,
int  sessionReinviteTimer = 0 
)
void setInviteData ( const SipMessage previousInvite,
const char *  newUri 
)
void setReinviteData ( SipMessage invite,
const char *  farEndContact,
const char *  contactUrl,
UtlBoolean  inviteFromThisSide,
const char *  routeField,
int  sequenceNumber,
int  sessionReinviteTimer 
)
void setOptionsData ( const SipMessage inviteRequest,
const char *  LastRespContact,
UtlBoolean  optionsToCallee,
int  localCSequenceNumber,
const char *  routeField,
const char *  localContact 
)
void setNotifyData ( SipMessage subscribeRequest,
int  lastLocalSequenceNumber,
const char *  route,
const char *  stateField = NULL,
const char *  eventField = NULL,
const char *  id = NULL 
)
void setNotifyData ( const char *  uri,
const char *  fromField,
const char *  toField,
const char *  callId,
int  lastNotifyCseq,
const char *  eventtype,
const char *  id,
const char *  state,
const char *  contact,
const char *  routeField 
)
void setSubscribeData ( const char *  uri,
const char *  fromField,
const char *  toField,
const char *  callId,
int  cseq,
const char *  eventField,
const char *  acceptField,
const char *  id,
const char *  contact,
const char *  routeField,
int  expiresInSeconds 
)
void setEnrollmentData ( const char *  uri,
const char *  fromField,
const char *  toField,
const char *  callId,
int  CSequenceNum,
const char *  contactUrl,
const char *  protocolField,
const char *  profileField,
int  expiresInSeconds = -1 
)
void setMessageSummaryData ( UtlString &  msgSummaryData,
const char *  msgAccountUri,
UtlBoolean  bNewMsgs = FALSE,
UtlBoolean  bVoiceMsgs = FALSE,
UtlBoolean  bFaxMsgs = FALSE,
UtlBoolean  bEmailMsgs = FALSE,
int  numNewMsgs = -1,
int  numOldMsgs = -1,
int  numFaxNewMsgs = -1,
int  numFaxOldMsgs = -1,
int  numEmailNewMsgs = -1,
int  numEmailOldMsgs = -1 
)
void setMWIData ( const char *  method,
const char *  fromField,
const char *  toField,
const char *  uri,
const char *  contactUrl,
const char *  callId,
int  CSeq,
UtlString  bodyString 
)
void setRegInfoData ( const char *  method,
const char *  fromField,
const char *  toField,
const char *  uri,
const char *  contactUrl,
const char *  callId,
int  CSeq,
SipRegInfoBody &  regInfoBody 
)
void setVoicemailData ( const char *  fromField,
const char *  toField,
const char *  Uri,
const char *  contactUrl,
const char *  callId,
int  CSeq,
int  subscribePeriod = -1 
)
void setReferData ( const SipMessage inviteResponse,
UtlBoolean  byeToCallee,
int  localSequenceNumber,
const char *  routeField,
const char *  contactUrl,
const char *  remoteContactUrl,
const char *  transferTargetAddress,
const char *  targetCallId 
)
void setRegisterData ( const char *  registererUri,
const char *  registerAsUri,
const char *  registrarServerUri,
const char *  takeCallsAtUri,
const char *  callId,
int  sequenceNumber,
int  expiresInSeconds = -1 
)
void setRequestData ( const char *  method,
const char *  uri,
const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber = 1,
const char *  contactUrl = NULL 
)
void setPublishData ( const char *  uri,
const char *  fromField,
const char *  toField,
const char *  callId,
int  cseq,
const char *  eventField,
const char *  id,
const char *  sipIfMatchField,
int  expiresInSeconds,
const char *  contact 
)

Set a PUBLISH request.

void applyTargetUriHeaderParams ( )

Apply any header parameters in the request uri to the message.

void addSdpBody ( int  nRtpContacts,
UtlString  hostAddresses[],
int  rtpAudioPorts[],
int  rtcpAudiopPorts[],
int  rtpVideoPorts[],
int  rtcpVideoPorts[],
RTP_TRANSPORT  transportTypes[],
int  numRtpCodecs,
SdpCodec *  rtpCodecs[],
SdpSrtpParameters srtpParams,
int  videoBandwidth,
int  videoFramerate,
const SipMessage pRequest = NULL,
const RTP_TRANSPORT  rtpTransportOptions = RTP_TRANSPORT_UDP 
)

There are some special rules implemented by this routine:

  • The header must not be forbidden by isUrlHeaderAllowed
  • If the header is a From, then any tag parameter on that new From header value is removed, and the tag parameter from the original From header is inserted. The original From header value is inserted in an X-Original-From header.
  • If the header is a Route, it is forced to be a loose route and inserted as the topmost Route.
  • If it a unique header per isUrlHeaderUnique, then the new value replaces the old one.
  • otherwise, the new header is just added.to the message.
void setSecurityAttributes ( const SIPXTACK_SECURITY_ATTRIBUTES *const  pSecurity)
SIPXTACK_SECURITY_ATTRIBUTES* const getSecurityAttributes ( ) const
inline
bool fireSecurityEvent ( const void *  pEventData,
const enum SIPX_SECURITY_EVENT  event,
const enum SIPX_SECURITY_CAUSE  cause,
SIPXTACK_SECURITY_ATTRIBUTES *const  pSecurity,
void *  pCert = NULL,
char *  szSubjectAltName = NULL 
) const
bool smimeEncryptSdp ( const void *  pEventData)
const SdpBody * getSdpBody ( SIPXTACK_SECURITY_ATTRIBUTES *const  pSecurity = NULL,
const void *  pEventData = NULL 
) const

Accessor to get SDP body, optionally decrypting it if key info. is provided.

void setResponseData ( const SipMessage request,
int  responseCode,
const char *  responseText,
const char *  localContact = NULL 
)

The following methods are used to build responses in this message

void setResponseData ( int  statusCode,
const char *  statusText,
const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber,
const char *  sequenceMethod,
const char *  localContact = NULL 
)
void setOkResponseData ( const SipMessage request,
const char *  localContact = NULL 
)
void setRequestTerminatedResponseData ( const SipMessage request)
void setRequestUnauthorized ( const SipMessage request,
const char *  authenticationScheme,
const char *  authenticationRealm,
const char *  authenticationNonce = NULL,
const char *  authenticationOpaque = NULL,
enum HttpEndpointEnum  authEntity = SERVER 
)
virtual
void setTryingResponseData ( const SipMessage request)
void setInviteBadCodecs ( const SipMessage inviteRequest,
SipUserAgent ua 
)

Generate a 488 response (no compatible codecs).

Parameters
uaSipUserAgent from which to extract the agent identification for the Warning: header.
void setInviteForbidden ( const SipMessage request)
void setRequestBadMethod ( const SipMessage request,
const char *  allowedMethods 
)
void setRequestUnimplemented ( const SipMessage request)
void setRequestBadExtension ( const SipMessage request,
const char *  unsuportedExtensions 
)
void setRequestBadAddress ( const SipMessage request)
void setRequestBadVersion ( const SipMessage request)
void setRequestBadRequest ( const SipMessage request)
void setRequestBadUrlType ( const SipMessage request)
void setRequestBadContentEncoding ( const SipMessage request,
const char *  allowedEncodings 
)
void setInviteRingingData ( const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber = 1 
)
void setInviteRingingData ( const SipMessage inviteRequest)
void setQueuedResponseData ( const SipMessage inviteRequest)
void setRequestPendingData ( const SipMessage inviteRequest)
void setForwardResponseData ( const SipMessage inviteRequest,
const char *  forwardAddress 
)
void setInviteBusyData ( const char *  fromAddress,
const char *  toAddress,
const char *  callId,
int  sequenceNumber = 1 
)
void setBadTransactionData ( const SipMessage inviteRequest)
void setLoopDetectedData ( const SipMessage inviteRequest)
void setInviteBusyData ( const SipMessage inviteRequest)
void setInviteErrorData ( const SipMessage inviteRequest,
int  errorCode,
const UtlString &  errorText 
)
void setInviteOkData ( const SipMessage inviteRequest,
int  maxSessionExpiresSeconds,
const char *  localContact = NULL 
)
int setInviteOkRoutes ( const SipMessage inviteRequest)
void setByeErrorData ( const SipMessage byeRequest)
void setReferOkData ( const SipMessage referRequest)
void setReferDeclinedData ( const SipMessage referRequest)
void setReferFailedData ( const SipMessage referRequest)
void setEventData ( void *  pEventData)
inline
UtlBoolean getFieldSubfield ( const char *  fieldName,
int  subfieldIndex,
UtlString *  subfieldValue 
) const
UtlBoolean getContactUri ( int  addressIndex,
UtlString *  uri 
) const
UtlBoolean getContactField ( int  addressIndex,
UtlString &  contactField 
) const
UtlBoolean getContactEntry ( int  addressIndex,
UtlString *  uriAndParameters 
) const
UtlBoolean getContactAddress ( int  addressIndex,
UtlString *  contactAddress,
int *  contactPort,
UtlString *  protocol,
UtlString *  user = NULL,
UtlString *  userLabel = NULL 
) const
void setViaFromRequest ( const SipMessage request)
void setReceivedViaParams ( const UtlString &  fromIpAddress,
int  fromPort 
)

fills in parameters in topmost via based on actual received information.

Parameters
fromIpAddressactual sender ip
fromPortactual sender port
void addVia ( const char *  domainName,
int  port,
const char *  protocol,
const char *  branchId = NULL,
const bool  bIncludeRport = false,
const char *  customRouteId = NULL 
)
void addViaField ( const char *  viaField,
UtlBoolean  afterOtherVias = TRUE 
)
void setLastViaTag ( const char *  tagValue,
const char *  tagName = "received" 
)
void setCallIdField ( const char *  callId = NULL)
void setCSeqField ( int  sequenceNumber,
const char *  method 
)
void incrementCSeqNumber ( )
void setFromField ( const char *  fromField)
void setFromField ( const char *  fromAddress,
int  fromPort,
const char *  fromProtocol = NULL,
const char *  fromUser = NULL,
const char *  fromLabel = NULL 
)
void setRawToField ( const char *  toField)
void setRawFromField ( const char *  toField)
void setToField ( const char *  toAddress,
int  toPort,
const char *  fromProtocol = NULL,
const char *  toUser = NULL,
const char *  toLabel = NULL 
)
void setToFieldTag ( const char *  tagValue)
void setToFieldTag ( int  tagValue)
void removeToFieldTag ( )

Remove the To field tag and value.

void setExpiresField ( int  expiresInSeconds)
void setMinExpiresField ( int  minimumExpiresInSeconds)
void setContactField ( const char *  contactField,
int  index = 0 
)
void setRequestDispositionField ( const char *  dispositionField)
void addRequestDisposition ( const char *  dispositionToken)
void setWarningField ( int  code,
const char *  hostname,
const char *  text 
)
void getFromLabel ( UtlString *  fromLabel) const
void getToLabel ( UtlString *  toLabel) const
void getFromField ( UtlString *  fromField) const
void getFromUri ( UtlString *  uri) const
void getFromUrl ( Url url) const
void getFromAddress ( UtlString *  fromAddress,
int *  fromPort,
UtlString *  protocol,
UtlString *  user = NULL,
UtlString *  userLabel = NULL,
UtlString *  tag = NULL 
) const
UtlBoolean getPAssertedIdentityField ( UtlString &  identity,
int  index = 0 
) const

Get the identity value from the P-Asserted-Identity header field.

Get the identity from the index'th P-Asserted-Identity header field if it exists.

Parameters
identity- network asserted SIP identity (name-addr or addr-spec format). Use the Url class to parse the identity
index- indicates which occurrance of P-Asserted-Identity header to retrieve.
Returns
TRUE/FALSE if the header of the given index exists
void removePAssertedIdentityFields ( )

Remove all of the P-Asserted-Identity header fields.

void addPAssertedIdentityField ( const UtlString &  identity)

Add the P-Asserted-Identity value.

UtlBoolean getResponseSendAddress ( UtlString &  address,
int &  port,
UtlString &  protocol 
) const
void convertProtocolStringToEnum ( const char *  protocolString,
OsSocket::IpProtocolSocketType &  protocolEnum 
)
static
void convertProtocolEnumToString ( OsSocket::IpProtocolSocketType  protocolEnum,
UtlString &  protocolString 
)
static
UtlBoolean getWarningCode ( int *  warningCode,
int  index = 0 
) const
UtlBoolean getViaField ( UtlString *  viaField,
int  index 
) const
UtlBoolean getViaFieldSubField ( UtlString *  viaSubField,
int  subFieldIndex 
) const
void getLastVia ( UtlString *  viaAddress,
int *  viaPort,
UtlString *  protocol,
int *  recievedPort = NULL,
UtlBoolean *  receivedSet = NULL,
UtlBoolean *  maddrSet = NULL,
UtlBoolean *  receivedPortSet = NULL 
) const
UtlBoolean removeLastVia ( )
void getToField ( UtlString *  toField) const
void getToUri ( UtlString *  uri) const
void getToUrl ( Url url) const
void getToAddress ( UtlString *  toAddress,
int *  toPort,
UtlString *  protocol,
UtlString *  user = NULL,
UtlString *  userLabel = NULL,
UtlString *  tag = NULL 
) const
void getCallIdField ( UtlString *  callId) const
void getDialogHandle ( UtlString &  dialogHandle) const
UtlBoolean getCSeqField ( int *  sequenceNum,
UtlString *  sequenceMethod 
) const
UtlBoolean getRequireExtension ( int  extensionIndex,
UtlString *  extension 
) const
UtlBoolean getProxyRequireExtension ( int  extensionIndex,
UtlString *  extension 
) const
void addRequireExtension ( const char *  extension)
UtlBoolean getContentEncodingField ( UtlString *  contentEncodingField) const
UtlBoolean getEventField ( UtlString *  eventType,
UtlString *  eventId = NULL,
UtlHashMap *  params = NULL 
) const

Retrieve the event type, id, and other params from the Event Header.

UtlBoolean getEventField ( UtlString &  eventField) const
void setEventField ( const char *  eventField)
UtlBoolean getExpiresField ( int *  expiresInSeconds) const
UtlBoolean getRequestDispositionField ( UtlString *  dispositionField) const
UtlBoolean getRequestDisposition ( int  tokenIndex,
UtlString *  dispositionToken 
) const
UtlBoolean getSessionExpires ( int *  sessionExpiresSeconds,
UtlString *  refresher 
) const
void setSessionExpires ( int  sessionExpiresSeconds,
const char *  refresher = NULL 
)
UtlBoolean getSupportedField ( UtlString &  supportedField) const
void setSupportedField ( const char *  supportedField)
UtlBoolean isInSupportedField ( const char *  token) const

Test whether "token" is present in the Supported: header.

UtlBoolean getSipIfMatchField ( UtlString &  sipIfMatchField) const

Get the SIP-IF-MATCH field from the PUBLISH request.

void setSipIfMatchField ( const char *  sipIfMatchField)

Set the SIP-IF-MATCH field for a PUBLISH request.

UtlBoolean getSipETagField ( UtlString &  sipETagField) const

Get the SIP-ETAG field from the response to a PUBLISH request.

void setSipETagField ( const char *  sipETagField)

Set the SIP-ETAG field in a response to the PUBLISH request.

const UtlString & getLocalIp ( ) const
void setLocalIp ( const UtlString &  localIp)
void setTransportInfo ( const SipMessage pMsg)
UtlBoolean getMaxForwards ( int &  maxForwards) const
void setMaxForwards ( int  maxForwards)
void decrementMaxForwards ( )
UtlBoolean getRecordRouteField ( int  index,
UtlString *  recordRouteField 
) const
UtlBoolean getRecordRouteUri ( int  index,
UtlString *  recordRouteUri 
) const
void setRecordRouteField ( const char *  recordRouteField,
int  index 
)
void addRecordRouteUri ( const char *  recordRouteUri)
UtlBoolean isClientMsgStrictRouted ( ) const
UtlBoolean getRouteField ( UtlString *  routeField) const
UtlBoolean getRouteUri ( int  index,
UtlString *  routeUri 
) const
void addRouteUri ( const char *  routeUri)
void addLastRouteUri ( const char *  routeUri)
UtlBoolean getLastRouteUri ( UtlString &  routeUri,
int &  lastIndex 
)
UtlBoolean removeRouteUri ( int  index,
UtlString *  routeUri 
)
void setRouteField ( const char *  routeField)
UtlBoolean buildRouteField ( UtlString *  routeField) const
void normalizeProxyRoutes ( const SipUserAgent sipUA,
Url requestUri,
UtlSList *  removedRoutes = NULL 
)

Adjust route values as required when receiving at a proxy.

Check the request URI and the topmost route

  • Detect and correct for any strict router upstream as specified by RFC 3261 section 16.4 Route Information Preprocessing
  • Pop off the topmost route until it is not me

If the removedRoutes is non-NULL, then any removed routes are returned on this list (in the order returned - topmost first) as UtlString objects. The caller is responsible for deleting these UtlStrings (a call to removedRoutes->destroyAll will delete them all).

Parameters
sipUAused to check isMyHostAlias
requestUrireturns normalized request uri
UtlBoolean getAlsoUri ( int  index,
UtlString *  alsoUri 
) const

Deprecated.

UtlBoolean getAlsoField ( UtlString *  alsoField) const

Deprecated.

void setAlsoField ( const char *  alsoField)

Deprecated.

void addAlsoUri ( const char *  alsoUri)

Deprecated.

void setRequestedByField ( const char *  requestedByUri)
UtlBoolean getRequestedByField ( UtlString &  requestedByField) const
void setReferToField ( const char *  referToField)
UtlBoolean getReferToField ( UtlString &  referToField) const
void setReferredByField ( const char *  referredByField)
UtlBoolean getReferredByField ( UtlString &  referredByField) const
UtlBoolean getReferredByUrls ( UtlString *  referrerUrl = NULL,
UtlString *  referredToUrl = NULL 
) const
void setAllowField ( const char *  referToField)
UtlBoolean getAllowField ( UtlString &  referToField) const
UtlBoolean getReplacesData ( UtlString &  callId,
UtlString &  toTag,
UtlString &  fromTag 
) const
bool hasSelfHeader ( ) const
Returns
true if the message has either a User-Agent or Server header
void getServerField ( UtlString *  serverFieldValue) const
void setServerField ( const char *  serverField)
void setAcceptField ( const char *  acceptField)
void setAuthField ( const char *  authField)
void setReasonField ( const char *  reasonField)
UtlBoolean getReasonField ( UtlString &  reasonField) const
void addDiversionField ( const char *  addr,
const char *  reasonParam,
UtlBoolean  afterOtherDiversions = FALSE 
)
void addDiversionField ( const char *  diversionField,
UtlBoolean  afterOtherDiversions = FALSE 
)
UtlBoolean getLastDiversionField ( UtlString &  diversionField,
int &  lastIndex 
)
UtlBoolean getDiversionField ( int  index,
UtlString &  diversionField 
)
UtlBoolean getDiversionField ( int  index,
UtlString &  addr,
UtlString &  reasonParam 
)
UtlBoolean verifyMd5Authorization ( const char *  userId,
const char *  password,
const char *  nonce,
const char *  realm,
const char *  uri = NULL,
enum HttpEndpointEnum  authEntity = SERVER 
) const
UtlBoolean getDNSField ( UtlString *  Protocol,
UtlString *  Address,
UtlString *  Port 
) const
Note
this will be deprecated
void setDNSField ( const char *  Protocol,
const char *  Address,
const char *  Port 
)
void clearDNSField ( )
void setTransaction ( SipTransaction transaction)

Accessor to store transaction reference.

Note
the transaction may be NULL
SipTransaction * getSipTransaction ( ) const

Accessor to get transaction reference.

Note
the transaction may be NULL
const UtlString getTransportName ( bool &  bCustom) const

Accessor to retrieve any transport string from.

to-field. Also determines if it is a custom transport.

void setUseShortFieldNames ( UtlBoolean  bUseShortNames)
inline
UtlBoolean getUseShortFieldNames ( ) const
inline
UtlBoolean isResponse ( ) const

Returns TRUE if this a SIP response as opposed to a request.

UtlBoolean isSameMessage ( const SipMessage message,
UtlBoolean  responseCodesMustMatch = FALSE 
) const

@ Transaction and session related inquiry methods

UtlBoolean isServerTransaction ( UtlBoolean  isOutgoing) const

Is message part of a server or client transaction?

Parameters
isOutgoing- the message is to be sent as opposed to received
UtlBoolean isSameSession ( const SipMessage message) const
UtlBoolean isSameSession ( Url previousUrl,
Url newUrl 
)
static
UtlBoolean isResponseTo ( const SipMessage message) const
UtlBoolean isAckFor ( const SipMessage inviteResponse) const
UtlBoolean isInviteFor ( const SipMessage inviteRequest) const
UtlBoolean isSameTransaction ( const SipMessage message) const
UtlBoolean isRequestDispositionSet ( const char *  dispositionToken) const
UtlBoolean isRequireExtensionSet ( const char *  extension) const
UtlBoolean isUrlHeaderAllowed ( const char *  headerFieldName)
static

Is this a header parameter we want to allow users or apps. to.

UtlBoolean isUrlHeaderUnique ( const char *  headerFieldName)
static

Does this header allow multiple values, or only one.

void parseViaParameters ( const char *  viaField,
UtlContainer &  viaParamList 
)
static

Get the name/value pairs for a Via field.

void OnError ( SIPX_SECURITY_EVENT  event,
SIPX_SECURITY_CAUSE  cause 
)
virtual

Implements ISmimeNotifySink.

bool OnSignature ( void *  pCert,
char *  szSubjAltName 
)
virtual

Implements ISmimeNotifySink.

bool getFromThisSide ( ) const
inline
void setFromThisSide ( const bool  bFromThisSide)
inline

sipXtackLib home page