Twilio studio connect call to SIP - twilio

I'm trying to setup a simple flow using Twilio studio, with the last widget being "Connect call to".
I want to have a caller connected to an agent with a SIP client, registered with the SIP domain in Twilio. The SIP client that's registered to the SIP domain is nothing but a Bria SIP client iOS app that has successfully registered with the SIP domain.
When I type in twilio's SIP domain details as the end point along with the username and password, the flow gets published fine.
When I test the flow by calling the number that triggers the flow, I do get the options as per the flow. I then press certain keys that triggers the "Connect call to" widget in question. At this point, call ends without connecting to the SIP client. I also see this error event, 32009 - The user you tried to dial is not registered with the corresponding SIP Domain.
Am confused. I tried looking into the documentation on Twilio but no luck.

Did you use the below format, making sure to include the us1 subdomain?
USERNAME#SIPDOMAIN.sip.us1.twilio.com

Related

Twilio SIP Domain not allowing inbound calls

I have purchased an US Phone Number on Twilio and associated it with a TwiML Bin.
The content of the TwiML Bin is supposed to redirect call to my SIP Domain:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Welcome. Your call will be routed to an agent now</Say>
<Dial>
<Sip>sip:+13365518647#branko.sip.us1.twilio.com</Sip>
</Dial>
</Response>
I have created a SIP Domain Credential
I have created a SIP Domain, added the Credential and enabled SIP Registration. Upon incoming call a welcome message should be played.
When I make a phone call to the purchased phone number the welcome message is played and the call gets redirected to my SIP Domain, but the default welcome voice does not get played. Instead, in the console I get The user you tried to dial is not registered with the corresponding SIP Domain error. I can't figure out what I configured wrong. Shouldn't user registration occur automatically? If not, how do I register the user? Please advise
EDIT: I'm using Zoiper as softphone Client. Using Twilio SIP Domain to make outbound calls
One thing you have wrong here is that when your TwiML bin dials your SIP endpoint, the webhook on the SIP domain will NOT be called. The SIP domain VoiceUrl will be called when you originate a call from the softphone that you have registered with the domain.
You've noticed that the console reports that your endpoint is not registered. Your softphone is responsible for registering itself and your username with the domain when it comes online.
I believe the issue you are having here is that you must specify the edge location in your softphone's domain configuration. Make sure you read the documentation on SIP registration.
Note that the bottom of that documentation has links to download a variety of step-by-step guides on configuring various softphones. I have actually tried to use Zoiper Desktop in the same way you are, but I found that it was not sufficiently compatible -- after successfully registering, it would continually re-register itself with the domain until it hit a rate limit, and then calls would fail. I've been very happy with Bria Solo as a reliable alternative.

Is it possible to make outbound call using SIP to PSTN with Twilio?

What I'm trying to achieve is the following: Use Twilio's Voice API to make an outbound call to a PSTN mobile number, however, instead of using Twilio's routing (which is 10x more expensive than normal SIP providers in my region), I want to use a 3rd-party SIP Trunk to perform the call.
The two areas I can't figure out are:
Can Twilio even do this when using a standard SIP Trunk
And/or, does the SIP Trunk need certain features for this to work (so I can't just signup for any old SIP Trunk)
I see Twilio can dial a SIP URI, however, I can't see how the SIP Trunk will route that call to the PSTN (ie. it seems it can only dial the SIP user as the final destination). Twilio has recently introduced BYOC - https://www.twilio.com/docs/voice/bring-your-own-carrier-byoc - which looked hopeful, however, when setting up the Origination Target you can only provide the SIP URI. This is the technical point I don't really understand, since my SIP Trunk requires a username and password to authenticate before making a call, and the BYOC setup doesn't offer this. Is there some special feature the SIP Trunk needs to work?
I think I'm missing something fundamental here, because I can't see a way of making this work (maybe it's not possible without a very specialized setup). So any help getting on the right track is appreciated (I did try Twilio Support, but they seem as clueless as I am).
So I can answer my own question for anyone coming across this post. You can use a standard SIP Trunk with Twilio's BYOC. Twilio sends an INVITE request to the SIP address entered in as the Origination on the BYOC setup. However, it must use IP address authentication - there's no way to use standard SIP credential authentication.
The ip addresses used depends on the DC it's coming from. See signalling IPs here - https://www.twilio.com/docs/voice/api/sip-interface#ip-address-whitelist
You can also append the "edge" parameter in the Origination SIP URI to dictate which Twilio DC it comes from - https://www.twilio.com/docs/voice/api/receiving-sip#SIP-URI-edge
For additional security, you could consider Twilio's private Interconnect option, or you could append some custom arguments to the SIP URI, which could be authenticated on the SIP Trunk side when it receives the INVITE - however, this would require a custom setup to achieve that, and whatever argument you use for authentication would be visible in the URI.

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.

undefined:undefined Twilio Studio Flow SMS Forwarding Function Error

I've been attempting to create a two-way conversation using SMS forwarding in Twilio Studio flow. I know there are multiple ways to set up SMS forwarding in Twilio, and I have been successful in doing so using functions on their own, TwiML and Studio Flow SMS on the send message widget. However, I am struggling with creating a flow that extends beyond one message. I've added the function for SMS forwarding into my flow, but every time a response is received it displays as "undefined:undefined" as opposed to "+15555555555:Hello SMS", Am i missing something?
You might want to use the CHAT product from Twilio instead which would manage all of the sessions, conversations and everything else.

Programmatically start a call with IBM Voice Gateway

I have connected a IBM Voice Agent (https://console.bluemix.net/docs/services/voice-agent/getting-started.html) with a Watson Assistant and a Twilio number.
I am able to call my Twilio number and follow a conversation with the assistant.
Now however, I don't want the user to call the number, but rather I want to programmatically trigger the call. Call some API to force the assistant to call some number. Ideally passing some context with it...
I know that Voice Agent uses Voice Gateway behind the scenes (https://www.ibm.com/support/knowledgecenter/en/SS4U29/welcome_voicegateway.html).
Update:
I was able to trigger a call by via Twilio. I ask Twilio to act as an intermediate. Twilio will call both my number and the SIP (Voice Agent) and bridge the call. However I am unable to pass any initial parameters to Watson Assistant since I don't control the process...
As mentioned above, IBM Voice Agent with Watson now allows end users to configure a custom header to extract from inbound SIP INVITE messages. Go to the "Advanced" section under "Edit Voice Agent" to configure it.

Resources