@getdial/sdk - v0.21.0
    Preparing search index...

    Function parseDialAudioMessage

    • Parse + validate a frame received from Dial. Throws on an invalid frame.

      Parameters

      • raw: string | object

      Returns
          | {
              call_id: string;
              direction: "inbound"
              | "outbound";
              formats: {
                  inbound:
                      | "mulaw_8000"
                      | "alaw_8000"
                      | "l16_8000"
                      | "l16_16000"
                      | "l16_24000";
                  outbound: | "mulaw_8000"
                  | "alaw_8000"
                  | "l16_8000"
                  | "l16_16000"
                  | "l16_24000";
              };
              from: string;
              instruction?: string
              | null;
              language?: string | null;
              reconnect?: boolean;
              to: string;
              type: "call_connected";
          }
          | { payload: string; seq?: number; type: "media" }
          | { digit: string; type: "dtmf" }
          | { name: string; type: "mark" }
          | { seconds_remaining: number; type: "duration_warning" }
          | { timestamp: number; type: "ping_pong" }
          | {
              reason:
                  | "error"
                  | "caller_hangup"
                  | "customer_hangup"
                  | "duration_limit";
              type: "call_ended";
          }