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:
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: [general] context=default [7001] type=friend context=from-internal host=dynamic secret=xxx disallow=all allow=ulaw,opus,vp8,h264 dtmfmode=info nat=yes More help: https://www.asteriskguru.com/tutorials/asterisk_voip_ipphone.html https://www.voip-info.org/wiki/view/Asterisk+config+sip.conf Configure a Web SIP channel for Asterisk 12 and beyond New versions of Asterisk uses chan_pjsip by default. In file pjsip.conf: [transport-udp] type=transport protocol=udp bind=0.0.0.0 [7001] type=endpoint context=from-internal disallow=all allow=ulaw,opus,vp8,h264 dtmfmode=info auth=7001 aors=7001 nat=yes [7001] type=auth auth_type=userpass password=xxx username=7001 nat=yes [7001] type=aor max_contacts=1 More help: https://wiki.asterisk.org/wiki/display/AST/Registering+Phones+to+Asterisk https://zadarma.com/en/support/instructions/asteriskpjsip/ Start or restart Asterisk Start: asterisk -cvvvvv Restart: asterisk -rx "core restart now" asterisk -rvvvvv 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. Configure the Web Phone for Asterisk: In the webphone_config.js enter the following settings: webphone_api.parameters = { serveraddress: 'ASTERISK_IP_OR_DOMAIN', username: '7001', sippassword: 'xxx', loglevel: 5, }; 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:
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:
For Webphone:
Note about WebRTC: To take full advantage of the new WebRTC technologies, you can use a WebRTC to SIP gateway or configure the built-in WebRTC in your Asterisk.
Web SIP client for Asterisk