Callback service on the website using Twilio - webrtc

Let's say I need to implement a callback service on a website.
I'm curious if it's possible to develop it using Twilio.
For example, if a website visitor provides his mobile phone number from one side, from another side I have a manager using his web CRM application. Is it possible to:
Make a call (using WebRTC?) to a manager
When the manager replies the incoming call, call to the website visitor (on his mobile phone)
Connect both sides together
I know there are lots of ready-to-use callback services, I'm just curious how it works under the hood.

Twilio developer evangelist here.
This is a feature we call Click to Call. Here's how it would work with Twilio:
The visitor provides his number through a form on the site
Generate a call to the manager using the Twilio REST API
When the call connects to the manager, dial the visitor.
This is achieved using TwiML
Whent the call connects, Twilio makes an HTTP request to a URL you provide in step 2
That URL needs to respond with TwiML, which is a subset of XML to tell Twilio what to do with the call
In this case the TwiML would be to <Dial> the visitors number
When the visitor answers the two are connected
This is a high level view of it, we also have a tutorial walking you through Click to Call with Twilio (this is the Python version, but there are others available too) which I recommend you take a look at.
Let me know if this helps at all.

Related

soundcloud api how get clientId

On page https://developers.soundcloud.com/
Register a new app (Currently unavailable)
A question for developers. How soon will fix the registration of apps?
Is it possible to register my application in manual mode?
I need my clientId!
Apparently they haven't given out new client IDs for months (another user says so).
To answer your question though, no. As Soundcloud says when you attempt to register an app, "...we will no longer be processing API application requests at this time."
I'm trying to use the API too. It seems like we either need to use client IDs belonging to other people, wait an unspecified period of time, or there may be select uses of their API that don't require a client ID.
It depends on what kind of content you want to access.
If you need only public content than you can obtain the CLIENT ID from your AJAX requests made to soundcloud. Open network debugger in your browser and explore AJAX requests you should see some queries made to api.... and the query string should contain client id:
https://api-v2.soundcloud.com/tracks/687584815/playlists_without_albums?offset=85&limit=5&client_id=xxxxxxxxxxxxxxxxxxxx
Hope that helps.

Twilio integration

I am using twilio from salesforce (On a custom object) to call some numbers. Is there any way to send voicemails to those numbers without ringing there phone or with ring as least as possible .
Will appreciate your help .
Thanks!
Twilio developer evangelist here.
The voicemail of someone else's phone is not under control by Twilio. So you can't directly leave a voicemail without ringing them. You also cannot control the number of rings someone else's phone will make before going to voicemail.
Using Twilio, you could make calls to the numbers and play a message when they or their voicemail answers. This would either directly deliver the message to the user or record it on their voicemail.
[edit]:
After the discussion in comments below, here is an updated answer.
I'll give an overview of the system I think you need to build. I can't be more specific, because I have little details of your system or what you've tried.
I think you need to build in Twilio Client to your Salesforce application. You can watch a video on how to integrate Twilio Client with Salesforce.
You can use this to generate the calls to your customers and speak to them from within Salesforce.
To add to this, you also want to leave a message if you get a voicemail. You will need to do a few things to achieve this.
First, you will need to store the Call Sid of the call you made in the browser. You can get this from the parameters attribute of the Twilio.Connection.
You will need to add a button to your interface that is active when you are on an active call. This button needs to hook up to an endpoint in your Salesforce app. The button should send the Call Sid you saved from your connection to the app.
Within the Salesforce app, you will need to build the endpoint for the above. This will receive the Call Sid as an argument. This Call Sid is the parent call and represents your connection to the call. We need to get the Child Call, which is the other end. We do this by calling on the Calls resource passing the Call Sid as the ParentCallSid parameter. This will get you access to the child call.
You now need to redirect the child call using the REST API to another endpoint that has the TwiML to <Play> your recorded message for voicemail.
Then, when your user is on a call and it goes to voicemail, they should press the button in the interface. This will redirect the child call away and consequently hang up on the user in salesforce.
Let me know if this helps at all.

Is it standard to make each user sign up for a 3rd party API key?

