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();
|
||||
let receiver: Channel = this.client.pbx.ari.Channel();
|
||||
const sender = await this.client.pbx.ari.channels.originate({
|
||||
endpoint: `PJSIP/${staff.extension}`,
|
||||
extension: staff.extension,
|
||||
callerId: 'LOC PBX AUTO OPERATOR <operator>',
|
||||
context: 'from-internal',
|
||||
priority: 1,
|
||||
app: 'cr-zero',
|
||||
});
|
||||
let sender: Channel = this.client.pbx.ari.Channel();
|
||||
|
||||
try {
|
||||
sender = await this.client.pbx.ari.channels.originate({
|
||||
endpoint: `PJSIP/${staff.extension}`,
|
||||
extension: staff.extension,
|
||||
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 () => {
|
||||
await Misc.play(this.client.pbx, sender, 'sound:pls-hold-while-try');
|
||||
|
|
Loading…
Reference in New Issue