mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 09:08:02 +00:00
add sip decline testcase
This commit is contained in:
@@ -796,9 +796,9 @@ class CallSession extends Emitter {
|
||||
}
|
||||
}
|
||||
|
||||
if (0 === this.tasks.length && ((this.requestor instanceof WsRequestor && !this.callGone) ||
|
||||
// Tasks are all done, but dialog is not establish yet, waiting for cancel/handup the call.
|
||||
!this.dlg)) {
|
||||
if (0 === this.tasks.length && ((this.requestor instanceof WsRequestor && !this.callGone)||
|
||||
// Tasks are all done, but outgoing dialog is not establish yet, waiting for cancel/handup the call.
|
||||
!this.dlg && !this.isFinalStatus() && this.direction === CallDirection.Outbound)) {
|
||||
//let span;
|
||||
try {
|
||||
//const {span} = this.rootSpan.startChildSpan('waiting for commands');
|
||||
@@ -1793,16 +1793,15 @@ class CallSession extends Emitter {
|
||||
this.updateCallStatus(Object.assign({}, this.callInfo.toJSON()), this.serviceUrl)
|
||||
.catch((err) => this.logger.error(err, 'redis error'));
|
||||
|
||||
if (this.wakeupResolver && !this.dlg && this.isCurrentCallStatusHigherThan(CallStatus.Failed)) {
|
||||
if (this.wakeupResolver && !this.dlg && this.isFinalStatus()) {
|
||||
// Someone is waiting for call to be final
|
||||
this.wakeupResolver({reason: 'session ended'});
|
||||
this.wakeupResolver = null;
|
||||
}
|
||||
}
|
||||
|
||||
isCurrentCallStatusHigherThan(target) {
|
||||
const obj = Object.values(CallStatus);
|
||||
return obj.indexOf(this.callStatus) >= obj.indexOf(target);
|
||||
isFinalStatus() {
|
||||
return [CallStatus.Failed, CallStatus.Busy, CallStatus.NoAnswer, CallStatus.Completed].includes(this.callStatus)
|
||||
}
|
||||
|
||||
async executeStatusCallback(callStatus, sipStatus) {
|
||||
|
||||
Reference in New Issue
Block a user