I want to take my phone, call the twilio number and then talk with the person in the other side; and as the same with the sms.
I don't want "url" apps, or phone apps... (I made this that actually works http://luiscallcenter.netne.net/callcenter/index.php)... but I don't want use this.. I want to use twilio as another phone number... ...
can you help me with some reference?... I read the API but all that is about web apps, but I don't want this and I'm confused.
Basic Call Forwarding
http://twimlets.com/forward?PhoneNumber=123-123-1234
In the above URL, replace 123-123-1234 with your cellphone number. Then set this URL as your twilio voice URL. Then all calls coming to your twilio number will be forwarded to the given number. This service is offered by twilio itself.
(For more details, visit here)
Twimlets Service by Twilio Labs
You can use this website provided by twilio to generate urls for some common use cases such as forwarding to a cell number, echo a message etc.
When using this feature, you dont have to do any actual coding. Just replace the necassary parts in the provided URL and set this URL as the voice URL in twilio.
Related
I had call tracking set up on my system following this tutorial https://www.twilio.com/docs/tutorials/call-tracking-php-laravel, i have created twiML app with Voice REQUEST URL configured for this call tracking purpose.
Basically on my system i have list of users with their own personal number and assigned twilio number so whenever call comes in to one of twilio numbers, twilio posts to Voice REQUEST URL and in that url i have logic for call forwarding to their personal number, recording call log etc.This is working fine.
Now my new requirement is ability to call through browser to any number, I read this tutorial https://www.twilio.com/docs/tutorials/browser-calls-php-laravel . It seems i need to use Twilio Device Client.
My question is it fine to create new different twiML app for this purpose so that i will have separate Voice REQUEST URL where i can put apporiate logic to call destination number OR i should use same twiML app and within same REQUEST URL of my system i need to put logic for two different purposes? what could be recommended way of doing this?
Thanks in advance for any suggestion
"create new different twiML app for this purpose so that i will have separate Voice REQUEST URL where i can put apporiate logic to call destination number"
Your first answer seems the best. Keeps your code and logic cleaner.
i wanna create a calling between passenger and driver using anonymous phone no. both are not see own no. it actually see the Twilio assign no. how can i integrate in custom PHP and please also tell me the work flow. if u have code must share your git link
This is a classic use case in many sharing economy platforms. Twilio website and documentation have sufficient details to enable you build this. Tutorials with code is also available.
Check out these steps and tutorial .
Steps include ( this is directly copied from Twilio website)
STEP ONE
PROVISION TWILIO PHONE NUMBERSPurchase a pool of phone numbers from the Twilio
self-service portal or the Twilio phone number API. You can search for phone
numbers with a specific country and area code.
STEP TWO
MAP TWILIO PHONE NUMBERS TO USERSImplement the mapping between the provisioned
Twilio phone numbers and your users. In this example, xxx-xxxx is associated
to Arya and Bran's personal phone numbers for the duration of their business
relationship.
STEP THREE
ARYA CALLS TWILIO NUMBER XXX-XXXXWhen Arya calls xxx-xxxx, Twilio receives the
call and makes an HTTP request to your web server.
STEP FOUR
YOUR WEB SERVER RETURNS BRAN'S PRIVATE NUMBERYour web server looks up the
private phone number of Bran associated to xxx-xxxx and returns a TwiML <Dial>
to Bran's number.
STEP FIVE
THE CALL IS CONNECTEDTwilio connects the call between Arya and Bran. Bran sees
the call coming in from xxx-xxxx.
In my web application I have used Twilio api for making calls,
params = {"PhoneNumber": 'xxxx123'};
params = {"callerId": 'aaaa987'};
params["PhoneNumber"] = 'xxxx123';
params["callerId"] = 'aaaa987';
Twilio.Device.connect(params);
But in receiver phone/twilio call logs did not get from number aaaa987, it is some other number like xyz567 every time.
How can I set from number for Twilio outgoing calls ?
Twilio evangelist here.
So to make sure I understand your question:
You want to use the Twilio Client for JavaScript to make a phone call from a browser to a regular PSTN phone
You want to have the Client pass parameters to Twilio to set the phone number and caller ID of the call to the PSTN phone
Assuming I understand your question correctly, it looks like you are on the right track, passing an array of values into the Connect function. Now, what Twilio will do with that array is we will take each item in the array and convert it into a parameter that we send with the HTTP request we make to the Voice Request URL you have configured for your TwiML app.
Based on the tags you set for your question, it looks like you are using PHP? If that's correct then you would just set the Voice URL to a PHP page that you have hosted on the internet.
That PHP page can use the $_REQUEST object to access the HTTP parameters Twilio is including in its request and use them to dynamically generate TwiML. In your case since you want to have Twilio dial out to another phone number, you are going to need to generate TwiML containing the <Dial> verb.
Here is a sample that shows how you can use the Twilio PHP Helper library to generate TwiML:
$response = new Services_Twilio_Twiml();
$response->dial($_REQUEST['PhoneNumber'], array(
'callerId' => $_REQUEST['callerId']
));
print $response;
In this case I am grabbing the PhoneNumber and callerId parameters from the HTTP request made by Twilio and injecting them into the dial method. This would result in the helper library generating some TwiML that looks like this:
<Response>
<Dial callerId="aaaa987">xxxx123</Dial>
</Response>
Your PHP page returns the generated TwiML to Twilio in response to Twilios HTTP request. Twilio then executes the TwiML making cool things happen, like a phone call to the number you've specified.
If you want a bit more of a step-by-step walk-through for Twilio Client for JavaScript, I'd suggest talking a look at the Twilio Client for JavaScript Quickstart. Its available in PHP and will take you through using Client for both inbound and outbound phone calls, including setting up a server side application in PHP to generate and return TwiML and also passing parameters into that PHP file.
Hope that helps.
I have created a free account in twilio for sending SMS through my website. After my registration I got a twilio number like XXX-XXX-XXXX. I am able to send message to mobile numbers but I don't know how to use this twilio number for receiving SMS. Please help me out on this.
Twilio evangelist here.
The way Twilio notifies you of both incoming SMS message and incoming voice phone calls is by using something called a webhook. This is basically an HTTP request that Twilio makes to a URL that you tell us about. Normally this URL is a web app that you've created and published to a public website.
http://en.wikipedia.org/wiki/Webhook
In your Twilio dashboard, click on the Numbers tab and you will see your trial number.
https://www.twilio.com/user/account/phone-numbers/incoming
Click the phone number and you will see two input fields, one for a Voice URL and one for a SMS url. Just put your URL's there and click the save button.
Now if you send a text message to your number, Twilio will make an HTTP request to the URL you've told us about. You can think of this like a standard Form submit. Twilio will send along parameters like the number the SMS is coming from and the body of the message. The full list of parameters we send to the SMS url is here:
https://www.twilio.com/docs/api/twiml/sms/twilio_request
Your app can grab those parameters and use them however it wants. Your app can also return TwiML instructions to us that tell us to respond to the SMS.
https://www.twilio.com/docs/api/twiml/sms/your_response
You might want to check out our quickstarts for examples of how to receive a text message and and howtos for lots more examples of both sending and receiving SMS messages.
https://www.twilio.com/docs/quickstart/php/sms/hello-monkey
https://www.twilio.com/docs/howto
Hope that helps.
Devin
I want to make a web page in PHP from there users can easily call to any mobile numbers how is this possible in PHP?
I think you're looking for something similar to Google Talk Developer API with the libjingle kit.
(Considering that's about as close to voice and calls you'll get to without finding a company with a phone number and SDK--Google voice I don't think has an SDK).
Additionally, you could Google "VOIP SDK" and see what you get.
If you don't need synchronous voice communication (i.e.: a pre-recorded message is fine) then Twilio has a wonderful HTTP API for interfacing with telephones.