mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fix exception in dial verb when dtmf detected but detector not in place
This commit is contained in:
@@ -206,19 +206,21 @@ class TaskDial extends Task {
|
|||||||
_removeDtmfDetection(cs, ep) {
|
_removeDtmfDetection(cs, ep) {
|
||||||
if (ep) {
|
if (ep) {
|
||||||
delete ep.dtmfDetector;
|
delete ep.dtmfDetector;
|
||||||
ep.removeListener('dtmf', this._onDtmf.bind(this, cs, ep));
|
ep.removeAllListeners('dtmf');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onDtmf(cs, ep, evt) {
|
_onDtmf(cs, ep, evt) {
|
||||||
const match = ep.dtmfDetector.keyPress(evt.dtmf);
|
if (ep.dtmfDetector) {
|
||||||
const requestor = ep.dtmfDetector === this.parentDtmfCollector ?
|
const match = ep.dtmfDetector.keyPress(evt.dtmf);
|
||||||
cs.requestor :
|
const requestor = ep.dtmfDetector === this.parentDtmfCollector ?
|
||||||
this.sd.requestor;
|
cs.requestor :
|
||||||
if (match) {
|
this.sd.requestor;
|
||||||
this.logger.debug(`parentCall triggered dtmf match: ${match}`);
|
if (match) {
|
||||||
requestor.request(this.dtmfHook, Object.assign({dtmf: match}, cs.callInfo))
|
this.logger.debug(`parentCall triggered dtmf match: ${match}`);
|
||||||
.catch((err) => this.logger.info(err, 'Dial:_onDtmf - error'));
|
requestor.request(this.dtmfHook, Object.assign({dtmf: match}, cs.callInfo))
|
||||||
|
.catch((err) => this.logger.info(err, 'Dial:_onDtmf - error'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user