| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SignalWire::Agents::Relay::Constants; |
|
2
|
5
|
|
|
5
|
|
118081
|
use strict; |
|
|
5
|
|
|
|
|
19
|
|
|
|
5
|
|
|
|
|
205
|
|
|
3
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
|
5
|
|
|
|
|
14
|
|
|
|
5
|
|
|
|
|
353
|
|
|
4
|
5
|
|
|
5
|
|
30
|
use Exporter 'import'; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
731
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
|
7
|
|
|
|
|
|
|
PROTOCOL_VERSION |
|
8
|
|
|
|
|
|
|
CALL_STATES CALL_STATE_CREATED CALL_STATE_RINGING CALL_STATE_ANSWERED CALL_STATE_ENDING CALL_STATE_ENDED |
|
9
|
|
|
|
|
|
|
CALL_TERMINAL_STATES |
|
10
|
|
|
|
|
|
|
CALL_END_REASONS |
|
11
|
|
|
|
|
|
|
DIAL_STATES DIAL_STATE_DIALING DIAL_STATE_ANSWERED DIAL_STATE_FAILED |
|
12
|
|
|
|
|
|
|
MESSAGE_STATES MESSAGE_STATE_QUEUED MESSAGE_STATE_INITIATED MESSAGE_STATE_SENT |
|
13
|
|
|
|
|
|
|
MESSAGE_STATE_DELIVERED MESSAGE_STATE_UNDELIVERED MESSAGE_STATE_FAILED MESSAGE_STATE_RECEIVED |
|
14
|
|
|
|
|
|
|
MESSAGE_TERMINAL_STATES |
|
15
|
|
|
|
|
|
|
EVENT_TYPES |
|
16
|
|
|
|
|
|
|
ACTION_TERMINAL_STATES |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
|
20
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Protocol version for signalwire.connect |
|
24
|
5
|
|
|
5
|
|
62
|
use constant PROTOCOL_VERSION => { major => 2, minor => 0, revision => 0 }; |
|
|
5
|
|
|
|
|
24
|
|
|
|
5
|
|
|
|
|
656
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# --- Call States --- |
|
27
|
5
|
|
|
5
|
|
47
|
use constant CALL_STATE_CREATED => 'created'; |
|
|
5
|
|
|
|
|
42
|
|
|
|
5
|
|
|
|
|
395
|
|
|
28
|
5
|
|
|
5
|
|
32
|
use constant CALL_STATE_RINGING => 'ringing'; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
371
|
|
|
29
|
5
|
|
|
5
|
|
35
|
use constant CALL_STATE_ANSWERED => 'answered'; |
|
|
5
|
|
|
|
|
12
|
|
|
|
5
|
|
|
|
|
358
|
|
|
30
|
5
|
|
|
5
|
|
35
|
use constant CALL_STATE_ENDING => 'ending'; |
|
|
5
|
|
|
|
|
12
|
|
|
|
5
|
|
|
|
|
388
|
|
|
31
|
5
|
|
|
5
|
|
63
|
use constant CALL_STATE_ENDED => 'ended'; |
|
|
5
|
|
|
|
|
10
|
|
|
|
5
|
|
|
|
|
418
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
5
|
|
|
|
|
329
|
use constant CALL_STATES => [ |
|
34
|
|
|
|
|
|
|
CALL_STATE_CREATED, |
|
35
|
|
|
|
|
|
|
CALL_STATE_RINGING, |
|
36
|
|
|
|
|
|
|
CALL_STATE_ANSWERED, |
|
37
|
|
|
|
|
|
|
CALL_STATE_ENDING, |
|
38
|
|
|
|
|
|
|
CALL_STATE_ENDED, |
|
39
|
5
|
|
|
5
|
|
32
|
]; |
|
|
5
|
|
|
|
|
9
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
5
|
|
|
|
|
467
|
use constant CALL_TERMINAL_STATES => { |
|
42
|
|
|
|
|
|
|
(CALL_STATE_ENDED) => 1, |
|
43
|
5
|
|
|
5
|
|
28
|
}; |
|
|
5
|
|
|
|
|
9
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# --- Call End Reasons --- |
|
46
|
5
|
|
|
|
|
345
|
use constant CALL_END_REASONS => { |
|
47
|
|
|
|
|
|
|
hangup => 'hangup', |
|
48
|
|
|
|
|
|
|
cancel => 'cancel', |
|
49
|
|
|
|
|
|
|
busy => 'busy', |
|
50
|
|
|
|
|
|
|
noAnswer => 'noAnswer', |
|
51
|
|
|
|
|
|
|
decline => 'decline', |
|
52
|
|
|
|
|
|
|
error => 'error', |
|
53
|
5
|
|
|
5
|
|
41
|
}; |
|
|
5
|
|
|
|
|
10
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# --- Dial States --- |
|
56
|
5
|
|
|
5
|
|
30
|
use constant DIAL_STATE_DIALING => 'dialing'; |
|
|
5
|
|
|
|
|
23
|
|
|
|
5
|
|
|
|
|
300
|
|
|
57
|
5
|
|
|
5
|
|
28
|
use constant DIAL_STATE_ANSWERED => 'answered'; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
386
|
|
|
58
|
5
|
|
|
5
|
|
29
|
use constant DIAL_STATE_FAILED => 'failed'; |
|
|
5
|
|
|
|
|
22
|
|
|
|
5
|
|
|
|
|
327
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
5
|
|
|
|
|
363
|
use constant DIAL_STATES => [ |
|
61
|
|
|
|
|
|
|
DIAL_STATE_DIALING, |
|
62
|
|
|
|
|
|
|
DIAL_STATE_ANSWERED, |
|
63
|
|
|
|
|
|
|
DIAL_STATE_FAILED, |
|
64
|
5
|
|
|
5
|
|
28
|
]; |
|
|
5
|
|
|
|
|
8
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# --- Message States --- |
|
67
|
5
|
|
|
5
|
|
29
|
use constant MESSAGE_STATE_QUEUED => 'queued'; |
|
|
5
|
|
|
|
|
17
|
|
|
|
5
|
|
|
|
|
2566
|
|
|
68
|
5
|
|
|
5
|
|
33
|
use constant MESSAGE_STATE_INITIATED => 'initiated'; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
305
|
|
|
69
|
5
|
|
|
5
|
|
28
|
use constant MESSAGE_STATE_SENT => 'sent'; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
313
|
|
|
70
|
5
|
|
|
5
|
|
28
|
use constant MESSAGE_STATE_DELIVERED => 'delivered'; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
324
|
|
|
71
|
5
|
|
|
5
|
|
26
|
use constant MESSAGE_STATE_UNDELIVERED => 'undelivered'; |
|
|
5
|
|
|
|
|
9
|
|
|
|
5
|
|
|
|
|
300
|
|
|
72
|
5
|
|
|
5
|
|
33
|
use constant MESSAGE_STATE_FAILED => 'failed'; |
|
|
5
|
|
|
|
|
10
|
|
|
|
5
|
|
|
|
|
335
|
|
|
73
|
5
|
|
|
5
|
|
36
|
use constant MESSAGE_STATE_RECEIVED => 'received'; |
|
|
5
|
|
|
|
|
8
|
|
|
|
5
|
|
|
|
|
370
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
5
|
|
|
|
|
333
|
use constant MESSAGE_STATES => [ |
|
76
|
|
|
|
|
|
|
MESSAGE_STATE_QUEUED, |
|
77
|
|
|
|
|
|
|
MESSAGE_STATE_INITIATED, |
|
78
|
|
|
|
|
|
|
MESSAGE_STATE_SENT, |
|
79
|
|
|
|
|
|
|
MESSAGE_STATE_DELIVERED, |
|
80
|
|
|
|
|
|
|
MESSAGE_STATE_UNDELIVERED, |
|
81
|
|
|
|
|
|
|
MESSAGE_STATE_FAILED, |
|
82
|
|
|
|
|
|
|
MESSAGE_STATE_RECEIVED, |
|
83
|
5
|
|
|
5
|
|
26
|
]; |
|
|
5
|
|
|
|
|
9
|
|
|
84
|
|
|
|
|
|
|
|
|
85
|
5
|
|
|
|
|
690
|
use constant MESSAGE_TERMINAL_STATES => { |
|
86
|
|
|
|
|
|
|
(MESSAGE_STATE_DELIVERED) => 1, |
|
87
|
|
|
|
|
|
|
(MESSAGE_STATE_UNDELIVERED) => 1, |
|
88
|
|
|
|
|
|
|
(MESSAGE_STATE_FAILED) => 1, |
|
89
|
5
|
|
|
5
|
|
27
|
}; |
|
|
5
|
|
|
|
|
8
|
|
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# --- Event Types --- |
|
92
|
5
|
|
|
|
|
720
|
use constant EVENT_TYPES => { |
|
93
|
|
|
|
|
|
|
# Call state events |
|
94
|
|
|
|
|
|
|
'calling.call.state' => 'CallState', |
|
95
|
|
|
|
|
|
|
'calling.call.receive' => 'CallReceive', |
|
96
|
|
|
|
|
|
|
'calling.call.dial' => 'CallDial', |
|
97
|
|
|
|
|
|
|
'calling.call.connect' => 'CallConnect', |
|
98
|
|
|
|
|
|
|
'calling.call.disconnect' => 'CallDisconnect', |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# Action events |
|
101
|
|
|
|
|
|
|
'calling.call.play' => 'CallPlay', |
|
102
|
|
|
|
|
|
|
'calling.call.record' => 'CallRecord', |
|
103
|
|
|
|
|
|
|
'calling.call.collect' => 'CallCollect', |
|
104
|
|
|
|
|
|
|
'calling.call.detect' => 'CallDetect', |
|
105
|
|
|
|
|
|
|
'calling.call.fax' => 'CallFax', |
|
106
|
|
|
|
|
|
|
'calling.call.tap' => 'CallTap', |
|
107
|
|
|
|
|
|
|
'calling.call.stream' => 'CallStream', |
|
108
|
|
|
|
|
|
|
'calling.call.transcribe' => 'CallTranscribe', |
|
109
|
|
|
|
|
|
|
'calling.call.pay' => 'CallPay', |
|
110
|
|
|
|
|
|
|
'calling.call.send_digits' => 'CallSendDigits', |
|
111
|
|
|
|
|
|
|
'calling.call.refer' => 'CallRefer', |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# Conference events |
|
114
|
|
|
|
|
|
|
'calling.conference' => 'Conference', |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# AI events |
|
117
|
|
|
|
|
|
|
'calling.call.ai' => 'CallAI', |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# Messaging events |
|
120
|
|
|
|
|
|
|
'messaging.receive' => 'MessageReceive', |
|
121
|
|
|
|
|
|
|
'messaging.state' => 'MessageState', |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
# System events |
|
124
|
|
|
|
|
|
|
'signalwire.authorization.state' => 'AuthorizationState', |
|
125
|
|
|
|
|
|
|
'signalwire.disconnect' => 'Disconnect', |
|
126
|
5
|
|
|
5
|
|
40
|
}; |
|
|
5
|
|
|
|
|
30
|
|
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# --- Action Terminal States (per event type) --- |
|
129
|
5
|
|
|
|
|
468
|
use constant ACTION_TERMINAL_STATES => { |
|
130
|
|
|
|
|
|
|
'calling.call.play' => { finished => 1, error => 1 }, |
|
131
|
|
|
|
|
|
|
'calling.call.record' => { finished => 1, no_input => 1 }, |
|
132
|
|
|
|
|
|
|
'calling.call.detect' => { finished => 1, error => 1 }, |
|
133
|
|
|
|
|
|
|
'calling.call.collect' => { finished => 1, error => 1, no_input => 1, no_match => 1 }, |
|
134
|
|
|
|
|
|
|
'calling.call.fax' => { finished => 1, error => 1 }, |
|
135
|
|
|
|
|
|
|
'calling.call.tap' => { finished => 1 }, |
|
136
|
|
|
|
|
|
|
'calling.call.stream' => { finished => 1 }, |
|
137
|
|
|
|
|
|
|
'calling.call.transcribe' => { finished => 1 }, |
|
138
|
|
|
|
|
|
|
'calling.call.pay' => { finished => 1, error => 1 }, |
|
139
|
5
|
|
|
5
|
|
34
|
}; |
|
|
5
|
|
|
|
|
13
|
|
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
1; |