-
Notifications
You must be signed in to change notification settings - Fork 1
/
a95x7.krl
70 lines (59 loc) · 1.46 KB
/
a95x7.krl
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
ruleset a95x6 {
meta {
name "Tolman Family bookmark added"
description <<
>>
author ""
// Uncomment this line to require Marketplace purchase to use this app.
// authz require user
logging off
key twilio {
"account_sid" : "TWILIO SID",
"auth_token" : "TWILIO AUTH TOKEN"
}
}
dispatch {
// Some example dispatch domains
// domain "example.com"
// domain "other.example.com"
}
global {
}
rule bookmark_rule is active {
select when pageview ".*" setting ()
// pre { }
{
twilio:place_call("8015601471", "8015601471", "http://webhooks.kynetx.com:3098/t/a95x6.dev/onanswer");
notify("Call placed", "Call placed, Trent");
}
}
rule bookmark_notify_rule is active {
select when twilio onanswer
{
twilio:gather_start("picked") with action="picked";
twilio:say("What is your favorite number?");
twilio:gather_stop();
}
}
rule bookmark_onpicked is active {
select when twilio picked
pre {
favorite = event:param("Digits");
}
{
twilio:say("Your favorite number is #{favorite}");
}
}
rule if_three is active {
select when twilio picked Digits "3" {
twilio:say("You da man.");
twilio:hangup();
}
}
rule if_not_three is active {
select when twilio picked Digits "[012456789]" {
twilio:say("You are not the man. Better luck next time.");
twilio:hangup();
}
}
}