From 5b339fdc0d594ef7dde987a07e55ee5968343873 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 04:01:52 +0000 Subject: [PATCH] Try qualifying MessageSend's To with a domain -- To/From asymmetry Live test: AMI MessageSend to a bare "pjsip:212" produced zero SIP wire traffic (confirmed via `pjsip set logger on` during a real delivery attempt with the target extension actively registered) -- Asterisk never even tried reaching the registered contact, meaning the failure was in URI resolution before anything got sent, not a rejection from the softphone. From already carried a domain (SMS_DOMAIN); To didn't. Testing whether that asymmetry was the actual cause. Explicitly a live experiment, not a confirmed fix -- next test will show whether this produces real SIP MESSAGE traffic in the logger. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01JDyKC6Kdg7tofmYSmRtgww --- services/sms-inbound.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/sms-inbound.sh b/services/sms-inbound.sh index 118d7f3..9c72b9a 100644 --- a/services/sms-inbound.sh +++ b/services/sms-inbound.sh @@ -367,9 +367,16 @@ def ami_deliver(from_number, to_exts, body): from_uri = "".format(from_number or "unknown", SMS_DOMAIN or "localhost") for ext in to_exts: + # A bare "pjsip:{ext}" (no domain) for To, tried first, produced + # zero SIP wire traffic at all -- confirmed live via `pjsip set + # logger on` during a real delivery attempt, so the failure was + # happening at URI resolution inside Asterisk, before it ever + # tried to reach the registered contact. From already carried a + # domain; To didn't. Qualifying To the same way to test whether + # that asymmetry was the actual problem. resp = send_action([ ("Action", "MessageSend"), - ("To", "pjsip:{}".format(ext)), + ("To", "pjsip:{}@{}".format(ext, SMS_DOMAIN or "localhost")), ("From", from_uri), ("Body", body), ])