-
Notifications
You must be signed in to change notification settings - Fork 20
/
callbacks.go
78 lines (73 loc) · 2.29 KB
/
callbacks.go
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
package twiml
// VoiceRequest represents the standard request format for callbacks received from the Twilio API. This struct is
// embedded in other callback requests that return this common data format.
type VoiceRequest struct {
CallSid string
AccountSid string
From string
To string
CallStatus string
APIVersion string `schema:"ApiVersion"`
Direction string
ForwardedFrom string
CallerName string
FromCity string
FromState string
FromZip string
FromCountry string
ToCity string
ToState string
ToZip string
ToCountry string
}
// DialActionRequest represents a request as a result of declaring an `action` URL on the Dial verb
type DialActionRequest struct {
VoiceRequest
DialCallStatus string
DialCallSid string
DialCallDuration int
RecordingURL string `schema:"RecordingUrl"`
QueueSid string
DequeueResult string
DequeuedCallSid string
DequeuedCallQueueTime int
DequeuedCallDuration int
}
// RecordActionRequest represents a request as a result of declaring an `action`
// URL on a Record verb
type RecordActionRequest struct {
VoiceRequest
RecordingURL string `schema:"RecordingUrl"`
RecordingDuration int
Digits string
}
// RecordingStatusCallbackRequest represents a request as a result of declaring
// a `recordingStatusCallback` on a Record verb
type RecordingStatusCallbackRequest struct {
AccountSid string
CallSid string
RecordingSid string
RecordingURL string `schema:"RecordingUrl"`
RecordingStatus string
RecordingDuration int
RecordingChannels int
RecordingSource string
}
// TranscribeCallbackRequest represents a request as a result of declaring
// a `transcribeCallback` on a Record verb
type TranscribeCallbackRequest struct {
TranscriptionSid string
TranscriptionText string
TranscriptionStatus string
TranscriptionURL string `schema:"TranscriptionUrl"`
RecordingSid string
RecordingURL string `schema:"RecordingUrl"`
CallSid string
AccountSid string
From string
To string
CallStatus string
APIVersion string `schema:"ApiVersion"`
Direction string
ForwardedFrom string
}