Open uchepercynnoch opened 1 year ago
Same Here but The App runs fine if i didn't catch any error on Statsis end i likely think that because of the channel is destory while we are accessing the channel, That's why asterisk server return Channel Not Found.Hope Developer Fix it or we need to make a pull request
Anyone have any ideas on this one? I'm having the same issue.
It's always possible to try hanging up a channel that was already hung up, which will trigger an error. You should handle those and any other errors in your async functions using try-catch blocks.
public async run() {
try {
const client = await this.getClient();
client.once('StasisStart', (event, channel) => this.handleStasisStart(event, channel, client));
client.once('StasisEnd', this.handleStasisEnd);
await client.start('hello-world');
} catch (err) {
console.log(err);
}
}
private async handleStasisStart(event: StasisStart, channel: Channel, client: Client) {
try {
const playback = client.Playback();
await channel.ring();
await appSetTimeout(2000);
await channel.answer();
await appSetTimeout(3000);
await channel.play({ media: 'sound:hello-world' }, playback);
await appSetTimeout(3000);
await channel.hangup();
} catch (err) {
console.log(err);
}
}
@uchepercynnoch , you have screen or config of dialplan extension, the part of execute Stasis app
Code Snippet
This works fine when I dial an extension. However, once I terminate the session, and try to hangup the session on
StasisEnd
handler, the above exception is thrown and node exists.I can't seem to point out what is happening. This also happens when I use callbacks not just async/await.
Please help