Twilio: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
Line 58: Line 58:
I set up a script in my dev SSL server, sms.php.
I set up a script in my dev SSL server, sms.php.


To set up HTTPS,  
=== HTTPS server set up ====
I had to tighten up security on my Apache, test it here: https://ssllabs.com/ssltest I started with a "C" rating and moved up to "A"!
 
To set up HTTPS, I had to tighten up security on my Apache, test it here: https://ssllabs.com/ssltest I started with a "C" rating and moved up to "A"!
How to: see https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
How to: see https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
See also https://wiki.mozilla.org/Security/Server_Side_TLS


Complete your certificate chain: https://certificatechain.io/ and http://superuser.com/questions/644343/how-do-you-fix-an-incomplete-ssl-chain
Complete your certificate chain: https://certificatechain.io/ and http://superuser.com/questions/644343/how-do-you-fix-an-incomplete-ssl-chain

Revision as of 18:53, 3 August 2016

Elastic Trunk + Asterisk

This is nothing to do with elephants or the back part of a sedan or rubber bands. It has nothing to do with the symbol above the "8" on your keyboard.

Refer to https://www.twilio.com/docs/api/sip-trunking/sample-configuration and https://www.twilio.com/resources/images/docs/Asterisk-Twilio.pdf

"Elastic" means you are not limited to a preset number of calls with one SIP account. You can make any number of outbound and accept any number of inbound calls over the one account; you just have to pay for the calls.

The price for a single phone number is $1 per month. The rate for calls is about a penny a minute.

Products -> Phone numbers
You need one. Set it up.

Products -> Elastic SIP Trunking -> Trunks
First time through, "Create Sip Trunk"
Termination - set it up so you can make calls. You need something like "bellman.pstn.twilio.com" where you choose "bellman".
Origination - set it up so you can receive calls and attach a phone number to it. Try using your server like sip:bellman.wildsong.biz

You need to set up authentication on the termination settings for the trunk. The first time through you get prompted but you can edit it later

Products -> Elastic SIP Trunking -> Authentication
IP Access Control Lists - Should have the IP addresses that your server uses for outbound traffic. 67.180.204.170
Credential lists - should have a username and password that you will put into your Asterisk set up.

You can have multiple IP addresses in one ACL, more than one ACL, and more than one credential set. That way you can use one Twilio account from more than one site if you want to.

Set up on Twilio account

  1. Go to http://twilio.com/
  2. Create an account if you don't have one
  3. Buy a phone number
  4. Attach the number to a trunk, the account comes with one trunk.

Access is controlled via IP address. You have to create an access control list for your Asterisk server and put its IP address into it.

You have to set up URLs for both termination and origination.

You have to set up a credential with a username and password.

Modifications to Asterisk

extensions.conf

sip.conf

SMS messages

You can use the same number to send and receive SMS calls. I tested it using the sample code by putting the PHP on my own server and then pointing the SMS URL at my server. It works. That's how I can receive SMS messages. I have not tried sending an SMS yet, except that the PHP code sends a reply back.

I set up a script in my dev SSL server, sms.php.

HTTPS server set up =

To set up HTTPS, I had to tighten up security on my Apache, test it here: https://ssllabs.com/ssltest I started with a "C" rating and moved up to "A"! How to: see https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/

See also https://wiki.mozilla.org/Security/Server_Side_TLS

Complete your certificate chain: https://certificatechain.io/ and http://superuser.com/questions/644343/how-do-you-fix-an-incomplete-ssl-chain

Goal - send text to server. Have the server phone back and read a message.

  1. Receive SMS - done
  2. Log information about SMS
  3. Initiate a call

Goal - build a system that will receive an SMS, perform an action, and send a confirmation.

This can be (and he stopped typing there)

Take aways from Signal Conference 2015

Move stuff into Asterisk

Lots of stuff in Twilio space could be implemented in Asterisk space

ie TWIML could be used to design IVR / autoattendant systems in Asterisk. Doing this could make it easy to implement a failover, primary would be Asterisk but if * is down then the same code would fire up and run in Twilio.

What Twilio is doing

What Twilio is doing is building a big company by (1) doing only the back end, no applications. They provide only APIs and you write your own applications. (2) Using cloud. Everything they do lives in Amazon. Based on that there must be some backend to connect to carriers that does not require anything but IP. :-) That is, they don't have big server rooms full of HT503's

They have that big giant corporation mentality. But they do make their services available to little fleas like us. I can buy one phone line for $1 a month.

What does it take to build a basic PBX in the cloud?

  1. Set up SIP phone and provision it
  2. Give the SIP phone an extension
  3. Allow VOIP extensions to call each other
  4. Set up a receptionist line
  5. Create an after hours autoattendant
  6. Voicemail
  7. Tracking usage of extensions at receptionist station

Now that I have a PBX, how can I extend it?

  1. SMS support
  2. WebRTC
  3. Text to Speech
  4. Speech to Text
  5. Presence detection
  6. Softphones
  7. Mobile softphones

What can Asterisk do that Twilio CANT and vice versa