Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions lib/RTCSession/ReferNotifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,23 @@ module.exports = class ReferNotifier
state = `active;expires=${this._expires}`;
}

// Put this in a try/catch block.
this._session.sendRequest(JsSIP_C.NOTIFY, {
extraHeaders : [
`Event: ${C.event_type};id=${this._id}`,
`Subscription-State: ${state}`,
`Content-Type: ${C.body_type}`
],
body : `SIP/2.0 ${code} ${reason}`,
eventHandlers : {
// If a negative response is received, subscription is canceled.
onErrorResponse() { this._active = false; }
}
});
try
{
this._session.sendRequest(JsSIP_C.NOTIFY, {
extraHeaders : [
`Event: ${C.event_type};id=${this._id}`,
`Subscription-State: ${state}`,
`Content-Type: ${C.body_type}`
],
body : `SIP/2.0 ${code} ${reason}`,
eventHandlers : {
// If a negative response is received, subscription is canceled.
onErrorResponse() { this._active = false; }
}
});
}
catch (e) {
logger.debug('sendRequest exception ignored', e);
}
}
};