[reSIProcate] Question about outbound decorator
Hi,
I have a
question about outbound decorator.
I noticed that
in Resiprocate 1.4.1 outbound decorator was added to SipMessage if it was a
request, while to "give app an chance to adorn the message" (as written in comment) onReadyToSend() method is called in DialogUsage::send().
As a consequence
onReadyToSend() method is called for InviteSession, ClientSubscription and
ServerSubscription (this is true also for Resiprocate 1.5).
See the following
excerpt taken from DialogUsageManager::send() method:
if
(msg->isRequest())
{
[...]
// !bwc! This is to avoid leaving
extra copies of the decorator in msg,
// when
the caller of this function holds onto the reference (and
this
// happens quite often in DUM). I would
prefer to refactor such that we
// are
operating on a copy in this function, but this would require a
lot
// of work on the DumFeatureChain stuff
(or, require an extra copy on top
// of the
one we're doing when we send the message to the stack,
which
// would chew up a lot of extra
cycles).
msg->clearOutboundDecorators();
// Add outbound decorator from
userprofile
SharedPtr<MessageDecorator>
outboundDecorator =
userProfile->getOutboundDecorator();
if
(outboundDecorator.get())
{
msg->addOutboundDecorator(std::auto_ptr<MessageDecorator>(outboundDecorator->clone()));
}
[...]
}
In Resiprocate 1.5
the reported block has been moved outside if statement, so outbound decorator
is called for every SipMessage (request or response).
This change has
modified behaviour of my application when I have updated Resiprocete release
from 1.4.1 to 1.5, but this is my concern.
Anyway, could anyone
tell me why that block has been moved since onReadyToSend() could possibly be
used to add outbound decorator to SipMessage?
What onReadyToSend()
method is used for?
Thank you in advance
and best regards.
Dario.