I want to make a desktop application which will need to use a 3rd party REST API to get information. However, the number of requests is limited by the API Key. If I use one API key for all users, the request quota will be exhausted really fast. Now, is it standard (and legal) to make each user sign up for his/her own API key? How are API keys used in context of open-source projects?
To generate the API key, I want to make a sign up form within the application, where the user puts in his/her information and the application sends those information to the 3rd party website to get an API key. Does that sound right?
In general the use of an API is limited to the requests from one machine and not to the API key most of the time.
Again depending of the type of third party services you are using, but the requests to the service should be established by the client not the server.
For example if you want to know geographic coordinates from a specific place, but obviously you can't ask the user directly for GPS coordinates. So you implement the Google Maps Javascript Library into your app which requests the Google API for the coordinates to the human readable address and returns it to the client. This in turn sends the data to your server.
In this way your server never comes into contact with the third party service.
If you have sensitive data or data which shouldn't be manipulated by the user you have to request from your server directly of course. But take a look into the documentation of the service before hack something together which isn't in the intention of the service provider.
Never ever try to outwit a service provider. They will detect your inappropriate use and block you for all time!

Twilio How to collect incoming SMS messages using .net efficiently

I created an application in VB.net that ties into a scheduling software. It keeps our employees up to date by sending them SMS updates. Employees can reply back to us. Sending messages works great. The application uses the Rest API to connect to Twilio. I can also get a list of incoming messages but I can't seem to get it in a way that works well for me.
Currently my application checks if there are new messages every 5 minutes. The application gets the messages list (with filter DateSent>=today) and then loops through the messages and copies the new ones into our scheduling database.
Is it possible to do a more efficient data pull for new SMS messages using VB.net only? Can I include a time filter in addition to current filter DateSent>=today to limit the result set? Any suggestions? (I don't do web coding unfortunately) Thanks.
Twilio evangelist here.
The best way to do this is just to use Twilios web hook to let Twilio proactively tell you each time its received a message. Whats a web hook you ask? Great question.
A webhook is simply an HTTP request that Twilio will make as soon as it received an inbound SMS messages to your Twilio phone number. You normally tell Twilio to make this HTTP request to a URL that you've created and published to a public website, which you can set up easily by using something like ASP.NET. In this scenario you can think of Twilio like a web browser that is making a request to a web application that you have created.
You can tell Twilio what URL it should request by opening the Numbers tab in your Twilio dashboard, and then locating and clicking the phone number you want to configure:
Now you set the URL you want Twilio to request in the Message Request URL field and click Save:
Now when Twilio requests this URL its going to pass a bunch of parameters with its request that you can use in your application logic. You can also do things like return TwiML back to Twilio in response to its HTTP request that tell it to do things like send an SMS right back to the person who just sent one to you.
If you're looking for a bit more of a step by step, the Quickstarts on our website are pretty easy to follow and will walk you through both sending an receiving text messages. The samples are in C# but are pretty straight forward so converting to VB.NET should be easy.
Hope that helps.
I am doing something similar with VB.Net and Twilio. My solution was to put up an Azure web site and an Azure SQL Database (the two can talk to each other). I set up my Twlio to call an .ashx asp.net web page on my Azure web site. Inside of that web page I have code that reads the incoming text message and saves it to my Azure SQL Database.
Works great, but my problem is the Azure database is in "the cloud" and my app\database that sends the original SMS is on mylocal network. Not sure how to cross that divide... (I should add that my local app can read the Azure SQL database, but seems ugly to have to call out to the Azure to get data. Would have preferred to have just saved it in my local db to begin with.)
Probably not a very helpful post, but maybe give you some architectural ideas. If you want to see my .ashx page just let me know.

Sending sms through my application coded in vb.net

My client requires an sms to be sent to him, whenever an invoice is made on his system by any of the employees. I have no idea how to configure it. Do I need to buy any sms-server service?
How to integrate into my application?
Any help will be highly appreciated.
Thanks
I am not sure what country you are in. But in the UK i use this provider.
They have excellent examples
I can send SMS from my webserver, my Windows .NET Form application, a iPhone app if i wanted to. This is possible because it uses a simple HTTP Request API, so even using JavaScript AJAX from the client will work.
Just search for SMS Gateway and find your countries advisability. Look at a few and decide which one suits your needs and also the costs involved.
My Provider charger per sms.. no signup fees, no contracts, just top up.
Using a mobile phone is more involved, but obviosly it has the benefit that you control every aspect of sending, receiving and processing data.
for example 1, 2, 3
You can even buy a module from china just designed to interface via Serial to send/recieve SMS, and even use the GPRS to get/send HTTP request.
There is two option
1) have to buy service from provider or
2) you have to connect your mobile with pc and send msg using AT command
A lot of carriers will allow SMS via e-mail. This may be a better option for you.
Here is a list of the e-mail address formats for a number of carriers.