(index ("twilio-sid" 0) ("twilio-auth" 224) ("twilio-from" 452) ("twilio-url" 694) ("twilio-make-call" 951) ("twilio-send-sms" 3061) ("twilio-write" 3960) ("twilio-response" 4189) ("twilio-say" 4505) ("twilio-play" 5251) ("twilio-sms" 5817))
(def (sig (parameter "twilio-sid → (get-environment-variable TWILIO_SID)" (id twilio-sid))) (p "The Twilio account SID") (highlight scheme "(define twilio-sid (make-parameter (get-environment-variable \"TWILIO_SID\")))"))
(def (sig (parameter "twilio-auth → (get-environment-variable TWILIO_AUTH)" (id twilio-auth))) (p "The Twilio auth token") (highlight scheme "(define twilio-auth (make-parameter (get-environment-variable \"TWILIO_AUTH\")))"))
(def (sig (parameter "twilio-from → (get-environment-variable TWILIO_FROM)" (id twilio-from))) (p "The phone number from which to post") (highlight scheme "(define twilio-from (make-parameter (get-environment-variable \"TWILIO_FROM\")))"))
(def (sig (parameter "twilio-url → https://~a:~a@api.twilio.com/2010-04-01/Accounts/~a/~a" (id twilio-url))) (p "The Twilio API URL") (highlight scheme "(define twilio-url\n  (make-parameter \"https://~a:~a@api.twilio.com/2010-04-01/Accounts/~a/~a\"))"))
(def (sig (procedure "(twilio-make-call to #!key url application-sid method fallback-url fallback-method status-callback status-callback-method send-digits if-machine timeout record) → unspecified" (id twilio-make-call))) (p "Make a call using the Twilio API; see " (link "http://www.twilio.com/docs/api/rest/making-calls") ".") (dl (dt (tt "to")) (dd "The phone number to call") (dt (tt "url")) (dd "TwiML URL when the call connects") (dt (tt "application-sid")) (dd "Alternatively, the app containing the URL") (dt (tt "method")) (dd "Method to request " (tt "url")) (dt (tt "fallback-url")) (dd "Second " (tt "url") " to try") (dt (tt "fallback-method")) (dd "Method to which to fall back") (dt (tt "status-callback")) (dd "URL to post status to") (dt (tt "status-callback-method")) (dd "Method to use") (dt (tt "send-digits")) (dd "Keys to dial after connecting") (dt (tt "if-machine")) (dd "Determine whether the caller is a machine") (dt (tt "timeout")) (dd "How long to let the phone ring") (dt (tt "record")) (dd "Whether to record the call")) (highlight scheme "(define (twilio-make-call\n         to\n         #!key\n         url\n         application-sid\n         method\n         fallback-url\n         fallback-method\n         status-callback\n         status-callback-method\n         send-digits\n         if-machine\n         timeout\n         record)\n  (let ((parameters\n          `((from unquote (twilio-from))\n            (to unquote to)\n            (url unquote url)\n            (application-sid unquote application-sid)\n            (method unquote method)\n            (fallback-url unquote fallback-url)\n            (fallback-method unquote fallback-method)\n            (status-callback unquote status-callback)\n            (status-callback-method unquote status-callback-method)\n            (send-digits unquote send-digits)\n            (if-machine unquote if-machine)\n            (timeout unquote timeout)\n            (record unquote record))))\n    (with-input-from-request\n      (twilio-url-calls)\n      (upper-camel-filter-parameters parameters)\n      void)))"))
(def (sig (procedure "(twilio-send-sms to body #!key status-callback application-sid) → unspecified" (id twilio-send-sms))) (p "Send an SMS using the Twilio API; see " (link "http://www.twilio.com/docs/api/rest/sending-sms") ".") (dl (dt (tt "to")) (dd "The number to send to") (dt (tt "body")) (dd "The SMS to send") (dt (tt "status-callback")) (dd "POST when the message is processed") (dt (tt "application-sid")) (dd "The application's SID")) (highlight scheme "(define (twilio-send-sms to body #!key status-callback application-sid)\n  (let ((parameters\n          `((from unquote (twilio-from))\n            (to unquote to)\n            (body unquote body)\n            (status-callback unquote status-callback)\n            (application-sid unquote application-sid))))\n    (with-input-from-request\n      (twilio-url-sms)\n      (upper-camel-filter-parameters parameters)\n      void)))"))
(def (sig (procedure "(twilio-write response) → unspecified" (id twilio-write))) (p "Write STwiML as TwiML.") (dl (dt (tt "response")) (dd "The STwiML response")) (highlight scheme "(define twilio-write write-shtml-as-html)"))
(def (sig (procedure "(twilio-response . verbs) → STwiML" (id twilio-response))) (p "Wrap verbs in a STwiML response; see " (link "http://www.twilio.com/docs/api/twiml") ".") (dl (dt (tt "verbs")) (dd "The verbs to wrap in a response")) (highlight scheme "(define (twilio-response . verbs) `(Response ,@verbs))"))
(def (sig (procedure "(twilio-say text #!key voice loop language) → STwiML" (id twilio-say))) (p "Say something; see " (link "http://www.twilio.com/docs/api/twiml/say") ".") (dl (dt (tt "text")) (dd "The text to say") (dt (tt "voice")) (dd "The voice to say it in") (dt (tt "loop")) (dd "How many times to say it") (dt (tt "language")) (dd "The language to say it in")) (highlight scheme "(define (twilio-say text #!key voice loop language)\n  (let ((parameters\n          (lower-camel-filter-parameters\n            `((voice ,voice) (loop ,loop) (language ,language)))))\n    (if (null? parameters)\n      `(Say ,text)\n      `(Say (,(string->symbol \"@\")\n             ,@(lower-camel-filter-parameters parameters))\n            ,text))))"))
(def (sig (procedure "(twilio-play url #!key loop) → STwiML" (id twilio-play))) (p "Play something; see " (link "http://www.twilio.com/docs/api/twiml/play") ".") (dl (dt (tt "url")) (dd "The audio file to play") (dt (tt "loop")) (dd "How many times to play it")) (highlight scheme "(define (twilio-play url #!key loop)\n  (let ((parameters (lower-camel-filter-parameters `((loop ,loop)))))\n    (if (null? parameters)\n      `(Play ,url)\n      `(Play (,(string->symbol \"@\")\n              ,@(lower-camel-filter-parameters parameters))\n             ,url))))"))
(def (sig (procedure "(twilio-sms text #!key to from action method status-callback) → STwiML" (id twilio-sms))) (p "Send an SMS; see " (link "http://www.twilio.com/docs/api/twiml/sms") ".") (dl (dt (tt "text")) (dd "The text to send") (dt (tt "to")) (dd "The number to send it to") (dt (tt "from")) (dd "The number to send it from") (dt (tt "action")) (dd "Action URL") (dt (tt "method")) (dd (tt "POST") " or " (tt "GET") " for " (tt "action")) (dt (tt "status-callback")) (dd "Status callback URL")) (highlight scheme "(define (twilio-sms text #!key to from action method status-callback)\n  (let* ((parameters\n           (lower-camel-filter-parameters\n             `((to ,to)\n               (from ,from)\n               (action ,action)\n               (method ,method)\n               (status-callback ,status-callback)))))\n    (if (null? parameters)\n      `(Sms ,text)\n      `(Sms (,at ,@(lower-camel-filter-parameters parameters)) ,text))))"))
