[reSIProcate] retry-after for ServerSubscription termination.
Dear resiprocate devels,
For some server subscription termination it is required to set
retry-after parameter to Subscription-State header as per RFC 3265
(3.2.4)
But currently DUM has no support for this.
Please consider attached patch for this purposes.
Thanks,
Roman Romanchenko.
Index: resip/dum/ServerSubscription.cxx
===================================================================
--- resip/dum/ServerSubscription.cxx (revision 10023)
+++ resip/dum/ServerSubscription.cxx (working copy)
@@ -356,15 +356,22 @@
void
-ServerSubscription::end(TerminateReason reason, const Contents* document)
+ServerSubscription::end(TerminateReason reason, const Contents* document, int retryAfter)
{
mSubscriptionState = Terminated;
makeNotify();
mLastRequest->header(h_SubscriptionState).param(p_reason) = getTerminateReasonString(reason);
+
if (document)
{
mLastRequest->setContents(document);
}
+
+ if (retryAfter != 0)
+ {
+ mLastRequest->header(h_SubscriptionState).param(p_retryAfter) = retryAfter;
+ }
+
send(mLastRequest);
}
Index: resip/dum/ServerSubscription.hxx
===================================================================
--- resip/dum/ServerSubscription.hxx (revision 10023)
+++ resip/dum/ServerSubscription.hxx (working copy)
@@ -30,7 +30,7 @@
void setSubscriptionState(SubscriptionState state);
SharedPtr<SipMessage> update(const Contents* document);
- void end(TerminateReason reason, const Contents* document = 0);
+ void end(TerminateReason reason, const Contents* document = 0, int retryAfter = 0);
virtual void end();
virtual void send(SharedPtr<SipMessage> msg);