ernaniaz / HTML5-sip-client

HTML5-sip-client is a Javascript based SIP client that uses WebRTC and WebSockets to connect to your SIP server. This project was originally based on ctxSip.

Home Page:https://ernaniaz.github.io/HTML5-sip-client/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML5-sip-client

GitHub release GitHub license

A Javascript SIP client based on SIP.js.

HTML5-sip-client is a Javascript based SIP client that uses WebRTC and WebSockets to connect to your SIP server. The UI is designed to be launched as a popup from within your application. This project was originally based on ctxSip, got some implementations from ha36d fork and many other implementations made, like Brazilian Portuguese internationalization, implementation of DTMF tones and more.

Features

  • Audio only, Hold / Resume, Mute, multiple call support.
  • Auto Answer.
  • Multi language.
  • No plugins required, Works with WebSocket / WebRTC enabled browsers. (Firefox, Google Chrome, Safari, Edge and other modern browsers).
  • Call log is saved to localStorage.
  • Intuitive interface makes it easy for users.
  • Easy to configure and integrate into your project.
  • MIT licensed.

SSL connections for are required for this to work!

Dependencies

Configuring

The webphone application has some hardcoded configurations you'll probably need to change. At js/app.js will find at line 44 the websocket URI, that point to the same server that provided the HTML webphone app page, connecting at port 443 using protocol WSS (Secure WebSocket) and at path /ws. You can change it to point to your SIP server WebSocket port to test. I didn't recomend you to leave your SIP server open to the network, but use a HTTP proxy to provide access only to the this resource at /ws. If you use NGiNX (and Asterisk server, for example), you can use the following NGiNX server configuration:

# Asterisk websocket connection
location /ws {
    proxy_pass http://127.0.0.1:8088/ws;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_read_timeout 86400s;
}

Also, the username used to authenticate at your SIP server was prepend to 'ws' string (js/app.js at line 33). Change it to reflect your server configuration.

Test installation

To test this software, you can easily configure your system, installing a clean, minimal, CentOS 7 OS. You'll need to install Asterisk and NGiNX. You can do it installing VoIPDomain Asterisk repo, with:

curl -s https://packagecloud.io/install/repositories/voipdomain/production/script.rpm.sh | sudo bash

After configure the repository, install the basic packages with:

yum install -y asterisk asterisk-opus asterisk-sip asterisk-pjsip nginx

You'll need to create the Asterisk SSL configuration files, to do it, use:

mkdir /etc/asterisk/keys
ast_tls_cert -C localhost.localdomain -O "Webphone Test" -d /etc/asterisk/keys

And to create the NGiNX self-signed certificate files, use:

mkdir /etc/nginx/ssl
openssl req -new -x509 -sha256 -newkey rsa:2048 -days 365 -nodes -out /etc/nginx/ssl/webphone.localnet.pem -keyout /etc/nginx/ssl/webphone.localnet.key
chmod 600 /etc/nginx/ssl/webphone.localnet.key
openssl req -new -sha256 -key /etc/nginx/ssl/webphone.localnet.key -out /etc/nginx/ssl/webphone.localnet.csr

Copy configuration files from configs/{asterisk,nginx} to your installation, deploy this repo to /var/www/html, start the NGiNX and Asterisk and access your machine using a modern web browser.

Demo

Clone the repository and use the following command in the directory

python -m SimpleHTTPServer 8000

License

MIT License.

About

HTML5-sip-client is a Javascript based SIP client that uses WebRTC and WebSockets to connect to your SIP server. This project was originally based on ctxSip.

https://ernaniaz.github.io/HTML5-sip-client/

License:MIT License


Languages

Language:JavaScript 99.3%Language:HTML 0.5%Language:CSS 0.2%