Impliment /stop
This commit is contained in:
parent
96f2fdf47b
commit
5e2ad3a4c1
10
index.js
10
index.js
|
|
@ -112,9 +112,13 @@ app.post('/stop', async (req, res) => {
|
|||
// Typically it might involve 'asterisk -rx "channel request hangup <channel>"' or similar via AMI.
|
||||
// Assuming we might want to run a command similar to originate but for hangup if we knew the channel.
|
||||
// Since we don't have the channel ID easily available without tracking it, we might need to implement channel tracking or use a broad command.
|
||||
|
||||
// Example placeholder:
|
||||
// exec(`/usr/sbin/asterisk -rx "channel request hangup all"`, (error, stdout, stderr) => { ... });
|
||||
exec(`/usr/bin/ast_drop ${process.env.PAGE_GROUP || '9000'}`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`Error stopping page: ${error}`);
|
||||
return res.status(500).send('Error stopping page');
|
||||
}
|
||||
console.log(`Page stopped: ${stdout}`);
|
||||
});
|
||||
|
||||
res.status(200).send('Stop request received');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue