Skip to content

Commit 9d3e5d6

Browse files
committed
Add the CallFlow.Record property for full call recording
1 parent 60325bc commit 9d3e5d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

voice/callflow.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ type CallFlow struct {
2121
// audio file.
2222
Steps []CallFlowStep
2323

24+
// Record instructs the Voice system to record the entire call.
25+
//
26+
// Note that this is distinct from the Record CallFlow step which records
27+
// only a single message from the callee.
28+
Record bool
29+
2430
CreatedAt time.Time
2531
UpdatedAt time.Time
2632
}
@@ -29,6 +35,7 @@ type jsonCallFlow struct {
2935
ID string `json:"id,omitempty"`
3036
Title string `json:"title"`
3137
Steps []CallFlowStep `json:"steps"`
38+
Record bool `json:"record"`
3239
CreatedAt string `json:"createdAt"`
3340
UpdatedAt string `json:"updatedAt"`
3441
}
@@ -40,6 +47,7 @@ func (callflow CallFlow) MarshalJSON() ([]byte, error) {
4047
Title: callflow.Title,
4148
// Steps are able to serialize themselves to JSON.
4249
Steps: callflow.Steps,
50+
Record: callflow.Record,
4351
CreatedAt: callflow.CreatedAt.Format(time.RFC3339),
4452
UpdatedAt: callflow.UpdatedAt.Format(time.RFC3339),
4553
}
@@ -95,6 +103,7 @@ func (callflow *CallFlow) UnmarshalJSON(data []byte) error {
95103
ID: raw.ID,
96104
Title: raw.Title,
97105
Steps: raw.Steps,
106+
Record: raw.Record,
98107
CreatedAt: createdAt,
99108
UpdatedAt: updatedAt,
100109
}
@@ -399,6 +408,9 @@ func (step *CallFlowPauseStep) UnmarshalJSON(data []byte) error {
399408

400409
// A CallFlowRecordStep initiates an audio recording during a call, e.g. for
401410
// capturing a user response.
411+
//
412+
// Note that this is distinct from CallFlow.Record which records the entire
413+
// call.
402414
type CallFlowRecordStep struct {
403415
CallFlowStepBase
404416

0 commit comments

Comments
 (0)