twilio Flashcards

1
Q

twilio: To set up call forwarding

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

twiml: When someone calls your twilio number

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

twiml: To make a call forwarding system for paypercall you should essentially

A

have the request trigger a gathering of response if you want accept the call, and if you do, forward the pending call.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

twiml: twilio.twiml.Response() is

A

an in memory xml object representation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

twilio: To get a CSV of all the calls made

A

https://api.twilio.com/2010-04-01/Accounts/ACcb2f97bf9d187010ed5d5b6343ab8f4e/Calls.csv?PageSize=1000
enter Ac SID as Username and Auth Token as Password

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

twilio: The api endpoint for a list of the calls is

A

https://api.twilio.com/2010-04-01/Accounts/ACcb2f97bf9d187010ed5d5b6343ab8f4e/Calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

twilio: The From and FormattedFrom columns in the calls reports csv show

A

The caller ID, not the actual number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

twilio: To make a link become a click to call, type

A

href=”tel:0327227817”

note: Plus sign is option, it literally dials what you wrote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

twilio: To make a call get a spoken message and then get forwarded, type

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

twilio: To give the callee a Say before they are connected to the caller, you must

A

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”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

twilio: To add an attribute to a noun or verb, type

A

response.dial(attribute=”value”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

twilio: To make a nest noun inside a verb, type

A

with response.dial(attribute=”value”) as r:

r.number(“972-53-722-7817”, attribute=”value”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

twilio: Often times when there is an error it is because

A

I have sent a POST request to my server instead of a GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

twilio: To create a twilio app go to

A

account
dev tools
twiml app

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

twilio: To play audio for a caller, type

A

response.play(“http://demo.twilio.com/hellomonkey/monkey.mp3”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

twilio: To call through a browser

A

create application id
Go to domain using httpS

pass a permission token into the template
from twilio.util import TwilioCapability
capability = TwilioCapability(account_sid, auth_token)
capability.allow_client_outgoing(application_sid)
token = capability.generate()
render(…,{“token”:token}) (pass into render)

create twiml url to react to connection to twilio from the capability token

def twiml(request):
    response = twiml.Response()
    response.say("string")
    response.dial("972537227817", callerId="+18186503041")
    return HttpResponse(str(response))
# callerId mandatory
Add to template in head
-script type="text/javascript" src="//static.twilio.com/libs/twiliojs/1.2/twilio.min.js">-/script>
-script type="text/javascript">
    Twilio.Device.setup("{{ token }}");
    Twilio.Device.ready(function (device) {
      //...
    });
    Twilio.Device.error(function (error) {
      //...
    });
    Twilio.Device.connect(function (conn) {
      //...
    });
    function call() {
        Twilio.Device.connect();
    }
    function hangUp() {
      Twilio.Device.disconnect(function (conn) {
        $("#log").text("Call ended");
      });
    }
-/script>

Note: The page that contains twilio must be rendered by a server.

17
Q

twilio: The voice debugger url is

A

https://www.twilio.com/user/account/monitor/alerts

18
Q

twilio: To instantiate a call in a script, type

A

from twilio.rest import TwilioRestClient

client = TwilioRestClient(‘ACcb2f97bf9d187010ed5d5b6343ab8f4e’, ‘8605322b42fc6848fce03e94465b4377’)
client.calls.create(to=”+972537227817”,
from_=”+18186503041”,
url=”http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient”)

19
Q

twilio: when your browser initiates a Twilio Client connection to Twilio

A

a request is made to the Voice request url the app from the capability token you sent in, then Twilio uses the TwiML response from its request to direct what happens with the Client connection.

20
Q

twilio: The dial verb in twiml must always

A

be accompanied by an attribute callerID=”+18186503041”

21
Q

twilio: The single origin policy also

A

prohibits requests to other urls while in development

22
Q

ssl: To make your site https

A

generate private key and csr (combined certificate)
openssl req -new -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr
answer the prompt:
Common name: www.yourdomain.com (must be subdomain specific)
State: Black if not applicable
Country: Two-letter ISO country code
Passphrase: Leave blank
Send the content of the CSR to a CA (Cerftying Authority)
CA will return a certification and save it as example.com.cert on pythonanywhere
CA will also return a certification chain (text file with various certs)
Prepend your certification to the certification chain text file and save it as example.com.combined.cert
if key is ~ Proc-Type: 4,ENCRYPTED type
openssl rsa -in server.key.encrypted -out server.key

Tell pythonanywhere through feedback where the combined.cert file and key are