Twilio & ThinQ qustion - twilio

I know there are some twilio experts here and would really appreciate it if someone could answer a question for us and if so, please let me know if you do freelance work.
Our website offer clients to purchase numbers, which are twilio numbers, and we forward the calls and SMS to their original number, while doing demographics, call recordings and marketing. The number on which call was received is important to us. We want to use Thinq LCR to reduce cost. But Thinq wants us to port the twilio number to them. If we port the twilio number to Thinq, will the existing twilio services break? and on which routing profile will we forward the numbers after porting, if twilio number has been ported to thinq, there's no twilio number to forward anymore. And will we need to change all the code to work with the new Thinq API as twilio is out of the game now?
Thank you!!!
Chip :)

From what I understand of your problem, you should port your existing Twilio DIDs to ThinQ and switch to provisioning new DIDs from ThinQ directly, going forward.
Once the DIDs are visible in the dashboard (i.thinq.com), you would configure them all to route to a Twilio SIP domain that you will need to create. See https://www.thinq.com/thinq-voice-origination-with-twilios-bring-your-own-number-byon-service/ for instructions on how to do this.
With this setup, people trying to reach your clients would dial the DIDs controlled by ThinQ. ThinQ would send the SIP calls over to the Twilio SIP domain which would then interact with your server's callbacks to handle the call.
Your callback would use the appropriate Twilio API (REST or TwiML) to dial the client's actual phone number via SIP so that it goes over your ThinQ VoIP account for lower costs (e.g dial to sip:#wap.thinq.com?thinQid=&thinQtoken= )

Related

Twilio Outbound calls with Caller Id

We have a query to ask regarding the Twilio voice communication and hope you will help us.
We are having a client and they are having business with Health care domain having Doctor-Patient communication happening through Twilio cloud.
We know that a non-twilio number can be used for caller id after verification with twilio by 6 digit input from the user.
The client requires a mechanism like when they sell the product to many customers, each customer just input any valid work number (office number) and wants to use those number as Caller Id without the verification process.
We would like to know whether Twilio us offering such custom caller ids without doing the verification steps ? Like with means of a high-level membership plan with twilio or for utlizing any bulk purchase schemes or by trusting the client with any documents or by any other means of ?
Please give your suggestions in this.
Thanks
No. You need to verify each number to use it for your caller ID. Another way of doing it is that you buy the number via Twilio when the customer signs up and that's their outbound caller ID. Would be much easier to do.
david

Can Twilio's Lookup API tell if a number is connected or not?

I saw that Twilio's Lookup API can tell you whether a phone number is landline, mobile, or voip, as well as what the carrier is. Is there any functionality or possibility of telling whether a number is disconnected or not, similar to what RealPhoneValidation does?
For example, I looked up a disconnected phone number in RealPhoneValidation and this was the output, versus the Twilio Lookup API only provided the line type and carrier.
Problem
By default, Twilio Lookup API does not provide information on phone number’s connection status with provider.
Solution
Twilio Lookup API allows for “addons”, one of which being the “payfone” addon that uses another service (payfone) to determine phone connection status.
References
Twilio Lookup API: https://www.twilio.com/docs/lookup/api
Twilio addons: https://www.twilio.com/docs/add-ons
Twilio Payfone addon: https://www.twilio.com/docs/add-ons/quickstart#using-the-payfone-lookups-add-on

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.

Register Twilio as extension/endpoint SIP client using username and password

I have the next situation:
A call is made to a PSTN/DID number of my phone company and that I can use with proprietary SIP cell phone app or SIP client application like Zoiper / Linphone configuring with SIP, user and password.
I cannot configure this service to forward a call to 3rd party service SIP URI. I've already asked it to my PSTN provider and they say that it is impossible.
The question is:
How can I make Twilio (or maybe another service) register as SIP client with user and password (like extension/endpoint ) to receive a call from PSTN and forward it to other SIP URI or phone number?
I know that asterisk / some cloud pbx can do it like it was previously free account at pbxes.com.
Have you considered porting your number to a carrier that will allow you to forward inbound calls to a specific SIP URI you configure or register for calls to that URI, given your current carriers constraints?
For example, Twilio has some documentation here on porting a number.
International Porting
Porting a number To Twilio
I understand, based on your country, this may not be an option.
Twilio does not have a way to register as a SIP client with another provider. It does offer the ability of using a Twilio hosted number (and thus the comment on porting) to register a SIP client against or forward a PSTN call to a SIP User Agent.

Twilio Opt-In/Opt-Out API

I am working on an Opt-In /Opt-Out api that integrates with Twilio. The way our Opt-In/Opt-Out works is each company (our customer) signs up for one or more Twilio phone numbers and their customers can opt-in/opt-out into these numbers.
When Twilio receives these opt-in/opt-outs we want Twilio to call us into a webhook URL.
So my question is: how do we register these callback URLs? Do these have to be defined at the time when each company signs up for a phone number? If so whats the API end point for that?
These numbers can be added by different companies at any time. Please advise how to do that. We already have URLs defined for sending and receiving SMS messages with Twilio. In this case we first send the message to Twilio and we specify a callback url in that. Can the Opt-In/Opt-outs work with these already registered end points?
All the phone numbers these companies sing up for are created as a subaccount under us. So is that fine with Twilio and can Twilio call us back on the already registered end points (URLs).
If you have any documentation on how to set up an Opt-In/Opt-Out,please include that. I couldn't find one anywhere. The API method we use for creating subaccounts when companies sign up for a phone number is CreateSubAccount and there is no parameter to specify an call back endpoint URL. I tried contacting their support but they haven't gotten back to us yet.
Twilio developer evangelist here.
I'm not sure exactly what you mean when you say "When Twilio receives these opt-in/opt-outs" as the only thing you will get webhooks for is when a number receives an incoming SMS (or phone call, but we're talking SMS right now).
You can set a different SMS webhook URL per each phone number using the API when you buy the phone number. As part of the POST request to the Incoming Phone Numbers resource you can add the optional parameters SmsUrl and SmsMethod.
Once you have purchased the number, you can also update the webhook URLs for it, by POSTing or PUTing to the instance resource, using the same parameters.
Let me know if this helps at all.

Resources