[tools] / trunk / demos / asterisk_dialplans / pitching-asr / extensions.conf Repository:
ViewVC logotype

Annotation of /trunk/demos/asterisk_dialplans/pitching-asr/extensions.conf

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24 - (view) (download)

1 : jhermanski 24 ;
2 :     ; Asterisk Dialplan for DiaStar Pitching Demo - LunexVox ASR version
3 :     ;
4 :     ; All media files are named the same as their contexts,
5 :     ;
6 :     ;
7 :     [globals]
8 :     ;
9 :     ; Media files are selected based on incoming SDP requests from SIP.
10 :     ; Audio and video files are kept in standard directories organized by
11 :     ; codec and resolution, followed by a directory named after the application.
12 :     FILE_LOC=pitching
13 :     VERBOSE_LEVEL=2
14 :    
15 :     [dialogic]
16 :     ; Always start here. Any extension starts the demo
17 :     exten => _X.,1,Answer
18 :     ;exten => _X.,n,Wait(3)
19 :     exten => _X.,n,Goto(greeting_000,s,1)
20 :     ;exten => _X.,n,Goto(make_recording,s,1)
21 :    
22 :     [make_recording]
23 :     ; Sometimes comes in handy - leave in
24 :     exten => s,1,WoomeraRecord(${FILE_LOC}/tmp_record,${FILE_LOC}/tmp_record)
25 :     exten => s,n,Wait(1)
26 :     exten => s,n,Hangup
27 :    
28 :     ; Repetative plays and menus are handled with the following generic context subroutines
29 :     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 :     [play_nointerrupt]
31 :     exten => s,1,Set(LOCAL(CALLING_CONTEXT)=${ARG1})
32 :     exten => s,n,Set(LOCAL(NEXT_CONTEXT)=${ARG2})
33 :     exten => s,n,Set(LOCAL(COMMENT)=${ARG3})
34 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Context: ${CALLING_CONTEXT})
35 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Next Context: ${NEXT_CONTEXT})
36 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Comment: ${COMMENT})
37 :     ; Play without interruption
38 :     exten => s,n,WoomeraPlayback(${FILE_LOC}/${CALLING_CONTEXT},${FILE_LOC}/${CALLING_CONTEXT})
39 :     exten => s,n,Goto(${NEXT_CONTEXT},s,1)
40 :     exten => s,n,Return
41 :    
42 :     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
43 :    
44 :     [greeting_000]
45 :     ; Beginning of the Demo - Start Here
46 :     exten => s,1,Set(COMMENT=Demo Intro - Video version)
47 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
48 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
49 :    
50 :    
51 :     [main_menu_000]
52 :    
53 :     ; Menu listing all categories of pitches
54 :     exten => s,1,Verbose(${VERBOSE_LEVEL},Context: main_menu_000)
55 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Choice of: fastball grips = 1, breakingball_grips = 2, offspeed grips = 3, knuckleball grips = 4)
56 :     ; Create the speech object
57 :     exten => s,n,SpeechCreate()
58 :     ; Load and activate grammar
59 :     exten => s,n,SpeechLoadGrammar(mainmenu,/etc/lumenvox/demogrammar/mainmenu.gram)
60 :     exten => s,n,SpeechActivateGrammar(mainmenu)
61 :     ; Woomera playback of video file
62 :     exten => s,n,WoomeraBackground(,${FILE_LOC}/${CONTEXT})
63 :     ; SpeechBackground with a 20 second no-input timeout to play the audio file
64 :     exten => s,n,SpeechBackground(${CONTEXT},20)
65 :     ; Kill Woomera video
66 :     exten => s,n,WoomeraStop()
67 :     ; Deactivate our grammar
68 :     exten => s,n,SpeechDeactivateGrammar(mainmenu)
69 :     ; Set a variable to store the answer, whether it was speech or DTMF (useful in case we need to confirm and later overwrite SPEECH_TEXT
70 :     exten => s,n,Set(CHOICE=${SPEECH_TEXT(0)})
71 :     exten => s,n,Verbose(${VERBOSE_LEVEL},1,Result was ${CHOICE})
72 :     exten => s,n,GotoIf($[ "${CHOICE}" = "1"]?Generic)
73 :     exten => s,n,GotoIf($[ "${CHOICE}" = "2"]?Generic)
74 :     exten => s,n,GotoIf($[ "${CHOICE}" = "3"]?Generic)
75 :     exten => s,n,GotoIf($[ "${CHOICE}" = "4"]?Generic)
76 :     exten => s,n(Specific),Goto(${CHOICE},s,1)
77 :     exten => s,n(Generic),Goto(main_menu_000,${CHOICE},1)
78 :    
79 :    
80 :     ; Goto the appropriate line depending on what the user did
81 :     exten => s,n,Goto(main_menu_000,${CHOICE},1)
82 :     exten => 1,1,Verbose(${VERBOSE_LEVEL},Choice is "1" )
83 :     exten => 1,n,Goto(fastball_menu_000,s,1)
84 :     exten => 2,1,Verbose(${VERBOSE_LEVEL},Choice is "2" )
85 :     exten => 2,n,Goto(breaking_ball_menu_000,s,1)
86 :     exten => 3,1,Verbose(${VERBOSE_LEVEL},Choice is "3" )
87 :     exten => 3,n,Goto(off_speed_menu_000,s,1)
88 :     exten => 4,1,Verbose(${VERBOSE_LEVEL},Choice is "4" )
89 :     exten => 4,n,Goto(knuckleball_menu_000,s,1)
90 :     exten => t,1,Goto(main_menu_000,s,1)
91 :     exten => i,1,Goto(main_menu_000,s,1)
92 :    
93 :     [fastball_menu_000]
94 :     ; Menu listing all fastball pitches
95 :     exten => s,1,Verbose(${VERBOSE_LEVEL},Context: fastball_menu_000)
96 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Choice of: four-seam fastball = 1, two-seam fastball = 2, split finger fastball = 3)
97 :     exten => s,n,SpeechLoadGrammar(fastball,/etc/lumenvox/demogrammar/fastball.gram)
98 :     exten => s,n,SpeechActivateGrammar(fastball)
99 :     exten => s,n,WoomeraBackground(,${FILE_LOC}/${CONTEXT})
100 :     exten => s,n,SpeechBackground(${CONTEXT},20)
101 :     exten => s,n,WoomeraStop()
102 :     exten => s,n,SpeechDeactivateGrammar(fastball)
103 :     exten => s,n,Set(CHOICE=${SPEECH_TEXT(0)})
104 :     exten => s,n,Verbose(${VERBOSE_LEVEL},1,Result was ${CHOICE})
105 :     exten => s,n,GotoIf($[ "${CHOICE}" = "1"]?Generic)
106 :     exten => s,n,GotoIf($[ "${CHOICE}" = "2"]?Generic)
107 :     exten => s,n,GotoIf($[ "${CHOICE}" = "3"]?Generic)
108 :     exten => s,n,GotoIf($[ "${CHOICE}" = "4"]?Generic)
109 :     exten => s,n(Specific),Goto(${CHOICE})
110 :     exten => s,n(Generic),Goto(fastball_menu_000,${CHOICE},1)
111 :     exten => 1,1,Verbose(${VERBOSE_LEVEL},Choice is "1" )
112 :     exten => 1,n,Goto(four_seam_fastball,s,1)
113 :     exten => 2,1,Verbose(${VERBOSE_LEVEL},Choice is "2" )
114 :     exten => 2,n,Goto(two_seam_fastball,s,1)
115 :     exten => 3,1,Verbose(${VERBOSE_LEVEL},Choice is "3" )
116 :     exten => 3,n,Goto(splitter,s,1)
117 :     exten => t,1,Goto(fastball_menu_000,s,1)
118 :     exten => i,1,Goto(fastball_menu_000,s,1)
119 :    
120 :     [breaking_ball_menu_000]
121 :     ; Menu listing all breaking ball pitches
122 :     exten => s,1,Verbose(${VERBOSE_LEVEL},Context: breaking_ball_menu_000)
123 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Choice of: beginners curveball = 1, straight curveball = 2, slider = 3)
124 :     exten => s,n,SpeechLoadGrammar(breakingball,/etc/lumenvox/demogrammar/breakingball.gram)
125 :     exten => s,n,SpeechActivateGrammar(breakingball)
126 :     exten => s,n,WoomeraBackground(,${FILE_LOC}/${CONTEXT})
127 :     exten => s,n,SpeechBackground(${CONTEXT},20)
128 :     exten => s,n,WoomeraStop()
129 :     exten => s,n,SpeechDeactivateGrammar(breakingball)
130 :     exten => s,n,Set(CHOICE=${SPEECH_TEXT(0)})
131 :     exten => s,n,Goto(breaking_ball_menu_000,${CHOICE},1)
132 :     exten => 1,1,Verbose(${VERBOSE_LEVEL},Choice is "1" )
133 :     exten => 1,n,Goto(beginners_curveball,s,1)
134 :     exten => 2,1,Verbose(${VERBOSE_LEVEL},Choice is "2" )
135 :     exten => 2,n,Goto(straight_curveball,s,1)
136 :     exten => 3,1,Verbose(${VERBOSE_LEVEL},Choice is "3" )
137 :     exten => 3,n,Goto(slider,s,1)
138 :     exten => t,1,Goto(breaking_ball_menu_000,s,1)
139 :     exten => i,1,Goto(breaking_ball_menu_000,s,1)
140 :    
141 :     [off_speed_menu_000]
142 :     ; Menu listing all offspeed pitches
143 :     exten => s,1,Verbose(${VERBOSE_LEVEL},Context: off_speed_menu_000)
144 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Choice of: three-finger changeup = 1, circle changeup = 2, palm ball = 3)
145 :     exten => s,n,SpeechLoadGrammar(offspeed,/etc/lumenvox/demogrammar/offspeed.gram)
146 :     exten => s,n,SpeechActivateGrammar(offspeed)
147 :     exten => s,n,WoomeraBackground(,${FILE_LOC}/${CONTEXT})
148 :     exten => s,n,SpeechBackground(${CONTEXT},20)
149 :     exten => s,n,WoomeraStop()
150 :     exten => s,n,SpeechDeactivateGrammar(offspeed)
151 :     exten => s,n,Set(CHOICE=${SPEECH_TEXT(0)})
152 :     exten => s,n,Goto(off_speed_menu_000,${CHOICE},1)
153 :     exten => 1,1,Verbose(${VERBOSE_LEVEL},Choice is "1" )
154 :     exten => 1,n,Goto(three_finger_changeup,s,1)
155 :     exten => 2,1,Verbose(${VERBOSE_LEVEL},Choice is "2" )
156 :     exten => 2,n,Goto(circle_change,s,1)
157 :     exten => 3,1,Verbose(${VERBOSE_LEVEL},Choice is "3" )
158 :     exten => 3,n,Goto(palmball,s,1)
159 :     exten => t,1,Goto(off_speed_menu_000,s,1)
160 :     exten => i,1,Goto(off_speed_menu_000,s,1)
161 :    
162 :     [knuckleball_menu_000]
163 :     ; Menu listing all knuckleball pitches
164 :     exten => s,1,Verbose(${VERBOSE_LEVEL},Context: knuckleball_menu_000)
165 :     exten => s,n,Verbose(${VERBOSE_LEVEL},Choice of: knuckleball = 1, knuckle curve = 2)
166 :     exten => s,n,SpeechLoadGrammar(knuckleball,/etc/lumenvox/demogrammar/knuckleball.gram)
167 :     exten => s,n,SpeechActivateGrammar(knuckleball)
168 :     exten => s,n,WoomeraBackground(,${FILE_LOC}/${CONTEXT})
169 :     exten => s,n,SpeechBackground(${CONTEXT},20)
170 :     exten => s,n,WoomeraStop()
171 :     exten => s,n,SpeechDeactivateGrammar(knuckleball)
172 :     exten => s,n,Set(CHOICE=${SPEECH_TEXT(0)})
173 :     exten => s,n,Goto(knuckleball_menu_000,${CHOICE},1)
174 :     exten => 1,1,Verbose(${VERBOSE_LEVEL},Choice is "1" )
175 :     exten => 1,n,Goto(knuckleball,s,1)
176 :     exten => 2,1,Verbose(${VERBOSE_LEVEL},Choice is "2" )
177 :     exten => 2,n,Goto(knucklecurve,s,1)
178 :     exten => t,1,Goto(knuckleball_menu_000,s,1)
179 :     exten => i,1,Goto(knuckecurvemenu_000,s,1)
180 :    
181 :     [four_seam_fastball]
182 :     exten => s,1,Set(COMMENT=Play four seam fastball instructions)
183 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
184 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
185 :    
186 :     [two_seam_fastball]
187 :     exten => s,1,Set(COMMENT=Play two seam fastball instructions)
188 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
189 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
190 :    
191 :     [splitter]
192 :     exten => s,1,Set(COMMENT=Play split finger fastball instructions)
193 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
194 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
195 :    
196 :     [beginners_curveball]
197 :     exten => s,1,Set(COMMENT=Play beginners curveball instructions)
198 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
199 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
200 :    
201 :     [straight_curveball]
202 :     exten => s,1,Set(COMMENT=Play straight curveball instructions)
203 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
204 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
205 :    
206 :     [slider]
207 :     exten => s,1,Set(COMMENT=Play slider instructions)
208 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
209 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
210 :    
211 :     [three_finger_changeup]
212 :     exten => s,1,Set(COMMENT=Play three finger changeup instructions)
213 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
214 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
215 :    
216 :     [circle_change]
217 :     exten => s,1,Set(COMMENT=Play circle chageup instructions)
218 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
219 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
220 :    
221 :     [palmball]
222 :     exten => s,1,Set(COMMENT=Play palmball instructions)
223 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
224 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
225 :    
226 :     [knuckleball]
227 :     exten => s,1,Set(COMMENT=Play knuckleball instructions)
228 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
229 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
230 :    
231 :     [knucklecurve]
232 :     exten => s,1,Set(COMMENT=Play knuckle curve instructions)
233 :     exten => s,n,Set(NEXT_CONTEXT=main_menu_000)
234 :     exten => s,n,Gosub(play_nointerrupt,s,1(${CONTEXT},${NEXT_CONTEXT},${COMMENT}))
235 :    
236 :    

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.8