[reSIProcate-users] header(h_SessionExpires).param(p_refresher)
Hi,
I want to set the refresher parameter of the Session-Expires header when I send an INVITE.
I've set the following in my MasterProfile:
masterProfile->addSupportedOptionTag(Token(Symbols::Timer));
masterProfile->setDefaultSessionTime(1800);
masterProfile->setDefaultSessionTimerMode(Profile::PreferUASRefreshes);
However, when I send down an INVITE, it contains only the Session-Expires time, without the refresher parameter:
Session-Expires: 1800
Min-SE: 900
Rather than:
Session-Expires: 1800;refresher=uas
Min-SE: 900
I had a poke about the code, and it appears that the InviteSessionCreator constructor doesn't check the value of Profile::mDefaultSessionTimerMode when creating the INVITE.
I've modified the file InviteSessionCreator.cxx to take account of this value:
Index: resip/dum/InviteSessionCreator.cxx
===================================================================
--- resip/dum/InviteSessionCreator.cxx (revision 8515)
+++ resip/dum/InviteSessionCreator.cxx (working copy)
@@ -34,6 +34,19 @@
if(userProfile->getDefaultSessionTime() >= 90)
{
getLastRequest()->header(h_SessionExpires).value() = userProfile->getDefaultSessionTime();
+
+ switch(userProfile->getDefaultSessionTimerMode())
+ {
+ case Profile::PreferLocalRefreshes:
+ case Profile::PreferUACRefreshes:
+ getLastRequest()->header(h_SessionExpires).param(p_refresher) = Data("uac");
+ break;
+ case Profile::PreferRemoteRefreshes:
+ case Profile::PreferUASRefreshes:
+ getLastRequest()->header(h_SessionExpires).param(p_refresher) = Data("uas");
+ break;
+ }
+
getLastRequest()->header(h_MinSE).value() = 90; // Absolute minimum specified by RFC4028
}
}
This seems to work fine, in that my INVITE now contains:
Session-Expires: 1800;refresher=uas
Min-SE: 900
However, it may not be correct in treating Profile::PreferLocalRefreshes as the same as Profile::PreferUACRefreshes and Profile::PreferRemoteRefreshes as the same as Profile::PreferUASRefreshes.
There also seems to be a related bug (though this could come down to the difference between on the one hand: Profile::PreferLocalRefreshes and Profile::PreferUACRefreshes; and on the other hand: Profile::PreferRemoteRefreshes and Profile::PreferUASRefreshes -- the subtleties of which I might misunderstand).
After the timer Session-Expires timer expires the first time (or rather the Min-SE timer), the UAS sends my application a re-INVITE which I acknowledge. The INVITE received contains:
Session-Expires: 1800;refresher=uas
Min-SE: 900
And my 200 OK contains:
Session-Expires: 1800;refresher=uas
Min-SE: 900
However, when the timer fires next time, my reSIProcate sends down an UPDATE, rather than waiting to receive the re-INVITE. This update contains:
Session-Expires: 1800;refresher=uac
Min-SE: 900
I haven't investigated this too much yet, but I think it might be in InviteSession::setSessionTimerHeader(), where the refresher is primarily decided on the basis of whether the message is a request or not, rather than on either the Profile preference, or the content of the refresher parameter in the received message:
msg.header(h_SessionExpires).value() = mSessionInterval;
if(msg.isRequest())
{
msg.header(h_SessionExpires).param(p_refresher) = Data(mSessionRefresher ? "uac" : "uas");
}
else
{
msg.header(h_SessionExpires).param(p_refresher) = Data(mSessionRefresher ? "uas" : "uac");
}
msg.header(h_MinSE).value() = mMinSE;
I'll look into this further.
Regards,
Ruadhri.