Giter VIP home page Giter VIP logo

cx-webphone-sdk's Introduction

ConnexCS Webphone SDK Connector

ConnexCS Webphone is a SIP over WebRTC Client which is used in the ConnexCS Platform.

The purpose of this SDK is to provide minimal lines of code to a stable deployment.

Example Usage

<html>
	<head>
		<title>WebPhone Example</title>
	</head>
	<div id="cxPhone" style="height:300px;width:400px;"></div>
	<script src="https://webphone-sdk.connexcs.com/cx-webphone-sdk.js"></script>
	<script>
		window.addEventListener('DOMContentLoaded', () => {
			// Ready to Init
			var phone = cxWebphone('cxPhone', 'https://webphone.mydomain.com');
		});	
	</script>
</html>
<style> #cxPhone:empty { display: none; } #cxPhone { width: 400px; height: 300px; display: inline-block; } input { width: 30%; } #error { color: #f44336; } </style>
Enter your ConnexCS Portal URL Start

Call 160 Hang Up
<script src="https://webphone-sdk.connexcs.com/cx-webphone-sdk.js"></script> <script> var output = document.getElementById('output'); var isButton = document.getElementById('isButtons'); var phone = null isButton.style.display = 'none'; async function start(url) { try { output.innerHTML = ''; isButton.style.display = 'none'; if (!url) throw new Error('URL is required'); // Ready to Init phone = cxWebphone('cxPhone', url); isButton.style.display = 'block'; } catch (err) { console.error(err) output.innerHTML = `Error: ${err.message}`; output.style.color = "#f44336"; } } async function call (number) { try { output.innerHTML = `Running Function call(${number})`; let result = await phone.call(number) output.innerHTML = `Function call Complete\n` + JSON.stringify(result, null, 4); output.style.color = "#000"; } catch (err) { console.error(err) output.innerHTML = `Error: ${err.message}`; output.style.color = "#f44336"; } } async function hangup () { try { output.innerHTML = ''; let result = await phone.hangup() output.innerHTML = `Call ended\n` + JSON.stringify(result, null, 4); output.style.color = "#000"; } catch (err) { console.error(err) output.innerHTML = `Error: ${err.message}`; output.style.color = "#f44336"; } } </script>

cx-webphone-sdk's People

Contributors

nuneramu avatar

Watchers

Jonathan Hulme avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.