Call Twilio Client from Twimlet - twilio

Dialing a Twilio client app requires the <client> twiml noun. Is there a way to generate the Twiml necessary to forward a call to a client using a Twimlet? Ideally, the simulring would accept client OR numbers, but it does not appear to.

You can use something like this to simulring a mixture of clients
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="+1234567890">
<Client>Bob</Client>
<Client>Steve</Client>
<Client>Ted</Client>
</Dial>
</Response>
Remember that you must provide a valid callerId when calling out to a client or the call will fail.
If you want something like the sumulring TwiMLet you can host this code by pasting your TiwML into the Echo TwiMLet https://www.twilio.com/labs/twimlets/echo or by using TwiMLbin http://twimlbin.com/.

Related

Twilio client not receiving incoming event

I am trying to build a phone component that can handle twilio calls and I got outgoing working but when I try to receive phone calls no events are fired and my console shows no answer from the client, my token is given identity test, this is the twiml returned
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial answerOnBridge="true" callerId="(my twilio phone number)">
<Client>
<Identity>
test
</Identity>
</Client>
</Dial>
</Response>
The browser has a console.log added to the device.on("incoming") event but it does not fire, what am I doing wrong?

Make voice call using Twilio Client JS, a subaccount and access token

I am trying to make a voice call from a subaccount and keep getting the error:
callerId must be provided for TwilioClient and SIP calls when using Dial
I have verified my application SID, Account SID, api key SID and secret and all match up. The body of the response logged in the Twilio debugger is:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial answerOnBridge="true" callerId="PHONE NUMBER OF PARENT ACCOUNT">
<Number>THE PHONE NUMBER IM TRYING TO CALL (A REAL PHONE)</Number>
</Dial>
</Response>
I cant find anywhere in the docs that show this with the JS library. I have tried setting the From field in the options for Device.connect with no luck.
Do i have to specify anything for the voice grants?
Another odd thing, everything works if I dial from the parent account's number, but When i go and look at the parent account, it doesnt have voice enabled.

Twilio outbound call didn't wait the agent to answer and add client to call

Here is the logic :
a client is filling a quiz and once he finished twilio will call one of the customer agent using webhook then add the client to the call using twiml Dial. I'm sending the client number as a parameter to the twiml file it look like this https://handler.twilio.com/twiml/EH15xxxxxxxxxxxxxxxxx?clientnumber=+1234567890
And here is my twiml code :
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial answerOnBridge="true">
<Number>
{{clientnumber}}
</Number>
</Dial>
</Response>
The problem here is that twilio calls both the agent and the customer at the same time but what I need is to call the agent first then not call the customer until the agent answer the phone.

Receive call and dial single digit back with twilio?

I'm trying to answer a phone call and dial a single digit back depending on an input from the user, is this even possible with twilio?
edit: thanks for the downvote, if you knew the twilio API you would've known this is a valid question.
Twilio developer evangelist here.
After using <Gather> to collect your user input you can respond with Twiml containing the <Play digits="1"> verb to play DTMF tones during a call.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather action="/process_gather" method="GET">
<Say>
Please enter a digit
</Say>
</Gather>
</Response>
At /process_gather your server would respond with:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play digits="digit to play..."></Play>
</Response>
Please let me know if I can help further!

Twilio call forwarding just hangs up

I'm just following the instructions. From my Twilio dashboard, it shows the call incoming but no calls outgoing. What am I missing? Do I have to set a call forwarding option somewhere? I don't see any.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Number>+6612345678</Number>
</Dial>
</Response>

Resources