@@ -443,6 +443,20 @@ type CallFlowRecordStep struct {
443
443
//
444
444
// Allowed values: de-DE, en-AU, en-UK, en-US, es-ES, es-LA, fr-FR, it-IT, nl-NL, pt-BR.
445
445
TranscribeLanguage string
446
+
447
+ // (Optional) OnFinish contains the URL to get a new CallFlow from when the recording terminates and this CallFlowRecordStep ends.
448
+ //
449
+ // The URL must contain a schema e.g. http://... or https://...
450
+ // This attribute is used for chaining call flows. When the current step ends,
451
+ // a POST request containing information about the recording is sent to the URL specified.
452
+ // 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.
453
+ //
454
+ // To get at the recording information from the POST request body, you must call (instead of relying on req.Form):
455
+ // ```go
456
+ // body,_ := ioutil.ReadAll(req.Body)
457
+ // recordingInfo := string(body[:])
458
+ // ```
459
+ OnFinish string
446
460
}
447
461
448
462
type jsonCallFlowRecordStep struct {
@@ -454,6 +468,7 @@ type jsonCallFlowRecordStep struct {
454
468
FinishOnKey string `json:"finishOnKey"`
455
469
Transcribe bool `json:"transcribe"`
456
470
TranscribeLanguage string `json:"transcribeLanguage"`
471
+ OnFinish string `json:"onFinish"`
457
472
} `json:"options"`
458
473
}
459
474
@@ -467,6 +482,7 @@ func (step *CallFlowRecordStep) MarshalJSON() ([]byte, error) {
467
482
data .Options .FinishOnKey = step .FinishOnKey
468
483
data .Options .Transcribe = step .Transcribe
469
484
data .Options .TranscribeLanguage = step .TranscribeLanguage
485
+ data .Options .OnFinish = step .OnFinish
470
486
return json .Marshal (data )
471
487
}
472
488
@@ -483,6 +499,7 @@ func (step *CallFlowRecordStep) UnmarshalJSON(data []byte) error {
483
499
FinishOnKey : raw .Options .FinishOnKey ,
484
500
Transcribe : raw .Options .Transcribe ,
485
501
TranscribeLanguage : raw .Options .TranscribeLanguage ,
502
+ OnFinish : raw .Options .OnFinish ,
486
503
}
487
504
return nil
488
505
}
0 commit comments