twilio Flashcards
twilio: To set up call forwarding
put
http://twimlets.com/forward?PhoneNumber=%2B972537227817
into the Voice Request URL in the phone number’s settings
Note: %2B is the plus sign which comes before the full number.
twiml: When someone calls your twilio number
it send a request to twilio, who then sends a request with parameters to you, and based on the parameters you must respond to twilio with an xml object of what you want to do (e.g. say, redirect, play).
https://twilio.radicalskills.com/projects/talk-to-an-agent/2.html
twiml: To make a call forwarding system for paypercall you should essentially
have the request trigger a gathering of response if you want accept the call, and if you do, forward the pending call.
twiml: twilio.twiml.Response() is
an in memory xml object representation
twilio: To get a CSV of all the calls made
https://api.twilio.com/2010-04-01/Accounts/ACcb2f97bf9d187010ed5d5b6343ab8f4e/Calls.csv?PageSize=1000
enter Ac SID as Username and Auth Token as Password
twilio: The api endpoint for a list of the calls is
https://api.twilio.com/2010-04-01/Accounts/ACcb2f97bf9d187010ed5d5b6343ab8f4e/Calls
twilio: The From and FormattedFrom columns in the calls reports csv show
The caller ID, not the actual number
twilio: To make a link become a click to call, type
href=”tel:0327227817”
note: Plus sign is option, it literally dials what you wrote
twilio: To make a call get a spoken message and then get forwarded, type
pip install twilio
from twilio import twiml
from twilio.rest import TwilioRestClient
from django.http import HttpResponse
urls.py
url(r’^once_connected/’, views.once_connected_view, name=”once_connected”),
view.py def once_connected_view(request): response = twiml.Response() response.say("dial out to your sales team with the Dial verb", voice='alice') response.dial("972-53-722-7817") return HttpResponse(str(response))
and set the request url on twilios phone number preferences to http://www.exmaple.com/once_connected/ and GET REQUEST
Note: response.dial must be formated with only hyphens and must contain full area code.
twilio: To give the callee a Say before they are connected to the caller, you must
add an attribute to the Number noun within the Dial verb called url and pass is the URL of the twiml you want to execute on the callee
e.g.
with response.dial(attribute=”value”) as r:
r.number(“972-53-722-7817”, url=”http://…”, method=”GET”)
twilio: To add an attribute to a noun or verb, type
response.dial(attribute=”value”)
twilio: To make a nest noun inside a verb, type
with response.dial(attribute=”value”) as r:
r.number(“972-53-722-7817”, attribute=”value”)
twilio: Often times when there is an error it is because
I have sent a POST request to my server instead of a GET
twilio: To create a twilio app go to
account
dev tools
twiml app
twilio: To play audio for a caller, type
response.play(“http://demo.twilio.com/hellomonkey/monkey.mp3”)