All incoming web leads go into this app to be distributed to each agent. Each phone call that comes into the company is turned into a lead and given to the agent who picked up the call and is helping the customer with a quote. This distribution system keeps a count of how many and to who the leads were given to each day so they can be equally (or inequality) distributed.
baseUrl = "https://api.twilio.com/2010-04-01/Accounts/" & accountID & "/Calls/" & callSID & "/Recordings"
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
http.open "GET", baseUrl, False, accountID, passwordString
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
set fn_xml = nothing
Set http = Nothing