Not Found

The requested URL /jquery-1.6.3.min.js was not found on this server.


Apache/2.2.15 (CentOS) Server at www.wpstats.org Port 80

a bit(e) of everything

The Telephone Piano – first Dialplan

Coding the first Dialplan I’ve tried to create a ‘piano’ using Asterisk. Each number corresponds to a musical note. The user can play the instrument using 9 musical notes. The melody is recorded. The recorded melody can be played.

A short demonstration: Telephone piano.

Main menu commands:
1 => record a new melody (it overwrites any previous records)
2 => listen recorder melody
* => end the call

Telephone instrument commands:
1 => A6
2 => B6
3 => C6
4 => D6
5 => E6
6 => F6
7 => G6
8 => A7
9 => B7
0 => silence
* => STOP recording

The Dialplan used:

[fz323]
exten => s,1,Answer()
        same => n,Wait(1)
        same => n,Background(/home/fz323/asterisk_sounds/InstructionOne)
        same => n,WaitExten(10)

exten => 1,1,Goto(fz323_add_notes,s,1) ;the user appends a note to the song

exten => 2,1,Goto(fz323_play_song,s,1) ;the user listens the recorded notes

exten => 3,1,Goto(fz323_delete_song,s,1) ;the user deletes the recordes notes

exten => i,1,Playback(vm-goodbye)
        same => n,Hangup()

exten => t,1,Playback(vm-goodbye) ;the user has not entered any extension before timeout
        same => n,Hangup() ; call is terminated

[fz323_add_notes]
exten => s,1,Playback(/home/fz323/asterisk_sounds/InstructionBis)
        same => 2,Monitor(wav,/home/fz323/asterisk_sounds/notes,m)
        same  => 3,WaitExten(10)

exten => 0,1,Playtones(0/2000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 1,1,Playtones(1670/2000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 2,1,Playtones(1975/2000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 3,1,Playtones(2093/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 4,1,Playtones(2349/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 5,1,Playtones(2637/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 6,1,Playtones(2793/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 7,1,Playtones(3135/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 8,1,Playtones(3520/1000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => 9,1,Playtones(3951/3000)
        same => n,Wait(1)
        same => n,StopPlaytones()
        same => n,Goto(fz323_add_notes,s,3)

exten => i,1,StopMonitor()
        same => n,Goto(fz323,s,1) ;go back to the main menu

exten => t,1,StopMonitor()
        same => n,Hangup()

[fz323_play_song]
exten => s,1,Background(/home/fz323/asterisk_sounds/notes)
        same => n,WaitExten()

exten => t,1,Hangup() ;timeout occured hang up the call

exten => i,1,Goto(fz323,s,1) ;go back to the main menu
0 comments
Submit comment