dontUnderstand.dsl
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
library
context
{
output status:string?;
output serviceStatus:string?;
}
digression dont_understand_hangup_params
{
conditions { on false; }
var responses: Phrases[] = ["dont_understand_forward"];
var status = "DontUnderstandHangup";
var serviceStatus = "Done";
do
{
}
transitions
{
}
}
digression dont_understand
{
conditions { on true priority -1000; }
var retriesLimit=2;
var counter=0;
var resetOnRecognized=false;
var responses: Phrases[] = ["dont_understand"];
do
{
if (digression.dont_understand.counter == 2)
{
goto hangup;
}
set digression.dont_understand.counter=digression.dont_understand.counter+1;
set digression.dont_understand.resetOnRecognized = false;
for (var item in digression.dont_understand.responses)
{
#say(item, repeatMode: "ignore");
//#say("dont_understand_question");
}
#repeat(accuracy: "short");
return;
}
transitions
{
hangup: goto dont_understand_hangup;
}
}
preprocessor digression dont_understand_preprocessor
{
conditions { on true priority 50000; }
do
{
if (digression.dont_understand.resetOnRecognized)
{
set digression.dont_understand.counter = 0;
}
set digression.dont_understand.resetOnRecognized = true;
return;
}
transitions
{
}
}
node dont_understand_hangup
{
do
{
$cjm.push("dont_understand_hangup");
for (var item in digression.dont_understand_hangup_params.responses)
{
#say(item, repeatMode: "ignore");
}
set $status=digression.dont_understand_hangup_params.status;
set $serviceStatus=digression.dont_understand_hangup_params.serviceStatus;
//#forward("12223334455"); //use if you want to transfer a call
//#disconnect();
goto do_before_exit;
}
transitions
{
do_before_exit: goto do_before_exit;
}
}