Skip to main content

TTML

Timed Text Markup Language "was designed to be used for the purpose of authoring, transcoding or exchanging timed text information presently in use primarily for subtitling and captioning functions", but apparently FreeSWITCH uses them to compose sequences of tones.

fur_elise.ttml comes with a vanilla FreeSWITCH installation, and it is a sequence of FreeSWITCH tones:

Snippet from fur_elise.ttml

%(167, 0, 659)
%(167, 0, 622)
%(167, 0, 659)
%(167, 0, 622)
%(167, 0, 659)
%(167, 0, 494)
%(167, 0, 554)
%(167, 0, 523)
%(333, 0, 440)
%(167, 0, 0)
%(167, 0, 262)
%(167, 0, 330)
%(167, 0, 440)
%(333, 0, 494)
%(167, 0, 0)
%(167, 0, 330)
%(167, 0, 415)
%(167, 0, 494)
%(333, 0, 523)
%(167, 0, 0)
%(167, 0, 330)
%(167, 0, 659)
%(167, 0, 622)
%(167, 0, 659)
%(167, 0, 622)
%(167, 0, 659)
%(167, 0, 494)


Usage

Taking the dialplan example from XML Dialplan:

<extension name="US-Domestic"> <condition field="destination_number" expression="_(NXXXXXXXXX)"> <action application="bridge" data="sofia/internal/$1@example.com"/> </condition></extension> <extension name="star-code-using-escape"> <condition field="destination_number" expression="_(\*XX)(.)"> <action application="log" data="ERR captured $1 ~~~ $2"/> <action application="answer"/> <action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/> </condition></extension>