# Version 2.4.5 Text Every Inbound Call

This patch adds the recommended demo/reliability setting:

TEXT_EVERY_INBOUND_CALL=true

## Behavior

When enabled:

1. Customer calls the Telnyx number.
2. App receives the inbound `call.initiated` webhook.
3. If caller ID looks SMS-usable, the app immediately schedules the initial recovery SMS.
4. The normal call flow still continues:
   - caller comfort message can play
   - business phone can still ring
   - voicemail/missed-call detection can still run
5. Later missed/no-answer/voicemail events will not send a duplicate SMS for the same call.

## Setting

Environment variable:

TEXT_EVERY_INBOUND_CALL=true

Admin page:

/admin/system → Live Automation Toggles → Text Every Inbound Call

## Delay

This uses the existing delay setting:

MISSED_CALL_SMS_DELAY_SECONDS=10

So with a 10-second delay, the text is sent around 10 seconds after the inbound call hits the app.

## Duplicate protection

The recovery function now dedupes per call session. If Text Every Inbound Call already sent/scheduled a text, later hangup/voicemail events do not send another one.

## Logs

Look for:

- [Voice routing decision]
- textEveryInboundCall: true
- validSmsCandidate: true
- [Missed-call recovery triggered]
- source: inbound_call_text
- [Missed-call SMS delay started]
- [Missed-call recovery SMS sent]
- [Missed-call recovery skipped: already sent for this call]
