forwarding calls to non-twilio number - forward

i'm new at this. Trying this code, howtos/phonemenu/phonemenu.php but calls are able to be forwarded to numbers purchased from twilio but won't forward to other non-twilio numbers, even though this is a verified number. Any help?

Related

How to handle uber like scenario in twilio

I have an uber like scenario, where a customer can call a driver, how to handle such call in twilio. My initial attempts were as follows,
client.calls
.create({
url: 'https://handler.twilio.com/twiml/EXXXXXXXXXXXXXXXXXXXXXX',
from: '+18XXXXXXXXX', // customer
to: '+12XXXXXXXXX' // Driver
})
.then(call => console.log(call.sid))
.catch(e => console.log(e))
Here, the url returns the following twiml.
<Response>
<Dial>+12XXXXXXXXX</Dial>
</Response>
I have created a twimlBin(url in client.calls.create() function) which simply dials the driver's number. The problem is that I dont understand how wether the call is made by the client.calls.create() function or the twimlBin. Also no such tutorial is present, to handle such situation.
Thanks in advance
Twilio developer evangelist here.
In the case of a customer calling a driver, your customer would call a Twilio number and that Twilio number would forward onto the driver's number. So, you don't need to create the call using the REST API yourself, the call will be initiated by the customer.
So, you will need a Twilio number for this. Once you have a Twilio number, you will need to set the number's handler for incoming calls. You can point that to the TwiMLBin that you've created as it will do for this first use case. Save the number and call your Twilio number, it will dial you through to the driver's number.
However, you will find that the driver's phone will show the customer's number. For privacy reasons you likely don't want that. This feature is known as masked calling.
To mask the customer's number you can add a callerId attribute to your <Dial>, like this:
<Response>
<Dial callerId="{YOUR_TWILIO_NUMBER}">+12XXXXXXXXX</Dial>
</Response>
Now when your customer calls the driver, the call will be forwarded to the driver and they will see the Twilio number.
This is great for our simple use-case here, but if you want to mask numbers for a number of drivers, then there's a bunch of work to do. Thankfully, masking numbers is such a common scenario, Twilio built a product to handle that for you. Check out Twilio Proxy and the Twilio Proxy quick start for a tutorial on how to use it to mask numbers.

nexmo: forward to application and callers number

We have 3 options to connect to get inbound call.
Forward to Phone
Forward to application
Forward to SIP
Forward to Phone: When we call LVN then provided number gets call and callers number is seen in incoming call.
Forward to application: When we call LVN, then it goes to answer URL webhook. From answer url webhook, we provide connect ncco to call to my number. This time I am seeing LVN number in incoming call.
So is there any way in "Forward to application" method, that we will be able to see callers number in incoming call.
Yes you can forward the number of the incoming call by dynamically generating the NCCO when the call comes in and setting the from field in the connect action.
There are some examples in different coding languages available on the Nexmo developer portal and check the NCCO reference on connection actions for exact examples but in a nutshell set the "from field at the same level as the action and endpoint fields in the NCCO response to contain the "to" number that is in the GET parameter of the incoming webhook to your answer_url.
Hopefully that makes sense, good luck :)

freeswitch sip trunk not receiving inbound calls

my sip trunk provider has given me a user name sip123456 when I configure that siip trunk as a gateway, I can make calls out no problem but I cannot receive any inbound calls! Now I did a lot of investigation and I found out that the user name has to be set as the telephone number for inbound calls to work, is there any other ways to overcome that issue in freeswitch, as my SIP trunk provider is unwilling to change the user name to the matching telephone number?
For information I am unable to provide a log as the call does not even reach freeswitch, my provider does not wish to provide a trace, also this issue happens in Asterisk, and Fusionpbx too! Now to make sure that my findings were correct, I used a different provider with another client, which uses telephone number as the user name, and my configuration works on both incoming and outgoing. I'm sure you would say to dump the other SIP provider but my client wants to find a solution hence I am posting this question...
My sincere apologies for being unable to provide further information such as trace logs etc, but has anyone faced the same issue, if yes what other work around have you used?
I suggest you go to Call Detail Records and find which variable contains the number you called. You would then use that variable for the inbound routes. You can change a setting in Default Settings
Category: dialplan
Subcategory: destination
Type: text
Value: ${sip_to_user}
In this example I used sip_to_user your carrier may send the number that was dialed in that variable or they could send it another way. Either way find your phone number and use the correct variable name. If this setting doesn't exist then add it. Click on the 'Reload' button to make the changes take effect. Go to Dialplan -> Destinations and re-save your inbound destinations and it will rewrite the inbound routes for you with the new variable.
Best Regards, Mark J Crane - FusionPBX Creator

Google Apps + Mailgun Split Delivery

This is a question that was asked a while ago on Server Fault, but was never really answered.
I have attempted to follow multiple guides, however, every single time I test it out I get
The error that the other server returned was:
550 5.7.1 Relaying denied
Does anyone have any advice on using Mailgun to achieve split delivery for Google Apps?
The way I do it, is setup a subdomain that has the mx records set to point at mailgun, then on the main domain, any addresses I want to go to mailgun I setup to forward to the subdomain
so say I want website#example.com to go to mailgun, i set this to forward to website#mailgun.example.com
You just need to make sure your code swaps out #mailgun.example.com with #example.com in the to fields if that matters to what you are doing
Hope that helps

Nexmo - how to send messages to US/Canada based mobile numbers

I am trying to send SMS to the people all over the world using a non-registered short codes, but the sms cannot be delivered to US or Canada. How do I achieve this?
Is there an API to get information of the country using a phone number, so that I can know if the current number is of US or Canada's?
(Disclaimer: I work at Nexmo.)
To identify US vs CA numbers you can use Nexmo's Number Insight API. Besides the country you can also get lots of info, landline or mobile, carrier, reachable or not, etc.
If you you want to send to the US using short codes without needing a short code yourself, you can also use our US Short Codes API. If your use case fits into what we support (two-factor authentication, alerts, or marketing).

Resources