chickadee » twilio » twilio-make-call

twilio-make-call to #!key url application-sid method fallback-url fallback-method status-callback status-callback-method send-digits if-machine timeout recordprocedure

Make a call using the Twilio API; see http://www.twilio.com/docs/api/rest/making-calls.

to
The phone number to call
url
TwiML URL when the call connects
application-sid
Alternatively, the app containing the URL
method
Method to request url
fallback-url
Second url to try
fallback-method
Method to which to fall back
status-callback
URL to post status to
status-callback-method
Method to use
send-digits
Keys to dial after connecting
if-machine
Determine whether the caller is a machine
timeout
How long to let the phone ring
record
Whether to record the call
(define (twilio-make-call
         to
         #!key
         url
         application-sid
         method
         fallback-url
         fallback-method
         status-callback
         status-callback-method
         send-digits
         if-machine
         timeout
         record)
  (let ((parameters
          `((from unquote (twilio-from))
            (to unquote to)
            (url unquote url)
            (application-sid unquote application-sid)
            (method unquote method)
            (fallback-url unquote fallback-url)
            (fallback-method unquote fallback-method)
            (status-callback unquote status-callback)
            (status-callback-method unquote status-callback-method)
            (send-digits unquote send-digits)
            (if-machine unquote if-machine)
            (timeout unquote timeout)
            (record unquote record))))
    (with-input-from-request
      (twilio-url-calls)
      (upper-camel-filter-parameters parameters)
      void)))