Hi <@U08CKJH7C12>, I just switched to openai gpt-...
# agents
n
Hi @refined-appointment-81829, I just switched to openai gpt-4o from openai_realtime, and voicemail stopped working. It ends the call as soon as user's voicemail script is over. Function:
Copy code
@function_tool()
    async def leave_voicemail(self, ctx: RunContext):
        """
        TERMINAL FUNCTION.
        Leave an automated voicemail message when the call is forwarded to voicemail.
        Rules:
        - Do not append any ADDITIONAL instructions, commentary, or acknowledgements.
        """
        logger.info("Leaving voicemail for patient")
        voicemail_message = self.voicemail_template or self.get_default_voicemail()
        logger.info(f"Voicemail message: {voicemail_message[:100]}...")
        await ctx.session.say(
            text=voicemail_message,
        )
        await self.end_call(ctx=ctx)
Section which handles voicemail in my prompt:
Copy code
### 5. WHEN CALL IS FORWARDED TO VOICEMAIL
If the call is forwarded to voicemail:
**IMMEDIATE ACTION REQUIRED:**
- IMMEDIATELY use: `leave_voicemail()`
- **CRITICAL: This function will automatically:**
  - Deliver the complete voicemail message
  - Wait for message delivery to complete
  - Update call records appropriately
  - End the call automatically
- **DO NOT take any other actions after calling this function**
- **DO NOT continue conversation or use `end_call()` separately**
**Technical Notes:**
- The `leave_voicemail()` function handles timing automatically
- No additional delays or actions needed
- Function includes built-in message delivery verification
Hi @refined-appointment-81829 bubbling this up for your insight on this.. Thanks..