fix sip cmd

merge-requests/21/merge
Matthew 2021-03-06 18:05:11 -05:00
parent 79dae33fac
commit e43ecb8146
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 14 additions and 8 deletions

View File

@ -23,14 +23,20 @@ export default class SIP extends Command {
const bridge = await this.client.pbx.ari.Bridge().create(); const bridge = await this.client.pbx.ari.Bridge().create();
let receiver: Channel = this.client.pbx.ari.Channel(); let receiver: Channel = this.client.pbx.ari.Channel();
const sender = await this.client.pbx.ari.channels.originate({ let sender: Channel = this.client.pbx.ari.Channel();
endpoint: `PJSIP/${staff.extension}`,
extension: staff.extension, try {
callerId: 'LOC PBX AUTO OPERATOR <operator>', sender = await this.client.pbx.ari.channels.originate({
context: 'from-internal', endpoint: `PJSIP/${staff.extension}`,
priority: 1, extension: staff.extension,
app: 'cr-zero', callerId: 'LOC PBX AUTO OPERATOR <operator>',
}); context: 'from-internal',
priority: 1,
app: 'cr-zero',
});
} catch {
return this.error(message.channel, 'Unable to dial your extension.');
}
sender.once('StasisStart', async () => { sender.once('StasisStart', async () => {
await Misc.play(this.client.pbx, sender, 'sound:pls-hold-while-try'); await Misc.play(this.client.pbx, sender, 'sound:pls-hold-while-try');