The Construction of the Twilio Client. Notes step by step.
Progress in motion
Step by step notes
the Twilio Client
Browser to browser calling.
or site to site.
Below are info-snippets ( bits of content from many pages at Twilio any personal note added will Triassic* to preserve content.
Reference of Documentations
*Below is a step by step process to create the Twilio Client Browser to Browser call.
I will try to make sense of it and translate in this 101 page so that its one part of my own study guide second a reference for duplication, maybe even illustrate.*
Twilio Client: A New Way to Phone
Notes :TwiML verbs and nouns that are available for handling Twilio Voice calls are also available for handling Twilio Client connections. Also added a new noun for dialing to a Client.
*From my understandings of the Twilio docs https://www.twilio.com/docs/client/twilio-js the js needs to be loaded.
For some reason an object is needed.*
this needs to be hardcode into a html file in the FTP
The twilio.js Library: Twilio in the Browser
You should choose to load the twilio.js library over the same protocol (HTTP or HTTPS) that you are using to serve the page. Using a protocol relative URL, as we do in the above example, will automatically load the content over the correct protocol
also see more about Java http://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html
The Twilio.Device object is available when twilio.js is included in your page. It represents a soft device, the client that provides connections into Twilio. There is no need to instantiate Twilio.Device yourself, but you do need to invoke .setup() before using it
Remember, to enable incoming connections you must give your device a name using the Capability Token you provided in .setup(token). See the Client Quickstart on receiving incoming connections for more information.
*NAme your https://www.twilio.com/docs/client/capability-tokens Capability Token.
ok so the The twilio.js Library: Twilio in the Browser
What is DMZ ?
Some home routers
refer to a DMZ host
. A home router DMZ host is a single address (e.g., IP address) on the internal network that has all traffic sent to it which is not otherwise forwarded to other LAN hosts. By definition this is not a true DMZ (demilitarized zone), since it alone does not separate the host from the internal network. That is, the DMZ host is able to connect to hosts on the internal network, whereas hosts within a real DMZ are prevented from connecting with the internal network by a firewall that separates them, unless the firewall permits the connection. A firewall may allow this if a host on the internal network first requests a connection to the host within the DMZ. The DMZ host provides none of the security advantages that a subnet
provides and is often used as an easy method of forwarding all ports to another firewall / NAT
device. This tactic (establishing a DMZ host) is also used with systems which do not interact properly with normal firewalling rules or NAT. This can be because no forwarding rule can be formulated ahead of time (varying TCP or UDP port numbers for example, as opposed to a fixed number or fixed range). This is also used for network protocols for which the router has no programming to handle (6in4 or GRE tunnels are prototypical examples).
Hash-based message authentication code
In cryptography, a keyed-hash message authentication code (HMAC) is a specific construction for calculating a message authentication code (MAC) involving a cryptographic hash function in combination with a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authentication of a message. Any cryptographic hash function, such as MD5 or SHA-1, may be used in the calculation of an HMAC; the resulting MAC algorithm is termed HMAC-MD5 or HMAC-SHA1 accordingly. The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function, the size of its hash output, and on the size and quality of the key. An iterative hash function breaks up a message into blocks of a fixed size and iterates over them with a compression function. For example, MD5 and SHA-1 operate on 512-bit blocks. The size of the output of HMAC is the same as that of the underlying hash function (128 or 160 bits in the case of MD5 or SHA-1, respectively), although it can be truncated if desired. The definition and analysis of the HMAC construction was first published in 1996 by Mihir Bellare, Ran Canetti, and Hugo Krawczyk, who also wrote RFC 2104. This paper also defined a variant called NMAC that is rarely, if ever, used. FIPS PUB 198 generalizes and standardizes the use of HMACs. HMAC-SHA1 and HMAC-MD5 are used within the IPsec and TLS protocols.
- Take the full URL of the request URL you specify for your phone number or app, from the protocol (https…) through the end of the query string (everything after the ?).
- If the request is a POST, sort all of the POST parameters alphabetically (using Unix-style case-sensitive sorting order).
- Iterate through the sorted list of POST parameters, and append the variable name and value (with no delimiters) to the end of the URL string.
- Sign the resulting string with HMAC-SHA1 using your AuthToken as the key (remember, your AuthToken’s case matters!).
- Base64 encode the resulting hash value.
- Compare your hash to ours, submitted in the X-Twilio-Signature header. If they match, then you’re good to go.
4367 273 83