Reputation: 3153
I just took a look JsSIP library, and it seems pretty promising except the fact that it has no actual demonstration or code which implements calling actual mobile phone. so is it actually possible to call phone which is in offline mode or in online? here is code on docs
var ua = new JsSIP.UA(configuration);
ua.start();
// Register callbacks to desired call events
var eventHandlers = {
'progress': function(e) {
console.log('call is in progress');
},
'failed': function(e) {
console.log('call failed with cause: '+ e.data.cause);
},
'ended': function(e) {
console.log('call ended with cause: '+ e.data.cause);
},
'confirmed': function(e) {
console.log('call confirmed');
}
};
var options = {
'eventHandlers' : eventHandlers,
'mediaConstraints' : { 'audio': true, 'video': true }
};
var session = ua.call('sip:[email protected]', options);
even demo is implementing call within browsers, which is more easily done with WebRTC but i want to call phone. how is that possible, if it is possible in OFFLINE mode it would be better
Upvotes: 1
Views: 1734
Reputation: 610
You need first to look for a PSTN provider that provides you with a SIP account to make calls to phone numbers. That's not free typically. Then you probably want to configure such a SIP account in your SIP server and router calls from JsSIP to the PSTN provider. And deal with accounting and so on. Not something trivial.
Upvotes: 2