title: How to Make Calls using Twilio in Asynchronous mode - Classic ASP?
body: <p>Normally, when I run my Classic ASP script to make calls, for 200 calls, it takes approx 190 seconds to load the page. How can I make asynchronous call to Twilio, so that my page loads quicker rather than waiting for response from Twilio for each call?</p>
  
  <p>I have tried adding CallBackStatus url, however, it didn't help. Here is my code:</p>
  
  <pre><code>sub CallANumberSpeakAMessage(fromnumber,tonumber,url)
  
  if isnull(fromnumber) or isnull(tonumber) then exit sub
  if len(tonumber) &lt; 10 then exit sub
  
  dim baseurl
  dim smsurl
  dim from
  dim recipient
  dim body
  dim postdata
  dim displayreturn
  
  baseUrl = "https://api.twilio.com"
  baseUrl = baseUrl &amp; "/2010-04-01/Accounts/" &amp; authSID &amp; "/Calls"
  
    'Debug
  'response.write "BaseURL:" &amp; baseUrl &amp; "&lt;br&gt;&lt;br&gt;"
  
  'setup the request and authorization
  Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
  http.open "POST", baseUrl, False, authSID, authToken
  http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  
  mFromPhone = fromnumber ' the number to call from
  mToPhone = tonumber ' the number to dial
  url = Url ' URL handler for the call, should return TwiML
  callBackUrl = "http://www.abcserver.com/status_callback.asp"
  
  postData = "From=" &amp; Server.URLEncode(mFromPhone)
  postData = postData &amp; "&amp;To=" &amp; Server.URLEncode(mToPhone)
  postData = postData &amp; "&amp;Url=" &amp; Server.URLEncode(url)
  postData = postData &amp; "&amp;Method=GET"
  postData = postData &amp; "&amp;StatusCallback=" &amp; Server.URLEncode(callBackUrl)
  postData = postData &amp; "&amp;IfMachine=Continue"
  
  http.send postData
  Set http = Nothing
  end sub
  </code></pre>
  
  <p>I have tried changing this "http.open "POST", baseUrl, False, authSID, authToken" to "http.open "POST", baseUrl, True, authSID, authToken". The page loads fast as the ServerXMLHTTP object makes an async call, however, it doesn't really make the call to Twilio, and nothing really happens. </p>
  
  <p>Any help would be greatly appreciated. </p>