Playtones Info

Playtones online documentation is really lousy so I’m adding some notes here:

  • The tonelist itself is defined by a comma-separated sequence of elements. Each element consist of a frequency (f) with an optional duration (in ms) attached to it (f/duration).
  • The frequency component may be a mixture of two frequencies (f1+f2) or a frequency modulated by another frequency (f1*f2). The implicit modulation depth is fixed at 90%, though.
  • If the list element starts with a !, that element is NOT repeated, therefore, only if all elements start with !, the tonelist is time-limited, all others will repeat indefinitely.

concisely:

element = [!]freq[+|*freq2][/duration]
tonelist = element[,element]*

You can use “0” to play nothing. Useful for putting a pause in between tones. For example,

0/500

will play no tone for 500ms (1/2 second).

Please note that SPACES ARE NOT ALLOWED in tone lists!

Some examples of US Phone tones:

ringcadence = 2000,4000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/2000,0/4000
congestion = 480+620/250,0/250
callwaiting = 440/300,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440

Tones are just notes so you can make your own phone compositions! You can easily find a “musical note to frequency converter” online:http://www.phy.mtu.edu/~suits/notefreqs.html

mary had a little lamb
Dialplan Snippet:

;notes
;e = 330/100,0/20,
;d = 294/100,0/20,
;c = 262/100,0/20,
;mary had a little lamb
[NETID_playtones]
exten => s,1,Playtones(330/400,0/20,294/400,0/20,262/400,0/20,294/400,0/20,330/400,0/20,330/400,0/20,330/400,0/20,330/400,0/20,294/400,0/20,294/400,0/20,330/400,0/20,294/400,0/20,262/1000,0/2000)
exten => s,n,Wait(20)
exten => s,n,StopPlaytones()