dial outbound with Twilio - java

A previous question asked how to dial from a web browser. Fair enough, but how do I dial a number from a soft-phone, like Jitsi, or an IP phone?
I would have to build an app for that purpose, using the client?
Oddly, incoming calls require almost no configuration for an IP phone and dialing from the API is fairly easy.

Think what you're looking for is SIP.
https://www.twilio.com/docs/api/twilio-sip/sending-sip-how-it-works
Making outbound and inbound calls using SIP domain
Using Asterix as an example, the call flow from 5000#example.sip.com(SIP endpoint) to alice#example.sip.us1.twilio.com should look like this:
SIP End point ----> YOURNAME(Asterix PBX) ----> Internet -----> Twilio cloud ----> SIP domain(example.sip.us1.twilio.com) -----> alice
Now once the call reaches alice, web hooks can be used to make the necessary modifications as per individual use case.
You can also use this concept to make an outbound call so lets say alice.example.sip.us1.twilio.com calls 5000#example.sip.com this can be achieved by using <SIP> which is a part of the <Dial> verb in TwiML.
Making outbound and inbound calls using SIP Trunking
Check out the getting started guide here.
The way SIP trunking works is best understood by the analogy of a pipe. You can route your calls towards the Twilio cloud (termination) or from Twilio cloud towards your infrastructure (origination). You also would need to set up an IP access list or credential list for security purposes.
Please let me know if this helps at all.

Related

How to receive incoming calls to a Twilio Number from a Web Browser?

Using Twilio for Java, I want to know the process on how to be able to make our Call Client application receive calls from an Incoming call to a Twilio Number.
Whereas each "Call Client" is a web browser.
What are the steps to achieve this?
What is required in the web browser-based application to be able to receive calls?
What is the strategy to be able to "map" a Twilio Worker into a specific browser?
Twilio developer evangelist here.
What you want here is a combination of TaskRouter and Twilio Client.
TaskRouter will take care of queuing calls and routing them to available agents. Twilio Client will let you take calls in the browser.
To understand this better, I recommend you first go through this TaskRouter tutorial, followed by the Twilio Client JavaScript quickstart and that should give you enough to put the two together and take your TaskRouter routed calls in the browser.
One further thing, if you are looking to build out some sort of contact centre where agents can take calls in the browser and hook into other services, you might want to consider Twilio Flex which can do all of this out of the box for you and then gives you the flexibility to extend the way you want to.
Let me know how you get on.

Regarding wireless lan messaging system

i am developing a chat application for local environment where our office employees can chat easily so here I am getting some conflicts when I am trying to send message over the IP but there IP being change dynamically so how can i resolve it .
First of all, I recommend using a well established solution like a local Jabber Server installation and using a client that supports the required features.
If you really want to pull this off on your own, you'll need at least a central controlling point (Server) to abstract Users from their Endpoint.
Configured user would then have to login to that server to signal they are ready to receive messages. Doing this, you have the momentarily correct IP that you can then use to relay messages or to give to other clients wanting to send to that user. Also consider that users may want to use more than one client (they have 2 PCs?). You probably wouldn't want to bind one user to one client device.
Also note that you will have to create a decent protocol for all this. This can be quite tedious if you want similar features to for example Skype Chat or ICQ, or some derivate of XMPP / Jabber.
This leads me again back to my first suggestion: Better use something that already exists. Installing and configuration of that can already be effort enough. Coding all that by yourself, though will take way more effort.
And I didn't even go into status/statusmessages, groupchats, sending/sharing Files, sending messages while User is away/offline ...

What is the established way to request data from an android device

I currently have an small application that I have been using to learn java/android programming. Right now I have a setup were the app on one phone sends a request (via sms) to another phone running the same app. The remote phone receives the request and sends back some info. Next I would like to try this from the web. Is there an established "best" way to to this?
I was thinking I would have a web server send requests to the device via google cloud messaging and then have the device return the data directly to the web server. (Not that I really know how to do any of that just yet).
I see that there is a google cloud messaging return path (send messages from the device to the google cloud server, but it seems very new, do I need something like that? The main thing I want is to be able to ask the phone to do something when I want, not have it poll to see if there is a request, or just periodically update some status.
UPDATE:
Thanks to the answers below for confirming to me that I was on the right track.
I now have some basic functionality.
I started out using this gcm android demo code
https://code.google.com/p/gcm/source/browse/#git%2Fgcm-client%2Fsrc%2Fcom%2Fgoogle%2Fandroid%2Fgcm%2Fdemo%2Fapp%253Fstate%253Dclosed
and this ruby gem
https://github.com/spacialdb/gcm/blob/master/README.md
between the above two I was able to send a message to my phone pretty easily.
To get the round trip working, I setup a very simple rails app on heroku.
I included a modified version of the sample code in the gcm gem in a controller and then used
HttpPatch (needed for rails 4) to send a post/patch from my phone to my web app, the controller then echoes the message back to my phone.
I guess it would be nice to get the two way gcm stuff to work, but I am not sure there are any gems that handle that, and I am not qualified to handle a task like that :)
I would say it's the right call: Google Cloud Messaging for Android
From the site Android Developer:
This could be a lightweight message telling your app there is new data
to be fetched from the server (for instance, a movie uploaded by a
friend), or it could be a message containing up to 4kb of payload data
(so apps like instant messaging can consume the message directly).
In this case you don't want to fetch data from the server but you want to send them.
You can send them in different ways. I would suggest, since you are learning, to try a RESTful solution using one of the implementation of JAX-RS.
As a short and direct answer for beginner : GCM (Google Cloud Messaging) would solve your issue. However, if your app turned out to be something bigger, other more technical and complicated solutions are present too.
see this link.

SMS Based Application How To

I would like to develop an application which users interact with on an sms platform. Its more of an experiment to learn something new. Any pointers on technology to study and things to look at as pre-requisites before diving in? Thanks
First, you'll need a device that can act as a wireless modem to provide you with a connection for the gateway. If your cellphone supports tethering and you have an SMS plan, it would be pretty easy to use that. Otherwise you'll need to get a modem and a plan to go with it. I'm not sure how close to the metal you want to get, but you can then use SMSLib to listen on the device and wait for incoming messages. With this setup you can both send and receive messages. It is also possible to use something like Minicom to send commands directly to the modem for experimenting.
As another approach, you could also use a vendor such as Clickatell as an API for interacting with an SMS gateway. They seem to be able to handle both sending and receiving SMS on behalf of their clients.
You can easily do this with something like Twilio (where I work). Here is a howto for sending/receiving in PHP using just HTTP POST requests: http://www.twilio.com/docs/quickstart/sms/

Send sms from java servlet to cell phone

I want to create an application which send sms from java servlet to mobile device, it's my first time to make like this application.
I found many APIs that supports this feature, actually they confuse me, so I choose one tutorial and follow it,
here's the link of the tutorial http://www.visualgsm.com/tutorial010_send_sms_java.htm
I download VisualGSM Enterprise Server (SMS Gateway) and run it, try to make the steps as mentioned, step 3 in example 2 doesn't work.
I want to know, whether I can make real testing for sending sms? Can I receive an sms on my own cell phone??
what is the best way to send sms? I really confused :(
There's 2 ways to do this: via modem or via API service.
There are various services which provide a gateway to the carriers as a service. They are called aggregators. A few industrial grade ones are mobile messenger and ericsson other consumer grade aggregators are http://www.twilio.com/sms/.

Categories