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

The generateBranch() method can generate the same branch value #102

Open
jsbeltz opened this issue Feb 23, 2016 · 0 comments
Open

The generateBranch() method can generate the same branch value #102

jsbeltz opened this issue Feb 23, 2016 · 0 comments

Comments

@jsbeltz
Copy link

jsbeltz commented Feb 23, 2016

From http://tools.ietf.org/html/rfc3261#page-39

The branch parameter value MUST be unique across space and time for
all requests sent by the UA. The exceptions to this rule are CANCEL
and ACK for non-2xx responses. As discussed below, a CANCEL request
will have the same value of the branch parameter as the request it
cancels. As discussed in Section 17.1.1.3, an ACK for a non-2xx
response will also have the same branch ID as the INVITE whose
response it acknowledges.

I locally have changed generateBranch to but you might have a better solution for this.

//transaction layer
var uuid = require('node-uuid');
function generateBranch() {
var buffer = new Buffer(16);
return ['z9hG4bK',uuid.v4({}, buffer).toString('hex')].join('');
// return ['z9hG4bK',Math.round(Math.random()*1000000)].join('');
}

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

No branches or pull requests

1 participant