Difference between revisions of "Out of Dialog Requests"

From reSIProcate
Jump to: navigation, search
(Created page with "=Sending An Out-of-Dialog Request= *Ensure you install a ClientOutOfDialogHandler. ie: mDum->addOutOfDialogHandler(REFER, mUA); *Implement the OutOfDialogHandlers. ie:...")
(No difference)

Revision as of 16:51, 16 December 2016

Sending An Out-of-Dialog Request

  • Ensure you install a ClientOutOfDialogHandler. ie: mDum->addOutOfDialogHandler(REFER, mUA);
  • Implement the OutOfDialogHandlers. ie:
// OutOfDialogHandler //////////////////////////////////////////////////////////
virtual void onSuccess(resip::ClientOutOfDialogReqHandle, const resip::SipMessage& response);
virtual void onFailure(resip::ClientOutOfDialogReqHandle, const resip::SipMessage& response);
virtual void onReceivedRequest(resip::ServerOutOfDialogReqHandle, const resip::SipMessage& request);
  • If you are only sending a request, then all you need to fill in is the onSuccess and onFailure methods. This is where you place your logic to handle a successful or failed OOD request.
  • There are two methods on DialogUsageManager class for creating OOD requests. See DialogUsageManager::makeOutOfDialogRequest. One takes a user profile. The other will use the installed MasterProfile.
  • You can provide an AppDialogSet to the methods, if you want to store application specific data that you can access later in the onSuccess and onFailure callbacks.
  • Call DialogUsageManager::makeOutOfDialogRequest with something like: makeOutOfDialogRequest(toAor, userProfile, REFER, MyAppDialogSet) This will create a REFER message and pass it back to you in a SharedPtr.
  • You can add modify headers on the returned message. ie: for an OOD REFER you will probably want to add a ReferTo and/or ReferredBy headers to the returned message.
  • Use DialogUsageManager::send when you are happy with the message to send it out. See dum/test/BasicCall main line 725 for a really basic example of sending an OOD OPTIONs message.
  • Expect to receive either an onSuccess or onFailure callback.