With every incoming call, twilio sends a field callSID. Use the callSID field to go back and get the recording of the call. I run this code on the page that displays the call recordings, looping through each phone call that doesn't already have a recording url saved in the database.
private sub getRecordingFromTwilio(callSID)
baseUrl = "https://api.twilio.com/2010-04-01/Accounts/AC89e2a204b62fc0e2da147477921519e9/Calls/" & callSID & "/Recordings"
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
http.open "GET", baseUrl, False, "xxxx", "xxxx"
http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
displayReturn = http.responSetext 'Get Twilio Response
Set fn_xml = Server.CreateObject("msxml2.DOMDocument.6.0")
fn_xml.async = False
on error resume next
url = (fn_xml.selectSingleNode("//TwilioResponse/Recordings/Recording/Uri").text)
recordingDuration = (fn_xml.selectSingleNode("//TwilioResponse/Recordings/Recording/Duration").text)
recordingURL = "https://api.twilio.com" & url & ".mp3"
on error goto 0
strSQL = "update log_calls set recordingURL = '" & recordingURL & "',recordingDuration='" & recordingDuration & "' where callSID = '" & callSID & "'"
if len(recordingURL) > 10 then rs.Open strSQL, CONNECTIONSTRING, 3, 1
set fn_xml = nothing
Set http = Nothing
Contact Scott Business Research PPC at (888) 520-3644
Google Partners are agencies, marketing professionals, and online experts who have been certified by Google to manage AdWords accounts. Companies who qualify for Partner status earn the Google Partner badge. We are experts at Insurance Marketing, San Diego Adwords Marketing & Management.
San Diego Adwords Management