Skip to content

SRS sends non-standard multipart/mixed in 200 OK — breaks RFC-compliant SIP stacks (jambonz/drachtio) #36

Description

@Ma91Wa

Summary

loreste/siprec responds to SIPREC INVITEs with Content-Type: multipart/mixed in the 200 OK, combining the SDP answer with RS-Metadata XML. This is not required or specified by RFC 7866 for SRS responses, and it breaks RFC-compliant SIP stacks like jambonz/drachtio-srf.

Root Cause

RFC 7866 specifies that:

  • The SRC includes multipart/mixed in the INVITE (SDP offer + RS-metadata) — this is correct
  • The SRS 200 OK only needs to include an SDP answer (application/sdp)

loreste/siprec currently sends multipart/mixed in the SRS 200 OK response. This is non-standard behavior.

Impact

When drachtio-srf processes the 200 OK to createUAC(), it only sets uac.remote.sdp if the response body is application/sdp. With multipart/mixed, the SDP answer is embedded in the multipart body and not extracted — uac.remote.sdp remains undefined. rtpengine is never configured, and no RTP is forked to the SRS.

Symptom: SIP signaling succeeds (INVITE/200/ACK), but all recordings are empty (44-byte WAV headers, no audio data).

Affected Environments

  • jambonz Voice Gateway as SRC (drachtio-srf createUAC)
  • Cognigy Voice Gateway (jambonz-based)
  • Any RFC-compliant SIP stack that does not special-case multipart bodies in 200 OK

Workaround

We added a PLAIN_SDP_RESPONSE=true environment variable to force application/sdp in the 200 OK:

plainSDPMode := os.Getenv("PLAIN_SDP_RESPONSE") == "true"
if recordingSession != nil && !plainSDPMode {
    // multipart/mixed (current default — non-standard)
} else {
    responseHeaders["Content-Type"] = "application/sdp"
    s.sendResponse(message, 200, "OK", responseHeaders, responseSDP)
}

Suggested Fix

Make application/sdp the default response for the SRS 200 OK (RFC-conformant). Optionally allow multipart/mixed as an opt-in via config for SRC implementations that specifically handle it.

This is similar to the workaround in our fork: see PR #35 (fix/cognigy-vgw-compat-and-rtp-race).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions