Skip to content

Commit 6a93987

Browse files
committed
implemented onFinish attribute for CallFlowRecordStep; necessary to generate POST requests for chaining call flows
1 parent 29552d9 commit 6a93987

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

voice/callflow.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ type CallFlowRecordStep struct {
439439
//
440440
// Allowed values: de-DE, en-AU, en-UK, en-US, es-ES, es-LA, fr-FR, it-IT, nl-NL, pt-BR.
441441
TranscribeLanguage string
442+
443+
OnFinish string
442444
}
443445

444446
type jsonCallFlowRecordStep struct {
@@ -449,6 +451,7 @@ type jsonCallFlowRecordStep struct {
449451
Timeout int `json:"timeout"`
450452
FinishOnKey string `json:"finishOnKey"`
451453
TranscribeLanguage string `json:"transcribeLanguage"`
454+
OnFinish string `json:"onFinish"`
452455
} `json:"options"`
453456
}
454457

@@ -461,6 +464,7 @@ func (step *CallFlowRecordStep) MarshalJSON() ([]byte, error) {
461464
data.Options.Timeout = int(step.Timeout / time.Second)
462465
data.Options.FinishOnKey = step.FinishOnKey
463466
data.Options.TranscribeLanguage = step.TranscribeLanguage
467+
data.Options.OnFinish = step.OnFinish
464468
return json.Marshal(data)
465469
}
466470

@@ -476,6 +480,7 @@ func (step *CallFlowRecordStep) UnmarshalJSON(data []byte) error {
476480
Timeout: time.Duration(raw.Options.Timeout) * time.Second,
477481
FinishOnKey: raw.Options.FinishOnKey,
478482
TranscribeLanguage: raw.Options.TranscribeLanguage,
483+
OnFinish: raw.Options.OnFinish,
479484
}
480485
return nil
481486
}

0 commit comments

Comments
 (0)