sipjs.com 0.6.0 Receive a Call - Accept a Call
by OnSIP
HTML
<script src="https://rawgit.com/onsip/SIP.js/0.13.5/dist/sip-0.13.5.js"></script>
<video id="remoteVideo"></video>
<video id="localVideo" muted="muted"></video>
<!-- sip.js is included by JsFiddle as External Resources -->
CSS
video {
border: 1px solid lightgrey;
}
JavaScript
/*
* Check out the full guide at
* http://sipjs.com/guides/make-call/
*
* This sample uses
* http://sipjs.com/download/sip-0.13.5.js
*
* Login with your developer account to receive calls at
* http://sipjs.com/demo-phone
*/
var options = {
media: {
local: {
video: document.getElementById('localVideo')
},
remote: {
video: document.getElementById('remoteVideo'),
// This is necessary to do an audio/video call as opposed to just a video call
audio: document.getElementById('remoteVideo')
}
},
ua: {
uri: '[email protected]',
authorizationUser: 'test',
password: 'password',
}
};
var simple = new SIP.Web.Simple(options);
simple.on('ringing', function() {
simple.answer();
});