Webphone Documentation
Webphone Documentation
Webphone Documentation
Mizu WebPhone
Cross-Platform SIP for browsers
Mizu-WebSIPPhone is a standard based VoIP client running from browsers as a ready to
use softphone or usable as a JavaScript library. Based on the industry standard SIP
protocol, it is compatible with all common VoIP devices.
Version 2.3
Mizutech
8/7/2017
Contents
About .............................................................................................................................................................................................................................3
Usage .............................................................................................................................................................................................................................3
Steps.......................................................................................................................................................................................................................3
Web Softphone ......................................................................................................................................................................................................4
Click-to-call.............................................................................................................................................................................................................4
Developers .............................................................................................................................................................................................................5
Designers................................................................................................................................................................................................................5
Features, technology and licensing ................................................................................................................................................................................5
Feature list .............................................................................................................................................................................................................5
Requirements .........................................................................................................................................................................................................6
Technical details.....................................................................................................................................................................................................6
Licensing ................................................................................................................................................................................................................8
Integration and customization.......................................................................................................................................................................................9
Concepts.................................................................................................................................................................................................................9
User interface Skin/Design ...................................................................................................................................................................................10
Web Dialer/Softphone .........................................................................................................................................................................................11
Click to call ...........................................................................................................................................................................................................11
Custom solutions ..................................................................................................................................................................................................14
Integration with web server side applications .....................................................................................................................................................14
Development ........................................................................................................................................................................................................16
Parameters ..................................................................................................................................................................................................................17
SIP account settings .............................................................................................................................................................................................18
Engine related settings ........................................................................................................................................................................................20
Call divert and other settings ...............................................................................................................................................................................29
User interface related settings .............................................................................................................................................................................34
Parameter security ...............................................................................................................................................................................................39
JavaScript API ...............................................................................................................................................................................................................40
About .......................................................................................................................................................................................................................40
Basic example ..........................................................................................................................................................................................................40
Functions ..................................................................................................................................................................................................................41
Events .......................................................................................................................................................................................................................48
FAQ ..............................................................................................................................................................................................................................53
Resources .....................................................................................................................................................................................................................80
About
The Mizu WebPhone is a universal SIP client to provide VoIP capability for all browsers using a variety of technologies compatible with most OS/browsers. Since
it is based on the open standard SIP and RTP protocols, it can inter-operate with any other SIP-based network, allowing people to make true VoIP calls directly
from their browsers. Compatible with all SIP softphones (X-Lite, Bria, Jitsi others), devices (gateways, ATAs, IP Phones, others), proxies (SER, OpenSIPS, others),
PBX (Asterisk, Elastix, Avaya, 3CX, Broadsoft, Alcatel, NEC, others), VoIP servers (Mizu, Voipswitch, Cisco, Huawei, others), service providers (Vonage, others) and
any SIP capable endpoint (UAC, UAS, proxy, others).
The Mizu WebPhone is truly cross-platform, running from both desktop and mobile browsers, offering the best browser to SIP phone functionality in all
circumstances, using a variety of built-in technologies referred as engines:
NS (Native Service/Plugin)
WebRTC
Java applet
Flash
App
P2P/Callback
Native Dial
The engine to use is automatically selected by default based on OS, browser and server availability (It can be also set manually from the configuration or
priorities can be changed). This multi-engine capability has considerable benefits over other naive implementations.
The webphone can be used with the provided user interface (as a ready to use softphone or click to call button) or as a JavaScript library via its API.
The provided user interfaces are implemented as simple HTML/CSS and can be fully customized, modified, extended or removed/replaced.
Usage
The webphone is an all-in-one VoIP client module which can be used as-is (as a ready to use softphone or click to call) or as a JavaScript library (to implement any
custom VoIP client or add VoIP call capabilities to existing applications). You can create custom VoIP solutions from scratch with some JavaScript knowledge or
use it as a turn-key solution if you dont have any programming skills as the webphone is highly customizable by just changing its numerous settings.
Steps
1. Download
The package can be downloaded from here: webphone download.
It includes everything you need for a browser to SIP solution: the engines, the JavaScript API, the skins and also a few usage examples.
2. Deploy
You can find the requirements here which need to be fulfilled to be able to use the webphone.
Unzip and copy the webphone folder into your webserver and refer it from your html (for example from your main page) or open one of the included html in
your browsers by specifying its exact URL.
For example: http://yourdomain.com/webphone/samples/techdemo_example.html or http://yourdomain.com/webphone/softphone.html .
Note1: You might have to enable the .jar, .exe, .swf, .dll, .so, .pkg, .dmg 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).
Note2: 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 doesnt have an SSL certificate then we can host the webphone for you for free or you can install a cheap or free
certificate.
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)
3. Integrate
The webphone can be used as a turn-key ready to use solution (just refer to it from your HTML) or as a Java-Script library to develop custom software.
There are multiple ways to use it:
o Use one of the supplied templates (the softphone or the click to call) and customize it after your needs. You can place one of them as an iframe or
div to your website
o Integrate the webphone with your webpage, website or web application
o Integrate the webphone with your server side application (if you are a server side developer)
o Create your custom solution by using the webphone as a JavaScript library (if you are a JavaScript developer)
4. Settings
The webphone has a long list of parameters which you can set to customize it after your needs.
You can set these parameters multiple ways (in the webphone_api.js file, pass by URL parameter or via the setparameter() API).
If you are using the webphone with a SIP server (not peer to peer) then you must set at least the serveraddress parameter.
The easiest way to start is to just enter the required parameters (serveraddress, username, password and any other youm might wish) in the webphone_api.js
file.
5. Design
If you are a designer then you might create your own design or modify the existing HTML/CSS. For simple design changes you dont need to be a designer.
Colors, branding, logo and others can be specified by the settings for the supplied softphone and click to call skins.
Mizutech can also supply a ready to use pre-customized build of the softphone skin with your settings and branding for no extra cost (ask for it).
Please note that the webphone also works without any GUI.
6. Launch
Launch one of the examples (the html files in the webphone folder) or your own html (from desktop by double clicking on it or from browser by entering the
URL). You might launch the index.html to see the included templates.
At first start the webphone might offer to enable or download a native plugin if no other suitable engine are supported and enabled by default in your browser.
It will also ask for a SIP username/password if you use the default GUI and these are not preset.
On init, the webphone will register (connect) to your VoIP server (this can be disabled if not needed).
Then you should be able to make calls to other UA (any webphone or SIP endpoint such as X-Lite or other softphone) or to pstn numbers (mobile/landline) if
outbound call service is enabled by your server or VoIP provider.
More details:
Webphone file list
Customization
How it works?
Quick webphone tutorial
Web Softphone
The webphone package contains a ready to use web softphone.
Just copy the webphone folder to your webserver and change the serveraddress setting in the in webphone_api.js file to your SIP server IP or domain to have a
fully featured softphone presented on your website. You can just simply include (refer to) the softphone.html via an iframe (this way you can even preset the
webphone parameters in the iframe URL) div or on demand.
Note: you might have to enable the following mime types in your web server if not enabled by default: .jar, .swf, .dll, .dylib, .so, .pkg, .dmg, .exe
The web softphone can be configured via URL parameters or in the "webphone_api.js" file, which can be found in the root directory of the package. The most
important configuration is the serveraddress parameter which should be set to your SIP server IP address or domain name. More details about the parameters
can be found below in this documentation in the Parameters section.
We can also send you a build with all your branding and settings pre-set: contact us.
Check here for more options.
Click-to-call
The webphone package contains a ready to use click to call solution.
Just copy the whole webphone folder to your website, set the parameters in the webphone_api.js file and use it from the click2call.html.
Rewrite or modify after your needs with your custom button image or you can just use it via a simple URI or link such as:
http://www.yourwebsite.com/webphonedir/click2call.html?wp_serveraddress=YOURSIPDOMAIN&wp_username=USERNAME&wp_password=PASSWORD&wp_
callto=CALLEDNUMBER&wp_autoaction=1
You can find more details in the click to call section.
Developers
Developers can use the webphone as a JavaScript library to create any custom VoIP solution integrated in any webpage or web application.
Just include the "webphone_api.js" to your project or html and start using the webphone API.
Note: You can adjust the webphone behavior also without any development knowledge by just modifying its settings in Parameters section at the top at the
webphone_api.js file.
Designers
If you are a designer, you can modify all the included HTML/CSS/images or create your own design from scratch using any technology that can bind to JS such as
HML5/CSS, Flash or others.
For simple design changes you dont need to be a designer. Colors, branding, logo and others can be set by the settings.
See the User Interface Skin/Design section for more details.
Note: If you are using the built-in softphone or click2call skins, then you can adjust them also without any designer knowledge by just modifying its user interface
settings in Parameters section at the top at the webphone_api.js file.
Feature list
Standard SIP voice calls (in/out), video, chat, conference and others (Session Initiation Protocol)
Maximum browsers compatibility. Runs in all browsers with Java, WebRTC or native plugin support (Chrome, Firefox, IE, Edge, Safari, Opera)
Includes several different technologies to make phone calls (engines): Java applet, WebRTC, NS (Native Service or Plugin), Flash, App, Native and server
assisted conference rooms, P2P and callback
SIP and RTP stack compatible with any standard VoIP servers and devices like Cisco, Voipswitch, Asterisk, softphones, ATA and others
Transport protocols: UDP, TCP, HTTP, RTMP, websocket (uses UDP for media whenever possible)
Encryption: SIPS, TLS, DTLS, SRTP, end to end encryption for webphone to webphone calls
NAT/Firewall support: auto detect transport method (UDP/TCP/HTTP), stable SIP and RTP ports, keep-alive, rport support, proxy traversal, auto
tunneling when necessary, ICE/STUN/TURN protocols and auto configuration, firewall traversal for corporate networks, VoIP over HTTP/TCP when
firewalls blocks the UDP ports with full support for ICE TCP candidates
Works over the internet and also on local LANs (perfectly fine to be used with your own internal company PBX)
RFCs: 2543, 3261, 7118, 2976, 3892, 2778, 2779, 3428, 3265, 3515, 3311, 3911, 3581, 3842, 1889, 2327, 3550, 3960, 4028, 3824, 3966, 2663, 6544,
5245 and others
Supported methods: REGISTER, INVITE, re-INVITE, ACK,PRACK, BYE, CANCEL, UPDATE, MESSAGE, INFO, OPTIONS, SUBSCRIBE, NOTIFY, REFER
Audio Codec: PCMU, PCMA, G.729, GSM, iLBC, SPEEX, OPUS (including wide-band HD audio)
Video codec: H.263, H.264 and VP8 for WebRTC only
SIP compatible codec auto negotiation and adjustment (for example G.729 - wideband or WebRTC G.711 to G.729 transcoding if needed)
Video calls (for all WebRTC enabled browsers)
Screen-sharing (beta)
Call divert: rewrite, redial, mute, hold, transfer, forward, conference and other PBX features
Call park and pickup, barge-in (with NS)
Voice call recording
IM/Chat (RFC 3428), SMS, file transfer, DTMF, voicemail (MWI)
Multi-line support
Multi account support
Contacts: management, synchronization, flags, favorites, block, auto prioritization
Presence (DND/online/offline/others) via standard SIP PUBLISH/SUBSCIBE/NOTIFY
Balance display, call timer, inbound/outbound calls, caller-id display
High level JavaScript API: web developers can easily build any custom VoIP functionality using the webphone as a JS library
Stable API: new releases are always backward compatible so you can upgrade with no changes in your code
Integration with any website or application including simple static pages, apps with client side code only (like a simple static page) or any server side
stack such as PHP, .NET, java servlet, J2EE, Node.js and others (sign-up, CRM, callcenter, payments and others)
Phone API accessible from any JavaScript framework (such as AngularJS, React, jQuery and others) or from plain/vanilla JS or not use the JS API at all
Branding and customization: customizable user interface with your own brand, skins and languages (with ready to use, modifiable themes)
Flexibility: all parameters/behavior can be changed/controlled by URL parameters, preconfigured parameters, from javascript or from server side
Requirements
Server side:
Any web hosting for the webphone files (any webserver is fine: IIS, nginx, Apache, NodeJS, Java, others; any OS: Windows, Linux, others).
Chrome and Opera requires secure connection for WebRTC engine to work (otherwise this engine will be automatically skipped). We can also host the
webphone for free if you wish on secure http. Note that the web phone itself doesnt require any framework, just host it as static files (no PHP, .NET,
JEE, NodeJS or similar server side scripting is required to be supported by your webserver, however you are free to integrate the webphone with any
such server side stacks if you need so)
At least one SIP account at any VoIP service provider or your own SIP server or IP-PBX (such as Asterisk, Voipswitch, 3CX, FreePBX, Trixbox, Elastix, SER,
Cisco and others)
Optional: WebRTC capable SIP server or SIP to WebRTC gateway (Mizutech free WebRTC to SIP service is enabled by default. The webphone can be
used and works fine also without WebRTC, however if you prefer this technology then free software is available and Mizutech also offers WebRTC to
SIP gateway (free with the Advanced license) and free service tier. Common VoIP servers also has built-in WebRTC support nowadays)
Client side:
Any browser supporting WebRTC OR Java OR native plugins with JavaScript enabled (most browsers are supported)
Audio device: headset or microphone/speakers
Compatibility:
OS: Windows (XP,Vista,7,8,10) , Linux, MAC OSX, Android, iOS (app only), BlackBerry, Chromium OS and others
Browsers: Firefox, Chrome, IE (6+), Edge, Safari, Opera and others
Different OS/browser might have different compatibility level depending on the usable engines. For example the rarely used Flash engine doesnt
implement all the functionalities of the WebRTC/Java/NS engines (these differences are handled automatically by the webphone API)
If you don't have an IP-PBX or VoIP account yet, you can use or test with our SIP VoIP service.
Server address: voip.mizu-voip.com
Account: create free VoIP account from here or use the following username/passwords: webphonetest1/webphonetest1,
webphonetest2/webphonetest2 (other people might also use these public accounts so calls might be misrouted)
Technical details
The goal of this project is to implement a VoIP client compatible with all SIP servers, running in all browsers under all OS with the same user interface and API. At
this moment no technology exists to implement a VoIP engine to fulfill these requirements due to browser/OS fragmentation. Also different technologies have
some benefits over others. We have achieved this goal by implementing different VoIP engines targeting each OS/browser segment. This also has the
advantage of just barely run a VoIP call, but to offer the best possible quality for all environments (client OS/browser). All these engines are covered by a single,
easy to use unified API accessible from JavaScript. To ease the usage, we also created a few different user interfaces in HTML/JS/CSS addressing the most
common needs such as a VoIP dialer and a click to call user interface.
Each engine has its advantages and disadvantages. The sip webphone will automatically choose the best engine based on your preferences, OS/Browser/server
side support and the enduser preferences (this can be overridden by settings if you have some special requirements): VoIP availability in browsers.
Engines
NS
Our native VoIP engine implemented as a native service or browser plugin. The engine works like a usual SIP client, connecting directly from client PC to your SIP server, but it is fully
controlled from web (the client browser will communicate in the background with the native engine installed on the client pc/mobile device, thus using this natively installed
sip/media stack for VoIP).
Pros:
All features all supported, native performance
Cons
Requires install (one click installer)
WebRTC
A new technology for media streaming in modern browsers supporting common VoIP
features. WebRTC is a built-in module in modern browsers which can be used to
implement VoIP. Signaling goes via websocket (unencrypted or TLS) and media via
encrypted UDP (DTLS-SRTP). These are then converted to normal SIP/RTP by the VoIP
server or by a gateway.
Pros:
Comfortable usage in browsers with WebRTC support because it is has no
dependencies on plugins
Cons:
It is a black-box in the browser with a restrictive API
Lack of popular VoIP codec such as G.729 (this can be solved by CPU intensive
server side transcoding)
A WebRTC to SIP gateway may be required if your VoIP server dont have built-
in support for WebRTC (there are free software for this and we also provide a
free service tier, included by default)
Flash
A browser plugin technology developed by Adobe with its proprietary streaming protocol
called RTMP.
Pros:
In some old/special browsers only Flash is available as a single option to
implement VoIP
Cons:
Requires server side Flash to SIP gateway to convert between flash RTMP and
SIP/RTP (we provide free service tier)
Basic feature set
Java Applet
Based on our powerful JVoIP SDK, compatible with all JRE enabled browsers. Using the
Java Applet technology you can make SIP calls from browsers the very same way as a
native dialer, connecting directly from client browser to SIP server without any
intermediary service (SIP over UDP/TCP and RTP over UDP).
Pros:
All SIP/media features are supported, all codecs including G.729, wideband and custom extra modules such as call recording
Works exactly as a native softphone or ip phone connecting directly from the user browser to your SIP capable VoIP server or PBX (but with your user interface)
Cons:
Java is getting deprecated by modern browsers (handled automatically by the webphone by just choosing another available engine)
Some browsers may ask for user permission to activate the Java plugin
App
Some platforms dont have any suitable technology to enable VoIP in browsers (a minor percentage, most notably iOS/Safari). In these cases the webphone can offer to the user to
install a native softphone application. The apps are capable to fully auto-provision itself based on the settings you provide in your web application so once the user installs the app
from the app store, then on first launch it will magically auto-provision itself with most of your settings/branding/customization/user interface as you defined for the webphone
itself.
Pros:
Covering platforms with lack of VoIP support in browsers (most notable: iOS Safari)
Cons:
No API support. Not the exactly same HTML user interface (although highly customized based on the settings you provided for the webphone)
These are treated as a secondary (failback) engines and used only if no other engines are available just to be able to cover all uncommon/ancient devices with lack of support for all
the above engines which is very rare. However it might be possible that these fits into your business offer and in that case you might increase their priority to be used more
frequently.
Native Dial
This means native calls from mobile using your mobile carrier network. This is a secondary engine to failback to if no any VoIP capabilities were found on the target platform or
there is no network connection. In these circumstances the webphone is capable to simply trigger a phone call from the user smartphone if this option is enabled in the settings.
Rarely used if any.
The most important engines are: Java, WebRTC, NS and Flash. The other engines are to provide support for exotic and old browsers maximizing the coverage for all OS/browser
combinations ensuring that enduser has call capabilities regardless of the circumstances.
API
All the above engines are covered with an easy to use unified Java Script API, hiding all the differences between the engines as described below in the JavaScript API section.
GUI
The webphone can be used with or without a user interface.
The user interface can be built using any technology with JS binding. The most convenient is HTML/CSS, but you can also use any others such as Flash.
The webphone package comes with a few prebuilt feature rich responsive user interfaces covering the most common usage such as a full featured softphone user interface and a
click to call implementation. You are free to use these as is, modify them after your needs or create your own from scratch. For more details check the User interface Skin/Design
section.
Licensing
The webphone is sold with unlimited client license (Advanced and Gold) or restricted number of licenses (Basic and Standard). You can use it with any VoIP
server(s) on your own and you can deploy it on any webpage(s) which belongs to you or your company. Your VoIP server(s) address (IP or domain name) and
optionally your website(s) address will be hardcoded into the software to protect the licensing. You can find the licensing possibilities on the pricing page. After
successful tests please ask for your final version at [email protected]. Mizutech will deliver your webphone build within one workday after your
payment.
Release versions dont have any limitations (mentioned below in the Demo version section) and are customized for your domain(s). All mizu and mizutech
words and links are removed so you can brand it after your needs (with your company name, brand-name or domain name), customize and skin (we also provide
a few skin which can be freely used or modified).
Your final build must be used only for you company needs (including your direct sip endusers, service customers or integrated in your software).
Title, ownership rights, and intellectual property rights in the Software shall remain with MizuTech.
The agreement and the license granted hereunder will terminate automatically if you fail to comply with the limitations described herein. Upon termination, you
must destroy all copies of the Software. The software is provided "as is" without any warranty of any kind. You must accept the software SLA before to use the
webphone.
You may:
Use the webphone on any number of computers, depending on your license
Give the access to the webphone for your customers or use within your company
Offer your VoIP services via the webphone
Integrate the webphone to your website or web application
Use the webphone on multiple webpages and with multiple VoIP servers (after the agreement with Mizutech). All the VoIP servers must be
owned by you or your company. Otherwise please contact our support to check the possibilities
You may not:
Resell the webphone as is
Sell webphone services for third party VoIP providers and other companies usable with any third-party VoIP servers (except if coupled with
your own VoIP servers)
Resell the webphone or any derivative work which might compete with the Mizutech webphone software offer
Reverse engineer, decompile or disassemble or modify the software in any way except modifying the settings and the HTML/CSS skins or the
included JavaScript examples
Note: It is perfectly fine to sell or promote it as a webphone service if that is tied to your own SIP servers. But if you sell it as webphone software which can be used with any server
than you are actually selling the same as Mizutech and this is not allowed by the license.
Demo version
The downloadable demo version can be used to try and test before any purchase. The demo version has all features enabled but with some restrictions to
prevent commercial usage. The limitations are the followings:
maximum 10 simultaneous webphone at the same time
will expire after several months of usage (usually 2 or 3 months)
maximum ~100 sec call duration restriction
maximum 10 calls / session limitation. (After ~10 calls you will have to restart your browser)
will work maximum ~20 minutes after that you have to restart it or restart the browser
can be blocked from Mizutech license service
In short: the demo version can be used for all kind of tests or development, but it cant be used for production.
Note: for the first few calls and in some circumstances the limitations might be weaker than described above, with fewer restrictions.
On request we can also provide test builds with only trial period limitation (will expire after ~3 weeks of usage) and without the above demo limitations.
See the pricing and order your licensed copy from here.
Concepts
The webphone can be customized by its numerous settings, webphone APIs and by changing its HTML/CSS.
Deploy:
The webphone can be deployed as a static page (just copy the webphone file to your website), as a dynamic page (with dynamically generated settings) or used
as a JavaScript VoIP library by web developers. You can embed the webphone to your website in a div, in an iFrame or on demand, as a module or as a separate
page. The webphone settings can be set also by URL parameters so you can just launch it from a link with all the required settings specified.
VoIP platform:
All you need to use the webphone is a SIP account at any VoIP service provider or your own softswitch/IP-PBX.
Free SIP accounts can be obtained from numerous VoIP service providers or you can use our service. (Note that free accounts are free only for VoIP to VoIP calls.
For outbound pstn/mobile you will need to top-up your account).
If you wish to host it yourself then you can use any SIP server software. For example FreePBX for linux or the advanced / free VoIP server for windows by
Mizutech. We can also provide our WebRTC to SIP gateway (for free with the Advanced or Gold license) if your softswitch dont have support for WebRTC and
you need a self-hosted solution.
Technical settings:
The most important parameter that you will need to set is the serveraddress which have to be set to the domain or IP:port of your SIP server.
If you wish, you might change also other sip account, call-divert or VoIP engine related settings after your needs.
Integration:
You can integrate the webphone with your web-site or web-application:
-using your own web server API
-and/or using the webphone client side JavaScript API to insert any business logic or AJAX call to your server API
The webphone library doesnt depend on any framework (as it is a pure client side library) but you can integrate it with any server side framework if you wish
(PHP, .NET, NodeJS, J2EE or any server side scripting language) or work with it only from client side (from your JavaScript).
On the client side you can use the webphone API from any JavaScript framework (such as AngularJS, React, jQuery and others) or from plain/vanilla JS or not use
the JS API at all.
Design
You can completely change any of the included skins (click to call button, softphone), or change the softphone colors or create your user interface from scratch
with your favorite tool and call the webphone API from there.
Custom application:
For deep changes or to create your unique VoIP client or custom application you will need to use the JavaScript API.
See the development section for more details.
Branding:
Since the webphone is usually used within your website context, your website is already your brand and no additional branding is required inside the webphone
application itself. However the softphone skin (if you are using this turn-key GUI) has its own branding options which can be set after your requirements.
Additionally you can change the webphone HTML/CSS design after your needs if more modifications are required.
On request, we can send your webphone build already preconfigured with your preferences.
For this just answer the points from the voip client customization page (as many as possible) and send to us by email. Then we will generate and send your
webphone build within one work-day. All the preconfigured parameters can be further changed by you via the webphone settings.
Of course, this is relevant only if you are using a skin shipped with the webphone, such as the softphone.html. Otherwise you can create your custom solution
using the webphone library with your unique user interface or integrate into your existing website.
The webphone is shipped with a few ready to use open source user interfaces such as a softphone and click to call skins. Both of
these can be fully customized or you can modify their source to match your needs. You can also create any custom user interface
using any technique such as HTML/CSS and bind it to the web phone javascript API.
The default user interface for the softphone and other included apps can be easily changed by modifying parameters or changing
the html/css. For simple design changes you dont need to be a designer. Colors, branding, logo and others can be set by the
settings parameters.
Also you can easily create your own app user interface from scratch with any tool (HTML/CSS or others) and call the webphone
Java Script API from your code.
In short, there are two ways to achieve your own (any kind of) custom user interface:
A. Use one of the skins provided by the webphone
Here you also have two possibilities:
o Quick customization changing the webphone built-in user-interface related settings (you can change the colors, behaviors and others)
o If you are a web developer, then have a look at the html and JavaScript source code and modify it after your needs (we provide all the source code
for these; it can be found also in the downloadable demo)
B. Create your own user web VoIP user interface and use the webphone as a JavaScript library from there.
The webphone has an easy to use API which can be easily integrated with any user interface. For example from your Call button, just call the webphone
webphone_api.js.call(number) function. Have a look at the samples folder: minimal_example.html, basic_example.html or techdemo_example.html
(You can also use the provided samples as a template to start with and modify/extend it after your needs)
We can also send you a web softphone with your preferred skin. For this just set your customization on the online designer form and send us the parameters.
We can also send you fully customized and branded web softphone with your preferences. For this just send us the customization details.
Advanced skinning
Web developers/designers can easily modify the existing skins or create their own.
For the softphone application all the HTML source code can be found in "softphone.html" file as a single-page application model.
There are a few possibilities to change the skins:
If you need only minor/color changed, then just change the color theme
You might also change the jQuery theme:
The jQuery mobile Theme Roller generated style sheet can be found in this file: "css\themes\wphone_1.0.css".
Current jQuery mobile version is 1.4.2. Using the Theme roller, you can create new styles: http://themeroller.jquerymobile.com/
The style sheet which overrides the "generated" one (in which all the customizations are defined) is "css/mainlayout.css".
You can also manually edit the html and css file with your favorite editor to change it after your needs
Or just create your design with your favorite tools and call the web sip phone API from there
Note: If you are using the webphone as a javascript library then you can customize the choose engine popup in "css\pmodal.css".
The webphone can be positioned on your webpage after your needs. You can put it in a DIV or iFrame control and define any position from HTML of CSS. For
example you can make it floating as described here.
If you have different needs or dont like the default skins, just create your own from scratch and call the webphone JavaScript API from your code. Using the API
you can easily add VoIP call capabilities also to existing website or project with a few function calls as described in the Java Script API section below.
Note: You can quickly test this also from the online demo if you havent downloaded the webphone demo package yet:
https://www.webvoipphone.com/webphone_online_demo/softphone_launch.html (this will launch the very same softphone.html included in the download
package).
If you are a JavaScript developer then you might implement even more modifications by changing the HTML, CSS or JS files (softphone.html, js\softphone files).
We can also ship the webphone with ready to use customized softphone skin (with your branding and settings). For this, just answer the points on this page on
your order and send the answers by email.
Regarding css files, styling, most of these css files in "css" directory are related to jQuery Mobile framework which is used to aid in the build of the Single Page
application and these should not be edited/changed.
All the styling of the webphone skin is defined in "mainlayout.css" and can be customized from here. This css file should be used to change any styling.
Every jQuery mobile "page" defined in softphone.html has a corresponding Javascript file in /softphone/ directory.
Pages in softphone.html are <DIV> elements with the following attribute: data-role="page"
For example settings page's HTML is defined in softphone.html file in a <DIV> element with the id: page_settings. The corresponding Javascript file for the
settings page is: \js\softphone\_settings.js. All these "page view" Javascript files contain a few lifecycle functions which are used to initiate/load/destroy a page.
These are the followings:
onCreate() - these functions are executed once, when the webphone skin is loaded.
Event listeners and other setup tasks can be handled here.
onStart() - these functions are executed every time a "page" is displayed. The data and content of the page can be managed from here.
For example on Contacts page we load and display the contacts list.
onDestroy() - these functions are executed every time when we navigate away from a "page".
Click to call
You can use the webphone library to implement your custom click-to-call solution or use one of the skin templates for click to call.
There are multiple ways to achieve click to call functionality with the sip webphone:
1) Click to call from HTML link via URL parameters (single line copy-paste code into your html)
2) Use the webphone library directly (via its API) to implement any custom click to call solution (for JavaScript developers)
3) Use the click2call template as-is. A click to call skin is shipped with the webphone (click2call.html and related css/js files) as a turn-key click to call
solution which can be used without any development knowledge
4) Modify the click2call template by changing its settings and skin after your needs)
Details:
This will launch the click to call page and will initiate the call automatically. You can find more examples for URL parameters here.
You can also use any other skins for click to call. For example here is with the softphone skin:
https://www.webvoipphone.com/webphone_online_demo/softphone.html?wp_serveraddress=voip.mizu-
voip.com&wp_username=webphonetest1&wp_password=webphonetest1&wp_callto=testivr3&wp_autoaction=1
Configure it after your needs by adjusting (changing and/or adding) the settings in the Configuration parameters section in the click2call.html file. See the
parameters settings for the full list of adjustable settings.
Note: You can quickly test this also from the online demo if you havent downloaded the webphone demo package yet:
https://www.webvoipphone.com/webphone_online_demo/click2call.html
Copy this html element in you page, where you want the click to call button to show up:
<div id="c2k_container_0" title=""><a href="tel://CALLTO" id="c2k_alternative_url">CALLTO</a></div>
The styling can be further customized from click2call.css located in css/click2call/ directory.
Floating button
This click to call button can also be used as a floating button on a web page. The floating related configurations can be found in click2call.js file located in
js/click2call/ folder.
To enable floating, set the "float_button" config to true and specify two direction coordinates for the floating. For example to have a floating button on the top
right corner of your page, located from 100 pixels from the top and 10 pixels from the right:
var float_button = true;
var float_distance_from_top = 100; // floating 100 pixels from the top of the page
var float_distance_from_left = -1;
var float_distance_from_bottom = -1;
var float_distance_from_right = 10; // floating 10 pixels from the right of the page
The floating parameters also apply to the chat window in the same way as for the click to call button.
Floating webphone skin
To float the webphone skin over your web page, just set the following CSS attributes for the container HTML element of the webphone (which can be a DIV or an
iframe):
// this aligns the webphone to the bottom-right corner of you page
style="z-index: 1000; position: fixed; bottom: 0px; right: 0px;"
If you wanted for instance to set it in the top-left corner, then the CSS attributes would be:
style="z-index: 1000; position: fixed; top: 0px; left: 0px;"
Multiple instances
To add more than one click to call button to a page, include the script part in the <head> section once, and copy the container <div> increasing the id index
number for every instance.
ex:
<div id="c2k_container_0" title="55555"></div>
<div id="c2k_container_1" title="66666"></div>
<div id="c2k_container_2" title="77777"></div>
<div id="c2k_container_3" title="88888"></div>
These id indexes must be unique and increasing.
The callto parameter can be set as the title attribute of the <div> element.
Load on demand
You can also load the sip web phone on demand as explained here.
Auto-call
If you wish to make a call automatically, then just initialize the webphone as described above and
-either set also the autoaction parameter to 1
-or make the call with the webphone_api.call(number) API from the onLoaded() or from the onRegistered() callback.
The autoaction API parameter controls the behavior of the click to call button and can have the following values:
0: Nothing (default) - it will display the click to call button and will place a call whet the user clicks it.
1: Call - it will immediately place a call, once page is loaded in which the click to call button is integrated.
2: Chat - a chat window will be displayed for the user
3: Video Call - it will immediately place a video call, once page is loaded in which the click to call button is integrated.
Note:
o Even if you initiate a call form onLoaded and the webphone is not yet registered -and it needs to register-, then it will handle registration first then it will initialize the call
automatically.
o If your IP-PBX doesnt require registrations, then just set the register setting to 0.
More details about the click to call functionality can be found here and in this wiki article.
Custom solutions
The most common use case for the webphone is as a dialer (softphone user interface) or as a click to call solution (simple click to call button user interface).
For these we got you covered with ready to use solutions shipped with the webphone (see the softphone.html and the click2call.html files).
However this doesnt mean that the webphone usage is restricted only for these. You can create any kind of solution using the webphone. A few examples are
listed here.
All you need is a little HTML knowledge to create your desired user interface and some JavaScript knowledge to use the webphone API from your HTML/JS.
See the webphone development section for more details.
First of all it is important to mention that the webphone doesnt have any server side framework dependencies. You can host it on any webserver without any
framework (.PHP, .NET, Node.Js ot others installed).
The webphone is running entirely on the client side (in the user browser as a browser sip plugin) and can be easily manipulated via its JavaScript SIP API,
however you can easily integrate the webphone with any server side application or script be it .NET, PHP, Node.Js, J2EE or any other language or framework
even if you dont have JavaScript experience. Just create a HTTP API to catch events such as login/call start/disconnect and drive your app logic accordingly.
The most basic things you can do is to dynamically generate the webphone parameters per session depending on your needs. For example if the user is already
logged-in, then you can pass its SIP username/password for the webphone (possibly encoded).
For this, just generate the webphone_api.js dynamically or pass the parameters in the URI.
For a tighter integration you will just have to call into your server from the webphone.
This can be done with simple XMLHTTP /AJAX or websocket requests against your server HTTP API, then process the events in your server code according to your
needs. The requests can be generated using the built-in HTTP API events or you can just post them yourself from your custom JavaScript code using websocket
or ajax requests. Usually these requests will be made from callback events which are triggered on web phone state machine changes, but you are free to place
ajax request anywhere in your code such as click on a button.
Example:
For example if you need to save each call details (date, caller, called, duration, others) into a server side database, then just define a oncalldetails or similarly
named API in your server side application which can be called via simple HTTP request in one of the following ways:
Then you will receive request to this API entry on your app server and you can process them accordingly (load the URL parameters and store in your database).
You can do similar things for all other important events such as on phone start, on chat, on call setup, etc and perform various actions on your server side such as
storing the data in your database or return valuable data to be displayed in the client browser (such as remote party details).
For auto-provisioning from a server side application, you can create an API to return all the webphone parameters (settings) and set the scurl_setparameters
setting to this API URL.
For API request, the webphone will try to use following techniques (first available): AJAX/XHTTP, CORS, JSONP and websocket (if available).
For example here is tutorial for Salesforce webphone integration in case if you are interested in this platform or some details about VoIP callcenter integration.
Consult your CRM documentation to find the details about integration third-party general modules (or even better if it has an interface specific for third party
phone integrations). Contact us if you need help with any integration.
Development
This section is for JavaScript developers. You can use this webphone also without any JavaScript skills:
If you dont have any programming skills: customize and use the included turn-key templates (for example the softphone.html) on your website.
If you are a server-side developer not comfortable with JS: take advantage of the server integration capabilities
Developers can use the webphone as an SDK (JavaScript library) to create any custom VoIP solution, standalone or integrated in any webpage or web
application.
Setup
First of all you should deploy the webphone on your webserver (Copy the webphone folder to your webserver and adjust any settings you might need according
to your SIP server). You can also launch it from local file system on your dev environment (works with some limitations), but better if you use it from a
webserver.
The library parameters can be preconfigured in webphone_api.js, changed runtime from JavaScript, passed by URL parameters or set dynamically by any server
side script such as PHP, .NET, java servlet, J2EE or Node.js.
The webphone doesnt require any extra client or server side framework (it is a client side VoIP implementation which can be used from simple JavaScript) however you are free to use
your own favorite framework or libraries to interact with the web phone (for example use with jQuery on the client side or integrate into your PHP/.ASP/.NET/J2EE/NodeJS or other
server side framework or use it straight without any frameworks involved).
The downloadable demo version has some limitations to disable commercial usage, however if your development process is affected by these then you can
request a trial from mizutech with all demo limitation removed.
API
The public JavaScript API can be found in "webphone_api.js" file, under global javascript namespace "webphone_api".
Just include the "webphone_api.js" to your project or html and start using the webphone API.
Simple example
A minimal implementation can be achieved with less than 5 lines of code on your website. See the minimal_example.html (found in the webphone package)
Example:
<head>
<!-- Include the webphone_api.js to your webpage -->
<script src="webphone_api.js"></script>
</head>
<body>
<script>
//Wait until the webphone is loaded, before calling any API functions
webphone_api.onLoaded(function () {
//These API calls below actually should be placed behind separate functions (button clicks)
//Make a call (Usually initiated by user action, such as click on a click to call button. Number can be extension, SIP username, SIP URI or mobile/landline phone)
webphone_api.call(NUMBER);
//Send instant message (Number can be extension, SIP username. Usually called from a send chat button)
webphone_api.sendchat(NUMBER, MESSAGETEXT);
});
//You should also handle events from the webphone and change your GUI accordingly (onXXX callbacks)
</script>
</body>
Other examples
See the html files in the webphone/samples folder for more examples.
o a very simple but functional basic example can be found in the webphone package: basic_example.html
o as a better example, see the tech demo page (techdemo_example.html / techdemo_example.js) or the api_example.html
o click2call.html is a ready to use click to call implementation
o softphone.html implements a fully features browser softphone (this can be found in the webphone root folder, not in the samples folder)
You can also try the same examples from our online demo.
You are free to use/modify any of these file and adjust it after your needs or create your own solution from scratch.
For development we would recommend to start with the basic_example.html , api_example.html or techdemo_example and modify/improve it after
your needs.
If you need something ready to use, then just use the softphone.html (this can be also customized with the many webphone parameters or by changing the
html/css/js files)
Advanced functions
Most of the traditional VoIP functionalities (in/our calls, chat, call divert) can be handled very easily with the webphone, however some advanced features might
require special care if you wish to interact with them.
Lots of things can be achieved by the webphone parameters, without the need of any programming effort.
Here are some examples for advanced usage:
o settings/auto-provisioning: it can be done easily with the setparameter API but you might have special needs which would require to pass the parameters in
a special way. See the beginning of the parameters section for the possibilities and some more in the FAQ.
o multiple lines: handled automatically but you might need to handle it explicitly if required for your project
o low-level engine messages: this is only for advanced users and rarely needed to intercept these messages. You might use the onEvents callback for this but
it is recommended to use the other high level events such as the onCallStateChange to handle the web SIP state machine
o low-level interaction with the native engines: if somehow you have some extra requirements which is not available with this high-level API then you might
use the low-level jvoip API with the NS and Java engines
o dtmf, call transfer, hold, forward: we took special care to make these as simple to use as possible so all of these can be handled by a single API call
o voice call recording: just set the voicerecupload parameter or use the voicerecord API from Java Script
o conference: handled automatically by default via a single API call but optionally you might implement some specific user interface to display all parties
o parameter encryption/obfuscation: usually not required since you are working with them in the otherwise secure user session, but if you wish to use it then
it is described here
o video: you must provide a html element where the video have to be displayed and manage this GUI accordingly: <div id="video_container"></div>
o chat, sms: these also requires some extra user interface to send the messages and display the call history
o manipulating SIP messages: requires some VoIP/SIP skills if you need to interact this way with your VoIP server and you can use the
setsipheader/getsipheader APIs
Note: all of these are implemented in the softphone skin which is included with the webphone so you might use/modify this skin if you need a complete
softphone like solution instead to develop your own from scratch (if you dont have specific requirements which cant be handled by customizing the softphone
skin)
For more details, see the JavaScript API section below in this documentation.
Parameters
The parameters can be used to customize the user interface or control the settings like the SIP server domain, authentication, called party number, autodial and
many others.
Most of the settings are optional except the "serveraddress" (but also this can be provided at runtime via the API).
The other important parameters are the SIP user credentials (username, password) and the called number (callto) which you can also preset (for example if you
wish to implement click to call) however these are usually entered by user (and optionally can be saved in local cookie for later reuse).
The webphone parameters can be set in multiple ways (statically and dynamically) to allow maximum flexibility and ease the usage for any work-flow.
Use one (or more) of the following methods for the webphone configuration:
Preset the settings in the "webphone_api.js" file, under "parameters" variable (in "parameters" Javascript object at the beginning of the file)
Use the setparameter() API call from JavaScript (Other function calls might also change settings parameters)
Webpage URL query string (The webphone will look at the embedding document URL at startup. Prefix all keys with wp_. For example
&wp_username=x or any other parameter specified in this documentation)
Via the scurl_setparameters settings which can load the parameters from your server side application (This will be called after "onStart" event and can
be used to provision the webphone from server API. The answer should contain parameters as key/value pairs, ex: username=xxx,password=yyy)
Cookies (prefix all keys with wp_. For example wp_username)
SIP signaling (sent from server) with the x-mparam header (or x-mparamp if need to persist). Example: x-mparam=loglevel=5;aec=0
Auto-provisioning: the browser phone is also capable to download its settings from a config file based on user entered OP CODE (although this way of
configuration is a little bit redundant for a web app, since you can easily create different versions of the app for example by deploying it in different
folders- already preconfigured for your customers, providing a direct link to the desired version instead of asking the users to enter an additional
OPCODE)
User input: You can let the user to modify the settings. For example to enter username/password for SIP authentication (For example using the
softphone skin most of the settings can be specified by the users which might overwrite server side settings loaded from the webphone_api.js file)
Also see here and here
The quick and easiest way to start is to just set all the required parameters in the webphone_api.js file. For example:
var parameters = {
serveraddress: 'voip.mizu-voip.com', //your SIP server URI (or IP:port)
username: 'webphonetest1', //the username is usually specified by the enduser and not need to be set here
password: 'webphonetest1', //the password is usually specified by the enduser and not need to be set here
displayname: 'John Smith', //optional display name
brandname: 'BestPhone', //your brand name
rejectonbusy: true, //will reject incoming call if user already in call
ringtimeout: 50, //disconnect the call after 50 sec on no answer
loglevel: 5, //enable detailed logs
};
Usually you might set some parameters in the above webphone_api.js file (the common parameters applicable for all users), then you use one of the other
methods to specify instance specific parameters (for example user credentials for auto login).
Note:
For a basic usage you will have to set only your VoIP server ip or domain name (serveraddress parameter).
The SIP username/password are asked from the user with the default skins if not preconfigured.
The rest of the parameters are optional and should be changed only if you have a good reason for it.
Some parameters (username/password, displayname) are usually set by the user via some user interface (using the setparameter() API), however in
some situation you might hardcode them on the server side webphone_api.js file. For example if you have some static IVR service and the caller user
identity doesnt matter.
All parameters can be passed as strings and will be converted to the proper type internally by the webphone browser plugin.
Most parameters are saved by the webphone (in web storage and cookies) and reused at next sessions (but you can always overwrite already stored
settings or clear them by setting the value to NULL).
Dont remove or comment out already set parameters because the old value might be already cached by the browser webphone. Instead of this you
should just set to NULL/DEF or its default value. Details here.
Prefix parameter name with ucfg_ if it should prefer client side settings (otherwise server side settings defined in the webphone_api.js will overwrite
the client settings). Example: ucfg_aec: 2
Parameters can be also encrypted or obfuscated. See the Parameter security section for the details.
serveraddress
(string)
The address of your SIP server (domain or IP + port).
It can be specified as IP address or as A or SRV domain name.
Specify also the port if your server is not using the default 5060; in this case append the port after the address separated by colon.
Examples:
mydomain.com (this will use the default SIP port: 5060)
sip.mydomain.com:5062
10.20.30.40:5065
This is the single most important parameter for the webphone (along with the username/password but those can be also entered by the user).
Default value is empty.
username
(string)
This is the SIP username (used for authentication and as A number/Caller-ID for the outgoing calls).
Default value is empty.
Note:
o The username/password parameters are usually supplied by the user (via some user interface and then calling the setparameter() API, however in some cases you might just set
it statically in the webphone_api.js file (when caller user credentials doesnt matter). See more here.
o Even if you dont need a username and/or your server accepts all calls without authentication, you must set some username to some value: the anonymous username might
be used in this case
o If you set the username setting to Anonymous then the username input box will be hidden on the softphone skin settings and login screens
o If you wish to set a separate caller-id you can use this parameter to specify it and then use the sipusername parameter to specify the username used for authentication as
specified in SIP standards. However please note that most SIP server can treat also the below mentioned displayname parameter as the caller-id so the usage of separate
username/sipusername is usually not necessary and confusing. See more details here.
password
(string)
SIP authentication password.
Default value is empty.
Note:
o Make sure to never hardcode the password in html or set it via insecure http. See more details here about security.
o You can use the webphone also without password (if not using via server or your server doesnt authenticate the users). In this case you can set the password to any value since
it is supposed that it will not be required for calls or registrations
o If your IP-PBX accept blind registrations and/or calls then the value of the password doesnt matter (it will not be used anyway)
o If you set the password setting to nopassword then the password input box will be hidden on the softphone skin settings and login screens
o If your IP-PBX doesnt require registrations or you are not using any server then you should set the register setting to 0
displayname
(string)
Optional SIP display name.
Specify default display name used in from or contact SIP headers.
Default value is empty (the username field will be displayed for the peers).
See more details here.
realm
(string)
Optional parameter to set the SIP realm if not the same with the serveraddress or domain.
Rarely required. (Only if your VoIP server has different realm setting as its domain and it strictly enforces that realm)
Default value is empty. (By default the serveraddress will be used without the port number)
proxyaddress
(string)
Outbound SIP proxy address (Examples: mydomain.com, proxy.mydomain.com:5065, 10.20.30.40:5065)
Leave it empty if you dont have a stateless proxy. (Use only the serveraddress parameter)
Default value is empty.
Note: Set to null if you already set it before (to a wrong value) and wish to clear it.
register
(number)
With this parameter you can set whether the softphone should register (connect) to the sip server.
0: no (the webphone will not send REGISTER requests)
1: auto guess (yes if username/password are preset, otherwise no)
2: yes (and must be registered before to make calls)
Default value is 1.
registerinterval
(number)
Registration interval in seconds (used by the re-registration expires timer).
Default value is 120 or 300 depending on the circumstances.
This is important for SIP servers to find out unexpected termination if the webphone application or webpage such as killing the browser, power loss or others (so
the server will know that the client is no longer alive if this time is expired, but no new re-registration were received from the client).
Note: we dont recommend to set the re-register interval below 30 seconds (it just causes unnecessary server load; below 30 seconds most of the SIP servers will
not decide anyway; some servers doesnt accept such short re-registration periods). Also you should not set it longer then 3600 (one hour).
voicemailnum
(string)
Specify the voicemail number (which the user can call to hear its own voicemails) if any.
Most PBX servers will automatically send the voicemail access number so usually this is detected automatically.
Default value is empty (auto-detect).
callto
(string)
The webphone can initiate call on startup if this is set. It can be used to implement click to call or similar functionality.
Can be any phone number, username or SIP URI acceptable by your VoIP server.
Default value is empty.
autoaction
(number)
Useful for click-to-call to specify what to do if you pass the callto parameter
0: Nothing (do nothing, just preset the destination number; the user will have to initiate the call/chat)
1: call (default. Will auto start the call to callto)
2: chat (will show the chat user interface presenting a chat session with callto)
3: video call (will auto start a vide call)
Default is 0.
Note: the other SIP related settings can be found in the Engine related settings below (such as dtmfmode or codec).
engine priority
By default the webphone will choose the best suitable engines automatically based on OS/browser/server support. This algorithm is optimized for all OS and
all browsers so you can be sure that your users will have the best experience with default settings, however, if you wish, you can influence this engine selection
algorithm by setting one or more of the following parameters:
enginepriority_java
enginepriority_webrtc
enginepriority_ns
enginepriority_flash
enginepriority_app
enginepriority_p2p
enginepriority_accessnum
enginepriority_nativedial
enginepriority_otherbrowser
Possible values:
0: Disabled (never use this engine)
1: Lower (decrease the engine priority)
2: Normal (default)
3: Higher (will boost engine priority)
4: Highest (will use this engine whenever possible)
5: Force (only this engine will be used)
Example:
-if you wish to prioritize the NS engine, just set: enginepriority_ns: 3
-if you wish to avoid WebRTC engine, just set: enginepriority_webrtc: 1
Best practices:
-You should not change the engine priorities unless you have a good reason (one of the main strength of the webphone is automatic optimal engine selection based on circumstances,
so there should be rare cases when you might need to adjust this manually)
-Even if you have a favorite engine, you should not disable the others. Just set your favorite engine priority to 3 or 4. This way even endusers which doesnt have a chance to run your
favorite engine might be able to make calls with other engines.
-Even if for some reason you dont like an engine, dont entirely disable it, just lower its priority (set its enginepriority to 1 instead of 0). This means that the webphone will pickup the
engine only if there is no -any other alternatives and having the webphone working with an unwanted engine is much better then not working at all.
The engines also have a built-in default priority number assigned which can range from 0 to 100 and can be changed with the enginedefpriority_ENGINENAME settings.
Default values:
enginedefpriority_java: 32
enginedefpriority_webrtc: 20
enginedefpriority_flash: 13
enginedefpriority_ns: 30
enginedefpriority_app: 10
enginedefpriority_p2p: 5
enginedefpriority_callback: 5
enginedefpriority_nativedial: 3
You should not touch these values!
webrtcserveraddress
(string)
Optional setting to indicate the domain name or IP address of your websocket service used for WebRTC if any (your server address and websocket listen port).
Examples:
ws://mydomain.com
ws://10.20.30.40:5065
wss://asterisk.mydomain.com:8088/ws
wss://sip.mydomain.com:8080
Default value is empty (which means auto service discovery and if no webrtc service found then the mizu webrtc service can be used if accessible).
Note: latest Chrome and Opera require secure websocket (wss). You will need to install an SSL certificate for your WebRTC server for this and set this parameter
with the domain name (not IP address). This is needed only if your VoIP server is WebRTC capable or you have your own WebRTC to SIP gateway. Otherwise no
changes are required.
More details about webrtc can be found in the FAQ.
rtmpserveraddress
(string)
Optional setting to indicate the address (domain name or IP address + port number) of your flash service if any (flash media + RTMP). If not set, then the mizu
flash to sip service might be used (rarely used in normal circumstances). Format: yourdomain.com:rtmpport
Example: 10.20.30.40:5678
Default value is empty.
stunserveraddress
(string)
STUN server address in address:port format (RFC 5389)
You can set to null to completely disable STUN.
Examples:
11.22.33.44:3478
mystunserver.com:3478
null
By default (if you leave this setting unchanged) the webphone will use the Mizutech STUN servers (unlimited free service for all webphone customers). You can
change this to your own STUN server or use any public server if you wish.
Note: if you set an incorrect STUN server, then the symptoms are extra delays at call setup (up to icetimeout).
turnserveraddress
(string)
TURN server address in address:port format (RFC 5766)
You can set to null to completely disable TURN.
Examples:
11.22.33.44:80
mystunserver.com:80
null
TURN is required only if the webphone cannot send the media directly to the peer (which is usually your VoIP server) and your server doesnt support TCP
candidates. For example if all UDP is blocked or only TCP 80 is allowed or you need peer to peer media via TURN relay
By default (if you leave this setting unchanged) the webphone can use the Mizutech TURN servers. If you wish, you can deploy your own TURN server using the
popular open source coturn server. The MizuTech WebRTC to SIP gateway also has its own built-in TURN server and there is no need to set this parameter.
turnparameters
(string)
Any TURN URI parameter.
Example: transport=tcp
turnusername
(string)
Username for turn authentication.
ice
(string)
Instead of using the above stun and turn parameters, you can also set in the following format:
ice: [{ url: 'stun:stun.l.google.com:19302'}, { url:'turn:[email protected]', credential:'myPassword'}]
(You can also set multiple STUN and TURN servers if you wish)
A list of public stun servers can be found here however if you are using the mizu gateway then there is no need to set any STUN server.
turnpassword
(string)
Password for turn authentication.
icetimeout
(number)
Timeout for ICE address gathering (STUN/TURN/others) in milliseconds.
Default is 3000 (3 seconds).
You might increase in special circumstances if you are using some slow STUN/TURN server or decrease if peer address is public (like if your SIP or WebRTC server
is on public IP always routing the media, so calls will work also without STUN).
autodetectwebrtc
(number)
Try to auto-detect webrtc address if not set (if the active SIP server has built-in WebRTC capabilities)
0: no
1: yes
Default is 1.
android_nativedialerurl
(string)
Android native softphone download URL if any. (Optional setting to allow alternative softphone offer on Google Play).
Note: Android browsers has support also for WebRTC so this might be selected only with old phones or if you disable WebRTC.
Default is empty (which means the default app).
ios_nativedialerurl
(string)
iOS native softphone download URL if any. (Optional setting to allow alternative softphone offer on Apple App Store).
The safari browser under iOS doesnt offer any plugin for VoIP so the webphone can use its native softphone (will be auto provisioned from your webphone
settings).
Default is empty (which means the default app).
accessnumber
(string)
Set this if your IP-PBX has an access number where users can call into from PSTN and it can forward their call on VoIP (IVR asking for the target number).
This can be used when no other engines are working (no suitable environment, no internet connection).
Default is empty.
callbacknumber
(string)
Set this if your server has a callback access number where users can ring into and will receive a call from your server (possibly with an IVR which might offer the
possibility to specify the destination number via DTMF).
This can be used when no other engines are working (no suitable environment, no internet connection) and it is very useful in situation where call from the
server is cheaper than user call to server.
Default is empty.
useragent
(string)
This will overwrite the default User-Agent setting.
Do not set this when used with mizu VoIP servers because the server detects extra capabilities by reading this header.
Default is empty.
customsipheader
(string)
Set a custom sip header (a line in the SIP signaling) that will be sent with all messages. Can be used for various integration purposes and usually has a key:val
format. For example: myheader:myvalue.
Default is empty.
Note:
Custom SIP headers should begin with X- to be able to bypass servers, gateways and proxies (For example: X-MyHeader: 47).
You can add more than one header, separated by semicolon (For example: customsipheader: 'x-key1: val1;x-key2: val2',).
You can also use the setsipheader API call at runtime.
checkmicrophone
(number)
Specify whether calls should fail or succeed also without a microphone device.
0: no (calls with be allowed even if client doesnt have any microphone audio device)
1: with warning (call will be allowed but a warning message will be displayed for the user)
2: yes (calls will fail if user doesnt have a microphone device)
Default is 1.
allowsipuriasusername
(number)
Used for SIP user name normalization.
0: No: if username is a SIP URI, then the webphone will remove the domain and save only the username part
1: Yes: will not touch the entered user name
Default is 0.
backgroundcalls
(boolean)
If you are using the NS engine, your webpage can be started automatically on incoming calls if you set this parameter to true.
When background calls is turned on, the NS engine will listen continuously for incoming call and chat notifications and will launch your website with the
incoming session details if your page is not already started by the user. This will enable incoming SIP calls even if the browser is closed.
Default is false.
transport
(number)
Transport protocol for native SIP.
0: UDP (User Datagram Protocol. The most commonly used transport for SIP)
1: TCP (signaling via TCP. RTP will remain on UDP)
2: TLS (SIPS encrypted signaling)
3: HTTP tunneling (both signaling and media. Supported only by mizu server or mizu tunnel)
4: HTTP proxy connect (requires tunnel server)
5: Auto (automatic failover from UDP to HTTP if needed)
Default is 0.
Note: this will not affect WebRTC since webrtc transport is controlled by the browser: http/https, websocket/secure websocket (ws/wss) and DTLS/SRTP for the media.
localip
(String)
Specify local IP address to be used.
This should be used only on devices with multiple ethernet interface to force the specified IP.
Default is empty (autodetect)
Note: This setting is not applicable for WebRTC (In case of WebRTC this is handled entirely by the browser internal WebRTC stack)
signalingport
(number)
Specify local SIP signaling port to use.
Default is 0 (a stable port which is selected randomly at the first usage)
Note: This is not the port of your server where the messages should be sent. This is the local port of the signaling socket.
Note: This setting is not applicable for WebRTC (In case of WebRTC this is handled entirely by the browser internal WebRTC stack)
rtpport
(number)
Specify local RTP port base.
Default is 0 (which means signalingport + 2)
Note: If not specified, then VoIP engine will choose signalingport + 2 which is then remembered at the first successful call and reused next time (stable rtp port).
If there are multiple simultaneous calls then it will choose the next even number.
Note: This setting is not applicable for WebRTC (In case of WebRTC this is handled entirely by the browser internal WebRTC stack)
sendrtponmuted
(boolean)
Send rtp even if muted (zeroed packets)
Set to true only if your server is malfunctioning when no RTP is received.
Default value is false.
mediaencryption
(number)
Media encryption method
0: not encrypted (default)
1: auto (will encrypt if initiated by other party)
2: SRTP
Default is 0.
Note: this will not affect WebRTC since WebRTC always uses DTLS/SRTP for the media.
dtmfmode
(number)
DTMF send method
0: disabled
1: sip INFO method
2: auto detect (SIP INFO for WebRTC, and RFC2833 with NS/Java engines in the RTP if RTP stream is working and peer announced telephone-event payload, otherwise it
will send also SIP INFO)
3: both INFO and RFC2833 (This might be used only with NS/Java engines. With WebRTC this will send dtmf in either SIP INFO or RFC2833 but not both)
4: RFC2833 (Will not send SIP INFO even if there is no RTP stream negotiated. Only RFC2833)
Default is 2.
Note:
o Received DTMF are recognized by default in both INFO or RFC2833 formats (No In-Band DTMF processing)
o If you are using the mizu WebRTC-SIP gateway, you can set dtmf type for both inbound and outbound globally with the fs_dtmf_type_intern and fs_dtmf_type_extern server
side settings and also per user with the inbounddtmf and outbounddtmf webphone parameters. The out-bound is also handled automatically after the dtmfmode setting
(defaults to SIP info) and for in-bound both info and rfc2833 are accepted by default.
o DTMF messages can be sent from the existing skin templates or using the dtmf API. Incoming dtmf messages are displayed automatically on skins or can be cached with the
onDTMF callback.
playdtmfsound
(number)
Specify whether the webphone should generate local DTMF tone when DTMF is sent.
0=no
1=if one digit
2=always (also when multiple digits are sent at once)
Default is 1.
earlymedia
(number)
Start to send media when session progress is received.
0: no
1: reserved
2: auto (will early open audio if wideband is enabled to check if supported)
3: just early open the audio
4: null packets only when sdp received (NS only)
5: yes when sdp received
6: always forced yes
Default is 2.
prefcodec
(string)
Set your preferred audio codec. Will accept one of the followings: pcmu, pcma, g.711 (for both PCMU and PCMA), g.719, gsm, ilbc, speex, speexwb, speexuwb,
opus, opuswb, opusuwb, opusswb
Default is empty which means the built-in optimal prioritization.
By default the engine will present the codec list optimized regarding the circumstances (the combination of the followings):
available client codec set (not all engines supports all codecs)
server codec list (depending on your server, peer device or carrier)
internal/external call: for IP to IP calls will prioritize wideband codecs if possible, while for outbound calls usually G.729 will be selected if available
network quality (bandwidth, delay, packet-loss, jitter): for example iLBC is more tolerant to network problems if supported
device CPU: some old mobile devices might not be able to handle high-complexity codecs such as opus or G.729. G711 and GSM has low computational costs
You can also fine-tune the codec settings with the use_xxx settings where xxx is the codec name as described in JVoIP documentation.
codec
(string)
List of allowed audio codecs separated by comma.
By default the webphone will automatically choose the best codec depending on available codecs, circumstances (network/device) and peer capabilities.
Set this parameter only if you have some special requirements such as forcing a specific codec, regardless of the circumstances.
Example: Opus,G.729,PCMU (This will disable Speex, GSM, iLBC, GSM and PCMA).
Default: empty (which means auto detection and negotiation)
Recommended value: leave it empty
With the NS and Java engines you can also use the use_codecname settings to disable/enable codec. Possible values: 0=never,1=dont offer,2=yes with low priority,3=yes with high
priority. For example to disable all codec except PCMU you can use the following settings:
use_pcmu=3 use_pcma=0 use_g729=0 use_gsm=0 use_speex=0 use_speexwb=0 use_speexuwb=0 use_opus=0 use_opuswb=0 use_opusuwb=0 use_opusswb=0 use_ilbc=0
vcodec
(string)
List of allowed video codecs separated by comma.
You might use this parameter to exclude some codec from the offer list.
For example if you dont wish to use VP8, then set this to: H264, H263
Default: empty (which means auto detection and negotiation)
Note: WebRTC has support only for H.264 and VP8 from common browsers so you should not disable these codecs.
video
(number)
Enable/disable video.
-1: auto (default)
0: disable
1: enable
2: force always
Note:
-If you are using the webphone with a custom skin, the video will be displayed in a div with id set to video_container, so your html must have this element:
<div id="video_container"></div>
-The WebRTC engine is required for video to work (the webphone will handle this automatically by switching to WebRTC on video request if it is available)
audio_bandwidth
(number)
Max bandwidth for audio in kbits.
It will be sent also with SDP b:AS attribute.
Default is 0 which means auto negotiated via RTCP and congestion control.
video_bandwidth
(number)
Max bandwidth for video in kbits.
It will be sent also with SDP b:AS attribute.
Default is 0 which means auto negotiated via RTCP and congestion control.
screensharing
(number)
Enable/disable screen sharing:
0=No (default)
1=Auto (if supported by the platform)
2=Yes (always force)
Default is: 0
Softphone skin users: If the screensharing is set, a screen share button will appear on the softphone user interface.
Note: screen sharing is still an experimental feature in WebRTC standards and you might need a browser extension to enable it.
You might also need the followings:
Chrome: start the browser with --enable-usermedia-screen-capturing flag
Firefox: in the about:config create a media.getusermedia.screensharing.enabled key and set its value to true and in
media.getusermedia.screensharing.allowed_domains append the IP address of your server
codecframecount
(number)
Number of payloads in one UDP packet.
By default it is set to 0 which means 2 frames for G729 and 1 frame for all other codec.
aec
(number)
Enable/disable acoustic echo cancellation
0=no
1=yes except if headset is guessed
2=yes if supported
3=forced yes even if not supported (might result in unexpected errors)
Default is 1.
agc
(number)
Automatic gain control.
0=Disabled
1=For recording only
2=Both for playback and recording
3=Guess
Default value is 3
jittersize
(number)
Although the jitter size is calculated dynamically, you can modify its behavior with this setting.
0=no jitter,1=extra small,2=small,3=normal,4=big,5=extra big,6=max
Default is 3
enablepresence
(number)
Enable/disable presence.
Possible values:
0: disable presence
1: auto (if presence capabilities detected)
2: always enable / force
Default is 1.
autostart
(boolean)
Specify whether the webphone stack should be started automatically on page load.
If set to false then the start() method needs to be called manually in order for the webphone to start. Also the webphone will be started automatically on some
other method calls such as register() or call().
Default is true.
Note: you can set this to false to prevent the auto initialization of the webphone, so you might delay this until actually the user wish to interact with your phone
UI (such as pushing your click to call button)
loglevel
(number)
Tracing level. Values from 1 to 5.
Log level 5 means a full log including SIP signaling. Higher log levels should be avoided, because they can slow down the softphone.
Loglevel above 5 is meant only for Mizutech developers and might slow down the webphone (includes also RTP packets).
Do not set to 0 because that will disable also the important notifications presented for the users.
Recommended values:
1: minimal logs for production
5: detailed logs for tests
More details about logs can be found here.
There is also a maxloglevel parameter which you can use to prevent users to set the log level above this predefined value.
logtoconsole
(boolean)
Specify whether to send logs to console.
true: will output all logs to console (default)
false: will output only level 1 (important events also displayed for the user)
The amount of logs depends on the loglevel parameter.
Default is: true
normalizenumber
(number)
Normalize called phone numbers.
If the dialed number looks like a phone number (at least 5 number digits and no a-z, A-Z or @ characters and length between 5 and 20) then will drop all special
characters leaving only valid digits (numbers, *, # and + at the beginning).
Possible values:
0: no, dont normalize
1: yes, normalize (default)
techprefix
(string)
Add any prefix for the called numbers.
Default is empty.
numpxrewrite
In case if you need to rewrite numbers after your dial plan on the client side, you can use the numpxrewrite parameter (although these kind of number rewrite
are usually done after server side dial plan):
You can set multiple rules separated by semicolon.
Each rule has 4 parameters, separated by comma: prefix to rewrite, rewrite to, min length, max length
For example:
74,004074,8,10;+,001,7,14;',
This will rewrite the 74 prefix in all numbers to 004074 if the number length is between 8 and 10.
Also it will rewrite the + prefix in all numbers to 001 if the number length is between 7 and 14.
blacklist
(string)
Block incoming communication (call, chat and others) from these users. (username/numbers/extensions separated by comma).
Default value is empty.
callforwardonbusy
(string)
Specify a number where incoming calls should be forwarded when the user is already in a call. (Otherwise the new call alert will be displayed for the user or a
message will be sent on the JS API)
Default is empty.
callforwardonnoanswer
(string)
Forward incoming calls to this number if not accepted or rejected within 15 seconds.
Default is empty.
callforwardalways
(string)
Specify a number where ALL incoming calls should be forwarded.
Default is empty.
calltransferalways
(string)
Specify a number where ALL incoming calls should be transferred to.
This might be used if your server doesnt support call forward (302 answers) otherwise better to set this on server side because the call will not reach the
webphone when it is offline/closed, so no chance for it to forward the call.
Default is empty.
autoignore
(number)
Set to ignore all incoming calls.
0: dont ignore
1: silently ignore
2: reject
Default value is 0.
autoaccept
(boolean)
Set to true to automatically accept all incoming calls (auto answer).
Default value is false.
acceptcall_onsharedevice
(boolean)
Specify whether to auto accept incoming calls when the user clicks to enable device sharing for WebRTC (the audio device permission browser popup)
-true: accept webrtc call on browser share device click (default)
-false: do nothing (user will have to click the Accept button to accept the incoming call or you must call the accept() API)
Default is false.
beeponconnect
(number)
Will play a short sound when calls are connected
0: Disabled
1: For auto accepted incoming calls
2: For incoming calls
3: For outgoing calls
4: For all calls
Default value is 0
redialonfail
(number)
Retry the call on failure or no response.
0: no
1: yes
Default value is 1.
rejectonbusy
(boolean)
Set to true to automatically reject (disconnect) incoming call if a call is already in progress.
Default value is false.
disablesamecall
(number)
Specify whether to enable (possible accidental) outgoing call to a number where there is already a call in progress.
This might happen as a result of API misuse or by user double-click on the call button.
Set to 1 to reject such kind of second call.
Set to 0 to disable this verification and enable all calls.
Default is 1.
allowcallredirect
(number)
Set to 1 to auto-redial on 301/302 call forward.
Set to 0 to disable auto call forward.
Default value is 1.
muteholdalllines
(number)
Auto Mute/Hold all call legs on conference calls.
0=no
1=yes
Default is 0.
automute
(number)
Specify if other lines will be muted on new call
0=no (default)
1=on incoming call
2=on outgoing call
3=on incoming and outgoing calls
4=on other line button click
Default is 0
autohold
(number)
Specify if other lines will be muted on new call
0=no (default)
1=on incoming call
2=on outgoing call
3=on incoming and outgoing calls
4=on other line button click
Default is 0
audiodevicein
(string)
Audio device name for recording (microphone). Set to a valid device name or Default which would select the system default audio device.
Note: this is usually set at run-time from the API or from an audio device select control presented to the users (already implemented by the softphone skin). If not set, then the
webphone will use the OS default recording device.
audiodeviceout
(string)
Audio device name for playback (speaker). Set to a valid device name or Default which would select the system default audio device.
Note: this is usually set at run-time from the API or from an audio device select control presented to the users (already implemented by the softphone skin). If not set, then the
webphone will use the OS default playback device.
audiodevicering
(string)
Audio device name for ringtone. Set to a valid device name or Default which would select the system default audio device. You can also set it to All to have
the ringtone played on all devices.
Note: this is usually set at run-time from the API or from an audio device select control presented to the users (already implemented by the softphone skin). If not set, then the
webphone will use the OS default playback device. Separate ringer device selection is not available with the WebRTC engine.
volumein
(number)
Default microphone volume in percent from 0 to 100. 0 means muted. 100 means maximum volume, 0 is muted.
Default is 50% (not changed)
Note: The result volume level might be affected by the AGC if it is enabled.
volumeout
(number)
Default speaker volume in percent from 0 to 100. 0 means muted. 100 means maximum volume, 0 is muted.
Default is 50% (not changed)
Note: The result volume level might be affected by the AGC if it is enabled.
volumering
(number)
Default ringback volume in percent from 0 to 100. 0 means muted. 100 means maximum volume, 0 is muted.
Default is 50% (not changed)
Note: there is no separate ring device for WebRTC (this is not a webphone limitation, but current browsers doesnt expose such functionality for WebRTC)
transfertype
(number)
Specify transfer mode for native SIP.
-1=default transfer type (same as 6)
0=call transfer is disabled
1=transfer immediately and disconnect with the A user when the Transf button is pressed and the number entered (unattended/blind transfer)
2=transfer the call only when the second party is disconnected (attended transfer)
3=transfer the call when the VoIP phone is disconnected from the second party (attended transfer)
4=transfer the call when any party is disconnected except when the original caller was initiated the disconnect (attended transfer)
5=transfer the call when the VoIP phone is disconnected from the second party. Put the caller on hold during the call transfer (standard attended transfer)
6=transfer the call immediately with hold and watch for notifications (unattended transfer)
If you have any incompatibility issue, then set to 1 (unattended is the simplest way to transfer a call and all sip server and device should support it correctly)
Note: only unattended/blind transfer is support between SIP and WebRTC (if one endpoint is using native SIP while the other is on WebRTC)
transfwithreplace
(number)
Specify if replace should be used with transfer so the old call (dialog) is not disconnected but just replaced.
This way the A party is never disconnected, just the called party is changed. The A party must be able to handle the replace header for this.
-1=auto
0=no (will create a separate call)
1=yes (smooth transfer, but not supported by some servers)
Default is -1
changesptoring
(number)
If to treat session progress (183) responses as ringing (180). This is useful because some servers never sends the ringing message, only a session progress and
might not start to send in-band ringing (or some announcement). In this circumstances the webphone can generate local ringback.
The following values are defined:
0: do nothing (no ringback on session progress message)
Will not call startRingbackTone() on 183 (only for 180)
1: change status to ring
2: start local ring if needed and be ready to accept media (which is usually a ringtone or announcement and will stop the locally generated ringback once media
received)
Will call startRingbackTone() on 180 and 183 but stop on early media receive.
3: start media receive and playback (and media recording if the earlymedia parameter is set)
4: change status to ringing and start media receive and playback (and media recording if the earlymedia parameter is set to true)
5: play early ringback and dont stop even if incoming early media starts
Will call startRingbackTone() on 180 and 183 and do NOT stop on early media receive.
Default value is 2.
*Note: on ringing status the web phone is able to generate local ringback tone. However with the default settings this locally generated ringtone playback is stopped immediately
when media is started to be received from the server (allowing the user to hear the server ringback tone or announcements)
ringtimeout
(number)
Maximum ring time allowed in millisecond.
Default is 90000 (90 second)
You can also set separate ring timeout for incoming and outgoing calls with the ringtimeoutin and ringtimeoutout settings.
calltimeout
(number)
Maximum speech time allowed in millisecond.
Default is 10800000 (3 hours)
mediatimeout
(number)
RTP timeout in seconds to protect again dead sessions.
Calls will be disconnected if no media packet is sent and received for this interval.
You might increase the value if you expect long call hold or one way audio periods.
Set to 0 to disable call cut off on no media.
Default value is 300 (5 minute)
bargeinheader
(string)
You can barge-in or spy on the calls by sending a specific SIP header specified by the bargeinheader parameter available for NS and Java engines.
For example if you specify the value as X-barge: yes, then when your server sends this in the INVITE, the call will be auto-accepted and hidden joining a
conference with all calls made by the user/agent.
Default is empty (disabled).
voicerecupload
(string)
Voice record upload URL (FTP or HTTP/HTTPS).
With this setting you can setup VoIP call recording (voice recording).
Default value is empty (no voice call recording).
If set then calls will be recorded and uploaded to the specified ftp or http address in pcm/wave, gsm, mp3 or ogg format.
The files can be uploaded to your
your FTP server (any FTP server with specified user login credentials)
or to your HTTP server using HTTP PUT or multipart/form-data POST (in this case you need a server side script to save the uploaded data to file)
You can use the following keywords in the file name as these will be replaced automatically at runtime to their respective values:
DATETIME: will be replaced to current date-time
DATE: will be replaced to current date (year/month/day)
TIME: will be replaced to current time (hour/min/sec)
CALLID: will be replaced to sip call-id
USER: will be replaced to local user name
CALLER: will be replaced to caller party name (caller id)
CALLED: will be replaced to callee party name
SERVER: the domain or IP of the SIP server
COUNTER: an auto-increasing number
If you set a HTTP URI, then the following headers will be also set in the HTTP PUT or POST: X-type, X-filename, X-user, X-caller, X-called, X-callid and X-server.
We recommend to use FTP first (or try this first) as this is very easy to configure and doesnt require any server side script
FTP Example:
ftp://user01:[email protected]/voice_DATETIME_CALLER_CALLED
You can also suggest a particular file format by appending its extension to the file name (for example .wav or .mp3).
For example: ftp://user01:[email protected]/voice_DATETIME_CALLER_CALLED.wav
Since the username:password part is part of the URI here, no special characters are allowed (dont use ftp accounts with characters like @ ; / \ in the
username or in the password).
HTTP Example:
http://www.foo.com/myfilehandler.php/?filename=callrecord_CALLID
You can also suggest a particular file format by appending its extension to the file name (for example .wav or .mp3).
For example: http://www.foo.com/myfilehandler.php/?filename=callrecord_DATETIME_USER.wav
Example HTTP POST header packet if you set the url to http://yourdomain.com/myapi/voicerecord/anyentry?filename=callrecord_DATE_CALLID.mp3:
--------------------------fde9999399e1b8eb
Content-Disposition: form-data; name="file"; filename="callrecord_2017_03_12_xxx.mp3"
Content-Type: application/octet-stream
.....
You will receive file as the form name parameter and the name of the file as the form data filename parameter.
(So you will receive the file name as both the filename form parameter and also in the X-filename HTTP header).
The content type can be application/octet-stream, audio/x-wav, audio/mpeg, audio/x-gsm or audio/ogg.
(Regardless of the suggested file name, you can save the files on your server with any name, this is your choice).
A working example for PHP can be downloaded from here.
More details about handling HTTP file upload: C#, ASP.NET, .PHP, NodeJS, Java.
Note: You can also use the voicerecord API to turn on/off the voice recording at runtime (if not all calls have to be recorded)
brandname
(string)
Brand name of the softphone to be displayed as the title and at various other places such as SIP headers.
Default is empty.
companyname
(string)
Your company name to be displayed in the about box and various other places.
Default is empty.
logo
(string)
Displayed on login page.
Can be text or an image name, ex: "logo.png" (image must be stored in images/folder)
Default is empty.
colortheme
(number)
You can easily change the skin of the supplied user interfaces with this setting (softphone, click to call).
Possible values:
1. Default
2. Light Blue
3. Light Green
4. Light Orange
5. Light Purple
6. Dark Red
7. Yellow
8. Blue
9. Purple
10. Turquoise
11. Light Skin
12. Green Orange
Default is 0.
More details about design changes.
language
Set the language for the user interface.
Two character language code (for example en for English or it for Italian).
More details about localization can be found in the FAQ.
featureset
(number)
User interface complexity level.
0=minimal
5=reduced
10=full (default)
15=more (for tech user)
You might set to 5 for novice users or if only basic call features have to be used.
Default is 10.
showserverinput
(number)
This can be used to hide the server address setting from the user if you already preconfigured the server address in the webphone_api.js (serveraddress config
option), so the enduser have to type only their username/password to use the softphone.
Possible values:
0: no (will hide the server input setting for the endusers)
1: auto (default)
2: yes (will shot the server input setting for the endusers)c
useloginpage
(number)
Whether to use a simplified login page with username/password in the middle (instead of list style settings; old haveloginpage).
Possible values:
-1: auto (will auto set to 1 if featureset is Minimal, otherwise 0)
0: no
1: only at first login
2: always
chatsms
(number)
0: Auto guess or Ask
1: SMS only
2: Chat only
Default is 0.
showincomingchatas
(number)
Define how to handle incoming chat messages.
0: open/show chat window if not in call
1: just set a notification
Default is 0.
conferencerooms
(number)
Enable/disable conference room feature.
0: disabled
1: enabled (if supported by the server)
Default is 1.
callparknumber
(string)
Can be used to add call park and call pickup (will be sent as DTMF for call park and user need to call to pickup number to later reload the call from the same or
other device).
If set, then it will be displayed on the call page as an extra option.
hasringcounter
(boolean)
Enable/disable the time counter during ring-time.
hasfiletransfer
(boolean)
Set to true to enable file transfer.
filetransferurl
(string)
HTTP URI used for file transfer. By default Mizutech service is used which is provided for free with the web softphone.
displaynotification
(number)
Show notifications in phone notification bar (usually on the top corner of your phone).
0:Never
1:On event
2:Always
Default is 1.
displayvolumecontrols
(boolean)
Always display volume controls when in call.
Default is false.
displayaudiodevice
(boolean)
Always display audio device when in call.
Default is false.
displaypeerdetails
(string)
Specify where to display the information returned by scurl_displaypeerdetails.
It can be used display details about the peers from your CRM such as full name, address or other details.
(Useful in call-centers and for similar usage)
Possible values:
0: show on call page (instead of contact picture)
1: on new page
div id: display on the specified DIV element
savetocontacts
(number)
Whether to (automatically) add new unknown called numbers to your contact list.
0:No
1:Ask
2:Yes (will not ask for a contact name)
Default is 1.
hasincomingcallpopup
(boolean)
Whether to display a popup about incoming calls in certain engines.
Set to false to disable (in this case make sure that you handle the incoming call alert from your HTML/JS if required).
Default is true.
header
(string)
Header text displayed for users on top of softphone windows.
Default is empty.
footer
(string)
Footer text displayed for users on the bottom of softphone windows.
Default is empty.
version
(string)
Version number displayed for users.
Default is empty (will load the built-in version number)
messagepopup
(string)
Display custom popup for user once.
Default is empty.
showsynccontactsmenu
(number)
This is to allow contact synchronization between mobile and desktop.
-1=don't show
0=show Sync option in menu and Contacts page (if no contacts available)
1=show in menu only
Default is 1
defcontacts
(string)
Set one or more contacts to be displayed by default in the contact list.
Name and number separated by comma and contacts separated by semicolon:
Example: defcontacts: 'John Doe,12121;Jill Doe,231231'
disableoptions
(string)
List of settings options and features to be disabled or hidden.
To disable entire features, use the upper case keywords such as CHAT,VIDEO,VOICEMAIL,CONFERENCE.
To disable settings, use the setting label or name such as Audio device, Call forward.
Example: disabledsett: 'theme,email,Call forward,callforwardonbusy,callforwardonnoanswer,callforwardalways,VIDEO'
hidesettings
(string)
List of settings options to be disabled or hidden when using the softphone skin.
Example: hidesettings: 'theme,email,callforwardonbusy,callforwardonnoanswer,callforwardalways,autoaccept,autoanswer_forward,forward,autoignore'
extraoption
(string)
Custom parameters can be set in a key-value pair list, separated by semicolon Ex: displayname=John;
Default is empty.
logsendto
(number)
Specify allowed actions on the logs page.
0: no options (users will still be able to copy-paste the logs)
1: upload (default)
2: email launch (the email address set by the supportmail parameter or [email protected] if not set)
links
(strings)
The webphone GUI can load additional information from your web server application or display some content from your website internally in a WebView or
frame. You can integrate the included softphone user interface with your website and/or VoIP server HTTP API (if any) by using the following parameters:
advertisement: Advertisement URL, displayed on bottom of the softphone windows.
supportmail: Company support email address.
supporturl: Company support URL.
newuser: New user registration http request OR link (if API then suffix with star *)
forgotpasswordurl: Will be displayed on login page if set.
homepage: Company home page link.
accounturi: Company user account page link.
recharge: Recharge http request (pin code must be sent) or link.
p2p: Phone to phone http request or link.
callback: Callback http request or link (For example: http://yourdomain.com/callback?user=USERNAME)
sms: SMS http request.
creditrequest: Balance http request, result displayed to user.
ratingrequest: Rating http request, result displayed for user on call page.
helpurl: Company help link.
licenseurl: License agreement link.
extramenuurl: Link specifying custom menu entry. Will be added to main page (dialpad) menu.
extramenutxt: Title of custom menu entry. Will be added to main page (dialpad) menu.
Parameters can be treated as API requests (specially interpreted) or links (to be opened in built-in webview). For http API request the value must begin with
asterisk character: "*http://domain.com/...." For example if the "newuser" is a link, then it will be opened in a browser page; if it's an API http request (begins
with *), then a form will be opened in the softphone with fields to be completed.
o The followings are always treated as API request: creditrequest, ratingrequest
o The followings can be links OR API http requests: newuser, recharge, p2p, callback, sms
o The rest will be treated always as links (opened in built-in webview or separate browser tab)
You can also use keywords in these settings strings which will be replaced automatically by the web softphone. The following keywords are recognized:
o DEVICEID: unique identifier for the client device or browser
o SESSIONID: session identifier
o USERNAME: sip account username. preconfigured or entered by the user
o PASSWORD: sip account password
o CALLEDNUMBER: dialed number
o PEERNUM: other party phone number or SIP uri
o PEERDETAILS: other party display name and other available details
o DIRECTION: 1=outgoing call, 2=incoming call
o CALLBACKNR,PHONE1, PHONE2: reserved
o PINCODE: reserved. will be used in some kind of requests such as recharge
o TEXT: such as chat message
o STATUS: status messages: onLoad, onStart, callSetup, callRinging, callConnected, callDisconnected, inChat, outChat
o MD5SIMPLE: md5 (pUser + ":" + pPassword)
o MD5NORMAL: md5 (pUser + ":" + pPassword+":"+randomSalt)
o MD5SALT: random salt
Parameter security
Parameters are safe by default since they are used only in the user http session. This means that the enduser can discover its own settings including the
password, but other users including users for the same browser or middle-men such as the ISP- will not be able to see the sensitive parameters if you are using
secure http (HTTPS).
The only sensitive parameter is the SIP account password! (This is sent only as digest hash in signaling, but make sure to never display or log from your code)
Make sure to never hardcode the password into your website (It should not found if you check the source of your webpage in the browser. The only exception
would be if you offer some free to call service which is not routed to outside paid trunks/carriers). If the password has to be preconfigured then load it via an
ajax call or similar method; just make sure to use HTTPS in this case because otherwise all the communication is in clear text between the browser and your
server if the page is running on unsecure HTTP. Otherwise just let the endusers to enter their password on a login/settings form and pass it to the webphone
with the setsipheader() API call.
Please note that even if you pass the password around in clear text, you are still protected if your page is in secured (on HTTPS). Only the enduser might be able
to found its own password from the browser in this case, but this is usually not a problem since the users should know their own password anyway (Or if
somehow you dont wish the enduser to known its own password then you can implement your own custom encryption or obfuscation in JavaScript)/
There is no much reason to try to obfuscate or hide other parameters.
For example the serveraddress can be discovered anyway by analyzing the low level network traffic and this is perfectly normal. Most of the other parameters
are completely irrelevant. Some sensitive informations are also managed by the webphone (such as the user contact list) however these are stored only locally
in the browser secure web storage or secure cookie by default (on HTTPS) and further encrypted or obfuscated by the webphone.
The following methods can be used to further secure the webphone usage:
-set the loglevel to 1 (with loglevel 5 the password might be written in the logs)
-dont hardcode the password if possible (let the users to enter it) or if you must hardcode it then use encryption and/or obfuscation
-restrict the account on the VoIP server (for example if the webphone is used as a support access, then allow to call only your support numbers)
-instead of password, use the MD5 and the realm parameters if possible (and this can also passed in encrypted format to be more secure)
-instead of preconfigured parameters you can use the javascript VoIP api (setparameter)
-use https (secure http / TLS)
-encrypt/obfuscate the password in JavaScript code if you wish to hide it even from its owner
-for parameter encoding (encryption/obfuscation) you can use XOR + base64 with your built-in key (ask from Mizutech), prefixed with the encrypted__3__
string (you can verify your encryption with this tool using selecting XOR Base64 Encrypt)
-secure your VoIP server (account limits, rate-limits, balance limits, fraud detection) and follow the VoIP security best practices. For example here you can find
some details about mizu VoIP server security.
JavaScript API
About
You can use the webphone javascript library in multiple ways for many purposes:
create your own web dialer
add click to call functionality to your webpage
add VoIP capability to your existing web project or website
integrate with any CRM, callcenter client or other projects
modify one of the existing projects to achieve your goal (see the included softphone and click to call examples) or create yours from scratch
and many others
The public JavaScript API can be found in "webphone_api.js" file, under global javascript namespace "webphone_api".
To be able to use the webphone as a javascript VoIP library, just copy the webphone folder to your web project and add the webphone_api.js to your page.
Basic example
<head>
<!-- Include the webphone_api.js to your webpage -->
<script src="webphone_api.js"></script>
</head>
<body>
<script>
//Wait until the webphone is loaded, before calling any API functions
webphone_api.onLoaded(function () {
//Make a call (Usually initiated by user action, such as click on a click to call button. Number can be extension, SIP username, SIP URI or mobile/landline phone)
webphone_api.call(NUMBER);
//Send instant message (Number can be extension, SIP username. Usually called from a send chat button)
webphone_api.sendchat(NUMBER, MESSAGETEXT);
});
//You should also handle events from the webphone and change your GUI accordingly (onXXX callbacks)
</script>
</body>
See the webphone package for more examples. You should check especially the tech demo (techdemo_example.html / techdemo_example.js).
Note: If you dont have JavaScript/web development experience, you can still fully control and customize the webphone:
by its numerous configuration options which can be passed also as URL parameters
from server side as described here
we can also send ready to use fully customized web softphone with preconfigured settings, branding and integration with your web and VoIP server
Functions
Use the following API calls to control the webphone:
Example:
setparameter(username,john); //this will set the SIP username to be used for upcoming registration or call
Note:
All parameters are saved by the webphone so they will persist (except if you clear the browser storage and/or cookies).
You can easily clear previously set values using the delsettings () API or by using the setparameter with an empty value.
For example setparameter(displayname,);
getparameter (param)
Return type: string
Will return value of a parameter if exists, otherwise will return empty string.
Example:
var mystringvariable = getparameter(displayname); //this will return the display name if it was set previously
start()
Optionally you can "start" the phone, before making any other action.
In some circumstances the initialization procedure might take a few seconds (depending on usable engines) so you can prepare the webphone with this method
to avoid any delay when the user really needs to use by pressing the call button for example.
Set the autostart parameter to false if you wish to use this function. Otherwise the webphone will start automatically on your page load.
If the serveraddress/username/password is already set and auto register is not disabled (not 0), then the webphone will also register (connect) to the SIP server
upon start.
If start() is not called, then the webphone will initialize itself the first time when you call some other function such as register() or call().
The webphone parameter should be set before you call this method (preset in the js file or by using the setparameter() function). See the Parameters section
for details.
stop()
Optionally you can "stop" the webphone engine (but this is done automatically on browser close or refresh, so not really needed). Calling the stop() API will also
unregister.
register ()
Optionally you can "register" if your SIP server has also registrar roles (most of them have this). This will "connect" to the SIP server by sending a REGISTER
request and will authenticate if requested by the server (by sending a second REGISTER with the digest authorization details).
Note:
o If the serveraddress/username/password is already set and auto register is not disabled (not 0), then the webphone will register (connect) to the SIP server
upon start, so no need to use this function in these circumstances.
o There is no need to call the register() multiple times as the webphone will automatically manage the re-registrations (based on the registerinterval
parameter)
registerex (accounts)
You can use this function to register with multiple SIP accounts (multi-account feature).
The accounts are passed as string in the following format: server,usr,pwd,ival;server2,usr2,pwd2,ival
Note: another way to be registered with multiple accounts is to launch multiple webphone instances
unregister ()
Un-register from your SIP server (will send a REGISTER with Expire header set to 0, which means de-registration).
Unregister is called also automatically at browser close so usually there is no need to call this explicitly.
call (number)
Initiate call to a number, sip username or SIP URI.
Perhaps this is the most important function in the whole webphone API.
It will automatically handle all the details required for call setup (network discover, ICE/STUN/TURN when needed, audio device open and call setup signaling).
With this function you can make calls via your SIP server or SIP service provider:
to any SIP endpoint (such as softphone or IP phone)
to any WebRTC endpoint
to pstn/mobile/landline (if your server allows outbound calls. If you have a SIP subscription then most probably you need a positive balance to be able to make pstn calls)
videocall (number)
Initiate a video call to a number, sip username or SIP URI.
The WebRTC engine is required for video to work (the webphone will handle this automatically by switching to WebRTC on video request if it is available).
Will failback to a simple voice call if video is not supported by peer, by the server or gateway. It should always work between WebRTC endpoints if users has a
camera device.
If the webphone is used as SDK and video feature is used, then you will have to add the following <div> element to your page as the container of the video that
will be displayed:
<div id="video_container"></div>
screenshare (number)
Initiate a screen sharing session with the user specified by the number parameter.
Special permissions might be needed. See also the screensharing parameter for details.
hangup ()
Disconnect current call.
Notes about line-management (in case if you are implementing a multi-line user interface, otherwise you dont need to deal with line numbers):
o If the line is set to -2 it will disconnect all active calls.
o If line is set to -1, then it will disconnect the call on the current line (default behavior).
o Otherwise it will disconnect the call on the specified line.
accept ()
Connect incoming call.
reject ()
Disconnect incoming call.
(You can also use the hangup() function for this)
ignore ()
Silently ignore incoming call.
forward (number)
Forward incoming call to the specified number (phone number, username or extension)
mute (state, direction)
Mute current call.
Pass true for the state to mute or false to un-mute.
The direction can have the following values:
0: mute in and out
1: mute out (speakers)
2: mute in (microphone)
hold (state)
Hold current call. This will issue an UPDATE or a reinvite with the hold state flag in the SDP (sendrecv, sendonly, recvonly and inactive).
Set state to true to put the call on hold or false to un-hold.
transfer (number)
Transfer current call to number which is usually a phone number or a SIP username. (Will use the REFER method after SIP standards).
If the number parameter is empty and there are 2 calls in progress, then it will transfer line A to line B.
You can set the mode of the transfer with the transfertype parameter.
If number is empty than will mix the currently running calls (interconnect existing calls if there is more than one call in progress).
If number is a number between 1 and 9 then it will mean the line number.
Otherwise it will call the new number (usually a phone number or a SIP user name) and once connected will join with the current session.
Example:
call(999); //normal call to 999
conference(1234); //will call 1234 and add to conference (conference between local user + 999 + 1234)
conference(2,false); //remove line 2 from conference
conference(); //add all current calls to conference
conference(,false); //destroy conference (but keep the calls on individual lines)
setline(3); //select the third line
hangup(); //will disconnect the third line
setline(-2); //select all lines
hangup(); //will disconnect all lines
Note:
-if number is empty and there are less than 2 active calls, then the conference function cant be used (you cant put one single active call into a conference)
-you can also use the webphone with your server conference rooms/conference bridge. In this way, there is no need to call this function (just make a normal call to your server
conference bridge/room access number)
dtmf (msg)
Send DTMF message by SIP INFO or RFC2833 method (depending on the "dtmfmode" parameter).
Please note that the msg parameter is a string. This means that multiple dtmf characters can be passed at once and the webphone will streamline them properly.
The dtmf messages are sent with the protocol specified with the dtmfmode parameter.
Use the space character to insert delays between the digits.
Example:
API_Dtmf(-2,"1");
API_Dtmf(-2," 12 345 #");
Note: You can also just set the voicerecupload parameter to have all calls recorded.
audiodevice()
Open audio device selector dialog (built-in user interface).
getaudiodevicelist(dev, callback)
Call this function and pass a callback, to receive a list of all available audio devices.
For the dev parameter pass 0 for recording device names list or 1 for the playback or ringer devices.
The callback will be called with a string parameter which will contain the audio device names in separate lines (separated by CRLF).
Note: with the Java or NS engine it might be possible that you receive only the first 31 characters from the device name. This is a limitation coming from the OS audio API but it should
not cause any problem, as you can pass it as-is for the other audio device related functions and it will be accepted and recognized as-is.
getaudiodevice(dev, callback)
Call this function and pass a callback, to receive the currently set audio device.
For the dev parameter one of the followings are expected:
0: for recording device
1: for the playback device
2: for ringer device
The callback will be called with a string parameter which will contain the currently selected audio device.
Note: WebRTC doesnt support a separate ringer device at this moment (This is a browser limitation)
getvolume(dev, callback)
Call this function, passing a callback and will return the volume (percent) for the selected device.
The dev parameter can have the following values:
0 for the recording (microphone) audio device
1 for the playback (speaker) audio device
2 for the ringback (speaker) audio device
The callback will be called with the volume parameter which will be 0 (muted), 50 (default volume) or other positive number.
Note: the reason why this needs a callback (and doesnt just returns the volume as the function return value is because for some engines the volume will be requested in an
asynchronous way so it might take some time to complete).
setvolume(dev, volume)
Set volume (percent for the selected device. Default value is 50% -> means no change
The dev parameter can have the following values:
0 for the recording (microphone) audio device
1 for the playback (speaker) audio device
2 for the ringback (speaker) audio device
setsipheader(header)
Set a custom sip header (a line in the SIP signaling) that will be sent with all messages.
Can be used for various integration purposes (for example for sending the http session id or any custom data).
For example: setsipheader(X-MyExtra: whatever);
You can also set extra SIP headers with the customsipheader parameter.
Note:
It is recommended to prefix customer headers with X- so it will bypass SIP proxies.
Multiple lines can be separated by semicolon ; Example: setsipheader(X-MyExtra1: aaa; X-MyExtra2: bbb);
Multiple lines can be also set by calling this function multiple times with different keys.
There are two kinds of headers that you can set:
o per line: if the current line is set and there is an active call on that line
o global (set for all lines including the registrar endpoint): if the line is -2 or there is no current call on the selected line (for example if you set it at startup, before any
calls or with line set to -2)
You can remove all the previously passed headers (per line or global) by calling this function with an empty string. Example: setsipheader();
You can remove a previously set header by calling this function with an empty key for that header. Example: setsipheader(X-MyExtra:);
getsipheader(header, callback)
Call this function passing a callback.
Example: getsipheader(Contact,mycallback)
The passed callback function will be called with one parameter, which will be the string value of the requested sip header from the received SIP messages
(received from your server of from the other peer). If no such header is found or some other error occurs, then the returned string begins with ERROR (for
example: ERROR: no such header) so you might ignore these.
Note:
-The reason why this needs a callback (and doesnt just returns the last seen header values is because for some engines the signaling messages have to be requested in an
asynchronous way so it might take a little time usually only a few milliseconds- to complete the request).
-The getsipheader() will send you the headers from the incoming SIP messages (not the headers previously set by the setsipheader() function call)
You can use this function if you have good SIP knowledge and wish to parse the SIP messages yourself from JavaScript for some reason (for example to extract
some part of it to be processed for other purposes).
Example to return the last received INVITE message about an incoming call: getsipmessage(0,3,mysipmsgrecvcallback)
Note: just as other functions, this will take in consideration the active line (set by setline() or auto set on in/out call setup). You can set the active line to all [with setline(-2)] to get
the last message regardless of the line.
getlinedetails (line)
Will return the state and various parameters of an endpoint as a string in the following format:
LINEDETAILS,line,state,callid,remoteusername,localusername,type,localaddress,serveraddress,mute,hold,remotefullname
getlastcalldetails ()
Returns a string with details about the previously disconnected call.
getregfailreason ()
Returns a string with the reason about failed connect/registration.
setline (line)
This function can be used for explicit line/channel management and it will set the current active channel.
For the line parameter you can pass one of the followings:
-line number: -2 (all), -1 (current/best), 0 (invalid), 1 (first channel), 2 (second channel) . 100
-sip call id (so the active line will be set to the line number of the endpoint with this sip call id)
-peer username (so the active line will be set to the line number of the endpoint where the peer is this user)
Use this function only if you present line selection for the users. Otherwise you dont have to take care about the lines as it is managed automatically (with each
call on the first free line)
Note: You can set the line to -2 and -1 only for a short period. After some time the getline() will report the real active line or best line.
More details about multi-line can be found in the FAQ.
getline ()
Return type: number
Will return the current active line number. This should be the line which you have set previously except after incoming and outgoing calls (the webphone will
automatically switch the active line to a new free line for these if the current active line is already occupied by a call).
More details about multi-line can be found in the FAQ.
isregistered ()
Return type: boolean
Return true if the webphone is registered ("connected") to the SIP server.
Note: you can track the phone state machine also with the events callbacks or check this FAQ.
isincall ()
Return type: boolean
Return true if the webphone is in call, otherwise false.
Note: you can track the phone state machine also with the events callbacks.
ismuted ()
Return type: boolean
Return true if the call is muted, otherwise will return false.
isonhold ()
Return type: boolean
Return true if the call is on hold, otherwise will return false.
isencrypted ()
Check if communication channel is encrypted: -1=unknown, 0=no, 1=partially, 2=yes, 3=always
checkpresence (userlist)
Will receive presence information as events: PRESENCE, status,username,displayname,email (displayname and email can be empty)
Userlist: list of sip account username separated by comma.
In order for presence to work, make sure that your server has support for subscribe/notify.
setpresencestatus (status)
Function call to change the user online status with one of the followings strings: Online, Away, DND, Invisible, Offline (case sensitive).
getenginename ()
Returns the currently used engine name as string: "java", "webrtc", "ns", "app", "flash", "p2p", "nativedial".
Can return empty string if engine selection is in progress.
Might be used to detect the capabilities at runtime (for example whether you can use the below jvoip function or not)
listcontacts (all)
This function will return a String containing the whole contact list. If there are no contacts, it will return null.
Set the all parameter to true to receive also virtual contacts as well, like voicenumber, etc...
Contacts will be separated by "carriage return new line": \r\n
Contact fields will be separated by "tabs": \t
A contact can have more than one phone numbers or SIP URIs, so these will be separated by Pipe(Vertical bar): |
See example below:
The order of fields and their meaning:
name: String - the name of the contact
number: array of String - the number(s)/SIP URI(s) of the contact
favorite: int - 0=No, 1=Yes
email: String - email address of the contact
address: String - the address of the contact
notes: String - notes attached to this contact
website: String: web site attached to this contact
getworkdir ()
Returns the working directory for the NS and Java engines (not applicable for WebRTC and Flash).
The working directory is the folder which is used to save any files (configurations, logs, voice recordings).
delsettings (level)
Delete stored data (from cookie, config file and local-storage).
For the level parameters the following are defined:
1: just settings file
2: delete everything: settings, contacts, call history, messages
You should call this on logout (not at start) if for some reason you wish to delete the stored phone settings.
jvoip(name, jargs)
If engine is Java or the NS Service plugin, then you can access the full low-level API as described in the JVoIP SDK documentation.
Parameters:
Name: name of the function
Jargs: array of arguments passed to the called function. Must be an array, if API function has parameters. If API function has no parameters, then it can be an
empty array, null, or omitted altogether.
For example the low level API function: API_Call(number) can be called like this: webphone_api.jvoip('API_Call', line, number);
getlogs ()
Returns a string containing all the accumulated logs by the webphone (the logs are limited on size, so old logs will be lost after long run).
More details about logs can be found here.
getstatus ()
Returns the webphone global status. The possible returned texts are the same like for getEvenetsnotifications.
You might use the events described below instead of polling this function.
Events
The following callback functions can be used to receive event from the webphone such as the phone state machine status (registered/call init/call
connected/disconnected) and other important events and notifications:
onLoaded (callback)
The passed callback function will be called when the webphone was loaded.
You can start working with the webphone library from here. Call any API function only after this callback!
onStart (callback)
The passed callback function will be called when the VoIP engine was started.
Webphone is ready to make call here.
Note: you can already initiate calls on the onLoaded callback as those will be queued and executed after onStart.
onRegistered (callback)
The passed callback function will be called on registered (connected) to VoIP server (if the webphone has to register).
onRegisterFailed (callback)
The passed callback function will be called on connection or registration failure with the reason as a string parameter.
onUnRegistered (callback)
The passed callback function will be called on unregistered (disconnected) from VoIP server.
Note: If user closes the webpage, then you might not have enough time to catch this event.
onCallStateChange (callback)
The passed callback function will be called on every call state change.
Parameters:
status: can have following values: callSetup, callRinging, callConnected, callDisconnected
direction: 1 (outgoing), 2 (incoming)
peername: is the other party username (or phone number or extension)
peerdisplayname: is the other party display name if any
line number
onChat (callback)
The passed callback function will be called when chat message is received.
Parameters:
from: username, phone number or SIP URI of the sender
msg: the content of the text message
line number
onDTMF (callback)
The passed callback function will be called when a DTMF digit is received.
Parameters:
dtmf: received DTMF character as string
line number
onCdr (callback)
The passed callback function will be called at each call disconnect. You will receive a CDR (call detail record).
Parameters:
caller: the caller party username (or number or sip uri)
called: called party username (or number or sip uri)
connect time: milliseconds elapsed between call initiation and call connect (includes the call setup time + the ring time)
duration: milliseconds elapsed between call connect and hangup (0 for not connected calls. Divide by 1000 to obtain seconds)
direction: 1 (outgoing call), 2 (incoming call)
peerdisplayname: is the other party display name if any
reason: disconnect reason as string
line number
Note: you can get some more details about the call by using the getlastcalldetails() function.
onDisplay (callback)
Here you can receive important events and notifications (as strings) that should be displayed to the user.
The passed callback function will be called with two string parameters:
-message: a text message intended to be displayed for the user
-title: the title of the "popup/alert". This can be null/empty for some messages
For example:
o "Invalid phone number or SIP URI or username" (displayed if user is trying to call an invalid peer)
o "Waiting for permission. Please push the Allow/Share button in your browser..." (when waiting for WebRTC browser permission)
o Check your microphone! No audio record detected. (which is displayed after 6 seconds in calls if the VAD doesnt report any activity).
If you call this function, then the webphone will not display these messages anymore (You can silently ignore them, handle somehow or just display to the user).
If you dont setup a callback for this, then the notifications will be displayed as auto-hiding popups.
Note:
-The text of the message is language dependent, meaning if the language of the webphone is changed, the message/title language is also changed.
-Engine selection related popups are always handled by the webphone (However these are presented only when really necessary and can be suppressed by forcing the webphone to a
single engine)
onLog (callback)
The passed callback function will receive all the logs in real time. It can be used for debugging or for log redirection if the other possibilities dont fit your needs.
onEvents (callback)
This function returns ALL events from the webphone including sip stack state, notifications, events and logs.
This is a low level function and you should prefer the onXXX callback instead of using string typed notifications.
Call this function once and pass a callback, to receive important events (as strings), which should be displayed for the user and/or parsed to perform other
actions after your software custom logic. For the included softphone and click to call these are already handled, so no need to change, except if you need some
extra custom actions or functionality.
See the Notifications section below for the details.
Example:
varevtarray = event.split(',');
If you dont wish to deal with notification strings parsing, then you can use the functions below to catch the important events from the webphone in which you
are interested in. Call them once, passing a callback:
Notifications
Notifications means simple string messages received from the webphone which you can parse with the onEvents(callback) to receive notifications and events
from the sip web phone about its state machine, calls statutes and important events.
Skip this section if you are not using the onEvents() function. (You can use the functions such as onRegistered/onCallStateChange/others to catch the important
events in which you are interested in and completely skip this section about the low-level notification strings handling).
If you are using the onEvents() function then you will have to parse the received notification strings from your java script code. Each notification is received in a
separate line (separated by CRLF). Parameters are separated by comma ,. For the included softphone and click to call these are already handled, so no need to
change, except if you need some extra custom actions or functionality.
STATUS,line,statustext,peername,localname,endpointtype,
Where line can be -1 for general status or a positive value for the different lines.
General status means the status for the best endpoint.
This means that you will usually see the same status twice (or more). Once for general phone status and once for line status.
For example you can receive the following two messages consecutively:
STATUS,1,Connected,peername,localname,endpointtype,peerdisplayname,[callid], online,registered,incall,mute,hold,encrypted
STATUS,-1,Connected
You might decide to parse only general status messages (where the line is -1).
The following statustext values are defined for general status (line set to -1):
o Initializing
o Ready
o Register
o Registering
o Register Failed
o Registered
o Accept
o Starting Call
o Call
o Call Initiated
o Calling
o Ringing
o Incoming
o In Call (xxx sec)
o Hangup
o Call Finished
o Chat
Note: general status means the best status among all lines. For example if one line is speaking, then the general status will be In Call.
The following statustext values are defined for individual lines (line set to a positive value representing the channel number starting with 1):
o Unknown (you should not receive this)
o Init (started)
o Ready (sip stack started)
o Outband (notify/options/etc. you should skip this)
o Register (from register endpoints)
o Subscribe (presence)
o Chat (IM)
o CallSetup (one time event: call begin)
o Setup (call init)
o InProgress (call init)
o Routed (call init)
o Ringing (SIP 180 received or similar)
o CallConnect (one time event: call was just connected)
o InCall (call is connected)
o Muted (connected call in muted status)
o Hold (connected call in hold status)
o Speaking (call is connected)
o Midcall (might be received for transfer, conference, etc. you should treat it like the Speaking status)
o CallDisconnect (one time event: call was just disconnected)
o Finishing (call is about to be finished. Disconnect message sent: BYE, CANCEL or 400-600 code)
o Finished (call is finished. ACK or 200 OK was received or timeout)
o Deletable (endpoint is about to be destroyed. You should skip this)
o Error (you should not receive this)
You will usually have to display the call status for the user, and when a call arrives you might have to display an accept/reject button.
For simplified call management, you can just check for the one-time events (CallSetup, CallConnect, CallDisconnect)
For example the following status means that there is an incoming call ringing from 2222 on the first line:
STATUS,1,Ringing,2222,1111,2,Katie,[callid]
The following status means an outgoing call in progress to 2222 on the second line:
STATUS,2,Speaking,2222,1111,1,[callid]
To display the global phone status, you will have to do the followings:
1. Parse the received string (parameters separated by comma)
2. If the first parameter is STATUS then continue
3. Check the second parameter. It -1 continue otherwise nothing to do
4. Display the third parameter (Set the caption of a custom html control)
5. Depending on the status, you might need to do some other action. For example display your Hangup button if the status is between Setup
and Finishing or popup a new window on Ringing status if the endpointtype is 2 (for incoming calls only; not for outgoing)
If the jsscripstats is on (set to a value higher than 0) then you will receive extended status messages containing also media parameters at the end of each call:
STATUS,1,Connected,peername,localname,endpointtype,peerdisplayname,rtpsent,rtprec,rtploss,rtplosspercet,serverstats_if_received,[callid]
PRESENCE,peername,presence
This notification is received for as an answer for a previous checkpresence request.
Line: used phone line
Peername: username of the peer
Presence: presence status string; one of the followings:
CallMe,Available,Pending,Other,CallForward,Speaking,Busy,Idle,DoNotDisturb,Unknown,Away,Offline,Exists,NotExists,Unknown
CHAT,line,peername,text
This notification is received for incoming chat messages.
Line: used phone line
Peername: username of the sender
Text: the chat message body
CHATCOMPOSING,line,peername,composing
This notification might be received when the other peer start/stop typing (RFC 3994):
Line: used phone line
Peername: username of the sender
Composing: 0=idle, 1=typing
CHATREPORT,line,peername,status,text
This notification is received for the last outgoing chat message to report success/fail:
Line: used phone line
Peername: username of the sender
Status: 0=unknown,1=sending,2=successfully sent,3=failed to send
Text: failure reason (if Status is 3)
CDR,line,peername,caller,called,peeraddress,connecttime,duration,discparty
After each call, you will receive a CDR (call detail record) with the following parameters:
Line: used phone line
Peername: other party username, phone number or SIP URI
Caller: the caller party name (our username in case when we are initiated the call, otherwise the remote username, displayname, phone number or
URI)
Called: called party name (our username in case when we are receiving the call, otherwise the remote username, phone number or URI)
Peeraddress: other endpoint address (usually the VoIP server IP or domain name)
Connecttime: milliseconds elapsed between call initiation and call connect
Duration: milliseconds elapsed between call connect and hangup (0 for not connected calls. Divide by 1000 to obtain seconds.)
Discparty: the party which was initiated the disconnect: 0=not set, 1=local, 2=peer, 3=undefined
Disconnect reason: a text about the reason of the call disconnect (SIP disconnect code, CANCEL, BYE or some other error text)
DTMF,line,peername,status,text
Incoming DTMF notification (the digit is passed in the msg parameter)
VREC,line,stage,type,path,reason
Voice upload status (for voice recording / call recording).
line: channel number (note: with stage 3 and 4 it will always report -1 or -2 means default/not specified)
stage: 0:disabled, 1:call record begin,2:upload begin, 3: upload success, 4: upload fail (note: stage 0 might not be reported)
type: upload method: 0: unknown, 1: local file, 2: ftp, 3: http, 4: server
path: upload path/file (note: if stage is 1 then type and path is not reported yet)
reason: failure reason (if stage is 4)
Note: this is sent only from the NS and Java engines. There is no client side feedback about WebRTC call recording
START,what
This message is sent immediately after startup (so from here you can also know that the SIP engine was started successfully).
The what parameter can have the following values:
api -api is ready to use
sip sipstack was started
EVENT,TYPE,txt
Important events which should be displayed for the user.
The following TYPE are defined: EVENT, WARNING, ERROR
This means that you might receive messages like this:
WPNOTIFICATION,EVENT,EVENT,any text NEOL \r\n
POPUP,txt
Should be displayed for the users in some way.
ACTION,txt
Various custom messages. Ignore.
LOG,TYPE,txt
Detailed logs (may include SIP signaling).
The following TYPE are defined: EVENT, WARNING, ERROR
VAD,parameters
Voice activity.
This is sent in around every 2000 milliseconds (2 seconds) by default from java and NS engines (configurable with the vadstat_ival parameter in milliseconds) if
you set the vadstat parameter to 3 or it can be requested by API_VAD. Also make sure that the vad parameter is set to at least 2.
This notification can be used to detect speaking/silence or to display a visual voice activity indicator.
Format:
VAD,local_vad: ON local_avg: 0 local_max: 0 local_speaking: no remote_vad: ON remote_avg: 0 remote_max: 0 remote_speaking: no
Parameters:
local_vad: whether VAD is measured for microphone: ON or OFF
local_avg: average signal level from microphone
local_max: maximum signal level from microphone
local_speaking: local user speak detected: yes or no
Other notifications
FAQ
If the included support period with your license is expired, it can be increased by 2 years for around $600 (Note: This is completely optional. There is no need for
any support plan to operate your webphone). For gold partners we also offer priority, phone and 24/7 emergency support.
Direct support is provided for the common features (voice calls, chat, dtmf, hold, forward and others) and common OS/browsers (Windows/Linux/Android/MAC
OS, IE/Firefox/Chrome/Safari/Opera) and not for extra features (such as presence, fax) and exotic OS/Browsers (such as FreeBSD, Chromium, Konqueror). The
webphone should work also with other OS/browsers, but we are not testing every release against exotic platforms.
What I will receive once I have made the payment for the webphone?
You will receive the followings:
the web phone software itself (the webphone files latest stable version- including the engines, javascript API, html5/css skins and examples)
the ready-to-use/turn-key softphone skin and click to call button
latest documentations and code examples
invoice (on request or if you havent received it before the payment)
support on your request according to the license plan
Depending on the client browser and the selected engine, the webphone might have to download some platform specific binaries. (These are found in the
native folder). Make sure that your web server allows the download of these resource types by allowing/adding the following mime types to your webserver
configuration if not already added/allowed:
You can easily test if works by trying to download these files typing their exact URI in the browser such as:
http://yourwebsite.com/webphone/native/webphone.jar
(The browser should begin to download the file, otherwise the jar mime type is still not allowed on your webserver or you entered an incorrect path or
webserver doesnt serve files from the specified folder)
You can also test the webphone without a web server by running from local file system.
The web phone is using the SIP protocol standard to communicate with VoIP servers and sofswitches. Since most of the VoIP servers are based on the SIP
protocol today the webphone should work without any issue. Some modules (WebRTC and Flash) might require specific support by your server or a gateway to
do the translation to SIP, however these modules are optional, gateway software are available for free and also mizutech includes its own free tier service
(usable by default with the webphone).
If you have any incompatibility problem, please contact [email protected] with a problem description and a detailed log (loglevel set to 5). For more
tests please send us your VoIP server address with 3 test accounts.
I wish to use the webphone but I don't have a SIP server or service
If you dont have your own VoIP server, you can use any third-party solution or service:
o SIP account(s) at any VoIP service provider and/or trunk/call-termination services OR
o Buy a VoIP server software or hardware (Cisco, Mizu, Brekeke, others) OR
o A free or open source VoIP server (Asterisk, FreePBX, OpenSIPS, others) OR
o Rent a softswitch (SaaS)
There are many SIP servers over the internet where you can create free SIP accounts.
We also provide such a service here: voip service (you can create multiple sip accounts for free and make calls between them)
Unlike traditional softphones, the webphone can be embedded in webpages while providing the same functionality as a traditional native solution
Single unified JavaScript API and custom web user interface
Easy and flexible customization for all kind of use-case (by the numerous parameters and optionally by using the API)
Compatible with all browsers (IE, Firefox, Safari, Opera, Chrome, etc) and all OS (Windows, Linux, MAC, Android, etc)
Compatible with your existing IP-PBX, VoIP server or any SIP service
Works also behind corporate firewalls (auto tunnel over TCP/HTTP 80 if needed)
Combines modern browser technologies (WebRTC, opus) with VoIP industry standards (G.729, conference, transfer, chat, voice recording, etc)
Easy to use and easy to deploy (copy-paste HTML code)
Easy integration with your existing infrastructure since it is using the open SIP/RTP standards
Easy integration with your existing website design
Proprietary SIP/RTP stack guarantees our strong long term and continuous support
Support for all the common VoIP features
Unlike NPAPI based solutions, the webphone works in all browsers (NPAPI is not supported anymore in Chrome and Firefox also plans do drop it)
Unlike pure WebRTC solutions, the webphone works in all browsers (webrtc doesnt work in IE, Edge, Safari only with extra plugin downloads)
Unlike pure WebRTC solutions, the webphone is optimized for SIP with fine-tuned settings (TURN, STUN and others)
Usage examples
The webphone can be used to create standalone VoIP solutions or integrated with any website or web application.
Here are a few examples about how the webphone could be used:
As a browser phone
Integration with other web or desktop based software to add VoIP capabilities
A convenient dialer that can be offered for VoIP endusers since it runs directly from your website
Callcenter VoIP client for agents/operators (easy integration with your existing software)
Ready to use web VoIP client without the need of any further development
SIP API for your favorite JS framework such as React, jQuery, Angular, Ember, Backbone or any others or just plain/vanilla JS
Embedded in VoIP devices such as PBX or gateways
Click to call functionality on any webpage
VoIP conferencing in online games
Buy/sell portals
WebRTC SIP client or WebRTC softphone
Salesforce help button
Social networking websites , facebook phone
Integrate SIP client with jQuery, Drupal, joomla, WordPress, angularjs, phpBB, vBulletin and others as a web plugin, module or API
As an efficient and portable communication tool between company employees
VoIP service providers can deploy the webphone on their web pages allowing customers to initiate SIP calls without the need of any other equipment
directly from their web browsers
Customer support calls (VoIP enabled support pages where people can call your support people from your website)
VoIP enabled blogs and forums where members can call each other
VoIP enabled sales when customers can call agents (In-bound sales calls from web)
Java Script phone or WebRTC SIP client
Web dialer for Asterisk and FreePBX
Turn all phone numbers into clickable links on your website
Integrate it with any Java applications (add the webphone.jar as a lib to your project)
HTTP Call Me buttons
Remote meetings
HTML5 VoIP
Web VoIP phone for callcenter agents integrated with your callcenter frontend
Asterisk integration (or with any other IP-PBX)
Convert any SIP link (sip: URI) on web to clickable (click to call) links and replace native/softphone solutions with a pure web solution
It is possible to delete the unneeded files (for example you can delete the softphone and the oldieskin folders if you are using the webphone as an API), however
you should not bother too much about these and just leave all the files on your server. This cant have any security implications; the webphone will use only the
required files for your use-case.
With other words: if all our server will be switched off tomorrow, you will be still able to continue using our webphone softphone.
However please note that by default the webphone might use some of the services provided by mizutech to ease the usage and to make it a turn-key solution
without any extra settings to be required from your side. Most of these are used only under special circumstances and none of these are critical for functionality;
all of them can be turned off or changed. The following services might be used:
Mizutech license service: demo, trial or free versions are verified against the license service to prevent unauthorized usage. This can be turned off by purchasing a license
and your final build will not have any DRM or call to home functionality and will continue to work even if the entire mizutech network is down.
Note: this is not used at all in paid versions
WebRTC to SIP gateway: if your server doesnt have WebRTC capabilities but you enable the WebRTC engine in the webphone then it might use the Mizu WebRTC to SIP
gateway service. Other possibilities are listed here.
Note: this might be used only if you are using the webphone WebRTC engine but your server doesnt have support for WebRTC nor you have a WebRTC-SIP gateway.
Flash to SIP gateway: rarely used (only when there is no better engine then Flash). Just turn it off (by setting the enginepriority_flash parameter to 0) or install your own
RTMP server and specify its address.
Note: usually Flash is not used at all as there are better built-in engines which are supported by more than 99.9% of the browsers.
STUN server: by default the webphone might use the Mizutech STUN service. You can change this by changing the stunserveraddress to your server of choice (there are
a lot of free public STUN services or you can run your own: stable open source software exists for this and it requires minimal processing power and network bandwidth
as STUN is basically just a simple ping-pong protocol sending only a few short UDP packets and it is not a critical service).
Note: you can use the webphone without any STUN service if your SIP server has basic NAT handling capabilities and it is capable to route the RTP if/when needed.
TURN server: by default the webphone might use the Mizutech TURN service which can help firewall/NAT traversal in some circumstances (rarely required). You can
specify your own turn server by setting the turnserveraddress parameter (if TURN is required at all).
Note: you can use the webphone without any TURN service if your SIP server has basic NAT handling capabilities and it is capable to route the RTP if/when needed.
JSONP: if you set some external API to be used by the softphone skin (such as for user balance or call rating requests) and your server cant be contacted directly with
AJAX requests due to CORS, then the API calls might be relayed by the Mizutech JSONP or websocket relay. To disable this, make sure that the domain where you are
hosting the web phone plugin can access your domain where your API is hosted.
Note: this might be used only in very specific circumstances (when you integrate the webphone with your own API, but your own API cant be accessed by the webphone
via normal AJAX GET/POST requests)
HTTPS proxy: with the WebRTC engine if you are using the webphone from Chrome and your website is not secured (not https) then the webphone might reload itself via
the Mizu HTTPS proxy. To disable this, host your webphone on HTTPS if you wish to use WebRTC from Chrome. API requests can be also routed via this service (such as
credit or rating requests) if you are running the webphone on HTTPS but defined your SIP server API as HTTP (otherwise browser blocks requests from secure page to
insecure resources)
Note: this might be used only if your website is not on HTTPS (no SSL certificate) and you are using the webphone with the WebRTC engine in Chrome.
Tunneling/encryption/obfuscation: In some conditions the webphone might use the Mizu tunneling service to bypass VoIP blockage and firewalls. This is usually required
in countries where VoIP is blocked (such as UAE or China) or behind heavy firewalls with DPI and you can turn it off by setting the usetunneling parameter to 0.
Note: this is a special feature which needs to be turned on by mizutech support, otherwise it is not enabled by default.
Auto upgrade: the native components can auto-upgrade itself from Mizutech download service. This is enforced only from known old versions to know good versions
(only if the new version is already used by other customers a few weeks). You can disable this by setting the autoupgrade to 6. (You can also set the autoupgrade to 5
which will also disable the upgrade of the built-in SSL certificates, but this should be avoided and upgrading the certificates cant do any harm to your webphone. This is
just to avoid expiring ssl certificates)
Note: this might be used only if you use the webphone NS engine and can be turned off.
Note: if you are using the webphone on a local LAN then these services are not required and are turned off automatically (so the webphone will not try to use
these if your VoIP and/or Web server are located on local LAN / private IP).
If you need to white-list (or block for some reason) our servers, here is the address list associated with the above services:
www.mizu-voip.com, mnt.mizu-voip.com, rtc.mizu-voip.com, usrtcx.webvoipphone.com, usrtc.webvoipphone.com, www.webvoipphone.com
88.150.148.180, 88.150.148.182, 88.150.183.87, 204.12.197.100, 204.12.197.98, 88.150.194.53
By default you dont need to make any configuration changes for the webphone to work for you. If possible (supported by the OS/browser/server/gateway/peer)
the WebPhone will use WebRTC. Otherwise it will select the NS, Java, Flash or App engine and the enduser should not notice any difference.
When the webphone selects the WebRTC engine, it cant connect directly to a server side SIP stack (if your SIP server doesnt have built-in WebRTC support), but
have to convert the WebRTC protocol (coming from the browser) to SIP (which is understood by your VoIP server or IP-PBX).
This conversion is done on the client side (the webphone is sending SIP packets in Websocket which just have to be converted to SIP UDP and it will emit a media
stream compatible with SIP servers) and on the server side (the server, proxy or gateway needs to understand WebRTC, ICE and decrypt DTLS/SRTP into raw RTP
packets).
Most of the time all these can be handled for you automatically, without any further configuration required. However if you need more control, you have several
options to deal with WebRTC:
1. Dont use WebRTC at all. There are other engines built into the web sip phone which can be used most of the time. There are only a few circumstances
when the only available engine would be WebRTC. (Although WebRTC is convenient for enduser since it doesnt need any browser plugin in browsers
where it is supported). To completely disable WebRTC, set the enginepriority_webrtc setting to 0.
2. Check if your VoIP server already has WebRTC support. Most modern VoIP server already has implemented WebRTC (including mizu VoIP server,
Asterisk and others) or you might just need to add/enable a module on your server for this, so chances are high that your VoIP server can handle
WebRTC natively. Just set the webrtcserveraddress setting to point to your server websocket address
3. Use the free Mizutech WebRTC to SIP service tier. This is enabled by default and it might be suitable for your needs if you dont have too much traffic
over WebRTC (the webphone will automatically start to boost the priority for other engines when you are over the free quote)
4. Use the mizutech WebRTC to SIP gateway software. We are providing this software for free (the standard license) for our advanced webphone
customers. (You just have to setup this near your SIP server)
5. Use any third party WebRTC to SIP gateway: There are few free software which is capable to do this task for you, including Asterisk and Dubango.
(However if you dont have any of these installed yet, then we recommend our own gateway as mentioned above as it is proven more reliable than the
alternatives)
6. Use the Mizutech WebRTC to SIP paid service. We can provide dedicated WebRTC to SIP conversion services for a monthly fee if required.
The webphone can be used as a WebRTC softphone by increasing the enginepriority_webrtc to 3 or 4 (in this case it will use the other engines only when
WebRTC is not supported by the browser).
Important: Latest Chrome and Opera browsers requires secure connection to allow WebRTC for both your website (HTTPS) and websocket (WSS). (This means
that if your page is not on HTTPS, then you can use only Firefox to test the webphone WebRTC capabilities).
The following are the conditions for the webphone to be able to use WebRTC:
You must run the webphone from a WebRTC capable browser such as Chrome, Firefox, Edge or Opera (in Safari trough there is no built-in WebRTC
support, the webphone can ask the user to download a plugin, thus turning Safari browsers WebRTC aware)
The webphone must be hosted on secure HTTP (HTTPS) with valid SSL certificate installed for your Web server (This is if you use Chrome or Opera.
With Firefox WebRTC can be used also on unsecure HTTP)
Your SIP server must be located on the public internet (so the webphone can use our free WebRTC-SIP service) OR your SIP server must have WebRTC
capabilities and you need to configure it by the webrtcserveraddress webphone parameter OR you must run a WebRTC gateway on your LAN (we
can also provide a WebRTC-SIP gateway for free with the webphone Advanced or Gold license or you can use open source solutions such as doubango)
If you wish to prioritize the WebRTC engine, just set the enginepriority_webrtc webphone parameter to 3. This way the webphone will use its WebRTC engine
whenever possible (the above conditions are meet) and will try to use other engines (such as NS or Java) only if WebRTC is not supported by the environment.
It is a moving target. The standards are not completed yet. Lots of changes are planned also for 2016. Edge just start to add a different ORTC
implementation
Incompatibility. WebRTC has known incompatibility issues with SIP and there are a lot of incompatibilities even between two WebRTC endpoint as
browsers has different implementation and different codec support
Not supported by all browsers. No support in Edge, IE and Safari. No support on iOS and MAC (except with extra plugin downloads). No support on
older Android phones.
Lack of popular VoIP codec such as G.729 which can be solved only by expensive server side transcoding
It is a black-box in the browser with browser specific bugs and a restrictive API. You have little control on what is going in the background
A WebRTC to SIP gateway required if your VoIP server dont have built-in support for WebRTC
Adds unneeded extra complexity. The server has to convert from the websocket protocol to clear SIP and from DTLS to RTP
Luckily the Mizu webphone has some more robust engines that can be used without these limitations and by default will prioritize these over WebRTC whenever
possible, depending on available browser capabilities and user willingness. (Small non-obtrusive notification might be displayed for the enduser when a better
engine is available or if a user can upgrade with one-click install).
One of the main advantages of the Mizu webphone is that it can offer alternatives for WebRTC, so you can be sure that all your VoIP users are served with the
best available technology, regardless of their OS and browser.
However we do understand that WebRTC is comfortable for the endusers as it doesnt require any extra plugin if supported by the user browser. The mizu
browser hone takes full advantage of this technology and we provide full support for WebRTC by closely following the evolution of the standards.
With a WebRTC only client you would miss all the benefits that could be offered by a standard SIP/RTP client connecting directly to your VoIP server with native
performance, full SIP support with all the popular VoIP codecs and without the need for any protocol conversion, directly from enduser browser.
Known limitations
-Not all the listed features are available from all engines (the webphone automatically handle these differences internally)
-Some platforms currently have very limited VoIP support available from browsers. The most notable is iOS where the default browser (Safari) lacks any VoIP
support. The webphone tries all the best to work around about these by using its secondary engines offering call capabilities also for users on these platforms
-Android chrome uses the speaker (speakerphone) for audio output (this is hardcoded in their WebRTC engine and hopefully they will change this behavior in
upcoming new versions). This affects only the WebRTC engine and you will have normal audio output if using the App engine on Android.
-For chat/IM to work your server have to support SIP MESSAGE as described in RFC 3428 (Supported by most SIP servers. See this section for more details)
-Video is implemented only with the WebRTC engine (the webphone will auto-switch or auto-offer WebRTC whenever possible on video request). WebRTC-SIP
video calls works only if there are a compatible codec on SIP side (H.264 or VP8). WebRTC-WebRTC video calls are expected to work in all circumstances between
same browsers if the users has a camera device. Video re-INVITE will not work with the webphone (use a SIP device which initiate or accept the video from start)
-Separate ringer device selection is not available with the WebRTC engine (this is not a webphone limitation, but there is no such functionality exposed by
current browser implementations)
-Scree sharing requires extra plugin and doesnt work in all browsers
-Some features might not work correctly between WebRTC and SIP. This is not a webphone limitation, but it depends completely on server side (your softswitch
or gateway responsible for WebRTC-SIP protocol conversion).
-Some features require also proper server side support to work correctly. For example call hold, call transfer and call forward. See your VoIP server
documentation about proper setup
-The webphone doesnt work when Private Browsing is enabled (because no outbound WebSocket connections are allowed when private browsing is enabled)
Some chrome versions only use the default input for audio. If you have multiple audio devices and not the default have to be used changing on chrome,
Advanced config, Privacy, Content and media section will fix the problem.
Some linux audio drivers allow only one audio stream to be opened which might cause audio issues in some circumstances. Workaround: change audio driver
from oss to alsa or inverse. Other workarounds: Change JVM (OpenJDK); Change browser.
Incoming calls might not have audio in some circumstances when the webphone is running in Firefox with the WebRTC engine using the mizu WebRTC to SIP
gateway (fixed in v.1.8).
Java related:
These details are important only if for some reason you might wish to force the Java engine. However please note that these java related issue are not real
problems since when possible the webphone uses WebRTC or NS engines, especially as Java is not available in latest Chrome and Firefox anymore.
If the java (JVM or the browser) is crashing under MAC at the start or end of the calls, please set the cancloseaudioline parameter to 3. You might also set the
"singleaudiostream to 5. If the webphone doesnt load at all on MAC, then you should check this link.
One way audio problem on OSX 10 Maverick / Safari 6/7 when using the Java engine: Safari allows users to place specific websites in an "Unsafe Mode" which
grants access to the audio recording. Navigate to "Safari ->Preferences -> Security (tab) and tick "Allow Plug-ins" checkbox. Then depending on safari version:
-from the Internet plug-ins (Manage Website Settings)" find the site in question and modify the dropdown to "Run In Unsafe Mode".
-or go to Plug-in Settings and for the option "When visiting other websites" select "Run in Unsafe Mode". A popup will ask again, click "Trust"
You will be asked to accept the site's certificates or a popup will ask again, click "Trust". Alternatively, simply use the latest version of the Firefox browser.
Java in latest Chrome is not supported anymore (the webphone will select WebRTC by default).
If for some reason you still wish to force Java, then in versions prior September 1, 2015 it can still be re-enabled:
Go to this URL in Chrome: chrome://flags/#enable-npapi (then mark activate)
Or via registry: reg add HKLM\software\policies\google\chrome\EnabledPlugins /v 1 /t REG_SZ /d java
Firefox also drops Java support which can be re-enabled in Firefox 52 by configuring the Firefox setting plugin.load_flash_only to false.
(By default the webphone will handle these automatically by choosing some other engine such as WebRTC unless you forced java by the engine priority settings)
NS engine download not found: you might have to set the nativepluginurl parameter to point to the ns installer file.
nativepluginurl
(string)
This setting is deprecated after 1.9 as the webphone should automatically detect its library path automatically.
The absolute location of the Native Service/Plugin installer. In most of the cases this is automatically guessed by the webphone, but if for some reason (for example: you era using URL rewrite) the guessed location is incorrect,
then it can be specified with this parameter.
The Service/Plugin installer is located in webphone package "native" directory.
Example:
https://mydomain.com/webphopne/native/WebPhoneService_Install.exe
Default value is empty.
By default only the PCMU,PCMA, G.729 and the speex ultra-wideband codecs are offered on call setup which might not be enabled on your server or peer UA.
You can enable all other codecs (PCMA, GSM, speex narrowband, iLBC and G.729 ) with the use_xxx parameters set to 2 or 3 (where xxx is the name of the
codec: use_pcma=2, use_gsm=2, use_speex=2,use_g729=2,use_ilbc=2). Some servers has problems with codec negotiation (requiring re-invite which is not
support by some devices). In these situations you might disable all codecs and enable only one codec which is supported by your server (try to use G.729 if
possible. Otherwise PCMU or PCMA is should be supported by all servers)
If you receive the ERROR, Already in call with xxx error on outbound call attempts and you wish to enable multiple calls to/from the same number, set the
disablesamecall parameter to 0.
If still doesnt work send us a detailed client side log with loglevel set to 5 (from the browser console or from softphone skin help menu)
For a better experience, we recommend to deploy the webphone files on a web server and test from there. The best experience is with a secure web server (via
https), but you can also test with a local web server via http://localhost.
Note: It is completely normal to use the webphone on LANs (browser client with private IP). This FAQ refers to the case when the SIP server (set by the serveraddress
parameter where the webphone will register to) and/or Web server (from where you load your webpage embedding the webphone) is located on private IP.
Details:
The webphone can be used also on local LANs (when your VoIP server and/or Web server are on your private network).
-The NS and Java engines will connect directly to your server as a normal SIP softphone does.
-For WebRTC to work you will need a WebRTC to SIP gateway on your LAN or your PBX have to support WebRTC, otherwise this engine will not be picked up (this
is handled automatically). You should also host your webpage on https (SSL certificate installed on your Web server) for WebRTC to work in Chrome.
-The webphone could use the Mizutech STUN, TURN, JSONP and HTTPS gateway services by default, however these are not required on local LANs (the
webphone will detect this automatically and will not try to use these services while on local LAN).
These circumstances will be automatically handled by the webphone, always selecting the best suitable engine if it has at least one available and unless you
change the engine priority related settings.
The softphone user interface (softphone.html) cant be included multiple times in a page (if you really need multiple phone UI on your page, then use separate
iFrame for them).
4. Load "webphone_api.js" using a script tag in the <head> section of your web page. This is actually not on demand, the webphone will be loaded when the
page is loaded.
5. Load "webphone_api.js" on demand, by creating a <script> DOM element. Below is an example function which loads the script into the <head> section of
the page:
function insertScript(pathToScript)
{
var addScript = document.createElement( "script" );
addScript.type = "text/javascript";
addScript.src = pathToScript;
document.head.appendChild( addScript );
}
6. The webphone can also be loaded into an iframe on demand. To have access to the webphone API in the iframe from the parent page, you have to follow
the below two steps:
a. set the iframe's "id" attribute to "webphoneframe", for example: <iframe id="webphoneframe" src="softphone.html" width="300"
height="500" frameborder="0" ></iframe>
b. include the "iframe_helper.js" file into your parent html page <head> section
c. access the webphone API from the parent page only after the page has finished loading, for example:
window.onload = function ()
{
webphone_api.onLoaded(function ()
{
webphone_api.setparameter("serveraddress", "SERVERADDRESS");
webphone_api.setparameter("username", "USERNAME");
webphone_api.setparameter("password", "PASSWORD");
webphone_api.start();
});
};
Not recommended:
1. The web phone can be loaded on demand using document.write(), but it is a bad practice to call document.write() after the page has finished loading.
2. The web phone can also be loaded using any AMD (Asynchronous Module Loader). This is not recommended, because webphone also uses AMD (Require JS)
to load its modules, so it won't improve performance, but it can lead to conflict between AMD loaders.
There is no way to keep the webphone session alive between page loads.
Instead of this, you should choose one of the followings:
run the webphone in a separate page (on its own dedicated page, so the enduser can just switch to this window/tab if needs to interact with the
webphone)
run the webphone in an frame
load your content dynamically (Ajax)
If this functionality is a must for your project, check the following FAQ for the possibilities.
//store the wopener variable to be used here and also on subsequent pages (useful if we open a third page from the second and so)
var wopener = window; //set to this document
if(window.opener && window.opener.webphone_api)
{
wopener = window.opener; //set to parent page document
}
if(wopener.wopener && wopener.wopener.webphone_api)
{
wopener = wopener.wopener; //the parent page might also loaded from its own parent, so load it from there
}
//create a reference to the webphone so we can easily access it on this page via this variable
var wapi = webphone_api;
New parameters was set but the old settings was loaded
Sometimes you might have to change the settings for each session (for example changing the user credentials).
In these situations it might happen that the webphone is still using the old setting (which you have set for the previous session and not for the current one).
Usually this might happen if the webphone is already started and registered with the old parameters before it loads the new parameters (For example before
you call the setparameter() API with the new values).
To prevent this, you should set the "autostart" parameter to "false" in the webphone_api.js
You can also set the register parameter to "0".
The use the start() and/or register() functions only after the webphone were supplied with the new parameters.
Note:
The webphone is also capable to load its parameters from the URL. Just us the format required (wp_username, wp_password and others).
It is not needed to call the register() after start() because the start() will automatically initiate the register if the server/username/password is already preset when it starts and if you
leave the register parameter at 1.
RTP statistics
For RTP statistics increase the log level to at least 3 and then after each call longer than 7 seconds you should see the following line in the log:
EVENT, rtp stat: sent X rec X loss X X%.
If you set the loglevel parameter to at least 5 than the important rtp and media related events are also stored in the logs.
You can also access the details about the last call from the softphone skin menu Last call statistics item.
NAT settings
In the SIP protocol the client endpoints have to send their (correct) address in the SIP signaling, however in many situations the client is not able to detect its correct public IP (or even
the correct private local IP). This is a common problem in the SIP protocol which occurs with clients behind NAT devices (behind routers). The clients have to set its IP address in the
following SIP headers: contact, via, SDP connect (used for RTP media). A well written VoIP server should be able to easily handle this situation, but a lot of widely used VoIP server fails
in correct NAT detection. RTP routing or offload should be also determined based in this factor (servers should be always route the media between 2 nat-ed endpoint and when at
least one endpoint is on public IP than the server should offload the media routing). This is just a short description. The actual implementation might be more complicated.
With the WebRTC engine make sure that the STUN and TURN settings are set correctly (by default it will use mizu services which will work fine if your server is
on the public internet).
For NS and Java engines you may have to change the webphone configuration according to your SIP server if you have any problems with devices behind NAT
(router, firewall).
If your server has NAT support then set the use_fast_stun and use_rport parameters to 0 and you should not have any problem with the signaling and media for
webphone behind NAT. If your server doesnt have NAT support then you should set these settings to 2. In this case the webphone will always try to discover its
external network address.
Example configurations:
If your server can work only with public IP sent in the signaling:
-use_rport 2 or 3
-use_fast_stun: 1 or 2
If your server can work fine with private IPs in signaling (but not when a wrong public IP is sent in signaling):
-use_rport9
-use_fast_stun: 0
-optionally you can also set the udpconnect parameter to 1
Asterisk is well known about its bad default NAT handling. Instead of detecting the client capabilities automatically it relies on pre-configurations. You should set
the "nat" option to "yes" for all peers.
More details:
http://www.voip-info.org/wiki/view/NAT+and+VOIP
http://www.voip-info.org/wiki/view/Asterisk+sip+nat
http://www.asteriskguru.com/tutorials/sip_nat_oneway_or_no_audio_asterisk.html
Server failover/fallback
Use the following settings if you have 2 voip servers:
In this way the webphone will always send a register to the first server first and on no answer will use the second server (the first server is the
serveraddressfirst at the beginning, but it can change to serveraddress on subsequent failures to speed up the initialization time)
Alternatively you can also use SRV DNS records to implement failover or load balancing, or use a server side load balancer.
Make sure that your browser has support for WebRTC and it works. Visit the following test pages: test1, test2
Make sure to run the webphone from secure http (https) otherwise WebRTC will not work in Chrome and Opera
If you have set the webrtcserveraddress parameter to point to your server or gateway, make sure that your server/gateway has WebRTC enabled
and test it also from some other client such as sipml5: config; test
You might contact mizutech support with a detailed log about the problem
If you are unable to fix webrtc in your setup then you might disable the webrtc engine by setting the enginepriority_webrtc parameter to 0 or 1.
See the other possibilities here.
If you have call quality issues then the followings should be verified:
Check your network quality: upload speed, packet loss, delay and jitter here. (Other tools: a , b, c, d)
Check whether you have good call quality using a third party softphone from the same location (try X-Lite for example). If not, than the problem should
be with your server, termination gateway or bandwidth issues.
Make sure that the CPU load is not near 100% when you are doing the tests
Make sure that you have enough bandwidth/QoS for the codec that you are using
Change the codec (disable/enabled codecs with the codec parameter)
If you are using PCMA, make a test with PCMU (codec =pcmu,use_pcma=0, use_pcmu=3)
Deploy the mediaench module (for AEC and denoise). (Or disable it if it is already deployed and you have bad call quality)
If you are on Linux, try to change your audio driver (from oss to alsa or others)
If you are using Windows, check if you are not affected by high DPC latency
If you are using the webphone with the WebRTC engine then it might happen that the webphone will chose to use our WebRTC-SIP gateway to handle
your traffic. Our gateways are located in US and UK and if you are fare from these locations (Asia, Australia, South America) then you might have too
much delay. There are many ways to solve this: webrtc solutions for web phone
Webphone logs (Check audio and RTP related log entries. Also check the statistics after call disconnect.)
Wireshark log (Check missing or duplicated packets)
If you have multiple sound drivers then make sure that the system default is workable or set the device explicitly from the webphone (with the Audio button
from the default user interface or using the API_AudioDevice function call from java-script)
To make sure that it is a local PC related issue, please try the webphone also from some other PC.
You might also try to disable the wideband codecs (set the use_speexwb and use_speexuwb parameters to 0 or 1).
Another source for this problem can be if your sound device doesnt support full duplex audio (some wrong Linux drivers has this problem). In this case you
might try to disable the ringtone (set the playring parameter to 0 and check if this will solve the problem).
If these dont help, you might set the cancloseaudioline parameter to 3 and/or the "singleaudiostream to 5.
No ringback tone
Depending on your server configuration, you might not have ringback tone or early media on call connect.
There are a few parameters that can be used in this situation:
If subsequent chat messages are not sent reliably, set the separatechatdiag parameter to 1.
Once the webphone is registered, the server should be able to send incoming calls to it.
There are many other things what you can do for a better integration, such as processing cdr records or recording the calls however most of these can be easily
controlled by the webphone parameters or implemented via the API.
We recommend use the NS and/or the Java VoIP engine in call-centers since these provides native call processing, connecting directly to your SIP server without
the need of any extra layer such as WebRTC. More details here.
P2P
The P2P term is misleading sometimes and it can have the following meanings:
Server assisted phone to phone calls. This means that both endpoints will be called by the server and once connected, the server interconnects the 2
endpoint. It can be useful when the client device doesnt have internet connection or doesnt have any platform to enable VoIP, such as an old dumb
phone. Exactly for this concept we refer with the P2P engine.
Peer to peer connection: useful to bypass the server for media or both media and signaling (peer to peer media routing is more important here).
Sometimes it might refer to peer to peer encryption (or end to end E2E encryption) which means that the server (if used) is a passive party from the
encryption point of view and is unable to decrypt the streams between the endpoints (just forwards the stream if needed)
The webphone also has support for peer to peer encrypted media with direct streaming (this is done via ICE techniques with automatic failback to routing via
server if a direct path cant be found.)
SMS
In order for the webphone to be capable sending SMS messages, your softswitch need SMS support.
Usually this is done by using SMS gateway services such as clickatell.
Note: such kind of services cant be used directly from the webphone, because you need to implement billing on your SIP server. So the messages have to be sent
to your SIP server first and from there it can be forwarded to a SMS gateway.
From webphone to server the SMS can be sent via one of the following methods:
via HTTP API: just configure your server SMS API via the sms webphone parameter (you can set this in the webphone_api.js file).
For example:
sms:https://myserver.com/api/function=sms&authkey=5829157329773&authid=4753584&authmd5=xxx&anum=MYNUMBER&bnum=TARGETMOBILE&txt
=TEXT (upper case keywords will be replaced automatically by the webphone).
via chat/IM: instead of calling an API, the SMS messages can be also carrier via SIP MESSAGE (RFC 3428). In this case your server have to check the
destination number and if that is a mobile number then it should forward the message as SMS instead of chat. Alternatively you can set an extra header
from the webphone which can be inspected by your server to determine if the message is an SMS. For example: P-Sms: Yes. You might also set the chatsms
webphone parameter to 1 in this case.
If you are using the mizu softswitch with the webphone, then the sms functionality will be automatically preconfigured in your webphone build if you have
configured sms on your server (via the smsurl global config option or by adding separate SMS gateways in Users and devices)
If your server has sms support and you have configured in the webphone as described above, then you can send SMS from the webphone in the following ways:
if you are using the softphone skin: send SMS as you were sending normal chat messages
if you are using the webphone as a JavaScript library: use the sendsms API
Sometime you might use a separate username/password combination on your website then on your SIP server. In this case you can auto-provision the
webphone with the sip credentials if the user is already logged in on your website to avoid typing a different username/password. This can be implemented
multiple ways:
by dynamically generating the webphone settings from a server script (set the username/password from the server since there you already know the
signed in user details and you can grab the SIP credentials from your softswitch database)
implement a custom API which returns the sip credentials and set its URI as the scurl_setparameters parameter (webphone will call
scurl_setparameters URI and wait for the (key/value) parameters in response and once received it will start the webphone)
handle it from JavaScript (use the setparameter() API to set the username/password)
implement some alternative authentication method on your SIP server (for example based a custom SIP header which you might set from the web
session using the setsipheader() API call)
You can also use the getregfailreason function to find the reason of a failed connect/register attempt.
In the new version (from v.2.2) there is an onRegisterFailed callback where you can listen for failed registrations.
Caller ID display
For outgoing calls the Caller ID (CLI/A number display) is controlled by the server and the application at the peer side (be it a VoIP softphone or a pstn/mobile
phone).
You can use the following parameters to influence the caller id display at the remote end:
o username (this is used for both SIP username and authentication username if sipusername is not set)
o sipusername (if this parameter is set, then the sipusername will be used for authentication and the username parameter as the SIP
username)
o displayname (SIP display name)
If you set all these parameters, then it will be sent in the SIP signaling in the following way (see the uppercase worlds):
INVITE sip:[email protected] SIP/2.0
From: "DISPLAYNAME" <sip:[email protected]>;tag=xyz
Contact: "DISPLAYNAME"<sip:[email protected]>
Remote-Party-ID: "DISPLAYNAME" <sip:[email protected]>;party=calling;screen=yes;privacy=off
Authorization: Digest username="SIPUSERNAME",realm="sipdomain.com"
Some VoIP server will suppress the CLI if you are calling to pstn and the number is not a valid DID number or the webphone account doesnt have a valid DID number assigned (You
can buy DID numbers from various providers).
The CLI is usually suppressed if you set the caller name to Anonymous (hide CLI).
If required by your SIP server, you can also set a Caller Identity header as a customsipheader parameter. (P-Preferred-Identity/P-Asserted-Identity/Identity-Info)
For incoming calls the webphone will use the caller username, name or display name to display the Caller ID. (SIP From , Contact and Remote-Party-ID fields).
if (passwordinput != encodeURIComponent(pwd))
{
//dont allow and display error
}
else
{
//password input is ok. go ahead with it
}
This means that we don't allow special characters and also the followings: , / ? : @ & = + $ # (see the RFC 3986).
We created two tutorials to help Asterisk beginners with the webphone integrations:
1. Using the webphone as a regular SIP client: Asterisk web SIP client
2. If you wish to use the Asterisk built-in WebRTC module: Asterisk WebRTC configuration
More about webphone WebRTC can be found here.
Once a parameter is set, it might be cached by the browser phone and used even if you remove it later.
To prevent this, set the parameter to DEF or NULL. So instead of just deleting or setting an empty value, set its value to DEF or NULL. DEF means that it
will use the parameter default value. For number values instead of removing or commenting them out, you might change to their default value instead.
Also check this FAQ if you made a recent upgrade but still seems that the old version is running.
If still doesnt work, you should check from another PC (to make sure that nothing is preinstalled/cached on your PC).
If still doesnt work, send a detailed log to Mizutech support.
Long answer:
You need to upgrade your webphone in the following situations:
1. If you have used the demo before and pay for the license, Mizutech will send your licensed copy
2. Upon a support request, Mizutech might send you a new build with changes regarding to your request (bug fix/improvement/new feature)
3. Occasionally you might choose to upgrade to the latest version if you see a new version published by Mizutech with features/changes of your interest (new
versions will be provided by mizutech for free during your support period)
Before to upgrade, first you should backup your existing webphone folder.
Then extract the zip sent by Mizutech and replace the files in your webphone folder with the new content, but make sure to:
o preserve the settings: if you set some configuration in the parameters section at the top of the webphone_api.js file, make sure to set them also in the new
file
o dont overwrite files where you made changes if any
Note:
o Although the webphone_js.api file is rarely changed, we dont recommend writing code in this file (except parameter settings at the top of the file). Use
your separate js files for your project and just include the webphone_api.js instead of using it for custom code.
o If you/your customers might use also the NS engine (you havent deprioritized it): you might adjust the minserviceversion if you have this set to any value,
otherwise you might have to upgrade the NS service manually or the new webphone will continue to use the old version (which is not a problem most of
the time, but we dont recommend to use very old outdated versions).
o You might reinstall the NS engine on your test PC if you have used this engine before, for the changes to be applied instantly: For this you just need to run
the WebPhoneService_Install.exe from the webphone\native folder.
o New versions of the webphone are always backward compatible and API compatibility is always ensured except occasional minor/compatible changes so
you can upgrade without any changes in your code. However each you version contains changes in the VoIP engines so you should always verify and test
before to put in production to make sure that the webphone still fulfills your needs and downgrade to the previous version if you encounter issues (Then
you might try the upcoming release again to see if your pending issue were fixed).
If somehow you managed to achieve your goals by modifying the webphone files (and not working in a separate projects/your own files by including the
webphone_api.js as suggested here), then just overwrite all files where you havent made any changes and all should be fine. You must overwrite at least the
followings:
o all .js files from the webphone\js\lib folder
o all files from the webphone\native folder
o all missing files (if there are some new files in the new version not present in your old version)
If you made changes in the webphone_api.js, then either keep your own file or merge the changes.
If your webphone is using the NS engine, then it might be possible that the PC is running an old version. This can be updated in the following ways:
-manually as described below
-set the minserviceversion parameter. If higher than the current installed version then it will ask the user to upgrade (one click install)
Note: the NS service version for v.2.2.4 softphone is 14 (so you can set the minserviceversion setting to 14 to force the latest version for all users, but this is already enforced by
default)
-auto-upgrade: the core of the ns engine is capable to auto upgrade itself if new versions are found (you can disable this by setting the autoupgrade parameter
to 6)
(In the NS service there is a built-in SSL certificate for localhost. This is also capable for auto-upgrade when new certificates are found unless you set the
autoupgrade to 5)
Also check this FAQ if your new settings are not applied.
If still doesnt work, you should check from another PC (to make sure that nothing is preinstalled/cached on your PC).
If still doesnt work, send a detailed log to Mizutech support.
This new webphone has an easy to use API, however if you wish to keep your old code, you can do so with minimal changes as we created a compatibility layer
for your convenience. Follow the next steps to upgrade/migrate to our new webphone:
1. The root folder of the new webphone is the folder, in which "webphone_api.js" and "softphone.html" files are located.
2. Copy the contents of the new webphone root folder, in the same folder where the old webphone's .html file is (merge "images" and "js" folders, if asked upon
copy process).
3. In the <head> section of the .html file, where the old webphone is, replace line:
<script type="text/JavaScript" src="js/wp_common.js"></script>"
with the following lines:
<script type="text/JavaScript" src="webphone_api.js"></script>
<script type="text/JavaScript" src="oldapi_support.js"></script>
Note: Don't remove or add any webphone related Javascript file imports.
"jquery-1.8.3.min.js " file will be imported twice, but that is how it supposed to be, in order for the upgrade to work correctly.
For old webphone customers: please note that this new webphone is a separate product and purchase or upgrade cost might be required. The old java applet
webphone have been renamed to VoIP Applet and we will continue to fully support it. More details can be found in the wiki.
Auto-provisioning
Auto-provisioning or auto-configuration is a simple way to configure IP-phones for SIP servers used on local LAN.
The exact same behavior can be easily achieved by using the webphone with dynamic parameters.
First you should set the parameters common for all instances (all users) on your webserver in the webphone_api.js file.
Then you just have to set account related settings (per user settings) at runtime using one of the method specified in the Parameters chapter (by URL, via a
server API by scurl_setparameters, or from javascript by the setparameter API).
How to translate?
The web sip phone can be easily localized for multiple languages.
The "language" parameter, is a 2 character language code string, for example: "en" for English and "hu" for Hungarian.
To add another language, just take the list of English strings from stringres.js, translate them to the desired language and add an underscore followed by the two
character language code suffix, to every string entry like below:
Desired language: Italian
Language code will be: it
- set the language API parameter: language: 'it',
- after translating all strings from English to Italian, copy them back to stringres.js adding the "_it" suffix:
String resource example:
For english: my_page_title: 'Phone',
For italian: my_page_title_it: 'Telefono',
Contact support if you have any difficulties with this. We will send you the file to be translated and once you translate it, we will apply to your webphone build.
You can create new themes easily by searching for existent dialer skins and after you find one that it is close to your needs just pick the preferred colors
using a software like Color Pic or you can search for a color matching tool to help you in building better color schemes.
Just set your account settings for the webphone and you are ready to go:
-your voip service provider server address (serveraddress webphone parameter)
-sip username (username webphone parameter),
-sip password (password webphone parameter)
-optionally preconfigure the number to call (callto webphone parameter)
You can set these statically from the webphone_api.js file or via javascript using the setparameter and call API. (Mizutech can also hardcode these in your final
licensed build if you wish.)
Then you can use the click2call.html from the samples folder or just use the call API from your custom button.
Note: if you hardcode the above parameters in the webphone_api.js, then it is a good idea to encrypt them or make sure that the account is restricted after your
needs.
For account username/password you should just create a special extension on your SIP server which is not authenticated and allows unrestricted calls to local
extensions only (not to outbound/paid).
Floating webphone
You can add a floating webphone to your website by setting the CSS stype of the DIV or iframe of the container hosting the webphone like this:
style="z-index: 1000; position: fixed; bottom: 0px; right: 0px;"
For example this can be applied for the softphone skin (softphone.html) to make it a floating control on your webpage.
To float the webphone skin over your web page, just set the following CSS attributes for the container HTML element of the webphone (which can be a DIV or an
iframe):
// this aligns the webphone to the bottom-right corner of you page
z-index: 1000; position: fixed; bottom: 0px; right: 0px;
If you wanted for instance to set it in the top-left corner, then the CSS attributes would be:
z-index: 1000; position: fixed; top: 0px; left: 0px;
By default you don't need to do anything to have multi-line functionality as this is managed automatically with each line on the first free line.
If you have multiple ongoing calls, then the active call will be the last one you make or pickup.
Multi-line vs Conference
When we refer to multi-line we mean the capability to have multiple calls in progress at the same time. This doesnt necessarily means conference calls. You
can initiate multiple calls by just using the call API multiple times (to initiate calls to more than one user/phone), so you can talk with remote peers
independently (all pears will hear you unless you use hold on some lines, but the peers will not hear each-others).
To turn multiple calls into a conference, you need to use the conference API (or use the conference button from the softphone.html). When you have multiple
peers in a conference, all peers can hear each-other.
User interface:
Multi line functionality is enabled by default in the webphone.
Once the enduser initiate or receive a second call, the webphone will automatically switch to multi-line mode.
If you are using the softphone skin (the softphone.html) its user interface will display the separate calls in separate tabs, so the user can easily switch between
the active calls.
Actually the followings user interface elements are related to multi line:
on the Call page, once you have a call, you can initiate more calls from Menu -> New call
for every call session, a line button will appear at the top of the page so the users can change the active line from there
the line buttons for managing call sessions, will also appear in case another incoming call arrives
you can easily transfer the call from line A to line B
you can easily interconnect the active lines (create conference calls)
Disable multi-line
You can disable multi-line functionality with the following settings:
-set the multilinegui webphone parameter to 0
-set the "rejectonbusy" setting to "true"
JavaScript library/API
When the webphone is used as an SDK, the lines can be explicitly managed by calling the setline/getline API functions:
- webphone_api.setline(line); // Will set the current line. Just set it before other API calls and the next API calls will be applied for the selected line
- webphone_api.getline(); //Will return the current active line number. This should be the line which you have set previously except after incoming and outgoing
calls (the webphone will automatically switch the active line to a new free line for these if the current active line is already occupied by a call)
For example if there are multiple calls in progress and you wish to hangup one of the calls, then just call the webphone_api.setline(X) before to call
webphone_api.hangup().
The active line is also switched automatically on new outgoing or incoming calls (to the line where the new call is handled).
Channels
The following line numbers are defined:
o -2: all (some API calls can be applied to all lines. For example calling hangup(-2) will disconnect all current calls)
o -1: current line (means the currently selected line or otherwise the best line to be used for the respective API)
o 0: undefined
o 1: first channel
o 2: second channel
o
o N: channel number X
Some behaviors will automatically change when you have multiple simultaneous calls. For example the conference API/button will automatically interconnect
the existing parties or the transfer API/button will transfer the call from the current line to the other line.
Note: If you use the setline() with -2 and -1, it will be remembered only for a short time; after that the getline() will report the real active line or best line.
There should be very rare circumstances when the default engine selection algorithm should be changed. The web sip lib always tries to select the engine which
will disturb the user the less (minimizing required user actions) and offers the best performance.
For example don't be inclined to disable Java for the sake of its age. Users will not be alerted to install Java by default. However if Java is already enabled in the user browser then
why not to use it? Java can offer native like VoIP capabilities and there should be no reason to disable it.
We spent a considerable amount of work to always select the best possible engine in all circumstances. Don't change this unadvisedly, except if you have a good
reason to use a particular engine in a controlled environment.
1. With the client side JavaScript using the webphone setparameter API (get the parameters from you webapp or via ajax requests)
2. Just generate the URL (iframe or link) dynamically from your server side scripts with the parameters set as required (wp_username, wp_password and
other URL parameters).
3. Set the scurl_setparameters setting to point to your server side http api which will have to return the details once called by the webphone.
This will be called after "onStart" event and can be used to provision the webphone from server API. The answer should contain parameters as
key/value pairs, ex: username=xxx,password=yyy.
See the beginning of the parameters section for all other possibilities.
If WebRTC engine is selected, how to find the websocket URL, sip server and ice settings.
Search for: "Webrtc connection details:". There you will find all the above details.
When sending logs to Mizutech support, please attach them as text files (dont insert in email body).
Resources
Homepage: https://www.mizu-voip.com/Software/WebPhone.aspx
Download: https://www.mizu-voip.com/Portals/0/Files/webphone.zip
Pricing: https://www.mizu-voip.com/Support/Webphonepricing.aspx
Contact [email protected]