Voice: DSML, DialerSeat Markup Language
A call flow as XML verbs (Say, Gather, Dial, Record and more) that DialerSeat runs for you, with no server of your own.
Point a number at a DSML application and every call to it fetches a document from your URL (or a document DialerSeat hosts for you) and runs its verbs, top to bottom. Gather, Dial and Record send their results to an action URL, which answers with the next document. If you have used TwiML or TeXML, the verbs will be familiar.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather action="https://crm.example.com/voice/menu" numDigits="1" timeout="6">
<Say voice="female">Thanks for calling Acme. Press 1 for sales, 2 for support.</Say>
</Gather>
<Say>We did not get that. Connecting you to the front desk.</Say>
<Dial callerId="+12145550100" timeout="20" record="record-from-answer" action="https://crm.example.com/voice/after-dial">
<Number>+15125550142</Number>
<Sip>sip:frontdesk@pbx.example.com</Sip>
</Dial>
<Record maxLength="120" playBeep="true" action="https://crm.example.com/voice/voicemail"/>
<Hangup/>
</Response>Verbs
- Say: Speak text to the caller. Attributes: voice, language, loop.
- Play: Play an MP3 or WAV from a URL. Attributes: loop, digits.
- Pause: Wait in silence. Attributes: length.
- Gather: Collect keypad digits, optionally while speaking or playing a prompt, then send them to your action URL. Attributes: action, method, numDigits, timeout, finishOnKey, minDigits, validDigits. Holds: Say, Play, Pause.
- Dial: Connect the caller to a number, a SIP address or a conference room. When it ends, DialerSeat calls your action URL with the outcome. Attributes: action, method, callerId, timeout, timeLimit, record, hangupOnStar, answerOnBridge, machineDetection. Holds: Number, Sip, Conference.
- Number (inside Dial): A US number to dial, inside Dial. Attributes: sendDigits, url, statusCallback.
- Sip (inside Dial): A SIP address to dial, inside Dial. Attributes: username, password, url, statusCallback.
- Conference (inside Dial): A conference room to join, inside Dial. Attributes: muted, beep, startConferenceOnEnter, endConferenceOnExit, waitUrl, maxParticipants, statusCallback.
- Record: Record the caller, for voicemail, and send the recording to your action URL. Attributes: action, method, timeout, maxLength, finishOnKey, playBeep, recordingStatusCallback.
- Stream: Stream the call's audio to your WebSocket while the document carries on. Attributes: url, track, name.
- Redirect: Fetch the next document from another URL. Attributes: method.
- Reject: Turn an inbound call away without answering it. Attributes: reason.
- Hangup: End the call.
The rules a document must follow
- The root is <Response>; verbs go inside it, in order.
- Number, Sip and Conference go inside Dial; Say, Play and Pause may go inside Gather.
- Nothing after Hangup, Reject or Redirect runs, so a document that has anything there is refused.
- Reject comes first, because an answered call cannot be rejected.
- Numbers are US numbers; audio is an https MP3 or WAV; streams go to a wss:// address.
- No DOCTYPE or entity declarations: a document can never make DialerSeat fetch a file.
POST /v1/voice/dsml/validate checks a document and answers with every verb as DialerSeat reads it, or the line and the reason it is wrong. The DSML checker on this site runs the same checks in your browser.
Applications and hosted documents
POST /v1/voice/applications: Where a number's calls go: a Voice API application that sends every event to your webhook, or a DSML application that fetches call instructions from your URL (or a hosted DSML document).POST /v1/voice/dsml_bins: Store a DSML document at a DialerSeat address, for flows that never change.POST /v1/voice/dsml/calls: Dial out and run a DSML document when it is answered: the quickest way to build an outbound flow without a webhook server.
Related:DialerSeat Voice: numbers, SIP and a voice API, Voice: numbers, porting and 911, Voice: SIP trunking and Voice: the Voice API.