-
Notifications
You must be signed in to change notification settings - Fork 303
DUM Creating New Client Subscriptions
Scott Godin edited this page Mar 5, 2021
·
1 revision
- To add support for the NOTIFY method
mProfile->addSupportedMethod(NOTIFY);
- To add support for receiving NOTIFY's with the desired body type
mProfile->addSupportedMimeType(NOTIFY, Mime("application", "pidf+xml"));
- To add Support for handling the client subscription
mDum.addClientSubscriptionHandler("presence", mHandler);
Sample Code:
SharedPtr<SipMessage> subMessage = dum.makeSubscription(presentityAor, "presence"); dum.send( subMessage );
Sample Code (this same code can also be used in onUpdatePending and onUpdateExtension):
void MyClientSubscription::onUpdateActive(ClientSubscriptionHandle h, const SipMessage& msg, bool outOfOrder) { InfoLog(<< "onUpdatePending(ClientSubscriptionHandle): handle=" << mSubscriptionHandle << ", " << msg.brief()); h->acceptUpdate(); if(msg.getContents()) { const Data& bodyData = msg.getContents()->getBodyData(); ...handle body... } }
- Navigation
- Developers
- Packages
- Community