The API is designed with love to make it easy to develop rich and robust HTML5 applications in few lines of code.
No need to know how SIP work to start writing your code. Using this API, it will be a piece of cake to write HTML5 VoIP applications.
Below, a very compact code showing how to initialize the engine, start the stack and make video call from bob to alice in less than 15 lines:
SIPml.init(
function(e){
var stack = new SIPml.Stack({realm: 'example.org', impi: 'bob', impu: 'sip:bob@example.org', password: 'mysecret',
events_listener: { events: 'started', listener: function(e){
var callSession = stack.newSession('call-audiovideo', {
video_local: document.getElementById('video-local'), // <video id="video-local" .../>
video_remote: document.getElementById('video-remote'), // <video id="video-remote" .../>
audio_remote: document.getElementById('audio-remote') // <audio id="audio-remote" .../>
});
callSession.call('alice');
}
}
});
stack.start();
}
);
|