fix sip cmd
parent
79dae33fac
commit
e43ecb8146
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue