As subject says I am reading api docs for twilio but even after brainstorming for 2 hours I am still unable to figure out exactly how can I receive a call from twilio on my web application and answer the call with my own voice like we do in a real phone.
I know how to respond a call when someone call your twilio number but that's only text to speech conversion like their "Hello Monkey" example application but nothing so far about answering a call using their API.
Can anyone please explain how can we do that? Not everything, just main concept and few references if possible
I am using Laravel so would be good if it's in php
Twilio evangelist here.
I would suggest working through the Twilio Client for JavaScript Quickstart. This will walk you through both the server and client side code needed to build a phone in your browser, showing you how to both make outbound calls from the browser to a PSTN phone as well as receive incoming PSTN calls in the browser.
The magic that you are looking for in either of those cases is the <Dial> verb. When an incoming PSTN call comes into Twilio, you can use the Dial verb to tell Twilio to dial and bridge that call with a Client instance:
<Dial>
<Client>jenny</Client>
</Dial>
When and instance of client make an outbound call and wants to connect to a PSTN phone number you again us the Dial verb:
<Dial>
<Number>+15555555555</Number>
</Dial>
The quickstart shows in more detail how this works.
Hope that helps.
You tried the Twilio PHP lib? As for Laravel... Incoming call? No problem!
Please try to use Google before asking questions! I think one important trait to any programmer is the ability to organize the idea of "what you want", and then google each step to get it that you want...
Related
I have a virtual number in nexmo 447775*****, then my goal is If someone texted me on that number the message will be forwarded to my personal number 55699*****. I read the documentation on how webhook works but I didn't quite sure if that is what I'm looking for. I already search google for a day to search for a tutorial but I didn't find any. Can someone provide me some reference or provide an example? Btw I'm using php.
You could setup your Nexmo virtual to "forward" to your personal number however you need to code your backed as such. Nexmo provides an API to facilitate sending/receiving SMS but it's not a forwarding service. Google Voice would be what you are looking if you want something out of the box. A Webhook is basically a URL that Nexmo would call when you receive an incoming SMS message. Your API/service would receive the message, parse it and do something with it. Hope this helps.
We're building Call Tracking website using Twilio API.
The goal of our website is, when someone call a Twilio number (i.e (855) 329-5712), that call will be redirected to a specific predefined number.
The following TwiML we have generated for the same:
<Response>
<Play>//s3.amazonaws.com/calltrackingdashboard/upload/greetings/d9e5234534c5ca818e26225ed7e15809.mp3</Play>
<Dial record="true">
<Number url="http://www.filenewtrack.com/callfrds/whisper/170">+919674683063</Number>
</Dial>
</Response>
The Call is not connecting to the receiver properly.
Call just redirecting properly and the Caller heard the continuous ringing though the receiver receives and start communication. Even Call Whisper is not working.
Any help in this regard will be highly obliged.
Thanks in advance.
Twilio evangelist here.
In addition to checking the App Monitor, I'd also suggest checking the call logs and see what Twilio is logging as the result of the call.
It looks like you are trying to dial an Indian number, so if nothing interesting shows up in the call logs or the app monitor, my suggestion would be to drop our awesome support team an email at help#twilio.com. If possible, include in your email the Call Sids of several calls where you experience the issue so the support team can dig into them for you.
Hope that helps.
I am trying to do this but it is not working....I was trying to text to my sandbox sms at Twilio so once twilio receive's that sms it would execute a script that should dial a number. This is not working as I get no error so I am assuming the only place where the Dial verb works is in the phone section of Twilio and not the sms part. Any help?
I want the sms to be a trigger that starts up a script which uses Twilio's dial verb to call people and give a message then hang.
The <Dial> verb is a top level one, so it should be a child of <Response>, i.e., not <Sms>. That said, Twilio's documentation strongly implies putting <Dial> in the <Response> for an SMS callback won't work; <Dial> is supposed to connect a current caller to another party. So, if this isn't working, you'll hit their REST API to initiate the call; you can POST the TwiML script with the message to speak and the instruction to then hang up.
Note this contradicts my first reply to your comment on your other Twilio question, my apologies for that.
Uptill now I have been using Twilio for phone calls. Now I want to be able to have a network monitoring tool that texts when there is a problem to a number. I would like to make it so that when twilio receives the text it will execute the script that I have put into its URL...I really don't know how to get started with sms it seems very hard and complicated as compared to phone calls...Any help on the sms is greatly appreciated to get me started.
If you've already figured Twilio voice calls, you'll find SMS easier once you figure out what they're doing. Which is essentially:
Carrier delivers an SMS to Twilio for a number you're renting from them.
Twilio makes an HTTP POST or GET (you choose) to the URL you setup in their web admin. The content of the text message will be a parameter in there.
You do whatever you want with the POST or GET, returning a TwiML if you want an SMS reply sent or nothing if not.
Note, Twilio can't execute a script for you, unless it's TwiML, in which case you're just returning TwiML as the response to the HTTP call from #3. So if you want to do something in response to an SMS, you'll need build that something into the logic that handles the URL you've given Twilio. If you're still lost a bit, tell us about how you're trying to do this, e.g., you've a Rails app, a PHP website, or just a Bash script you want to run and nothing else yet...
Why not avoid Twilio and have your network monitoring tool execute the script itself?
I want to make a web page in PHP from there users can easily call to any mobile numbers how is this possible in PHP?
I think you're looking for something similar to Google Talk Developer API with the libjingle kit.
(Considering that's about as close to voice and calls you'll get to without finding a company with a phone number and SDK--Google voice I don't think has an SDK).
Additionally, you could Google "VOIP SDK" and see what you get.
If you don't need synchronous voice communication (i.e.: a pre-recorded message is fine) then Twilio has a wonderful HTTP API for interfacing with telephones.