You should get a JSON response similar to the one below. You will need to replace the $TWILIO_ACCOUNT_SID and the $TWILIO_AUTH_TOKEN with your twilio credentials which you can obtain from the twilio dashboard. To get a list of STUN and TURN servers from Twilio use this cURL command: curl -X POST $TWILIO_ACCOUNT_SID/Tokens.json \ -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN The RTCPeerConnection constructor creates a connection with the user as well as a remote peer using the STUN and TURN urls provided. The code above is typical for what you might see in a webRTC application where iceServers is an array of STUN and TURN server urls. const connections = connections = new RTCPeerConnection(peerConnectionConfig) The below is some frontend javascript code setting up a peer to peer webRTC connection. Here is a Github repo with a list of all the freely available STUN servers you can use if you’re curious.Īlright now that we understand the purpose of STUN and TURN better let’s get into some code. It’s estimated that in roughly 80% of cases you can get by with only a STUN server and you won’t need a TURN server, although this statistic is more apocryphal than fact. Below is an excellent MDN diagram of how STUN servers work. Create New API Key Give the key a name of your choice, and leave the key type as standard. Click settings on the left-hand side navigation and click on the API Keys link then the Create new API Key button. In this case it is necessary to use a TURN server. Twilio Account SID: The account begins with AC. Sometimes it is not possible to connect with the public IP address of another user based on their router/firewall settings. The purpose of a STUN server is to get our public IP address as well as the public IP address of the user who we will be connecting with over the internet. STUN stands for Session Traversal Utilities for NAT. Before I describe the code of how to get a TURN server from Twilio, I would like to back up and talk about some of the basic definitions. As it turns out you there are quite a few free STUN servers out there, but most of the TURN servers require you to either pay or host the server yourself which would incur AWS fees and frankly take more setup time. After doing some digging I realized that the reason it did not work is because it did not have a TURN server set up. While testing the code with a friend, however, I noticed that it did not work properly. Plus it used React, Node, and socket.io which made for a tech stack that I was pretty familiar with. In order to enable this functionality I had to work with WebRTC.Īfter perusing some Github repos online I found this excellent repo that had a lot of the logic I was going to be implementing. Ohmystream only allows individuals to stream, but I thought it would be much better to give users the option to stream together for example if they wanted to do a video podcast. It should allow for SMS and MMS.I have recently been working on adding WebRTC to my live streaming app Ohmystream. Select 'Buy a Number' and find a phone number you are happy with.Click on the '#' sign on the left side per the image below: With your account upgraded, you will now need to purchase your phone number.Twilio will use this credit on your account to automatically charge for each text message. Allow Twilio to charge your card or paypal account $20 in order to make your account usable. This is done by tying your account to either a Credit Card or your Paypal account. Once your account is created and you are logged in, you will need to Upgrade your account by clicking on the 'Upgrade' button at the top of the page.You may select the options per the image below: The first stage will ask you a few questions. For ease of use, we recommend performing these steps on a PC where you an access both your Twilio Account. Twilio charges a one-time fee for the phone number, and then $0.02 per text message. In order to enable text messaging for SparkBooth, you must create a Twilio phone number. Add controls position to photo kiosk settings Update Twilio invalid login credentials error message 6.0.143 Add Send to Account Facebook notification 6.0.142 Add missing message font settings to Photo Kiosk mode 6.0. Solution home How to Guides How to Guides: SparkBooth How To: Setting up your Twilio Account
0 Comments
Leave a Reply. |