Skip to content

Text messages over SIP MESSAGE (26.3) - #6

Merged
HSMM merged 16 commits into
mainfrom
feature/5-sip-message
Nov 5, 2026
Merged

HSMM merged 16 commits into
mainfrom
feature/5-sip-message

Conversation

@HSMM

@HSMM HSMM commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Fixes #5

Text messaging over SIP MESSAGE: a fourth main-window tab with conversations kept between launches, send and receive of text/plain UTF-8 (Cyrillic included, up to 2800 bytes), SMS forwarded by Asterisk chan_dongle as ordinary messages, unread counts on the tab and the Dock icon, macOS notifications, an optional "New message" sound, per-message status (Sent means a 2xx from the SIP server or peer, not delivery to a phone), Not sent with the SIP reason and Retry, "Send Message" in the Contacts and Call Log menus.

Engine: pjsua_im_send, on_pager2/on_pager_status2, a 415 filter for non-text bodies, message text kept out of the log (delivery lines and packet dumps are redacted). Store: messages.json kept in memory with write-through, tolerant decoding, peers keyed by account, user, host and number format. Mockup screen 14 and spec in docs/design, README in both languages, demo states and self-test checks.

Not verified on a real network: a live Asterisk/chan_dongle server, MESSAGE over TCP/TLS, the 401/407 re-send.

HSMM added 16 commits November 5, 2026 15:16
sendMessage(_:to:from:) and sendMessage(_:to:from:id:) send text/plain;charset=utf-8
MESSAGEs through pjsua_im_send; the final answer arrives once per id as
.messageStatus (.accepted for 2xx, .failed with the SIP code, 408 on timeout, or 0
with the PJSIP error text for local failures and "interrupted" at stop). The user
data is a token in a bridge registry, so a failure pjsua reports inside
pjsua_im_send is emitted exactly once. Texts are limited to 2800 UTF-8 bytes
(PJSIP_MAX_PKT_LEN minus a header reserve).

Incoming text/plain MESSAGEs, also inside calls, become .messageReceived with the
account, the From party and the UTF-8 body. A shim module answers other content
types with 415, since pjsua 2.17 would accept any body with 200.

Tests with a MESSAGE stub on 127.0.0.1 (chan_dongle Cyrillic fixture, 404/480/408,
local failure, stop, 415, two accounts, in-call); docs/ENGINE.md "Text messages".
pjLogWriter passes every PJSIP line through MessageLogRedaction: the text in
pjsua_im.c's delivery lines and the body of MESSAGE requests in the packet dumps
(RX/TX and dropped packets) become "…", code, reason and headers stay. Tested pure
and at log level 4 on loopback.

RemoteParty.parse takes the URI from the last <...> outside the quoted display
name and unescapes a quoted name. The shim logs a failed 415 answer.
…s by host and number format, unread clamped, single-write retry
…state, per-message account, failure text, thread cache)
@HSMM
HSMM merged commit 867c6dc into main Nov 5, 2026
2 checks passed
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.

Feature request: SIP MESSAGE text messaging

1 participant