Skip to content

Add end-to-end SIP MESSAGE support (send/receive, persistence, status, and Messages UI) - #9

Closed
HSMM with Copilot wants to merge 1 commit into
mainfrom
copilot/feature-sip-message-text-messaging
Closed

HSMM with Copilot wants to merge 1 commit into
mainfrom
copilot/feature-sip-message-text-messaging

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown

This PR adds text messaging over SIP MESSAGE for MacroSIP, including receiving SMS relayed by Asterisk/chan_dongle as standard SIP messages and sending messages to SIP peers. It also introduces persistent conversations, unread/notification UX, and explicit per-message delivery state semantics.

  • SIP MESSAGE transport (core engine)

    • Added outgoing MESSAGE send path with text/plain; charset=utf-8.
    • Enforced payload size limit (maxMessageBytes, 2800 UTF-8 bytes) and input validation.
    • Added incoming MESSAGE mapping for text/plain; non-text bodies are rejected with 415.
    • Added send status mapping with explicit distinction between SIP acceptance and delivery certainty.
  • Asterisk/chan_dongle boundary behavior

    • Treats chan_dongle as SIP-side only: forwarded SMS are processed as ordinary incoming SIP MESSAGE.
    • Preserves UTF-8/Cyrillic content handling end-to-end.
    • Clarifies semantics: SIP 2xx means accepted by SIP peer/server, not guaranteed cellular delivery.
  • Message storage and conversation model

    • Added persistent message/conversation store (messages.json) with reload across app launches.
    • Added unread tracking, ordering, pruning limits, and interrupted-send recovery.
    • Added retry-safe message replacement flow for failed sends.
  • App model and UI

    • Added Messages tab with conversation list and thread view.
    • Added recipient/account selection for new outbound messages.
    • Added per-message state rendering (sending/sent/failed) with retry action.
    • Added unread badges and macOS notifications for incoming messages.
    • Added feature flag in Settings › General › Messages (off by default).
  • Coverage at SIP boundary

    • Added/expanded fixtures and tests around MESSAGE send/receive paths, UTF-8/Cyrillic payloads, status mapping, non-text rejection, and retry/state transitions.
// SIP MESSAGE status semantics
static func result(code: Int, reason: String, answered: Bool) -> MessageSendResult {
    if (200...299).contains(code) { return .accepted(code: code) } // SIP accepted
    let text = reason.isEmpty ? PJ.string(pjsip_get_status_text(Int32(code)).pointee) : reason
    if !answered && code != 408 { return .failed(code: 0, reason: text) } // local failure
    return .failed(code: code, reason: text)
}

Copilot AI assigned Copilot and HSMM Nov 6, 2026
Copilot AI linked an issue Nov 6, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for SIP MESSAGE text messaging in MacroSIP Add end-to-end SIP MESSAGE support (send/receive, persistence, status, and Messages UI) Nov 6, 2026
Copilot AI requested a review from HSMM November 6, 2026 16:55
@HSMM HSMM closed this Nov 6, 2026
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

2 participants