The webphone can be used in two ways: -as a ready to use customizable solution for webmasters/users -or as a JavaScript library for developers to add VoIP capability to any web application You can quickly try it from the online demo page, however for better understanding you should download the demo package and experiment with it. Here are some details about how it works. Just copy the webphone to your webserver (or test it from your local file system) and configure it like you do with a usual SIP client such as an IP Phone or softphone like X-Lite. The only most important setting is the serveraddress. Make sure to set this correctly to your SIP server address (domain or IP:port). Rarely some SIP servers might require also some other settings such as proxyaddress, realm, transport or different username/sipusername. See the "Parameters" chapter in the documentation for the full list of available settings.
You can configure the web phone via it’s settings (parameters) in multiple ways:
The webphone package contains a fully customizable turn-key web softphone and other templates. Follow these steps to deploy the softphone or click to call button to your website:
For simple click-to-call, you can also launch the webphone from URL query parameters. Example link: https://www.webvoipphone.com/webphone_online_demo/click2call.html?wp_serveraddress=voip.mizu-voip.com&wp_username=webphonetest1&wp_password=webphonetest1&wp_callto=testivr3&wp_autoaction=1 Note: you can configure the above way (via URL parameters) not only the click2call.htm, but also any others such as the softphone.html or your own custom html containing the webphone.
Create a custom VoIP solution or integrate the webphone with your application using the JavaScript library. The public JavaScript API can be found in "webphone_api.js" file, under global javascript namespace "webphone_api". You can use it from plain/vanilla JS or from any framework such as Rust, React, Angular, JQuery, Ember and others.
Simple example: <head> <!--include the webphone_api.js to your webpage--> <script src="webphone_api.js"></script> </head> <body> <script> //wait for the webhone to be loaded before to work with it webphone_api.onAppStateChange(function (state) { if (state === 'loaded') //Webphone library is fully loaded here, don't touch any API before this event { //set parameters (alternatively these can be also preset in your html, in the webphone_config.js or passed as URL parameters) //replace the UPPER CASE worlds below webphone_api.setparameter('serveraddress', SERVERADDRESS); //Specify your SIP server IP or domain (:port) webphone_api.setparameter('username', USERNAME); //A SIP username (extension/account) webphone_api.setparameter('password', PASSWORD); //The password for the above SIP account //see the “Parameters” section in the documentation for more options //start the webphone (optional but recommended) webphone_api.start(); //make a call (usually initiated by user action, such as click on a click to call button) webphone_api.call(number); //hangup (usually called on "disconnect" button click) webphone_api.hangup(); //send instant message (usually from a "send chat" button) webphone_api.sendchat(number, message); } }); //you should also handle events from the sip web phone and change your GUI accordingly (onXXX callbacks) </script> </body> You can find more examples and ready to use templates in the downloadable demo package. See the "Development" chapter in the documentation. If you are more comfortable with server side web development (ASP, .NET, java or others) then you can still control the webphone in many ways by:
For more details consult the documentation or contact us with any questions.
WebPhone