mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
refactor answer code into one location
This commit is contained in:
@@ -43,20 +43,6 @@ class InboundCallSession extends CallSession {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Answer the call, if it has not already been answered.
|
||||
*/
|
||||
async propagateAnswer() {
|
||||
if (!this.dlg) {
|
||||
assert(this.ep);
|
||||
this.dlg = await this.srf.createUAS(this.req, this.res, {localSdp: this.ep.local.sdp});
|
||||
this.wrapDialog(this.dlg);
|
||||
this.dlg.on('destroy', this._callerHungup.bind(this));
|
||||
this.emit('callStatusChange', {sipStatus: 200, callStatus: CallStatus.InProgress});
|
||||
this.logger.debug(`CallSession:propagateAnswer - answered callSid ${this.callSid}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is invoked when the caller hangs up, in order to calculate the call duration.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user