I use Twilio and Zoho Phonebridge for inbound and outbound calling to customers. I use Zoho's built in IVR which works well, but has gaps. The main gap is when I get a voicemail, I need to login to Twilio to get it and that's a time sink. I would like Twilio to email (or text, for all I care) those messages to me, transcribed or not. Problem is, I cannot modify the code provided by Zoho, so I need to have the function carry out in parallel. I'm not sure where to start. I can do code snippets easily enough, but I seems I need to replace the "Voice Configuration - Request URL", which kills the IVR.
Any help?
Related
I'm looking through documention but didn't find anything that can help me find registered clients to twilio voice incoming calls.
For example. I have 10 registered clients to javascript sdk, that can handle incoming calls by their identities. But on my backend I need to find out who is registered and who is not busy making another call.
Is there any endpoint or someting that can return list of users(identites, clients, devices) with their status?
Because with TwiML I can redirect incoming call up to 10 clients. But when I don't know who is ready to answer and not busy I can't redirect responsible.
Thanks for any leads.
Twilio developer evangelist here.
I'm afraid that there isn't a way to list your currently registered clients. But you have a couple of options with how to deal with this.
You could keep a list of your registered clients manually. Adding a client to the list as they log in and removing them when they disconnect.
Alternatively, you could consider using TaskRouter to keep track of this and control the passing out of incoming call tasks to available agents. Then the agents would log on and enter an idle status in TaskRouter, when they accept a call they would be busy, once the call is over they go through a wrapping up stage before you return them to idle and ready for another call.
I resolved it with another way. When the user connects a device to twilio, I put him in the presence group with WS. When the device starts calling, I put him in another presence group. On the backend, when recieving calls, I just check who is in the ready group and not in the calling one and connect him with this incoming call.
I am trying to use my laptop (running Twilio) to dial a land line using python 3 and have have a voice conversation. This is the simplest use case.
Here is the python code I am running on my laptop.
def test_voice_command_inline(self):
'''calls landline from laptop via twilio'''
twilio_client = twilio.rest.Client(self.twilio_account_sid,
self.twilio_auth_token)
vps_url = self.get_vps_url()
twilio_voice_call = twilio_client.calls.create(
from_=self.twilio_phone_number,
to=self.land_line_number,
url=vps_url
)
When I run this code, my land line rings, and I answer it. The call is connected. Next I get prompted by Twilio to press a key to "execute my code" (aka the webhook)
Since I already have a connected call, I don't need a webhook. I just want to start talking. However, the Twilio rest api requires me to put in a webhook url that returns TwiML to direct the call flow. And when the TwiML is finished processing, the call is hung up. I don't need a webhook, yet I am required to have one.
I tried various things in the webhook code in an attempt to let the already connected call continue. I tried returning blank TwiML from my webhook, which causes an immediate hangup. I also tried dialing the land line number from inside the webhook. Since the rest api already connected the call, trying to re-dial the number from the webhook caused a busy status (Twilio console). Looking at all the TwiML verbs I can use in the webhook, none look appropriate for my needs.
I must be missing something simple. Why can't I use the code above to make a voice call between my laptop and my land line (or any other phone)?
Twilio developer evangelist here.
When you make an outbound call using the REST API, Twilio is setting up a call between our server and the to number. The from number that you supply is just the callerId for the call.
In order to connect the call you make with the REST API to another phone, you need to return TwiML from your twiml_url that dials another number. Currently your TwiML is just an empty <Response> but it should be something like this:
<Response>
<Dial><Number>OTHER_NUMBER</Number></Dial>
</Response>
This can be written out by Python code too, if you want it to be dynamic. That's where you use the VoiceResponse that you mention. The important thing is that the second leg of the call that you are making should be controlled by TwiML returned from your URL.
Let me know if that helps at all.
what I am trying to achieve is to make a VoIP call from an iPhone to an iPhone using Twilio.
To do that I'm using the iOS SDK, the Twilio Voice to be more specific as the iOS SDK is superseded.
I have a server that generates an access token and when I create a call the Twilio API would make a request to my server and I would return a <Dial /> keyword with the client name and the connection would be established.
The problem is, this counts as two calls(iOS app to Twilio is the first one and when I return a TwML <Dial /> response is the second one) so the price is practically doubled.
Is there a way to make it as a single iOS app to an iOS app call? All my server does is to generate the TWiML using the parameters that are sent from the client anyway.
Oh and also in the documentation there are some talks about capability tokens but all the current documentation is using Access Tokens.
Are capability tokens relics of the past for the older API?
Thanks
Twilio developer evangelist here.
Twilio calls are always priced per leg, so in a call between two people you do always pay for the outgoing leg and the incoming leg. They may also have different lengths, if the outgoing call goes through some other TwiML before making the <Dial> for example.
However, if all you want to do is make calls between applications and you don't need to be able to make calls to the phone network then can I recommend you take a look at the Twilio Video project. While it is called "Video" you can use the SDK to make audio calls between apps too. And if you choose to create peer-to-peer rooms, then the audio stream is sent directly between the two devices and not charged as a call leg at all. The only extra thing you need to do is to generate the call notifications yourself.
As for capability tokens, they are indeed a left over bit of documentation. Capability tokens have mostly been renamed as access tokens so you can use them interchangeably. If you investigate the Video SDK, then everything will be Access Tokens too.
For incoming calls:
1) I am new to twilio, but I always want a "All calls are being monitored or recorded" to play for all incoming calls. What is the best way to do this?
2) I would like to create two messages after the "monitoring" message is played. one message during open hours and a second message during closed hours.
What is the best way to do this? Any good documentation?
Twilio developer evangelist here.
Welcome to using Twilio! I'll give you a quick overview of how incoming calls to Twilio work then point you to some useful parts of our documentation that will help you achieve what you are working towards.
When a Twilio phone number receives an incoming call, Twilio will send an HTTP request to your web application, asking for instructions on how to handle the call. Your web application will respond with an XML document containing TwiML. That TwiML contains the instruction that Twilio will follow to say some arbitrary text, play an MP3 file, make a recording and much more.
In your case you want to read messages to the caller, you could either do that by returning TwiML that uses <Say> to read out the messages using our text to speech engine. Or you could record yourself reading the message and play that to the caller using the <Play> TwiML.
To learn more:
Follow the Programmable Voice Quickstart
If you need more specific instruction on a particular Twilio feature, check out the Twilio Guides
If you need to see Twilio features as part of a complete application, check out the Twilio Tutorials which cover more specific use cases
Let me know if that helps at all.
We use microsoft botframework for our chatbots. We would want to enable Voice channel to our bot. Is there a way to solution this? Does Twilio have anything that can add speech capabilities to our bot. Our bots are exposed via webchat components, skype, facebook messenger etc.
Twilio developer evangelist here.
There's no way within Botframework to add voice capabilities from Twilio, however receiving calls works in a similar way. When someone calls your Twilio number you receive a webhook which you can respond to with TwiML to tell Twilio what to do with the call.
To then perform things by voice action you can <Record> the caller's response and set the transcribe parameter to true. You also need to set a transcribeCallback URL as the transcription is done asynchronously. Once you receive that callback, the text of the transcription will be available as a parameter in the request. You could also perform the transcription yourself with a third party service by just taking the recording and sending it off.
Once you receive the transcription you can then make your decision as the the next step of the conversation and redirect the live call to the next step of your process using the REST API.
This is just a high level overview of how you might accomplish this. Let me know if it is of any help.
Voximal offers as Twillo a similar product but based on VoiceXML. The difference is that Voximal integrates natively most of STT engines (Microsoft, Google, Watson, iSpeech) in the solution (you only need to set the key or the user/password to configure them). You use a builtin grammar "text" to translate. Then the processing is very similar to the Twilio. You need to push the content to a chatbot engine (HTTP/XML/JSON), and you have a way to play the result with a TTS engine.
Have a look to the Parrot example (a script that repeats all you said using the STT and TTS) :
https://github.com/voximal/voicexml-examples/blob/master/parrot/parrot.vxml