/
request.go
executable file
·110 lines (104 loc) · 5.27 KB
/
request.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package models
/*
authid -> call_uuid
call_uuid -> call_request
get auth id from the response and from that response.
*/
type CallRequest struct {
AsyncAmdStatusCallbackMethod string `json:"AsyncAmdStatusCallbackMethod"`
AsyncAmdStatusCallback string `json:"AsyncAmdStatusCallback"`
AsyncAmd string `json:"AsyncAmd"`
MachineDetectionSilenceTimeout string `json:"MachineDetectionSilenceTimeout"`
MachineDetectionSpeechEndThreshold string `json:"MachineDetectionSpeechEndThreshold"`
MachineDetectionSpeechThreshold string `json:"MachineDetectionSpeechThreshold"`
MachineDetectionTimeout string `json:"MachineDetectionTimeout"`
MachineDetection string `json:"MachineDetection"`
SipAuthPassword string `json:"SipAuthPassword"`
SipAuthUsername string `json:"SipAuthUsername"`
LoopPlay string `json:"loop_play" example:"3"`
Timeout string `json:"Timeout"`
From string `json:"From" example:"15677654321"`
To string `json:"To" example:"15677654321"`
CallerName string `json:"caller_name" example:"Tiniyo"`
CallerId string `json:"CallerId"`
Byoc string `json:"Byoc"`
CallReason string `json:"CallReason"`
Trim string `json:"Trim"`
RecordingStatusCallbackEvent string `json:"RecordingStatusCallbackEvent"`
RecordingTrack string `json:"RecordingTrack"`
RecordingChannels string `json:"RecordingChannels"`
ParentCallSid string `json:"parent_call_sid"`
AccountSid string `json:"AccountSid"`
Record string `json:"Record"`
SendDigits string `json:"SendDigits"`
Play string `json:"play" example:"https://tiniyo.s3.amazonaws.com/MissionImpossible.mp3"`
Speak string `json:"speak" example:"Hello Dear, Thanks for using our service"`
ApplicationSid string `json:"ApplicationSid" example:"your tiniyo application id"`
TinyML string `json:"TinyML" example:"<Response><Say>Hello World</Say>"`
Url string `json:"Url" example:"https://raw.githubusercontent.com/tiniyo/public/master/answer.xml"`
Method string `json:"Method" example:"GET"`
FallbackMethod string `json:"FallbackMethod"`
FallbackUrl string `json:"FallbackUrl"`
StatusCallback string `json:"StatusCallback"`
StatusCallbackMethod string `json:"StatusCallbackMethod"`
StatusCallbackEvent string `json:"StatusCallbackEvent"`
RecordingStatusCallback string `json:"RecordingStatusCallback"`
RecordingStatusCallbackMethod string `json:"RecordingStatusCallbackMethod"`
Rate float64 `json:"rate"`
Pulse int64 `json:"pulse"`
MaxDuration int64 `json:"max_duration"`
DestType string `json:"DestType"`
SrcType string `json:"SrcType"`
VendorAuthID string `json:"ParentAuthId"`
SipPilotNumber string `json:"SipPilotNumber"`
Sid string `json:"Sid"`
Bridge string `json:"Bridge"`
Host string `json:"Host"`
SrcDirection string `json:"SrcDirection"`
IsCallerId string `json:"IsCallerId"`
SipTrunk string `json:"SipTrunk"`
FromRemovePrefix string `json:"FromRemovePrefix"`
DialAttr
DialRecordAttr
Callback
RecordCallback
CallResponse
DialSipAttr
DialNumberAttr
GatherAttr
DialConferenceAttr
}
type CallUpdateRequest struct {
Sid string `json:"Sid,omitempty"`
Url string `json:"Url"`
Method string `json:"Method" example:"GET"`
FallbackMethod string `json:"FallbackMethod"` // `json:"FallbackMethod"`
FallbackUrl string `json:"FallbackUrl"` // `json:"FallbackUrl"`
StatusCallback string `json:"StatusCallback"` // `json:"StatusCallback"`
StatusCallbackMethod string `json:"StatusCallbackMethod"` // `json:"StatusCallbackMethod"`
Status string `json:"Status"` // `json:"StatusCallback"`
}
type CallPlayRequest struct {
Urls string `json:"urls"`
Length int `json:"length"`
Legs string `json:"legs"`
Loop int `json:"loop"`
Mix bool `json:"mix"`
}
type CallSpeakRequest struct {
Text string `json:"text"`
Voice string `json:"voice"`
Language string `json:"language"`
Legs string `json:"legs"`
Loop bool `json:"loop"`
Mix bool `json:"mix"`
}
type CallEventRequest struct {
SendDigits string `json:"digits"`
DigitsReceived string `json:"digitsReceived"`
Leg string `json:"leg"`
}
type Call struct {
uuid string
cr CallRequest
}