edgeport - v1.0.3
    Preparing search index...

    Function parseMessage

    • Parses a complete SIP message from a byte buffer.

      The buffer must contain the whole message: start line, headers, the blank-line separator, and exactly Content-Length body octets. Folded (continuation) header lines are unfolded.

      Parameters

      • bytes: Uint8Array

        The complete message bytes.

      Returns SipMessage

      The parsed request or response.

      If the start line or header block is malformed.

      1.0.3

      import { parseMessage, isResponse } from 'edgeport/sip';

      const msg = parseMessage(raw);
      if (isResponse(msg)) console.log(msg.status);