twilio master account make outbound call with subaccount validated number - twilio

I need to make outgoing calls from browser and i set capability token with the master account.
Then i make a call request to twilio from browser and return a twiml from my server.
In the twiml, i set the callerId to a subaccount validated outgoing phone number.
When dial to another client, it works fine. But, if dial to a phone number it not work.
From the debugger i saw this error:
it said callerId must be provided for TwilioClient and SIP calls when using Dial.
I dont know why, I need a help.

Related

Twilio number as voicemail - receive forwarding number as callerid

I am building an application where a user will call our clients personal phonenumber. His voicemail is set one of our Twilio numbers.
Is there a way to find out which client forwarded the call to us?
I am using a TwiML app with our API as webhook.
I successfully receive the calls and see the phonenumber of the caller as 'from' and 'caller' and our 'twilio' number as 'to'.
Since it is a forwarded call I would expect the 'caller' should be the clients number, 'from' the caller and 'to' our twilio number, or at least both 'caller' and 'from' should be the client rather than the original caller. However, both 'from' and 'caller' are always the number of the original caller.
One option is to provision a phone number for each client. That way each client will forward calls into a unique phone number that only they use. If you have 10 clients you will have 10 Twilio phone numbers. Each of those provisioned numbers will use your same TwiML app w/ API as webhook. This is described in this "How to Build a Call Tracking Solution".

Twilio does not post to my webhook on incoming calls

I have a trial account.
I have set up my webhook url in the number console.
I have set up a node server tunnelled with ngrok.
But when i call my twilio number, twilio does not send response to my
url. Even in the logs, the Request Inspector for all incoming call is
empty.
Since it is a trail account you need to press a key once the call is answered by Twilio to acknowledge it is a trial account before it will execute any TwiML.

Is there a way to disable in Twilio that I can make an outbound call with unverified numbers?

Is there a way to disable in Twilio so that I can make an outbound call with unverified numbers?
I'm trying to set up some kind of integration with Twilio, Fusionpbx, and Zoho CRM and this is where I get stuck: I need to disable the feature to only allow outbound calls from verified numbers.
there isn't a way to disable this feature. You can Verify CallerID's, so Twilio can verify you own a particular number, and therefore can advertise it in outbound CallerID. You can find more information, here:
Adding a Verified Phone Number or Caller ID with Twilio

Transfer call from SIP trunk to Twiml application

I have a phone number registered in Twilio that I wanted to use for both a Twiml application and an Elastic SIP Trunk (connected to Asterisk). The idea is that inbound calls hit the Twiml app first and then can be forwarded to the Asterisk server if needed, while outbound calls just go via the SIP trunk. (The reason it needs to be a SIP trunk instead of simply using SIP Registration with Programmable Voice is because that is the only way to have E911 support for outbound calls.)
Twilio support told me that it is not possible to use the same number for both.
Because of that limitation, my current plan is to use two Twilio phone numbers. My published phone number will go to the Twiml application, and a second number that I will not give out will go to the SIP Trunk. (Twilio allows number spoofing of other numbers on your account, so I will have the Asterisk server pretend to use my primary number for outbound calls instead of using the second private number.)
In order for this to work, I need to be able to transfer calls from my Twiml app to Asterisk and from Asterisk server back to the Twiml application. The former is easy: just use <Dial> with a SIP URL that points to the trunk. The latter is what I need help with. (I also want to do this in case someone does manage to call the second number - I want them to be redirected to the Twiml app.)
As far as I can tell, the only way for me to transfer calls back into my Twiml application is to forward the call from the Asterisk server back to my public number. The problem is that I think this will look like an outgoing+incoming call and I will get double-billed for these minutes. I'm already paying for another number, and I really don't want to have to pay extra for the minutes too.
Is there a better (or "official") way to transfer a call back to the Twiml app? Or am I wrong about Twilio seeing (and billing) this as two calls?
It is not clear why you cannot use the Twilio number for both a Twiml application and an Elastic SIP Trunk (connected to Asterisk). Did they indicate why?
Just don't assign that particular number to your Elastic SIP Trunk and you should be able to assign it to your TwiML application for inbound calls and use a when you want to forward the the call to your Asterisk PBX.
For outbound calls, you can have you Asterisk PBX send calls with that number as CallerID to your Elastic SIP Trunk Termination URI.
For E911 calls from the Twilio Elastic SIP Trunk, you should have a number associated with your Elastic SIP Trunk, enabled for Emergency Calling, so when 911 calls are placed, the CallerID of that number is used for outbound calls and calls can be returned to that number should the connection get disconnected.
If you did go the second route you mentioned, can you have your Asterisk Server send the call to a Twilio Programmable Voice SIP Domain, maybe have a Dial Plan defined so an Asterisk prefix digit sends calls out this different trunk. Not sure this will work (since mixing Elastic SIP Trunking with Programmable Voice in this manner) but one idea. Your Asterisk server will remain in the call path.

Dialling Offline Twilio Client

I need to make calls to some Twilio clients that will received the call through the browser. The problem is, these clients don't necessarily have their browser open.
I know normally, a user would have to open up the browser and through the twilio util capability and twilio device to turn their browser into a device. And THEN they can receive incoming call.
Is there way to dial clients, when they haven't initialize their twilio client yet?
Twilio evangelist here.
If you try to dial a client who is not online Twilio will view that as a no-answer. You can get a notification of this by providing a URL for the <Dial> verbs action parameter.
When the call ends Twilio will make a request to this URL with a parameter named DialCallStatus which you can use to determine what happened when Twilio tried to dial the Client.
Hope that helps.

Resources