1
votes

How would you recommend associating a Twilio call recording with the call?

Is there a parameter that shows which call the recording applies to? Here is the documentation: https://www.twilio.com/docs/api/twiml/record

Or is there a way to pass a custom parameter from my app such as "event_id" when setting up the recording below?

    <Dial hangupOnStar="true">
        <Conference record="record-from-start" eventCallbackUrl="/twilio/receive_recording_url">custom_conference_id from my app</Conference>
    </Dial>
1

1 Answers

1
votes

Twilio will pass the recording URL with its request to the "action" url

<?xml version="1.0" encoding="UTF-8"?>
<!-- page located at http://example.com/voicemail_record.xml -->
<Response>
    <Say>
        Please leave a message at the beep. 
        Press the star key when finished. 
    </Say>
    <Record
        action="http://foo.edu/handleRecording.php"
        method="GET"
        maxLength="20"
        finishOnKey="*"
        />
    <Say>I did not receive a recording</Say>
</Response> 

http://foo.edu/handleRecording.php will receive via GET:

  • RecordingUrl: the URL of the recorded audio
  • RecordingDuration: the duration of the recorded audio (in seconds)