sipxtacklib
Version 3.3
|
Client for SIP Presence and Instant Messaging. More...
#include <SipPimClient.h>
Public Types | |
enum | SipxRpidStates { invalid = -1, closed, open } |
typedef void(* | MessageCallback) (void *userData, const UtlString &fromAddress, const char *textMessage, int textLength, const char *subject, const SipMessage &messageRequest) |
Public Member Functions | |
SipPimClient (SipUserAgent &userAgent, Url &presentityAor) | |
Constructor. More... | |
virtual | ~SipPimClient () |
Destructor. More... | |
void | setLocalKeyCert (const char *localPkcs12DerKeyCert, int localPkcs12DerKeyCertLength, const char *sPkcs12Password) |
Set the Private key and Certificate for the local side. More... | |
void | setRemoteCertificate (const char *derFormatCertificate, int derFormatCertificateLength) |
Set the certificate containing the public key for the remote side. More... | |
UtlBoolean | sendPagerMessage (Url &destinationAor, const char *messageText, const char *subject, int &responseCode, UtlString &responseCodeText) |
Send a pager style instant message to the given destination. More... | |
void | setIncomingImTextHandler (MessageCallback callback, void *userData) |
Set callback function for incoming pager mode text messages. More... | |
UtlBoolean | updatePresenceState (SipxRpidStates newState) |
Update the presence state of the presentity indicate. More... | |
UtlBoolean | handleMessage (OsMsg &eventMessage) |
Handler for incoming SIP messages. More... | |
Protected Member Functions | |
void | getNextCallId (UtlString &callId) |
Call Id generator for SipPimClient. More... | |
Client for SIP Presence and Instant Messaging.
This client provides interfaces for publishing the current presence state of an entity or AOR. It also provides a basic client for sending pager style instant messages. That is non-session based messages using the MESSAGE request. Note that a user interface can provide a session base end user experience using a non-session based messages.
typedef void(* MessageCallback) (void *userData, const UtlString &fromAddress, const char *textMessage, int textLength, const char *subject, const SipMessage &messageRequest) |
enum SipxRpidStates |
SipPimClient | ( | SipUserAgent & | userAgent, |
Url & | presentityAor | ||
) |
Constructor.
Construct and bind AOR and user agent for Presence and IM client.
userAgent | - user agent to send requests and receive reponses |
presentityAor | - the entity whose presence state is to be published. This is also the From nameAddr used for instant messages sent. |
|
virtual |
Destructor.
void setLocalKeyCert | ( | const char * | localPkcs12DerKeyCert, |
int | localPkcs12DerKeyCertLength, | ||
const char * | sPkcs12Password | ||
) |
Set the Private key and Certificate for the local side.
localPkcs12DerKeyCert | DER format PKCS12 container for private key and certificate for the local side. |
localPkcs12DerKeyCertLength | the length of localPkcs12DerKeyCert in bytes |
sPkcs12Password | password (symmetric key) to decrypt the PKCS12 container/wrapper. |
void setRemoteCertificate | ( | const char * | derFormatCertificate, |
int | derFormatCertificateLength | ||
) |
Set the certificate containing the public key for the remote side.
Setting the remote certificate enable encryption of IM messages to the other side.
derFormatCertificate | - DER format certificate |
derFormatCertificateLength | - length of the certificate |
UtlBoolean sendPagerMessage | ( | Url & | destinationAor, |
const char * | messageText, | ||
const char * | subject, | ||
int & | responseCode, | ||
UtlString & | responseCodeText | ||
) |
Send a pager style instant message to the given destination.
Send a non-session based instant message using the MESSAGE method.
destinationAor | - destination to send the IM to. |
messageText | - text of the message to send in the IM |
responseCode | - the response code from the request to sent the text |
responseCodeText | - the response code text from the top header line |
void setIncomingImTextHandler | ( | MessageCallback | callback, |
void * | userData | ||
) |
Set callback function for incoming pager mode text messages.
Set the function to be called if there are incoming MESSAGE requests with text bodies. Note: the SipPimClient task MUST be started up for the callback to get invoked.
textHandler | - callback function with the following arguments: |
fromAddress | - the from field from the request |
textMessage | - the text message from the request body |
messageRequest | - the MESSAGE request |
UtlBoolean updatePresenceState | ( | SipxRpidStates | newState | ) |
Update the presence state of the presentity indicate.
Send a PUBLISH request to update the RPID document with the given presence state. If the current state is the same the presence state document is not updated.
newState | - the new RPID presence state to be published. |
UtlBoolean handleMessage | ( | OsMsg & | eventMessage | ) |
Handler for incoming SIP messages.
This consumes SIP messages and dispatched them to the callbacks.
|
protected |
Call Id generator for SipPimClient.