Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f28877ca90
Fetching contributors…

Cannot retrieve contributors at this time

81 lines (61 sloc) 3.013 kb
<html><body>
<object id="testPlugin" type="application/x-linphone" width="200" height="200" onload="alert('The plugin has loaded!');">
<param name="onload" value="pluginCB" />
<param name="enableVideo" value="1" />
<param name="enableVideoPreview" value="1" />
<param name="embedVideo" value="0" />
<param name="autoStart" value="0" />
<param name="autoAccept" value="1" />
<param name="username" value="571891103" />
<param name="password" value="dummypass1A" />
<param name="server" value="sip.helemik.cz" />
</object>
<object id="test1" type="application/x-test1" width="0" height="0" onload="alert('The plugin has loaded!');">
</object>
<hr style="visibility: hidden;" />
<script language="javascript">
var el, t1;
el = window.el = document.getElementById('testPlugin');
t1 = document.getElementById('test1');
el.addEventListener('globalStateChanged', function(state, msg) {
console.log('Global state changed:', state, msg);
});
el.addEventListener('registrationStateChanged', function(state, msg) {
console.log('Reg state changed:', state, msg);
});
el.addEventListener('callStateChanged', function(call, state, msg) {
console.log('Call state changed:', call, state, msg);
window.c = call;
});
el.addEventListener('authInfoRequested', function(user, realm) {
console.log('Auth info requested for', user, realm);
});
function completeStart() {
console.log('Init:', el.init());
// Setup
el.enableLogs("/tmp/linphone-js.log");
el.enableStun("stun.helemik.cz");
console.log('Start:', el.start());
console.log('Proxy:', el.addProxy('sip:sip.helemik.cz', 'sip:571891103@sip.helemik.cz'));
console.log('Auth:', el.addAuthInfo("571891103", "\"ipbx\"", "dummypass1A"));
}
</script>
<input type="button" onclick="alert(el.running);" value="Running?" />
<input type="button" onclick="alert(el.init());" value="Init" />
<input type="button" onclick="alert(el.start());" value="Start" />
<input type="button" onclick="alert(el.quit());" value="Quit" />
<br />
<input type="button" onclick='el.addAuthInfo("571891103", "\"ipbx\"", "dummypass1A")' value="Set auth info" />
<input type="button" onclick="el.addProxy('sip:sip.helemik.cz', 'sip:571891103@sip.helemik.cz')" value="Add proxy" />
<input type="button" onclick="alert(el.registered);" value="Registered?" />
<input type="button" onclick="completeStart();" value="Start" />
<br />
<input type="button" onclick="el.accept()" value="Accept call" />
<input type="button" onclick="el.terminate()" value="Terminate call" />
<br />
<input type="button" onclick="console.log(c = el.call('571891104'))" value="Call 1" />
<input type="button" onclick="console.log(c = el.call('sip:571891104'))" value="Call 2" />
<input type="button" onclick="console.log(c = el.call('sip:571891104@ipbx'))" value="Call" />
<input type="button" onclick="console.log(c = el.call('sip:571891104@sip.helemik.cz'))" value="Call" />
<input type="button" onclick="console.log(c = el.call('sip:571891104@vh027.ipex.cz'))" value="Call" />
<br />
Jump to Line
Something went wrong with that request. Please try again.