< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] [PATCH] Expand REFER w/ Replaces API


Anybody see any issues with the following patch to expand InviteSession's REFER w/ Replaces API to be able to take a Contents* just like the normal REFER call does?

If I don't hear anything in the next few days, I will commit it.


Index: resip/dum/InviteSession.hxx
===================================================================
--- resip/dum/InviteSession.hxx (revision 9004)
+++ resip/dum/InviteSession.hxx (working copy)
@@ -78,7 +78,9 @@
 
       /** sends a refer request with a replaces header */
       virtual void refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub = true);
+      virtual void refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::auto_ptr<resip::Contents> contents, bool referSub = true);
       virtual void refer(const NameAddr& referTo, const CallId& replaces, bool referSub = true);
+      virtual void refer(const NameAddr& referTo, const CallId& replaces, std::auto_ptr<resip::Contents> contents, bool referSub = true);
 
       /** sends an info request */
       virtual void info(const Contents& contents);
Index: resip/dum/InviteSession.cxx
===================================================================
--- resip/dum/InviteSession.cxx (revision 9004)
+++ resip/dum/InviteSession.cxx (working copy)
@@ -896,6 +896,12 @@
 void
 InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub)
 {
+   refer(referTo,sessionToReplace,std::auto_ptr<resip::Contents>(0),referSub);
+}
+
+void
+InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::auto_ptr<resip::Contents> contents, bool referSub)
+{
    if (!sessionToReplace.isValid())
    {
       throw UsageUseException("Attempted to make a refer w/ and invalid replacement target", __FILE__, __LINE__);
@@ -907,17 +913,23 @@
    replaces.param(p_toTag) = id.getRemoteTag();
    replaces.param(p_fromTag) = id.getLocalTag();
 
-   refer(referTo, replaces, referSub);
+   refer(referTo, replaces, contents, referSub);
 }
 
 void 
 InviteSession::refer(const NameAddr& referTo, const CallId& replaces, bool referSub)
 {
+   refer(referTo,replaces,std::auto_ptr<resip::Contents>(0),referSub);
+}
+
+void 
+InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::auto_ptr<resip::Contents> contents, bool referSub)
+{
    if (isConnected())  // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
    {
       SharedPtr<SipMessage> refer(new SipMessage());      
       mDialog.makeRequest(*refer, REFER);
-
+      refer->setContents(contents);
       refer->header(h_ReferTo) = referTo;
       refer->header(h_ReferredBy) = myAddr();
       refer->header(h_ReferredBy).remove(p_tag);


Aron Rosenberg
Sr. Director, Engineering
Logitech Inc. (SightSpeed Group)