I'm struggling to find proper documentation on how to fetch the recordingURL, or even the recording SID. Twilio's documentation isn't very clear, can someone help me out on this? Specifically in PHP, but any help is appreciated.
I'm struggling to find proper documentation on how to fetch the recordingURL, or even the recording SID. Twilio's documentation isn't very clear, can someone help me out on this? Specifically in PHP, but any help is appreciated.
When you set a recordingStatusCallback URL on a call that you are recording, Twilio will send you webhook requests to that URL as the recording goes through various statuses (in-progess, completed, or absent).
The request will be like other Twilio voice webhook requests, it is sent in the format application/x-www-form-urlencoded and includes a number of request parameters that tell you about the call or recording in this case. The recording request parameters are listed here. They include RecordingSid and RecordingUrl which you can use to download the media.
That recording URL may have a .json extension. If you remove the extension or replace it with .wav then you will get the recording in WAV format. If you replace the extension with .mp3 then you will get an MP3 file. You can see more about this in the docs on fetching a recording media file.
With that URL you should then be able to download the file with PHP.