forked from plivo/plivo-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultiparty_call.go
40 lines (32 loc) · 1.08 KB
/
multiparty_call.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
package plivo
type MultiPartyCall struct {
Node
BaseResource
}
type MultiPartyCallActionPayload struct {
Action string `json:"action" url:"action"`
To string `json:"to" url:"to"`
Role string `json:"role" url:"role"`
TriggerSource string `json:"trigger_source" url:"trigger_source"`
}
func (self *MultiPartyCall) update(params MultiPartyCallActionPayload) (response *NodeActionResponse, err error) {
req, err := self.client.NewRequest("POST", params, "phlo/%s/%s/%s", self.PhloID, self.NodeType,
self.NodeID)
if (err != nil) {
return
}
response = &NodeActionResponse{}
err = self.client.ExecuteRequest(req, response)
return
}
func (self *MultiPartyCall) Call(params MultiPartyCallActionPayload) (*NodeActionResponse, error) {
return self.update(params)
}
func (self *MultiPartyCall) WarmTransfer(params MultiPartyCallActionPayload) (response *NodeActionResponse,
err error) {
return self.update(params)
}
func (self *MultiPartyCall) ColdTransfer(params MultiPartyCallActionPayload) (response *NodeActionResponse,
err error) {
return self.update(params)
}