Skip to content

feat: SMS enhancements - fallback + two-way messaging#24

Open
jordanbench wants to merge 3 commits intoZeframLou:mainfrom
jordanbench:feature/sms-enhancements
Open

feat: SMS enhancements - fallback + two-way messaging#24
jordanbench wants to merge 3 commits intoZeframLou:mainfrom
jordanbench:feature/sms-enhancements

Conversation

@jordanbench
Copy link

Summary

This PR adds SMS capabilities to CallMe:

1. SMS Fallback on Voicemail (Fixes #21 partially)

When a call goes to voicemail (detected via Twilio AMD), automatically sends the original message as an SMS.

  • Configurable via CALLME_SMS_FALLBACK env var (default: true)
  • Uses Twilio's Machine Detection (AnsweredBy=machine_*)
  • Prefixes SMS with [Claude] for clarity

2. Fix ngrok Free Tier Domain Detection (Fixes #21)

ngrok free tier uses both .ngrok-free.dev and .ngrok-free.app domains. Updated detection to support both.

3. Two-Way SMS Support

New MCP tools for text-based async communication:

  • send_sms - Send an SMS to the user
  • check_messages - Check for incoming SMS replies

Adds /sms webhook endpoint to receive incoming messages from Twilio.

New Tools

// Send a text message
send_sms({ message: "Task completed! Let me know if you need anything." })

// Check for replies
check_messages()  // Returns: "1 message(s) received:\n[9:05 PM] +1234567890: Thanks!"

Configuration

To enable two-way SMS, configure your Twilio phone number's messaging webhook:

  • URL: <ngrok-url>/sms
  • Method: POST

Test Plan

  • Voicemail detection sends SMS fallback
  • ngrok .ngrok-free.app domains work
  • send_sms tool sends messages
  • /sms webhook receives incoming messages
  • check_messages returns queued messages

jordan.bench added 3 commits January 10, 2026 21:12
## SMS Fallback Feature
- Added `sendSMS()` method to PhoneProvider interface and Twilio implementation
- When AMD detects voicemail (AnsweredBy=machine_*), sends SMS with original message
- Configurable via CALLME_SMS_FALLBACK env var (default: true)
- Prefixes SMS with "[Claude]" for clarity

## ngrok Domain Fix
- Fixed ngrok free tier detection to include both .ngrok-free.dev and .ngrok-free.app
- Fixes ZeframLou#21

## Changes
- phone-call.ts: Track answeredByMachine state, send SMS in endCall()
- phone-twilio.ts: Implement sendSMS() using Twilio Messages API
- types.ts: Add optional sendSMS() to PhoneProvider interface
Adds the ability to send and receive SMS messages:

## New MCP Tools
- `send_sms` - Send an SMS text message to the user
- `check_messages` - Check for incoming SMS replies

## Webhook
- Added `/sms` endpoint to receive incoming SMS from Twilio
- Messages are queued in memory (last 50 kept)

## Usage
1. Configure Twilio phone number to send SMS webhooks to ngrok URL + /sms
2. Use send_sms to send messages to user
3. Use check_messages to see if user replied

This enables async text-based communication alongside voice calls.
Automatically updates the Twilio phone number's SMS webhook URL
to point to the ngrok URL whenever the server starts. This removes
the need to manually configure Twilio each time ngrok generates
a new URL.

- Added configureSmsWebhook() to PhoneProvider interface
- Implemented for TwilioPhoneProvider using Twilio API
- Called automatically on MCP server startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: ngrok free tier detection fails for .ngrok-free.app domains

1 participant