public function showRecord() { $response = new Twiml(); $response->say('Please record your message after the beep.' . ' Press star to end your recording.', ['voice' => 'alice', 'language' => 'en-GB']); $response->record(array('action' => '/recording/hangup', 'finishOnKey' => '*', 'method' => 'GET')); return response($response)->header('Content-Type', 'application/xml'); }
/** * Handles the callback after a call has finished * * @return \Illuminate\Http\Response */ public function agentVoicemail(Request $request, $agentId) { $response = new Twiml(); $callStatus = $request->input('DialCallStatus'); if ($callStatus !== 'completed') { $response->say('It appears that no agent is available. ' . 'Please leave a message after the beep', ['voice' => 'alice', 'language' => 'en-GB']); $response->record(['maxLength' => '20', 'method' => 'GET', 'action' => route('hangup', [], false), 'transcribeCallback' => route('store-recording', ['agent' => $agentId], false)]); $response->say('No recording received. Goodbye', ['voice' => 'alice', 'language' => 'en-GB']); $response->hangup(); return $response; } return "Ok"; }