URL Scheme for Phone Call - url

Much like the "mailto" URL prefix launches the user's default mail program and starts a new email with specified address, is there a similar URL scheme that would initiate a phone call? Perhaps "phone," "call," or "sip"?
Incidentally, I'm targeting a platform that is using Cisco CUPS, so there may be a platform-specific way for me to initiate a call that is particular to Cisco, but I thought I'd ask the more general question first. However if anyone knows specifically how to programmatically initiate a call via CUPS, that would be great too.

The official standard for providing a telephone number as a URI is here: http://www.ietf.org/rfc/rfc3966.txt
It basically says use tel: as the prefix, and start the number with +[international dialling code] before the number itself. You can put non-numeric characters as separators (e.g. -) but they must be ignored. So a London (UK) number might be:
tel:+44-20-8123-4567
A New York (US) number:
tel:+1-212-555-1234

There is such a URI scheme: tel. It has an elaborate syntax, but here is a simple example of its usage:
tel:123-4567
For the full specification, refer to http://www.ietf.org/rfc/rfc3966.txt .

I'm after the same sort of functionality for Microsoft Office Communicator. After a bit of investigation I found that the following URI syntax will initiate a (VoIP) phone call via communicator:
tel:+number
eg: to get communicator to call my extension:
tel:+7780

sip: (or sips:) is the official URI scheme for SIP, and I think callto: was used by Skype, but is deprecated.

Related

What does this steam-desktop shortcut URL steam:// mean

How do steam-desktop shortcuts steam:// actually work?
The URL / target of them is something like: "steam://rungameid/717"
I know similar things like "ftp://mynetworkadress:1337/subfoldercontainsgoodstuff" or for sure "http://".
But why and how does this steam thing work, can you do something similar on your own (e.g. "niceapp://launchprocess/param") and if so, why would you?
steam:// is the Steam browser protocol, i.e. a proprietary URL handler.
The official documentation is at Valve Software.
An article by PCWorld on the Steam URL protocol and potential security threats can be found here:
When the Steam client is installed on a system, it registers itself as a steam:// URL protocol handler. This means that every time a user clicks on a steam:// URL in a browser or a different application, the URL is passed to the Steam client for execution.
But why and how does this steam thing work, can you do something similar on your own
Yes. You can implement anything on your own.
The URI format is basically:
<protocol>:<arguments>
Some protocols such as http and ftp accept URL as argument. However the argument for any arbitrary protocol does not have to be a URL. For example, the magnet: protocol used by Bittorrent does not use a URL instead it describes the torrent and the torrent hash.
As you have experienced, browsers support some protocols built in. This includes http and ftp as well as custom protocols such as about:config in Firefox and chrome://settings in Google Chrome to display the settings page.
If a browser encounters a protocol that it does not understand it will ask you what program you want to open the link with. It will then tell the OS to run that program and pass the argument as a command-line argument to that program. This is how you can get the browser to open steam: link in Steam or a magnet: link in a torrent client.
It used to be that you can type any protocol in the browser's URL bar and trigger this behavior. However, modern browsers also use the same input as a search bar so typing in protocol:argument manually these days will more likely trigger a Google search. But links still work as they used to.

Pass extension from Twilio to Asterisk

I am using twilio to manage our IVR, to handle SMS, and for a few other things. After a user calls and goes through the IVR (for example they press 2 for sales or they say they want extension 205) I need it to hand off to Asterisk.
Setting up the trunk isn't my issue. I need to somehow tag it so asterisk knows how to handle the call. If they chose ext 205 on twilio, I need asterisk to automatically ring ext 205.
I am using a minimal version of asterisk basically for sip registration and voicemail and the rest is done by twilio.
Does anyone know if there is a way to do this in code? Or is my best bet to create a different trunk for each extension. That seems like it would get messy.
Correct solution is make IVR on asterisk. This solution also will be MUCH less costly.
But if you really want... On twilio setup via SIP tag
https://www.twilio.com/docs/voice/twiml/sip
set url to sip:0000+exten#your_asterisk_ip
On asterisk setup trunk to twilio server or allowguest=yes and default context to 'goext'
After that goext context something like this
[goext]
exten => _0000XXX,1,Set(ext=${EXTEN:4})
same => n,Dial(SIP/${ext},,o)
0000 replace with some random code, that required for prevent bots calls when allowguest=yes.

Twilio SIP custom headers containing an equal in their value

At the moment, I am successfully sending a call to a SIP extension using Twilio. I know Twilio support passing extra custom SIP headers to the PBX, and I can do it by doing something like this:
sip:jack#example.com?myHeader=blah
and this works well.
But how can I pass a header which contains an equal sign (=) in its value? For example, let's say 'blah', was 'blah=foobar' instead.
I tried with:
sip:jack#example.com?myHeader=blah=foobar
and of course the call didn't reach my PBX.
Please could anyone help me with this?
Thanks a lot!
Fabrizio
You will need to URL encode your value (which you should probably be doing anyway).
An = sign once URL encoded becomes %3D.
So in your example you would need: sip:jack#example.com?myHeader=blah%3Dfoobar
There are various online encoders/decoders and most languages have build in utilities to do this also.
https://www.w3schools.com/tags/ref_urlencode.asp
For posterity, the official positon of Twilio is that they don't support passing a list of parameters as a value for a custom SIP header.
The support engineer who worked with me on this case made a feature request to the engineering team, so hopefully I will soon be able to solve my problem.

