mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
initial WIP to remove freeswitch from media path when not recording or transcribing dial calls
This commit is contained in:
@@ -62,6 +62,7 @@ class SingleDialer extends Emitter {
|
||||
opts = opts || {};
|
||||
opts.headers = opts.headers || {};
|
||||
opts.headers = {...opts.headers, 'X-Call-Sid': this.callSid};
|
||||
this.ms = ms;
|
||||
let uri, to;
|
||||
try {
|
||||
switch (this.target.type) {
|
||||
@@ -313,6 +314,17 @@ class SingleDialer extends Emitter {
|
||||
return cs;
|
||||
}
|
||||
|
||||
async releaseMediaToSBC(remoteSdp) {
|
||||
assert(this.dlg);
|
||||
assert(this.dlg.connected);
|
||||
assert(this.ep);
|
||||
assert(typeof remoteSdp === 'string');
|
||||
await this.dlg.modify(remoteSdp);
|
||||
this.ep.destroy()
|
||||
.then(() => this.ep = null)
|
||||
.catch((err) => this.logger.error({err}, 'releaseMediaToSBC: Error destroying endpoint'));
|
||||
}
|
||||
|
||||
_notifyCallStatusChange({callStatus, sipStatus, duration}) {
|
||||
assert((typeof duration === 'number' && callStatus === CallStatus.Completed) ||
|
||||
(!duration && callStatus !== CallStatus.Completed),
|
||||
|
||||
Reference in New Issue
Block a user