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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JDyKC6Kdg7tofmYSmRtgww
This commit is contained in:
Claude
2026-07-27 04:01:52 +00:00
parent e48460d6f2
commit 5b339fdc0d
+8 -1
View File
@@ -367,9 +367,16 @@ def ami_deliver(from_number, to_exts, body):
from_uri = "<sip:{}@{}>".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),
])