Wiki

Web SIP client for Asterisk

Setup a browser web sip phone for Asterisk

The Mizu web phone can be used as a web sip client for Asterisk (and all it's clones such as FreePBX) so you can make call trough Asterisk from any browser.
Think about it as a normal SIP softphone, but with the following differences:

you need to deploy it to your web server (just copy the webphone folder to your website, change a few settings such as your SIP server address and refer to it from your html)

runs from browsers, so users will not have to install any softphone

settings can be provided in a file hosted on your webserver (webphone_api.js)

you can also implement any kind of logic or create your custom web sip client solution using its JavaScript API

A public IP address is highly recommended to avoid complicated NAT scenarios.

Setup Asterisk with a webphone extension

Configure an extension exactly the same way as you do for other endpoints such as a softphone.
Go to the directory where the configuration files are located: cd /etc/asterisk

Configure a Web SIP channel for Asterisk 11 and previous
You need to use chan_sip.
In file sip.conf:

Deploy the SIP Web Phone for Asterisk
Copy the webphone folder to your webserver and refer it from your html (for example from your main page) or use one of the html's from the webphone folder in your browsers by specifying its exact URL.Note1: You must set the webphonebasedir parameter if the html from where you refer to the webphone is not inside the webphone directory!
Note2: You might have to enable the .jar, .exe, .swf, .dll, .so and .dylib mime types in your webserver if not enabled by default (these files might be used in some circumstances depending on the client OS/browser).
Note3: If you wish to use (also) the WebRTC engine then your site should be secured (HTTPS with a valid SSL certificate). Latest Chrome and Opera requires secure connection for both your website (HTTPS) and websocket (WSS). If your website doesn’t have an SSL certificate then we can host the webphone for you for free.
Alternatives:
o You can also test it without a webserver by launching the html files from your desktop, although some engines might not work correctly this way
o You can also test it by using the online demo hosted by Mizutech website, but in this case you will not be able to change the configuration (you can still set any parameters from the user interface or from URL)
For more details see the webphone documentation.

Note: username/password can be also requested at runtime and entered by the enduser.

Launch the web client:
Launch your browser and open the html from where you are referring to the webphone or one of the html's from the webphone directory.
For example: http://yourdomain.com/webphone/techdemo_example.html
The web sip client should register automatically and you are now ready to:

accept incoming calls

make calls to other softphones or outbound calls to landline/mobile (if your Asterisk has an outbound channel)

send chat, make video calls, file transfer and others

implement your custom app logic using the webphone JavaScript API

Troubleshooting:
If the webphone can't register/connect or cannot make calls, first find out if the problem is with Asterisk or with the webphone.
Make a test call with some third-party softphone (for example X-Lite) and if this doesn't work, then the problem is with Asterisk setup. Otherwise the problem is with the webphone configuration.

For Asterisk:

watch the CLI, check the logs

make sure to set the CLI verbosity level to at least three while you reboot the phone