@@ -440,6 +440,18 @@ type CallFlowRecordStep struct {
440
440
// Allowed values: de-DE, en-AU, en-UK, en-US, es-ES, es-LA, fr-FR, it-IT, nl-NL, pt-BR.
441
441
TranscribeLanguage string
442
442
443
+ // (Optional) OnFinish contains the URL to get a new CallFlow from when the recording terminates and this CallFlowRecordStep ends.
444
+ //
445
+ // The URL must contain a schema e.g. http://... or https://...
446
+ // This attribute is used for chaining call flows. When the current step ends,
447
+ // a POST request containing information about the recording is sent to the URL specified.
448
+ // This gets a new callflow from the URL specified, but re-uses the original Call ID and Leg ID i.e. it's the same Call.
449
+ //
450
+ // To get at the recording information from the POST request body, you must call (instead of relying on req.Form):
451
+ // ```go
452
+ // body,_ := ioutil.ReadAll(req.Body)
453
+ // recordingInfo := string(body[:])
454
+ // ```
443
455
OnFinish string
444
456
}
445
457
@@ -451,7 +463,7 @@ type jsonCallFlowRecordStep struct {
451
463
Timeout int `json:"timeout"`
452
464
FinishOnKey string `json:"finishOnKey"`
453
465
TranscribeLanguage string `json:"transcribeLanguage"`
454
- OnFinish string `json:"onFinish"`
466
+ OnFinish string `json:"onFinish"`
455
467
} `json:"options"`
456
468
}
457
469
@@ -480,7 +492,7 @@ func (step *CallFlowRecordStep) UnmarshalJSON(data []byte) error {
480
492
Timeout : time .Duration (raw .Options .Timeout ) * time .Second ,
481
493
FinishOnKey : raw .Options .FinishOnKey ,
482
494
TranscribeLanguage : raw .Options .TranscribeLanguage ,
483
- OnFinish : raw .Options .OnFinish ,
495
+ OnFinish : raw .Options .OnFinish ,
484
496
}
485
497
return nil
486
498
}
0 commit comments