Is it mandatory to create a TwiML app in order to receive calls?

Im starting to integrate Twilio into our app and we need to receive the inbound notifications from Twilio. I noticed that I can also set up the webhook url straight into the number.
So, my questions is? which is preferable? Set up the url into the number or direct into the TwiML app? The advantage I see is that I can add parameters straight into the number (One number, one campaign) instead of a single url for all my numbers.
Are there other considerations that I need to take in count?
Twilio developer evangelist here.
It is not mandatory to create a TwiML app to receive calls, you can, as you say, set up a URL for each number you purchase.
TwiML apps do have benefits as you scale. For example, if you have multiple numbers, perhaps from different countries, which all point at the same URL, then using a TwiML app would mean that if you needed to change the URL in the future you could change it one place, not for every number. TwiML apps have the added benefit of a friendly name that you can use to describe what the URL does, rather than trying to guess from the URL itself.
The only downside to using a TwiML app that I can think of is that there is a level of indirection between what your number is doing and you have to go to the TwiML App section of the console when you are actively setting it up and experimenting.
My advice is that for short term experiments or work with single numbers to just use a URL and as you scale, move that to a TwiML app so that you can reap the benefits.
Let me know if that helps at all.

Rails connect to Asterisk and make phone calls

Hi i have googled all day long but i can't find an answer.
I have to write a web app which talks to asterisk.
It should be able to do ClicktoCall operations.
Can you guys recommend something ?
I came across a few projects but I'm still not sure.
I just want to connect to Asterisk and do calls from the web app.
thanks
If you're a Ruby programmer the best way for you to hook into Asterisk is adhearsion. It wraps up Asterisk's AGI and Manager (MAPI) APIs for you.
Also hAve a look at SIP, asterisk, adhearson and VoIP and in particular Adam Kalsey's answer. He works for Tropo which sponsor the adhearsion project.
First you need to know, that the protocol Asterisk uses is SIP, you can learn more at the Wikipedia.
Since you want to use an rails application, you may want to use ruby as well, so there's a ruby implementation named OverSip, you can check their API and see if it fits your requirements.
If you are aiming at web calls, you'll need an WebRTC, Flash or Java applet. For WebRTC you can check sipML5 for an opensource solution.
You can also opt for an interface, that will start a call from one number to another, using your phone. When the first call is picked up the server starts ringing in the destination.
Also you could make use of cloud communications providers like twilio, tropo, etc.
Try this Google search:
rails asterisk manager interface
I saw some interesting things right off. I am not trying to be one if those Use Google type people, just didn't want to paste all the links in that I found from this Google search.
Check it out, hope it helps.
There are several ways to do this but the three easiest ones are
1. Generate a call file on the Asterisk server
These files should be written to the dir
/var/spool/asterisk/outgoing
Asterisk will then pickup the file, process and delete it.
It's pretty aggressive when doing this so it's recommended to write the file into a temporary directory and then move it to the spool dir for processing.
An tutorial of the file format is here:
https://www.voip-info.org/asterisk-auto-dial-out/
(I personally feel this is a bit "hacky", and prefer doing it with an API call)
2. Generate the call by the AMI API interface.
Use the Originate function of the AMI API to generate the call. It's pretty easy to set this up just configure the manager.conf file whitch sets up a HTTP server on port 5038 from witch you can call the API.
https://www.voip-info.org/asterisk-config-managerconf/
3. Set up the call using the ARI API
First you need to setup ari.conf, this is enough for now:
[general]
enabled = yes
pretty=yes
allowed_origins=http://ari.asterisk.org
[my_username]
type = user
read_only = no
password = my_password
password_format = plain
This is a little bit more complicated to set up, but it really isn't that hard if you just get past the technical geek-speak. Just set up two channels, setup a mixing bridge and add both channels to the bridge.
To set up a click2call you dont even need to do that...
This is the call we use (ruby):
where
#{sip_id} is your registered SIP username
#{number} is the extension that is sent to the dialplan
#{USERNAME}
#{PASSWORD} is from ari.conf
HTTParty.post("http://sipserver.com/ari/channels?endpoint=SIP/#{sip_id}&extension=#{number}&context=outgoing&priority=1&timeout=30&api_key=#{USERNAME}:#{PASSWORD}")
(Note that you need to send the variabels for the variable parameter as a separate JSON for the originate command if you need to send them)
A really useful tool to understand how this works is the swagger at
http://ari.asterisk.org. We already allowed this origin in ari.conf so it should be ready to go. Remember to open your ports in firewalls etc.
Setup your Server IP and port and the API_KEY is in this format: my_username:my_password

Resources