Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUBSCRIBE refresh requests do not contain a To tag #87

Closed
josephfrazier opened this issue Aug 14, 2014 · 1 comment
Closed

SUBSCRIBE refresh requests do not contain a To tag #87

josephfrazier opened this issue Aug 14, 2014 · 1 comment
Assignees
Labels

Comments

@josephfrazier
Copy link
Contributor

According to RFC 6665 Section 4.1.2.2 (emphasis mine):

At any time before a subscription expires, the subscriber may refresh
the timer on such a subscription by sending another SUBSCRIBE request
on the same dialog as the existing subscription. The handling for
such a request is the same as for the initial creation of a
subscription except as described below.

However, a SIP.js Subscription refreshes itself by calling its subscribe method, as seen on lines 94 and 199 of Subscription.js. Since the subscribe method simply (re)sends the initial SUBSCRIBE request, it does not contain a To tag, but it should according to RFC 3261 Section 12.2.1.1 (emphasis mine):

The URI in the To field of the request MUST be set to the remote URI
from the dialog state. The tag in the To header field of the request
MUST be set to the remote tag of the dialog ID.
The From URI of the
request MUST be set to the local URI from the dialog state. The tag
in the From header field of the request MUST be set to the local tag
of the dialog ID. If the value of the remote or local tags is null,
the tag parameter MUST be omitted from the To or From header fields,
respectively.

This can be demonstrated by using code from #86 to create a UA with traceSip:true, calling UA#subscribe with a small value for the expires option, and observing the resulting SUBSCRIBE requests. Notice that the refresh requests actually create separate subscriptions, which explains why they have different ids in Subscription#receiveResponse.

josephfrazier pushed a commit to josephfrazier/SIP.js that referenced this issue Sep 3, 2014
refresh breaks with:

  SIP/2.0 403 forbidden in-dialog request without top Route pointing to us

 onsip#87
@wakamoleguy
Copy link
Contributor

Fixed in f80adf8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants