[reSIProcate] Bug in error handling / reSUBSCRIBE case for ClientSubscription
Scott Godin
sgodin at sipspectrum.com
Fri Sep 17 14:42:09 CDT 2010
Hi Aron,
Can you try this fix out?
Index: ClientSubscription.cxx
===================================================================
--- ClientSubscription.cxx (revision 8806)
+++ ClientSubscription.cxx (working copy)
@@ -170,7 +170,9 @@
InfoLog (<< "Received 481 to SUBSCRIBE, reSUBSCRIBEing (presence
server probably restarted) "
<< mLastRequest->header(h_To));
- SharedPtr<SipMessage> sub =
mDum.makeSubscription(mLastRequest->header(h_To), getUserProfile(),
getEventType(), getAppDialogSet()->reuse());
+ NameAddr target(mLastRequest->header(h_To));
+ target.remove(p_tag); // ensure To tag is removed
+ SharedPtr<SipMessage> sub = mDum.makeSubscription(target,
getUserProfile(), getEventType(), getAppDialogSet()->reuse());
mDum.send(sub);
delete this;
@@ -221,7 +223,9 @@
}
else
{
- SharedPtr<SipMessage> sub =
mDum.makeSubscription(mLastRequest->header(h_To), getUserProfile(),
getEventType(), getAppDialogSet()->reuse());
+ NameAddr target(mLastRequest->header(h_To));
+ target.remove(p_tag); // ensure To tag is removed
+ SharedPtr<SipMessage> sub = mDum.makeSubscription(target,
getUserProfile(), getEventType(), getAppDialogSet()->reuse());
mDum.send(sub);
delete this;
return;
@@ -450,7 +454,9 @@
{
InfoLog(<< "ClientSubscription: application retry new
request");
- SharedPtr<SipMessage> sub =
mDum.makeSubscription(mLastRequest->header(h_To), getUserProfile(),
getEventType(), getAppDialogSet()->reuse());
+ NameAddr target(mLastRequest->header(h_To));
+ target.remove(p_tag); // ensure To tag is removed
+ SharedPtr<SipMessage> sub = mDum.makeSubscription(target,
getUserProfile(), getEventType(), getAppDialogSet()->reuse());
mDum.send(sub);
delete this;
}
Thanks,
Scott
On Wed, Sep 15, 2010 at 6:14 PM, <aron_rosenberg at logitech.com> wrote:
> In a number of places in ClientSubscription.cxx, the class will
> automatically invoke dum.makeSubscription to create a new subscription if
> the current one is failed. One such place is
>
> else if (!mEnded &&
> msg.header(h_StatusLine).statusCode() == 481 &&
> msg.exists(h_Expires) && msg.header(h_Expires).value() > 0)
> {
> InfoLog (<< "Received 481 to SUBSCRIBE, reSUBSCRIBEing (presence server
> probably restarted) "
> << mLastRequest->header(h_To));
>
> SharedPtr<SipMessage> sub =
> mDum.makeSubscription(mLastRequest->header(h_To), getUserProfile(),
> getEventType(), getAppDialogSet()->reuse());
> mDum.send(sub);
>
> delete this;
> return;
> }
>
> This is the 481 dialog doesn't exist case. In this case, dum is properly
> building a new SUBSCRIBE message, but the new SUBSCRIBE message/dialog
> starts out with a populated ToTag. The presence server then rejects this new
> dialog since a ToTag must start empty. The new request has a different
> Call-Id, from tag, branch tag/via, but the ToTag is the same as the previous
> failed request
>
> My hunch is that passing in h_To is causing the old ToTag to get copied to
> the new request, but I am not sure what the proper fix is... I already tried
> removing the getAppDialogSet()->reuse() param but it didn't have any affect.
>
> I have a test case setup for this with our presence server so I can try
> various patches.
>
> -Aron
>
> Aron Rosenberg
> Logitech Inc, (SightSpeed Group)
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20100917/a3d4482c/attachment.htm>
More information about the resiprocate-devel
mailing list