Repository navigation
Text messages over SIP MESSAGE (26.3) - #6
Merged
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5
Text messaging over SIP
MESSAGE: a fourth main-window tab with conversations kept between launches, send and receive oftext/plainUTF-8 (Cyrillic included, up to 2800 bytes), SMS forwarded by Asteriskchan_dongleas 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.jsonkept in memory with write-through, tolerant decoding, peers keyed by account, user, host and number format. Mockup screen 14 and spec indocs/design, README in both languages, demo states and self-test checks.Not verified on a real network: a live Asterisk/
chan_dongleserver, MESSAGE over TCP/TLS, the 401/407 re-send.