acoustic-pharmacist-34178
02/26/2026, 10:30 PMllm.tool({
description: config?.tool_description || 'Hngup the phone call.',
execute: async (_, { ctx }) => {
console.log('SIP Hangup Tool: Starting execution.');
if (config.speak_during_execution && config?.speak_message) {
await ctx.waitForPlayout();
ctx.session.generateReply({
instructions: config.speak_message,
});
await ctx.waitForPlayout();
}
try {
const jobCtx = getJobContext();
await hangupSipCall(jobCtx);
return `SIP call has been hung up successfully.`;
} catch (err) {
const message =
err instanceof Error ? err.message : 'SIP transfer failed.';
return `Failed to hang up SIP call: ${message}`;
}
},
});