Skip to content

Commit

Permalink
YATE-client REGISTER fix (Yate support only 'auth' Digest)
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-ject committed Aug 28, 2018
1 parent 4f8873b commit 87ab244
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/100.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ module.exports = function(rq, flow, cb) {
function auth(err, session) {
session = session || { realm: sip._realm };
if (!isGuest(user) && !(digest.authenticateRequest(session, rq, { user: user, password: data.password })) && !(data.client_id)) {
let rs = digest.challenge(session, sip.makeResponse(rq, 407, 'Proxy Authentication Required'));
//let rs = digest.challenge(session, sip.makeResponse(rq, 407, 'Proxy Authentication Required'));
let rs = digest.challenge(session, sip.makeResponse(rq, 401, 'Unauthorized')); //if sip-server mode
if (rq.headers['user-agent'].match(/yate/i))
delete rs.headers[rs.status === 407 ? 'proxy-authenticate' : 'www-authenticate'][0].qop;

sip._registry.set(sip._sessionPrefix + user + rinstance, sip._sessionTimeout, session);

try {
Expand Down

0 comments on commit 87ab244

Please sign in to comment.