Skip to content

Commit d3dbde8

Browse files
author
Miguel Nogueira
committed
ReferNotifier sendRequest ignored
Scenario to be solved: A is on communication with B B transfers the call to C (blind transfer) B hangups the call with A, when trying is received C answers the call and the exception is triggered, killing the call The exception is triggered whenever A is trying to notify B about the refer status.
1 parent fff94c5 commit d3dbde8

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

lib/RTCSession/ReferNotifier.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,23 @@ module.exports = class ReferNotifier
4444
state = `active;expires=${this._expires}`;
4545
}
4646

47-
// Put this in a try/catch block.
48-
this._session.sendRequest(JsSIP_C.NOTIFY, {
49-
extraHeaders : [
50-
`Event: ${C.event_type};id=${this._id}`,
51-
`Subscription-State: ${state}`,
52-
`Content-Type: ${C.body_type}`
53-
],
54-
body : `SIP/2.0 ${code} ${reason}`,
55-
eventHandlers : {
56-
// If a negative response is received, subscription is canceled.
57-
onErrorResponse() { this._active = false; }
58-
}
59-
});
47+
try
48+
{
49+
this._session.sendRequest(JsSIP_C.NOTIFY, {
50+
extraHeaders : [
51+
`Event: ${C.event_type};id=${this._id}`,
52+
`Subscription-State: ${state}`,
53+
`Content-Type: ${C.body_type}`
54+
],
55+
body : `SIP/2.0 ${code} ${reason}`,
56+
eventHandlers : {
57+
// If a negative response is received, subscription is canceled.
58+
onErrorResponse() { this._active = false; }
59+
}
60+
});
61+
}
62+
catch (e) {
63+
logger.debug('sendRequest exception ignored', e);
64+
}
6065
}
6166
};

0 commit comments

Comments
 (0)