For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.telcoflow.com/use-cases/llms.txt. For full documentation content, see https://docs.telcoflow.com/use-cases/llms-full.txt.

# Interactive Notifications

Deliver pending notifications to callers and collect interactive responses, with database tracking of acknowledgments and follow-ups.

## Overview

This use case demonstrates:
- Delivering pending notifications to callers
- Interactive voice response via AI
- Database acknowledgment tracking
- Follow-up flagging for unconfirmed items

**State flow:** PENDING -> ANSWERED -> DISCONNECTED

## Example

```python
@client.on(events.INCOMING_CALL)
async def interactive_notification(call: ActiveCall):
    await call.answer()

    customer = await db.get_customer_by_phone(call.caller_number)
    pending_notifications = await db.get_pending_notifications(customer.id)

    for notification in pending_notifications:
        await call.send_audio(
            await tts.synthesize(notification.message)
        )

        # AI listens for confirmation/response
        response = await ai_model.get_caller_response(call)

        if response.confirmed:
            await db.mark_notification_acknowledged(notification.id)
            await call.send_audio(
                await tts.synthesize("Got it, that's been confirmed.")
            )
        else:
            await db.flag_for_followup(notification.id)
            await call.send_audio(
                await tts.synthesize(
                    "No problem, someone from our team will follow up."
                )
            )

    await call.send_audio(
        await tts.synthesize("That's everything. Have a great day!")
    )
    await call.disconnect()
```

## How It Works

1. When the caller calls in, the AI answers and identifies the customer by phone number
2. It retrieves all pending notifications from the database for that customer
3. For each notification, the AI:
   - Reads the notification message aloud
   - Listens for the caller's response using AI comprehension
   - If confirmed: marks the notification as acknowledged in the database
   - If not confirmed: flags it for follow-up by a human team member
4. After all notifications are delivered, the AI signs off and ends the call

## Key Commands Used

- [`answer()`](/concepts/call-commands#answer) - Answer the incoming call
- [`send_audio()`](/concepts/audio-streaming#sending-audio) - Read notifications aloud
- [`disconnect()`](/concepts/call-commands#disconnect) - End the call

## Related

- [AI Receptionist with Database Lookup](/use-cases/database-lookup) - Similar CRM-driven pattern
- [Appointment Booking](/use-cases/appointment-booking) - Another conversational data-gathering flow