Skip to content

Commit

Permalink
-added code to Dialog.cxx to facilitate Dialog recovery. Expected to …
Browse files Browse the repository at this point in the history
…work in conjunction with the

 new makeInviteSession API that takes a DialogSetId parameter.  If our original outbound request
 contained a to tag, then we are attempting to restore a previously existing dialog (from outside
 this process/stack instance).  Some clients will send the routeset to use as Record-Routes in the
 success response, however clients are not mandated to do so.  So if our original UAC dialog request
 had routes on it, then store these as the routeset for the dialog.
  • Loading branch information
sgodin committed May 24, 2019
1 parent 69e4525 commit 86a6fa0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions resip/dum/Dialog.cxx
Expand Up @@ -240,7 +240,7 @@ Dialog::Dialog(DialogUsageManager& dum, const SipMessage& msg, DialogSet& ds)
InfoLog(<< response); InfoLog(<< response);
throw Exception("lastRequest does not contain a valid contact.", __FILE__, __LINE__); throw Exception("lastRequest does not contain a valid contact.", __FILE__, __LINE__);
} }
mLocalContact = creator->getLastRequest()->header(h_Contacts).front(); mLocalContact = lastRequest->header(h_Contacts).front();
mRemoteTarget = contact; mRemoteTarget = contact;
} }
else else
Expand Down Expand Up @@ -678,8 +678,21 @@ Dialog::dispatch(const SipMessage& msg)
} }
else else
{ {
// Ensure that if the route-set in the 200 is empty, then we overwrite any existing route-sets // Note: This is code to facilitate Dialog recovery, and works in conjunction with the
mRouteSet.clear(); // makeInviteSession API that takes a DialogSetId parameter.
// If our original outbound request contained a to tag, then we are attempting to restore a previously
// existing (outside this process) dialog. Some clients will send the routeset to use as Record-Routes
// in the response, in which case the code above will store them. However clients are not mandated to
// do so, so if our outbound INVITE had routes on it, then store these as the routeset for the dialog.
if (creator->getLastRequest()->header(h_To).exists(p_tag) && creator->getLastRequest()->exists(h_Routes))
{
mRouteSet = creator->getLastRequest()->header(h_Routes);
}
else
{
// Ensure that if the route-set in the 200 is empty, then we overwrite any existing route-sets
mRouteSet.clear();
}
} }
} }


Expand Down

0 comments on commit 86a6fa0

Please sign in to comment.