<?xml version="1.0" encoding="UTF-8"?>
<!--
  TinyML (XML) schema - the reference for the verbs, nouns and attributes
  webfs executes. The public "TinyML (XML) reference" page is generated from
  the xs:documentation and xs:appinfo annotations below; keep them in step
  with managers/xmlmanager/xmlmanager.go and managers/tinixml/*.go.

  Annotation vocabulary (namespace https://siprtc.io/schema/tinyml-doc, only
  ever inside xs:appinfo, which validators ignore):
    doc:example        a short TinyML document, in CDATA
    doc:default        the value webfs uses when the attribute is absent
    doc:status         supported (default when absent) | ignored (accepted,
                       has no effect) | no-op (verb accepted and skipped) |
                       limited (works with a caveat the documentation states)
    doc:matching       case-insensitive: the attribute names of this verb are
                       matched in any letter case
    doc:callbackParam  a request parameter webfs (or the platform's event
                       pipeline) sends to the URL named in @for
    doc:note           a remark for the reference page

  The schema is strict about elements and attributes on purpose (see the
  annotation of <Response>): webfs logs and skips what it does not know, so a
  typo silently does nothing at run time; the schema is where it shows up.
  Only <Hangup> and <Reject> take any attribute, because webfs stores their
  extra attributes on the call.

  webfs loads this file with libxml2 (helper.ValidateXML); it must stay XML
  Schema 1.0. helper/tinyml_schema_test.go validates testdata/tinyml/.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:doc="https://siprtc.io/schema/tinyml-doc"
           elementFormDefault="unqualified"
           attributeFormDefault="unqualified">

  <xs:annotation>
    <xs:documentation>
      TinyML is SIPRTC's XML call-control language. When a call arrives on a
      number or SIP endpoint, or an API call is answered, webfs requests the
      application URL and executes the TinyML document it returns on the call,
      one verb at a time, top to bottom. Element and attribute names are
      case-sensitive unless a verb says otherwise. When the document runs out
      of verbs the call is hung up.

      Requests webfs makes to action and Redirect URLs: POST sends the
      parameters as a JSON object (Content-Type: application/json), GET sends
      them as query-string parameters. URLs must be absolute http(s) URLs
      (only &lt;Transcription statusCallbackUrl&gt; may be relative to the
      document URL). user:password@ in a URL is sent as HTTP Basic
      authentication. A non-200 response, or a response that is not a
      TinyML document with a &lt;Response&gt; root, falls back to the
      application's fallback URL and otherwise ends the call.

      Copyright Siprtc Private Limited.
    </xs:documentation>
    <xs:appinfo>
      <doc:callbackParam group="call" name="CallSid">Unique id of the call (leg) the request is about.</doc:callbackParam>
      <doc:callbackParam group="call" name="AccountSid">The account that owns the call.</doc:callbackParam>
      <doc:callbackParam group="call" name="From">The caller: phone number or SIP user.</doc:callbackParam>
      <doc:callbackParam group="call" name="To">The called number or SIP user.</doc:callbackParam>
      <doc:callbackParam group="call" name="Caller">Caller ANI as signalled.</doc:callbackParam>
      <doc:callbackParam group="call" name="Called">Called (destination) number as signalled.</doc:callbackParam>
      <doc:callbackParam group="call" name="Direction">inbound, outbound-api or outbound-call.</doc:callbackParam>
      <doc:callbackParam group="call" name="CallStatus">initiated, ringing, in-progress, completed, busy, no-answer, failed or canceled.</doc:callbackParam>
      <doc:callbackParam group="call" name="ParentCallSid">For a leg created by &lt;Dial&gt;, the call that dialled it.</doc:callbackParam>
      <doc:callbackParam group="call" name="Timestamp">Time of the event (GMT).</doc:callbackParam>
      <doc:callbackParam group="call" name="ApiVersion">API version, v1.</doc:callbackParam>
      <doc:callbackParam group="call" name="CallbackSource">call-progress-events.</doc:callbackParam>
      <doc:note>Custom SIP headers received on the call (X- headers) are added to these requests as extra parameters.</doc:note>
    </xs:appinfo>
  </xs:annotation>

  <!-- ===================================================================
       Shared simple types
       =================================================================== -->

  <xs:simpleType name="HttpMethodType">
    <xs:annotation>
      <xs:documentation>HTTP method for a callback or document request. Write it in upper case: some callbacks compare it exactly and treat anything but GET as POST.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="GET"/>
      <xs:enumeration value="POST"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="BooleanType">
    <xs:annotation>
      <xs:documentation>true or false, in lower case.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="true"/>
      <xs:enumeration value="false"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="BooleanAnyCaseType">
    <xs:annotation>
      <xs:documentation>true or false, in any letter case.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TranscriptionBooleanType">
    <xs:annotation>
      <xs:documentation>true/false, t/f or 1/0, in any letter case. A malformed value keeps the default.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="collapse"/>
      <xs:pattern value="[Tt]([Rr][Uu][Ee])?|[Ff]([Aa][Ll][Ss][Ee])?|1|0"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="UrlType">
    <xs:annotation>
      <xs:documentation>An absolute http:// or https:// URL.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:anyURI"/>
  </xs:simpleType>

  <xs:simpleType name="WebSocketUrlType">
    <xs:annotation>
      <xs:documentation>A ws:// or wss:// URL, without spaces.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="wss?://\S+"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DtmfDigitsType">
    <xs:annotation>
      <xs:documentation>DTMF digits 0-9, * and #; a lower-case w waits half a second.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[w0-9*#]*"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="LoopType">
    <xs:annotation>
      <xs:documentation>How many times to play. See the verb for what 0 means.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:integer">
      <xs:minInclusive value="0"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StatusCallbackEventListType">
    <xs:annotation>
      <xs:documentation>A space- or comma-separated list of event names.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:simpleType name="DialRecordType">
    <xs:annotation>
      <xs:documentation>When to record a dialled call, and in how many channels.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="true"><xs:annotation><xs:documentation>Same as record-from-answer.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="false"><xs:annotation><xs:documentation>Do not record (default).</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="do-not-record"><xs:annotation><xs:documentation>Do not record.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="record-from-answer"><xs:annotation><xs:documentation>Record from the moment the dialled party answers, mixed to one channel.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="record-from-ringing"><xs:annotation><xs:documentation>Record from ringing (early media), mixed to one channel.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="record-from-answer-dual"><xs:annotation><xs:documentation>Record from answer, each party in its own (stereo) channel.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="record-from-ringing-dual"><xs:annotation><xs:documentation>Record from ringing, each party in its own (stereo) channel.</xs:documentation></xs:annotation></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="RecordingTrackType">
    <xs:annotation>
      <xs:documentation>Which audio a recording keeps.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="both"><xs:annotation><xs:documentation>Both parties (default).</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="inbound"><xs:annotation><xs:documentation>Only the audio webfs receives on the call.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="outbound"><xs:annotation><xs:documentation>Only the audio webfs sends on the call.</xs:documentation></xs:annotation></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="RingToneCountryType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="at"/><xs:enumeration value="au"/><xs:enumeration value="bg"/>
      <xs:enumeration value="br"/><xs:enumeration value="be"/><xs:enumeration value="ch"/>
      <xs:enumeration value="cl"/><xs:enumeration value="cn"/><xs:enumeration value="cz"/>
      <xs:enumeration value="de"/><xs:enumeration value="dk"/><xs:enumeration value="ee"/>
      <xs:enumeration value="es"/><xs:enumeration value="fi"/><xs:enumeration value="fr"/>
      <xs:enumeration value="gr"/><xs:enumeration value="hu"/><xs:enumeration value="il"/>
      <xs:enumeration value="in"/><xs:enumeration value="it"/><xs:enumeration value="lt"/>
      <xs:enumeration value="jp"/><xs:enumeration value="mx"/><xs:enumeration value="my"/>
      <xs:enumeration value="nl"/><xs:enumeration value="no"/><xs:enumeration value="nz"/>
      <xs:enumeration value="ph"/><xs:enumeration value="pl"/><xs:enumeration value="pt"/>
      <xs:enumeration value="ru"/><xs:enumeration value="se"/><xs:enumeration value="sg"/>
      <xs:enumeration value="th"/><xs:enumeration value="uk"/><xs:enumeration value="us"/>
      <xs:enumeration value="us-old"/><xs:enumeration value="tw"/><xs:enumeration value="ve"/>
      <xs:enumeration value="za"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="HttpUrlPatternType">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="https?://\S+"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="RingToneType">
    <xs:annotation>
      <xs:documentation>A two-letter country code (the national ringback tone) or the http(s) URL of an audio file to play instead.</xs:documentation>
    </xs:annotation>
    <xs:union memberTypes="RingToneCountryType HttpUrlPatternType"/>
  </xs:simpleType>

  <xs:simpleType name="GatherLanguageType">
    <xs:annotation>
      <xs:documentation>Speech recognition language of &lt;Gather input="speech"&gt;. Any other value is ignored and en-US is used.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="en-US"/><xs:enumeration value="en-GB"/><xs:enumeration value="en-AU"/>
      <xs:enumeration value="en-IN"/><xs:enumeration value="en-IE"/><xs:enumeration value="en-NZ"/>
      <xs:enumeration value="en-ZA"/><xs:enumeration value="en-AB"/><xs:enumeration value="en-WL"/>
      <xs:enumeration value="hi-IN"/>
      <xs:enumeration value="ar-AE"/><xs:enumeration value="ar-BH"/><xs:enumeration value="ar-DZ"/>
      <xs:enumeration value="ar-EG"/><xs:enumeration value="ar-IL"/><xs:enumeration value="ar-IQ"/>
      <xs:enumeration value="ar-JO"/><xs:enumeration value="ar-KW"/><xs:enumeration value="ar-LB"/>
      <xs:enumeration value="ar-LY"/><xs:enumeration value="ar-MA"/><xs:enumeration value="ar-OM"/>
      <xs:enumeration value="ar-PS"/><xs:enumeration value="ar-QA"/><xs:enumeration value="ar-SA"/>
      <xs:enumeration value="ar-SY"/><xs:enumeration value="ar-TN"/><xs:enumeration value="ar-YE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StreamTrackType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="inbound_track"><xs:annotation><xs:documentation>The audio webfs receives on the call (the caller). Default.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="outbound_track"><xs:annotation><xs:documentation>The audio webfs sends on the call.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="both_tracks"><xs:annotation><xs:documentation>Both directions.</xs:documentation></xs:annotation></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StreamEncodingType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="audio/x-mulaw"><xs:annotation><xs:documentation>8 kHz G.711 mu-law (default).</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="audio/L16"><xs:annotation><xs:documentation>16-bit linear PCM; the only encoding that honours sampleRate.</xs:documentation></xs:annotation></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StreamSampleRateType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="8000"><xs:annotation><xs:documentation>8 kHz (default).</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="16000"><xs:annotation><xs:documentation>16 kHz.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="16k"><xs:annotation><xs:documentation>Same as 16000.</xs:documentation></xs:annotation></xs:enumeration>
      <xs:enumeration value="auto"><xs:annotation><xs:documentation>The call's own rate, e.g. wideband for an Opus browser call.</xs:documentation></xs:annotation></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <!-- ===================================================================
       <Response>
       =================================================================== -->

  <xs:element name="Response">
    <xs:annotation>
      <xs:documentation>
        The root element of every TinyML document. Its children are verbs,
        executed in order on the call; each verb finishes before the next one
        starts. A document whose &lt;Response&gt; has no verbs hangs the call
        up, as does reaching the end of the document. &lt;Dial action&gt;,
        &lt;Gather&gt;, &lt;Record&gt;, &lt;Redirect&gt;, &lt;Connect&gt;,
        &lt;Reject&gt; and &lt;Hangup&gt; end the document: what runs next
        comes from their action URL, if any. webfs logs and skips a verb it
        does not know (and a few reserved names such as top-level
        &lt;Stream&gt;, &lt;Pay&gt;, &lt;Refer&gt;, &lt;Siprec&gt; and
        &lt;Autopilot&gt;); this schema rejects them so a typo or an
        unsupported verb is caught before it silently does nothing.
        Verbs from other XML dialects that webfs does not execute include &lt;Sms&gt;,
        &lt;Message&gt; and the &lt;Client&gt; and &lt;Queue&gt; nouns.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="Polly.Joanna">Thanks for calling.</Say>
  <Dial timeout="20" action="https://example.com/after-dial">
    <Number>+14155550100</Number>
  </Dial>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Say" type="SayType">
          <xs:annotation><xs:documentation>Speak text to the caller with text-to-speech.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Speak" type="SayType">
          <xs:annotation><xs:documentation>Alias of &lt;Say&gt;; identical attributes and behaviour.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Play" type="PlayType">
          <xs:annotation><xs:documentation>Play an audio file, or send DTMF digits.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Pause" type="PauseType">
          <xs:annotation><xs:documentation>Wait in silence.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Gather" type="GatherType">
          <xs:annotation><xs:documentation>Collect DTMF digits or speech from the caller.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Record" type="RecordType">
          <xs:annotation><xs:documentation>Record the caller (voicemail).</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Dial" type="DialType">
          <xs:annotation><xs:documentation>Connect the call to a phone number, SIP endpoint or conference.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Enqueue" type="EnqueueType">
          <xs:annotation><xs:documentation>Put the caller in a TaskRouter queue to wait for an agent.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Leave" type="LeaveType">
          <xs:annotation><xs:documentation>Accepted and skipped; has no effect.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Redirect" type="RedirectType">
          <xs:annotation><xs:documentation>Continue the call with the TinyML at another URL.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Hangup" type="HangupType">
          <xs:annotation><xs:documentation>End the call.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Reject" type="RejectType">
          <xs:annotation><xs:documentation>Refuse an incoming call without answering it.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Start" type="StartType">
          <xs:annotation><xs:documentation>Start a one-way media stream or a live transcription, then go on with the document.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Stop" type="StopType">
          <xs:annotation><xs:documentation>Stop a stream or transcription started with &lt;Start&gt;.</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Connect" type="ConnectType">
          <xs:annotation><xs:documentation>Hand the call's audio to a bidirectional WebSocket stream (voice bot).</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Receive" type="ReceiveType">
          <xs:annotation><xs:documentation>Receive a fax on the call (T.38 / G.711).</xs:documentation></xs:annotation>
        </xs:element>
        <xs:element name="Sendfax" type="SendfaxType">
          <xs:annotation><xs:documentation>Send a fax document on the call.</xs:documentation></xs:annotation>
        </xs:element>
      </xs:choice>
      <xs:attribute name="version" type="xs:string">
        <xs:annotation>
          <xs:documentation>Optional document version label. Not read by webfs.</xs:documentation>
          <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

  <!-- ===================================================================
       <Say> / <Speak>
       =================================================================== -->

  <xs:complexType name="SayType">
    <xs:annotation>
      <xs:documentation>
        &lt;Say&gt; (alias &lt;Speak&gt;) converts its text to speech and plays
        it. The text is plain text or SSML: text whose root is a
        &lt;speak&gt; element is sent to the engine as SSML. Write SSML
        escaped (&amp;lt;speak&amp;gt;...) or inside a CDATA section; a raw
        child element is not read. The voice attribute picks the engine; when
        a vendor engine (Microsoft, Google, ElevenLabs, Deepgram, Cartesia,
        Soniox) fails, webfs speaks the text with the default Amazon Polly
        voice of the same language instead of leaving silence. Answers the
        call first if it is not answered yet. Allowed inside &lt;Gather&gt;
        and in conference waitUrl/hold documents.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Say voice="Elevenlabs.en-GB-George" speed="0.9">Your order has shipped.</Say>
  <Say voice="woman" language="fr-FR" loop="2">Bonjour.</Say>
  <Say>&lt;speak&gt;Press &lt;emphasis&gt;one&lt;/emphasis&gt; for sales.&lt;/speak&gt;</Say>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="voice" type="xs:string">
          <xs:annotation>
            <xs:documentation>
              The voice. Generic voices man, woman, alice and default map to
              an Amazon Polly voice for the language (default: Salli for
              en-US). Polly.&lt;VoiceId&gt; or a bare Polly voice id (Joanna,
              Raveena, ...) picks that Polly voice. Vendor voices are written
              &lt;Engine&gt;.&lt;voice&gt;: Microsoft.en-US-AvaNeural (bare
              Microsoft = en-US-AvaNeural), Google.en-US-Standard-C,
              Deepgram.aura-asteria-en, and for ElevenLabs, Cartesia and Soniox
              &lt;Engine&gt;.&lt;lang&gt;-&lt;REGION&gt;-&lt;voice id&gt;
              (e.g. Cartesia.es-MX-Daniela), where the locale is the language
              spoken; the engine name is matched in any case.
            </xs:documentation>
            <xs:appinfo><doc:default>default (Polly voice for the language)</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="language" type="xs:string">
          <xs:annotation>
            <xs:documentation>
              BCP-47 language, e.g. en-US, en-GB, de-DE, fr-FR, es-MX, hi-IN.
              Chooses the Polly voice for a generic voice and is passed to
              Google. When the voice has no engine prefix the language must
              be one of en-US, en-AU, en-CA, en-GB, en-IN, de-DE, sv-SE,
              zh-CN, zh-HK, zh-TW, pl-PL, pt-BR, pt-PT, ru-RU, fr-CA, fr-FR,
              it-IT, ja-JP, ko-KR, nb-NO, nl-NL, ca-ES, es-ES, es-MX, fi-FI or
              da-DK, else en-US is used.
            </xs:documentation>
            <xs:appinfo><doc:default>en-US</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="loop" type="LoopType">
          <xs:annotation>
            <xs:documentation>How many times to say the text. 0 repeats it (up to 1000 times) until the call moves on or ends.</xs:documentation>
            <xs:appinfo><doc:default>1</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="speed" type="xs:decimal">
          <xs:annotation>
            <xs:documentation>Speaking rate, 1 = normal. Used by ElevenLabs (clamped to 0.7-1.2), Cartesia (0.6-1.5) and Microsoft (SSML prosody rate); other engines ignore it.</xs:documentation>
            <xs:appinfo><doc:default>1</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="textType" type="xs:string">
          <xs:annotation>
            <xs:documentation>Accepted for compatibility; webfs decides text or SSML from the content itself.</xs:documentation>
            <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- ===================================================================
       <Play>
       =================================================================== -->

  <xs:complexType name="PlayType">
    <xs:annotation>
      <xs:documentation>
        Plays the audio file at the URL in its text (MP3 or WAV; leading and
        trailing whitespace is trimmed). With the digits attribute it first
        sends those DTMF tones on the call, e.g. to drive a remote IVR; a
        &lt;Play digits&gt; with no URL only sends the tones. Answers the
        call first if it is not answered yet. Allowed inside &lt;Gather&gt;
        and in conference waitUrl/hold documents.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Play loop="2">https://example.com/audio/welcome.mp3</Play>
  <Play digits="ww1234#"></Play>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="loop" type="LoopType">
          <xs:annotation>
            <xs:documentation>How many times to play the file. 0 plays it once (it does not loop forever).</xs:documentation>
            <xs:appinfo><doc:default>1</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="digits" type="DtmfDigitsType">
          <xs:annotation>
            <xs:documentation>DTMF digits to send before playing: 0-9, *, # and w for a half-second wait. A value with any other character is ignored.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- ===================================================================
       <Pause>
       =================================================================== -->

  <xs:complexType name="PauseType">
    <xs:annotation>
      <xs:documentation>Plays silence for length seconds. Allowed inside &lt;Gather&gt;.</xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Say>Please wait.</Say>
  <Pause length="3"/>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="length" type="xs:nonNegativeInteger">
      <xs:annotation>
        <xs:documentation>Seconds of silence. A non-numeric value means 1.</xs:documentation>
        <xs:appinfo><doc:default>1</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- ===================================================================
       <Gather>
       =================================================================== -->

  <xs:complexType name="GatherType">
    <xs:annotation>
      <xs:documentation>
        Collects input from the caller and posts it to action. The nested
        &lt;Say&gt;/&lt;Speak&gt;, &lt;Play&gt; and &lt;Pause&gt; prompts play
        first; digits pressed during them are collected too. With DTMF
        (the default) input ends when numDigits digits are in, when the
        finishOnKey key is pressed, or timeout seconds after the prompts end
        (or after the first digit pressed during them) - timeout is the whole
        wait, not a gap between digits. The collected digits then go to
        action and the TinyML it returns replaces the rest of this document.
        If nothing was pressed and actionOnEmptyResult is not true, webfs goes
        on with the verbs after &lt;Gather&gt; (and hangs up if there are
        none). With input="speech", webfs runs speech recognition after the
        prompts and posts the result to action. Answers the call first if it
        is not answered yet. In conference waitUrl documents &lt;Gather&gt; is
        accepted but does not work (see the reference notes).
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Gather action="https://example.com/menu" numDigits="1" timeout="6">
    <Say>Press 1 for sales, 2 for support.</Say>
  </Gather>
  <Say>We did not receive any input. Goodbye.</Say>
</Response>]]></doc:example>
        <doc:example><![CDATA[<Response>
  <Gather input="speech" language="en-GB" hints="billing,support" action="https://example.com/speech">
    <Say>How can I help you today?</Say>
  </Gather>
</Response>]]></doc:example>
        <doc:callbackParam for="action" name="Digits">DTMF input: the keys pressed, including the finishOnKey key when it ended the input. Empty when nothing was pressed (only sent with actionOnEmptyResult="true").</doc:callbackParam>
        <doc:callbackParam for="action" name="DtmfInputType">DTMF input: always dtmf.</doc:callbackParam>
        <doc:callbackParam for="action" name="SpeechResult">Speech input: the recognised text.</doc:callbackParam>
        <doc:callbackParam for="action" name="SpeechConfidence">Speech input: recognition confidence, 0.00-1.00.</doc:callbackParam>
        <doc:note>DTMF requests also carry the standard call parameters (CallSid, AccountSid, From, To, Direction, CallStatus, ...). Speech requests carry CallSid, AccountSid, From and To.</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Say" type="SayType">
        <xs:annotation><xs:documentation>Prompt spoken while waiting for input.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Speak" type="SayType">
        <xs:annotation><xs:documentation>Alias of &lt;Say&gt;.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Play" type="PlayType">
        <xs:annotation><xs:documentation>Audio prompt played while waiting for input.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Pause" type="PauseType">
        <xs:annotation><xs:documentation>Silence between prompts.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:choice>
    <xs:attribute name="action" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL that receives the input; the TinyML it returns continues the call. If omitted, the call's current document URL is requested again.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for action.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="input">
      <xs:annotation>
        <xs:documentation>dtmf collects key presses; speech runs speech recognition instead. Only one kind per &lt;Gather&gt;: any value other than speech (including "dtmf speech") collects DTMF.</xs:documentation>
        <xs:appinfo><doc:default>dtmf</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="dtmf"/>
          <xs:enumeration value="speech"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="numDigits" type="xs:positiveInteger">
      <xs:annotation>
        <xs:documentation>DTMF: stop after this many digits. Note the default is 1, so set it for anything longer than a single-key menu.</xs:documentation>
        <xs:appinfo><doc:default>1</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="finishOnKey">
      <xs:annotation>
        <xs:documentation>DTMF: the single key that ends input early. An empty value keeps #; input cannot be made to ignore every key.</xs:documentation>
        <xs:appinfo><doc:default>#</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[0-9*#]?"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="timeout" type="xs:positiveInteger">
      <xs:annotation>
        <xs:documentation>DTMF: seconds to wait for input after the prompts end.</xs:documentation>
        <xs:appinfo><doc:default>5</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="actionOnEmptyResult" type="BooleanAnyCaseType">
      <xs:annotation>
        <xs:documentation>DTMF: when true, a timeout with no digits still requests action (with an empty Digits); when false, webfs goes on with the verbs after &lt;Gather&gt;.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="language" type="GatherLanguageType">
      <xs:annotation>
        <xs:documentation>Speech: recognition language.</xs:documentation>
        <xs:appinfo><doc:default>en-US</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="hints" type="xs:string">
      <xs:annotation>
        <xs:documentation>Speech: comma-separated words or phrases to bias recognition towards (Azure engine).</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="speechTimeout" type="xs:positiveInteger">
      <xs:annotation>
        <xs:documentation>Speech: milliseconds to wait for the caller to start speaking (initial silence timeout, Azure engine).</xs:documentation>
        <xs:appinfo><doc:default>platform default</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="voiceMaxDuration" type="xs:positiveInteger">
      <xs:annotation>
        <xs:documentation>Speech: same setting as speechTimeout (milliseconds); if both are given the later one wins.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="startTimeout" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="midTimeout" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="endTimeout" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="voiceMode" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- ===================================================================
       <Record>
       =================================================================== -->

  <xs:complexType name="RecordType">
    <xs:annotation>
      <xs:documentation>
        Records the caller, typically for voicemail. A beep plays first
        (unless playBeep="false"); recording stops on any finishOnKey key, on
        timeout seconds of silence, or at maxLength seconds. When the
        recording is complete webfs requests action (or, if action is
        omitted, the call's current document URL again) and runs the TinyML it
        returns, so put the rest of the flow in that response rather than
        after &lt;Record&gt;. The account's recording policy can refuse a
        voicemail recording: the verb is then skipped and
        recordingStatusCallback receives RecordingStatus absent with an
        ErrorCode. Answers the call first if it is not answered yet.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Say>Please leave a message after the beep.</Say>
  <Record action="https://example.com/voicemail-done" maxLength="120" timeout="5"
          finishOnKey="#" recordingStatusCallback="https://example.com/recording-status"/>
</Response>]]></doc:example>
        <doc:callbackParam for="action recordingStatusCallback" name="RecordingSid">Unique id of the recording.</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="RecordingUrl">Where the recording can be fetched (MP3).</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="RecordingStatus">in-progress, completed, or absent (no audio, or refused by the recording policy).</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="RecordingDuration">Length in seconds.</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="RecordingStartTime">When recording started.</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="Timestamp">Time of the event.</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="CallSid">The call recorded.</doc:callbackParam>
        <doc:callbackParam for="action recordingStatusCallback" name="AccountSid">The account.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="ErrorCode">Set when the recording policy refused the recording: 64001 blocked by policy, 64004 policy unavailable, 64005 voicemail blocked.</doc:callbackParam>
        <doc:note>action also receives the standard call parameters.</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="action" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL requested when the recording is complete; its TinyML continues the call. Defaults to the current document URL.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for action.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="timeout" type="xs:nonNegativeInteger">
      <xs:annotation>
        <xs:documentation>Seconds of silence that end the recording; 0 turns silence detection off.</xs:documentation>
        <xs:appinfo><doc:default>5</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="finishOnKey">
      <xs:annotation>
        <xs:documentation>Keys that end the recording; any one of them stops it.</xs:documentation>
        <xs:appinfo><doc:default>1234567890*#</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[0-9*#]*"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="maxLength">
      <xs:annotation>
        <xs:documentation>Maximum length in seconds; values of 3600 or more are ignored (the maximum is 3600).</xs:documentation>
        <xs:appinfo><doc:default>3600</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:positiveInteger">
          <xs:maxInclusive value="3600"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="playBeep" type="xs:string">
      <xs:annotation>
        <xs:documentation>false (any case) records without a beep; any other value keeps the beep.</xs:documentation>
        <xs:appinfo><doc:default>true</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallback" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL notified as the recording's status changes.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallbackMethod" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for recordingStatusCallback.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallbackEvent" type="StatusCallbackEventListType">
      <xs:annotation>
        <xs:documentation>Which recording events to send: in-progress, completed (a completed recording with no audio is reported as absent), absent.</xs:documentation>
        <xs:appinfo><doc:default>completed</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="trim" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect on &lt;Record&gt;.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="transcribe" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; recordings are not transcribed by this attribute.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="transcribeCallback" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="storageUrl" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="storageUrlMethod" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- ===================================================================
       <Dial> and its nouns
       =================================================================== -->

  <xs:complexType name="DialType" mixed="true">
    <xs:annotation>
      <xs:documentation>
        Connects the caller to another party. The destination is either the
        text of &lt;Dial&gt; (a phone number, or a SIP URI starting with sip:)
        or one or more nouns: &lt;Number&gt;, &lt;Sip&gt; or one
        &lt;Conference&gt;. Several &lt;Number&gt;/&lt;Sip&gt; nouns ring at
        the same time and the first to answer wins, or one after another
        with sequential="true"; at most 10 nouns ring. A &lt;Conference&gt;
        should be the only noun. Attribute names of &lt;Dial&gt; are matched
        in any letter case. With action, webfs requests action when the
        dialled call ends and runs the TinyML it returns instead of the rest
        of this document; without action it goes on with the next verb.
        Outbound PSTN legs need rates for the destination, and the caller ID
        must be a number of the account (or verified for it); otherwise the
        call is hung up. On demo accounts &lt;Dial&gt; is replaced by a
        spoken upgrade notice.
      </xs:documentation>
      <xs:appinfo>
        <doc:matching>case-insensitive</doc:matching>
        <doc:example><![CDATA[<Response>
  <Dial callerId="+14155550123" timeout="25" record="record-from-answer"
        action="https://example.com/dial-done">
    <Number>+14155550100</Number>
    <Sip username="alice" password="secret">sip:alice@pbx.example.com</Sip>
  </Dial>
</Response>]]></doc:example>
        <doc:example><![CDATA[<Response>
  <Dial>+14155550100</Dial>
</Response>]]></doc:example>
        <doc:callbackParam for="action" name="DialCallStatus">Outcome of the dialled call: completed, busy, no-answer, failed or canceled; answered when a conference participant leaves.</doc:callbackParam>
        <doc:callbackParam for="action" name="DialCallSid">Call id of the dialled leg.</doc:callbackParam>
        <doc:callbackParam for="action" name="DialCallDuration">Seconds the dialled leg was connected.</doc:callbackParam>
        <doc:callbackParam for="action" name="DialHangupDisposition">Which side ended the dialled leg (SIP hangup disposition, e.g. recv_bye, send_bye).</doc:callbackParam>
        <doc:callbackParam for="action" name="RecordingUrl">The recording of the dialled call, when record was set.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingSid">Unique id of the recording.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingUrl">Where the recording can be fetched (MP3).</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingStatus">in-progress, completed or absent.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingDuration">Length in seconds.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="ErrorCode">Set when the recording policy refused the recording.</doc:callbackParam>
        <doc:note>action also receives the standard call parameters of the calling leg.</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Number" type="NumberType">
        <xs:annotation><xs:documentation>A phone number to dial.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Sip" type="SipType">
        <xs:annotation><xs:documentation>A SIP endpoint to dial.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Conference" type="ConferenceType">
        <xs:annotation><xs:documentation>A conference room to join.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:choice>
    <xs:attribute name="action" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL requested when the dialled call ends; its TinyML continues the call. When set, verbs after &lt;Dial&gt; are not executed.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for action.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="callerId" type="xs:string">
      <xs:annotation>
        <xs:documentation>Caller ID (number) presented to the dialled party. For phone numbers it must be a number of the account or a verified caller ID; when it is not, webfs falls back to the call's caller ID or From and hangs up (CallerId_Not_Whitelisted) if none is valid.</xs:documentation>
        <xs:appinfo><doc:default>the calling party</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="displayName" type="xs:string">
      <xs:annotation>
        <xs:documentation>Caller name presented to the dialled party.</xs:documentation>
        <xs:appinfo><doc:default>the caller ID</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="timeout" type="xs:nonNegativeInteger">
      <xs:annotation>
        <xs:documentation>Seconds to let the dialled party ring before giving up (DialCallStatus no-answer).</xs:documentation>
        <xs:appinfo><doc:default>30</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="timeLimit" type="xs:positiveInteger">
      <xs:annotation>
        <xs:documentation>Maximum seconds the dialled call may last once answered.</xs:documentation>
        <xs:appinfo><doc:default>14400 (4 hours)</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="answerOnBridge" type="BooleanAnyCaseType">
      <xs:annotation>
        <xs:documentation>true keeps an inbound caller unanswered (hearing ringback as early media) until the dialled party answers, so billing starts at the bridge. Default false answers the caller before dialling.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="hangupOnStar" type="BooleanAnyCaseType">
      <xs:annotation>
        <xs:documentation>true lets the caller press * to drop the dialled party; the caller's document then continues.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="sequential" type="BooleanAnyCaseType">
      <xs:annotation>
        <xs:documentation>true rings the nouns one after another, in document order, each for timeout seconds; false rings them all at once.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ringTone" type="RingToneType">
      <xs:annotation>
        <xs:documentation>Ringback the caller hears while the dialled party rings: a country code (us, uk, in, de, ...) or the http(s) URL of an audio file.</xs:documentation>
        <xs:appinfo><doc:default>a US-style ring</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="record" type="DialRecordType">
      <xs:annotation>
        <xs:documentation>Record the dialled call. The account's recording policy can refuse it; the call is then dialled without recording and recordingStatusCallback receives RecordingStatus absent.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingTrack" type="RecordingTrackType">
      <xs:annotation>
        <xs:documentation>Which audio the recording keeps.</xs:documentation>
        <xs:appinfo><doc:default>both</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallback" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL notified as the recording's status changes.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallbackMethod" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for recordingStatusCallback.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="recordingStatusCallbackEvent" type="StatusCallbackEventListType">
      <xs:annotation>
        <xs:documentation>Which recording events to send: in-progress, completed, absent.</xs:documentation>
        <xs:appinfo><doc:default>completed</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="callReason" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect on a dialled call.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="trim" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect on a dialled call.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:attributeGroup name="DialLegAttributes">
    <xs:annotation>
      <xs:documentation>Attributes shared by &lt;Number&gt; and &lt;Sip&gt;: per-leg status callback, whisper URL and (ignored) answering machine detection.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="url" type="UrlType">
      <xs:annotation>
        <xs:documentation>Whisper URL: when this party answers, webfs runs the TinyML at this URL on their leg only (e.g. &lt;Say&gt; who is calling, or a &lt;Gather&gt; to accept) and then connects them to the caller.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for url.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="statusCallback" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL notified of this leg's progress (see statusCallbackEvent).</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="statusCallbackMethod" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for statusCallback.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="statusCallbackEvent" type="StatusCallbackEventListType">
      <xs:annotation>
        <xs:documentation>Which progress events to send besides the final one: initiated, ringing, answered, completed. The end of the leg is always sent.</xs:documentation>
        <xs:appinfo><doc:default>completed</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="machineDetection" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; answering machine detection is not run on &lt;Dial&gt; legs (use the Calls API).</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="machineDetectionTimeout" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="machineDetectionSpeechThreshold" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="machineDetectionSpeechEndThreshold" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="machineDetectionSilenceTimeout" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="amdStatusCallback" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="amdStatusCallbackMethod" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:complexType name="NumberType">
    <xs:annotation>
      <xs:documentation>
        A phone number to dial, in E.164 (+14155550100). Anything after a ;
        is dropped. Routed over the PSTN by the account's rates and routes.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Dial>
    <Number sendDigits="ww1234" statusCallback="https://example.com/leg-status"
            statusCallbackEvent="ringing answered completed">+14155550100</Number>
  </Dial>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallback" name="CallSid">Call id of this leg.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ParentCallSid">The call that dialled it.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallStatus">initiated, ringing, in-progress, completed, busy, no-answer, failed or canceled.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallDuration">Seconds connected (final event).</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="SipResponseCode">SIP response of a failed leg.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="InitiationTime">When the leg was created.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="RingTime">When it started ringing.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="AnswerTime">When it was answered.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="HangupTime">When it ended.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="SequenceNumber">Order of the event for this leg.</doc:callbackParam>
        <doc:callbackParam for="url" name="CallSid">Call id of the answered leg; the request carries the standard call parameters of that leg.</doc:callbackParam>
        <doc:note>statusCallback also carries From, To, Direction, AccountSid, Timestamp, ApiVersion and CallbackSource (call-progress-events).</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="sendDigits" type="DtmfDigitsType">
          <xs:annotation>
            <xs:documentation>DTMF digits sent once the number answers (w = half-second wait), e.g. an extension.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="byoc" type="xs:string">
          <xs:annotation>
            <xs:documentation>Accepted; currently has no effect (routing comes from the account's routes).</xs:documentation>
            <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attributeGroup ref="DialLegAttributes"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="SipType">
    <xs:annotation>
      <xs:documentation>
        A SIP endpoint to dial: a SIP URI (sip:alice@example.com), a
        registered user of the account (sip:alice@yourdomain), or an IP
        address (dialled as the call's To user at that address). Custom SIP
        headers go after a ? in the URI, separated by &amp;amp;, and are
        sent on the INVITE.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Dial>
    <Sip username="pbxuser" password="pbxpass">sip:1001@pbx.example.com?X-Customer-Id=42&amp;X-Queue=sales</Sip>
  </Dial>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallback" name="CallSid">Call id of this leg; the same parameters as &lt;Number statusCallback&gt;.</doc:callbackParam>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="username" type="xs:string">
          <xs:annotation>
            <xs:documentation>User name for SIP digest authentication towards the endpoint.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="password" type="xs:string">
          <xs:annotation>
            <xs:documentation>Password for SIP digest authentication towards the endpoint.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attributeGroup ref="DialLegAttributes"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="ConferenceType">
    <xs:annotation>
      <xs:documentation>
        Joins the caller to the named conference room (names are scoped to
        the account). The first participant creates the room and later ones
        inherit its settings. A participant alone in the room hears waitUrl.
        With &lt;Dial action&gt;, action is requested with DialCallStatus
        answered when the participant leaves the room.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Dial action="https://example.com/left-room">
    <Conference beep="onEnter" startConferenceOnEnter="true" endConferenceOnExit="false"
                waitUrl="https://example.com/hold-music.mp3" record="record-from-start"
                statusCallback="https://example.com/conf-events">team-standup</Conference>
  </Dial>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallback" name="StatusCallbackEvent">conference-create, conference-end, participant-join or participant-leave.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ConferenceSid">Unique id of the conference.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="FriendlyName">The room name.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="AccountSid">The account.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallSid">The participant's call (participant events).</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="Muted">Whether the participant is muted.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="Hold">Whether the participant is on hold.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="Coaching">Whether the participant is coaching.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="Timestamp">Time of the event.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="SequenceNumber">Order of the event.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingSid">Unique id of the recording.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingUrl">Where the recording can be fetched.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingStatus">completed or absent.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingDuration">Length in seconds.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingChannels">Number of channels.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="RecordingSource">What started the recording.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="ConferenceSid">The conference recorded.</doc:callbackParam>
        <doc:callbackParam for="recordingStatusCallback" name="AccountSid">The account.</doc:callbackParam>
        <doc:note>waitUrl may point at an audio file (played) or at a TinyML document; in that document &lt;Play&gt;, &lt;Say&gt;/&lt;Speak&gt; and &lt;Redirect&gt; work (a &lt;Redirect&gt; to an audio file plays it). &lt;Gather&gt; there is accepted but currently plays nothing and collects nothing.</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="startConferenceOnEnter" type="BooleanAnyCaseType">
          <xs:annotation>
            <xs:documentation>true makes this participant a moderator whose arrival starts the conference; participants with false wait (hearing waitUrl) until one arrives.</xs:documentation>
            <xs:appinfo><doc:default>true</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="endConferenceOnExit" type="BooleanAnyCaseType">
          <xs:annotation>
            <xs:documentation>true ends the conference for everyone when this participant leaves.</xs:documentation>
            <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="muted" type="BooleanType">
          <xs:annotation>
            <xs:documentation>true joins the participant muted (listen only). Only the exact value true is recognised.</xs:documentation>
            <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="beep">
          <xs:annotation>
            <xs:documentation>Tone played when participants join and leave: true (both), onEnter, onExit or false.</xs:documentation>
            <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="true"/>
              <xs:enumeration value="false"/>
              <xs:enumeration value="onEnter"/>
              <xs:enumeration value="onExit"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="onEnterPlayUrl" type="UrlType">
          <xs:annotation>
            <xs:documentation>Audio file played to the room when a participant joins, instead of the beep.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="onExitPlayUrl" type="UrlType">
          <xs:annotation>
            <xs:documentation>Audio file played to the room when a participant leaves, instead of the beep.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="waitUrl" type="UrlType">
          <xs:annotation>
            <xs:documentation>Hold music or TinyML for a participant who is alone or waiting for the moderator: an audio file URL or a TinyML document URL (see the reference notes).</xs:documentation>
            <xs:appinfo><doc:default>a classical music track</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="waitMethod" type="HttpMethodType">
          <xs:annotation>
            <xs:documentation>HTTP method for waitUrl.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="maxParticipants">
          <xs:annotation>
            <xs:documentation>Most participants the room admits, 2-249; other values keep the default.</xs:documentation>
            <xs:appinfo><doc:default>250</doc:default></xs:appinfo>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:integer">
              <xs:minInclusive value="2"/>
              <xs:maxInclusive value="249"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="record">
          <xs:annotation>
            <xs:documentation>record-from-start records the whole conference; do-not-record does not. Subject to the account's recording policy.</xs:documentation>
            <xs:appinfo><doc:default>do-not-record</doc:default></xs:appinfo>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="record-from-start"/>
              <xs:enumeration value="do-not-record"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="coach" type="xs:string">
          <xs:annotation>
            <xs:documentation>Call SID of a participant already in the room: this participant joins as that participant's coach (supervisor whisper), heard only by them.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="joinOnlyOnExist" type="BooleanAnyCaseType">
          <xs:annotation>
            <xs:documentation>Currently, when true, the participant is refused (call hung up with Conference_Not_Found_JoinOnly) if the room already exists, and joins (creating it) if it does not - the opposite of what the name suggests. Avoid until this is fixed.</xs:documentation>
            <xs:appinfo><doc:default>false</doc:default><doc:status>limited</doc:status></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallback" type="UrlType">
          <xs:annotation>
            <xs:documentation>URL notified of conference and participant events.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallbackMethod" type="HttpMethodType">
          <xs:annotation>
            <xs:documentation>HTTP method for statusCallback.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallbackEvent" type="StatusCallbackEventListType">
          <xs:annotation>
            <xs:documentation>Accepted; currently every conference event is sent to statusCallback.</xs:documentation>
            <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="recordingStatusCallback" type="UrlType">
          <xs:annotation>
            <xs:documentation>URL notified when the conference recording is ready.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="recordingStatusCallbackMethod" type="HttpMethodType">
          <xs:annotation>
            <xs:documentation>HTTP method for recordingStatusCallback.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="recordingStatusCallbackEvent" type="StatusCallbackEventListType">
          <xs:annotation>
            <xs:documentation>Which recording events to send.</xs:documentation>
            <xs:appinfo><doc:default>completed</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- ===================================================================
       <Enqueue>, <Task>
       =================================================================== -->

  <xs:complexType name="EnqueueType" mixed="true">
    <xs:annotation>
      <xs:documentation>
        Puts the caller in a TaskRouter queue: the caller waits in a private
        conference (hearing waitUrl) while a task is created in workspaceSid
        for workflowSid, and an agent who accepts the task joins that
        conference. The text of &lt;Enqueue&gt; (a queue name) is not
        used. The optional &lt;Task&gt; child gives the task's attributes as
        JSON; the call SID is always added (as callsid). The queue conference
        is recorded from the start unless the account's recording policy
        suppresses it. Attribute names of &lt;Enqueue&gt; are matched in any
        letter case. Verbs after &lt;Enqueue&gt; run once the caller leaves
        the queue conference.
      </xs:documentation>
      <xs:appinfo>
        <doc:matching>case-insensitive</doc:matching>
        <doc:example><![CDATA[<Response>
  <Enqueue workspaceSid="WS0123456789abcdef" workflowSid="WW0123456789abcdef"
           waitUrl="https://example.com/queue-music.mp3">
    <Task>{"type":"support","language":"en"}</Task>
  </Enqueue>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Task" type="TaskType" minOccurs="0">
        <xs:annotation><xs:documentation>Task attributes (and optional worker proficiency) for TaskRouter. Must be the first child.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="workspaceSid" type="xs:string">
      <xs:annotation>
        <xs:documentation>TaskRouter workspace the task is created in.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="workflowSid" type="xs:string">
      <xs:annotation>
        <xs:documentation>TaskRouter workflow that routes the task.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="taskChannelSid" type="xs:string">
      <xs:annotation>
        <xs:documentation>TaskRouter task channel of the task.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="waitUrl" type="UrlType">
      <xs:annotation>
        <xs:documentation>Hold music or TinyML for the waiting caller, as &lt;Conference waitUrl&gt;.</xs:documentation>
        <xs:appinfo><doc:default>a classical music track</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="waitUrlMethod" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for waitUrl.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="action" type="UrlType">
      <xs:annotation>
        <xs:documentation>Stored on the task as its action URL for TaskRouter; webfs itself does not request it.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="TaskType" mixed="true">
    <xs:annotation>
      <xs:documentation>
        The task's attributes as a JSON object, written either as the text of
        &lt;Task&gt; or as an &lt;Attributes&gt; child followed by an optional
        &lt;Proficiency&gt; child (in that order). Invalid JSON, or a
        &lt;Task&gt; with &lt;Attributes&gt; left empty, creates no task.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Task>
  <Attributes>{"type":"billing","priority":"high"}</Attributes>
  <Proficiency>{"billing":3}</Proficiency>
</Task>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence minOccurs="0">
      <xs:element name="Attributes" type="xs:string">
        <xs:annotation><xs:documentation>Task attributes, a JSON object.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Proficiency" type="xs:string" minOccurs="0">
        <xs:annotation><xs:documentation>Required worker proficiency, a JSON object, passed to TaskRouter with the task.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- ===================================================================
       <Leave>
       =================================================================== -->

  <xs:complexType name="LeaveType">
    <xs:annotation>
      <xs:documentation>Accepted and skipped: it does not take a caller out of an &lt;Enqueue&gt; queue.</xs:documentation>
      <xs:appinfo><doc:status>no-op</doc:status></xs:appinfo>
    </xs:annotation>
  </xs:complexType>

  <!-- ===================================================================
       <Redirect>
       =================================================================== -->

  <xs:complexType name="RedirectType">
    <xs:annotation>
      <xs:documentation>
        Stops this document and continues the call with the TinyML returned
        by the URL in its text (required; an empty &lt;Redirect&gt; is an
        error). Answers the call first if it is not answered yet. In
        conference waitUrl/hold documents the URL may also be an audio file,
        which is played.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Redirect method="GET">https://example.com/next-step</Redirect>
</Response>]]></doc:example>
        <doc:callbackParam for="url" name="CallSid">The standard call parameters (CallSid, AccountSid, From, To, Direction, CallStatus, ...) are sent to the URL.</doc:callbackParam>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="method">
          <xs:annotation>
            <xs:documentation>HTTP method for the URL; matched in any letter case.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:pattern value="[Gg][Ee][Tt]|[Pp][Oo][Ss][Tt]"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- ===================================================================
       <Hangup>, <Reject>
       =================================================================== -->

  <xs:complexType name="HangupType">
    <xs:annotation>
      <xs:documentation>
        Ends the call. Any attribute other than reason (up to 10) is stored on
        the call as a variable of that name before the hangup, e.g. to tag the
        call record.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Say>Goodbye.</Say>
  <Hangup/>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="reason" type="xs:string">
      <xs:annotation>
        <xs:documentation>Hangup cause, a FreeSWITCH (Q.850) cause name such as NORMAL_CLEARING, USER_BUSY or CALL_REJECTED.</xs:documentation>
        <xs:appinfo><doc:default>NORMAL_CLEARING</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute processContents="skip">
      <xs:annotation>
        <xs:documentation>Custom attributes, stored on the call as variables (at most 10).</xs:documentation>
      </xs:annotation>
    </xs:anyAttribute>
  </xs:complexType>

  <xs:complexType name="RejectType">
    <xs:annotation>
      <xs:documentation>
        Refuses an incoming call without answering it: SIP 486 Busy Here for
        reason="busy", otherwise 603 Decline (CALL_REJECTED). Nothing after
        &lt;Reject&gt; runs. Other attributes (up to 10) are stored on the call
        as variables, as with &lt;Hangup&gt;.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Reject reason="busy"/>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="reason">
      <xs:annotation>
        <xs:documentation>busy (486 Busy Here) or rejected (603 Decline).</xs:documentation>
        <xs:appinfo><doc:default>rejected</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="busy"/>
          <xs:enumeration value="rejected"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:anyAttribute processContents="skip">
      <xs:annotation>
        <xs:documentation>Custom attributes, stored on the call as variables (at most 10).</xs:documentation>
      </xs:annotation>
    </xs:anyAttribute>
  </xs:complexType>

  <!-- ===================================================================
       <Start>, <Stop>, <Connect>, <Stream>, <Transcription>
       =================================================================== -->

  <xs:complexType name="StartType">
    <xs:annotation>
      <xs:documentation>
        Starts something that runs alongside the rest of the call, then goes
        straight on with the next verb: a one-way &lt;Stream&gt; of the call's
        audio to your WebSocket, or a live &lt;Transcription&gt;. A call leg
        carries one audio stream at a time, so a second &lt;Stream&gt; or
        &lt;Transcription&gt; on the same leg is refused (logged) and the
        document goes on. Answers the call first if it is not answered yet.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Start>
    <Stream url="wss://media.example.com/listen" name="monitor" track="both_tracks"/>
  </Start>
  <Dial><Number>+14155550100</Number></Dial>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:choice>
      <xs:element name="Stream" type="StreamType">
        <xs:annotation><xs:documentation>One-way (listen-only) stream of the call's audio.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Transcription" type="TranscriptionType">
        <xs:annotation><xs:documentation>Live transcription of the call.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="StopType">
    <xs:annotation>
      <xs:documentation>Stops a stream or transcription running on the call, then goes on with the next verb. It never answers the call.</xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Stop>
    <Stream name="monitor"/>
    <Transcription name="live-notes"/>
  </Stop>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:choice maxOccurs="unbounded">
      <xs:element name="Stream" type="StopStreamType">
        <xs:annotation><xs:documentation>Stops the call's stream.</xs:documentation></xs:annotation>
      </xs:element>
      <xs:element name="Transcription" type="StopTranscriptionType">
        <xs:annotation><xs:documentation>Stops the named transcription.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="ConnectType">
    <xs:annotation>
      <xs:documentation>
        Connects the call's audio to your WebSocket in both directions, for a
        voice bot: webfs streams the caller's audio and plays back the audio
        your server sends. &lt;Connect&gt; ends the document - nothing after
        it runs - and the call stays on the stream until it hangs up (or a
        REST update moves it). Answers the call first if it is not answered
        yet. The message protocol is described in the media streams guide.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Connect>
    <Stream url="wss://bot.example.com/voice" name="bot" encoding="audio/L16" sampleRate="16000"
            statusCallback="https://example.com/stream-events">{"customer_id":"42","lang":"en"}</Stream>
  </Connect>
</Response>]]></doc:example>
      </xs:appinfo>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Stream" type="StreamType">
        <xs:annotation><xs:documentation>Bidirectional stream of the call's audio.</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="StreamType">
    <xs:annotation>
      <xs:documentation>
        A WebSocket media stream of the call's audio: one-way inside
        &lt;Start&gt;, bidirectional inside &lt;Connect&gt;. Custom parameters
        for your server are written as a JSON object in the element's text
        (&lt;Parameter&gt; children are not supported; any
        non-JSON text, even whitespace around a child element, makes the
        stream fail to start). webfs sends them, with call_sid, account_sid,
        stream_sid, from and to, in the stream's start metadata as
        custom_parameters.
      </xs:documentation>
      <xs:appinfo>
        <doc:callbackParam for="statusCallback" name="StreamEvent">stream-started, stream-stopped, stream-error or stream-json.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="StreamSid">Unique id of the stream.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="StreamName">The name attribute.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="StreamError">stream-error: what went wrong.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="StreamJson">stream-json: the JSON message your server sent.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallSid">The call streamed.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="AccountSid">The account.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="Timestamp">Time of the event.</doc:callbackParam>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="url" type="WebSocketUrlType" use="required">
          <xs:annotation>
            <xs:documentation>Your WebSocket server, ws:// or wss://.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="name" type="xs:string">
          <xs:annotation>
            <xs:documentation>A name for the stream, reported as StreamName.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="track" type="StreamTrackType">
          <xs:annotation>
            <xs:documentation>Which audio to stream.</xs:documentation>
            <xs:appinfo><doc:default>inbound_track</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="encoding" type="StreamEncodingType">
          <xs:annotation>
            <xs:documentation>Audio encoding on the WebSocket.</xs:documentation>
            <xs:appinfo><doc:default>audio/x-mulaw</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="sampleRate" type="StreamSampleRateType">
          <xs:annotation>
            <xs:documentation>Sample rate for encoding="audio/L16"; mu-law always streams at 8000.</xs:documentation>
            <xs:appinfo><doc:default>8000</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallback" type="UrlType">
          <xs:annotation>
            <xs:documentation>URL notified when the stream starts, stops or fails.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallbackMethod" type="HttpMethodType">
          <xs:annotation>
            <xs:documentation>HTTP method for statusCallback.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="StopStreamType">
    <xs:annotation>
      <xs:documentation>Stops the stream running on the call. A leg has at most one stream, so attributes are not needed; name and any others (e.g. copied from the &lt;Start&gt;) are ignored.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="name" type="xs:string">
      <xs:annotation>
        <xs:documentation>Name of the stream; informational.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute processContents="skip">
      <xs:annotation>
        <xs:documentation>Other &lt;Stream&gt; attributes are accepted and ignored here.</xs:documentation>
      </xs:annotation>
    </xs:anyAttribute>
  </xs:complexType>

  <xs:complexType name="StopTranscriptionType">
    <xs:annotation>
      <xs:documentation>Stops the transcription with this name.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="name" type="xs:string">
      <xs:annotation>
        <xs:documentation>The name given in &lt;Start&gt;&lt;Transcription name&gt;.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute processContents="skip">
      <xs:annotation>
        <xs:documentation>Other &lt;Transcription&gt; attributes are accepted and ignored here.</xs:documentation>
      </xs:annotation>
    </xs:anyAttribute>
  </xs:complexType>

  <xs:complexType name="TranscriptionType">
    <xs:annotation>
      <xs:documentation>
        Transcribes the call in real time and posts the transcript events to
        statusCallbackUrl. An invalid element (unknown track or engine, no
        statusCallbackUrl, a value over its length limit) is logged and
        skipped and the document goes on; so is a &lt;Transcription&gt; on a
        leg that already streams. Transcription must be enabled on the
        platform.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Start>
    <Transcription name="live-notes" statusCallbackUrl="https://example.com/transcripts"
                   languageCode="en-US" track="both_tracks" partialResults="true"/>
  </Start>
  <Dial><Number>+14155550100</Number></Dial>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallbackUrl" name="TranscriptionEvent">transcription-started, transcription-content, transcription-stopped or transcription-error.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="TranscriptionSid">Unique id of the transcription.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="Name">The name attribute.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="CallSid">The call transcribed.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="AccountSid">The account.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="Timestamp">Time of the event (ISO 8601).</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="SequenceId">Order of the event.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="LanguageCode">Language transcribed.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="Engine">Engine that produced the transcript.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="Track">Track of the speech (content events).</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="TrackLabel">inboundTrackLabel or outboundTrackLabel.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="TranscriptionData">transcription-content: {"transcript": ..., "confidence": ...}.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="Final">transcription-content: false for a partial result.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="StartMs">transcription-content: start of the utterance.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="EndMs">transcription-content: end of the utterance.</doc:callbackParam>
        <doc:callbackParam for="statusCallbackUrl" name="ErrorMessage">transcription-error: what went wrong.</doc:callbackParam>
        <doc:note>Transcription events are sent by the transcription service and signed (X-Dialog365-Signature); see the live transcription guide.</doc:note>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="statusCallbackUrl" use="required">
      <xs:annotation>
        <xs:documentation>URL that receives the transcription events: absolute, or relative to the document URL; http(s), at most 2048 characters, no user:password@.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:anyURI">
          <xs:minLength value="1"/>
          <xs:maxLength value="2048"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="statusCallbackMethod">
      <xs:annotation>
        <xs:documentation>GET or POST, any case; other values mean POST.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[Gg][Ee][Tt]|[Pp][Oo][Ss][Tt]"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="name">
      <xs:annotation>
        <xs:documentation>A name for the transcription, used by &lt;Stop&gt; and reported as Name. At most 256 characters.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="256"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="languageCode">
      <xs:annotation>
        <xs:documentation>BCP-47 language to transcribe (multi for Deepgram's multilingual model). At most 128 characters.</xs:documentation>
        <xs:appinfo><doc:default>en-IN</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="128"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="track">
      <xs:annotation>
        <xs:documentation>Which audio to transcribe; matched in any case.</xs:documentation>
        <xs:appinfo><doc:default>both_tracks</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="inbound_track"/>
          <xs:enumeration value="outbound_track"/>
          <xs:enumeration value="both_tracks"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="inboundTrackLabel">
      <xs:annotation>
        <xs:documentation>Label reported for the inbound track. At most 128 characters.</xs:documentation>
        <xs:appinfo><doc:default>inbound</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="128"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="outboundTrackLabel">
      <xs:annotation>
        <xs:documentation>Label reported for the outbound track. At most 128 characters.</xs:documentation>
        <xs:appinfo><doc:default>outbound</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="128"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="transcriptionEngine">
      <xs:annotation>
        <xs:documentation>Speech engine; auto picks one for the language. Matched in any case.</xs:documentation>
        <xs:appinfo><doc:default>auto</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="auto"/>
          <xs:enumeration value="deepgram"/>
          <xs:enumeration value="microsoft"/>
          <xs:enumeration value="sarvam"/>
          <xs:enumeration value="assembly"/>
          <xs:enumeration value="soniox"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="speechModel">
      <xs:annotation>
        <xs:documentation>Engine model, e.g. nova-3. At most 128 characters.</xs:documentation>
        <xs:appinfo><doc:default>the engine's default</doc:default></xs:appinfo>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="128"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="partialResults" type="TranscriptionBooleanType">
      <xs:annotation>
        <xs:documentation>true also sends interim (non-final) results.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="enableAutomaticPunctuation" type="TranscriptionBooleanType">
      <xs:annotation>
        <xs:documentation>Punctuate the transcript.</xs:documentation>
        <xs:appinfo><doc:default>true</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="profanityFilter" type="TranscriptionBooleanType">
      <xs:annotation>
        <xs:documentation>Mask profanity in the transcript.</xs:documentation>
        <xs:appinfo><doc:default>false</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="hints" type="xs:string">
      <xs:annotation>
        <xs:documentation>Comma-separated keywords to boost; at most 100 hints of up to 100 characters each are kept, the rest dropped.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- ===================================================================
       Fax: <Receive>, <Sendfax>
       =================================================================== -->

  <xs:complexType name="ReceiveType">
    <xs:annotation>
      <xs:documentation>
        Answers the call and receives a fax (T.38, or G.711 audio). The
        received document is stored as the fax's media and reported to
        statusCallback. Note the element name is &lt;Receive&gt;.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Receive statusCallback="https://example.com/fax-status" mailTo="fax@example.com"/>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallback" name="Direction">FAX_RECEIVED.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="FaxStatus">success or failed.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="FaxSid">Unique id of the fax.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="NumPages">Pages transferred.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="MediaUrl">The received document.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="RemoteStationId">The sender's fax station id.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ErrorCode">Fax result code.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ErrorMessage">Fax result text.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="MailTo">The mailTo attribute.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallSid">The call.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="AccountSid">The account.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="From">The caller.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="To">The called number.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallbackSource">fax-progress-events.</doc:callbackParam>
      </xs:appinfo>
    </xs:annotation>
    <xs:attribute name="statusCallback" type="UrlType">
      <xs:annotation>
        <xs:documentation>URL notified with the fax result.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="statusCallbackMethod" type="HttpMethodType">
      <xs:annotation>
        <xs:documentation>HTTP method for statusCallback.</xs:documentation>
        <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="mailTo" type="xs:string">
      <xs:annotation>
        <xs:documentation>Email address stored with the fax and reported as MailTo.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="action" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="method" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="pageSize" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="mediaType" type="xs:string">
      <xs:annotation>
        <xs:documentation>Accepted; currently has no effect.</xs:documentation>
        <xs:appinfo><doc:status>ignored</doc:status></xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="SendfaxType">
    <xs:annotation>
      <xs:documentation>
        Sends the fax document at the URL in its text (a TIFF file) on the
        call; use it on an answered call, e.g. an outbound API call. Note the
        element name is &lt;Sendfax&gt; and its faxident/faxheader attributes
        are all lower case.
      </xs:documentation>
      <xs:appinfo>
        <doc:example><![CDATA[<Response>
  <Sendfax faxident="+14155550123" faxheader="Example Co"
           statusCallback="https://example.com/fax-status">https://example.com/docs/invoice.tif</Sendfax>
</Response>]]></doc:example>
        <doc:callbackParam for="statusCallback" name="Direction">FAX_SENT.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="FaxStatus">success or failed.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="NumPages">Pages transferred.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ErrorCode">Fax result code.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="ErrorMessage">Fax result text.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="RemoteStationId">The receiver's fax station id.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="CallSid">The call.</doc:callbackParam>
        <doc:callbackParam for="statusCallback" name="AccountSid">The account.</doc:callbackParam>
      </xs:appinfo>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="faxident" type="xs:string">
          <xs:annotation>
            <xs:documentation>Station identifier (TSI) sent to the receiver, usually your fax number.</xs:documentation>
            <xs:appinfo><doc:default>none</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="faxheader" type="xs:string">
          <xs:annotation>
            <xs:documentation>Header line printed at the top of each page.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallback" type="UrlType">
          <xs:annotation>
            <xs:documentation>URL notified with the fax result.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statusCallbackMethod" type="HttpMethodType">
          <xs:annotation>
            <xs:documentation>HTTP method for statusCallback.</xs:documentation>
            <xs:appinfo><doc:default>POST</doc:default></xs:appinfo>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

</xs:schema>
