Open Jean-Baptiste-Lasselle opened 11 months ago
According https://guillaume.nibert.fr/voip-asterisk-rpi-ipphone-project/ :
/ Create our JsSIP instance and run it:
var socket = new JsSIP.WebSocketInterface('wss:/sip.myhost.com');
var configuration = {
sockets : [ socket ],
uri : 'sip:alice@example.com',
password : 'superpassword'
};
var ua = new JsSIP.UA(configuration); // A user agent reference available in th react context
ua.start(); // this would be in a partytown daemon worker
/**
* and the code below is to call a
* phone via the ip pbx, providing
* the destination phone number
* -
* This code would be outside the
* webworker, and will get a ref on
* the user agent ( "ua", below ), from
* the React context
**/
/ 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:bob@example.com', options);
Below, screenshotof the utube video showing the details of the infos conveyed by SIP protocol:
invitation
field, it mentions a URI of the exact same format as the invitation link we can get from https://tryit.jssip.net/ : <phone number>@<ip address of the destination of the caller, could be wifi assigned ip for a phone, and there we ciould hhave a mobile app>
JsSIP
, this framework has more than 2k+ Github StarsOmy, look at the configuration below :
Asterisk,
we have to edit a couple of Asterisk
config files6001
phone number, then the IP PBX will use the SIP Client extension, to call the 6001 numberQuestion: how do I transfer calls?
Implement the exact asterisk installation instructions at https://guillaume.nibert.fr/voip-asterisk-rpi-ipphone-project/
It will be a multi-stage build, because the installation procedure involves building from source
So it's a client server, not a peer-to-peer, model, (or both options are possible by configuration ? )
et donc on Asterisk
pourra appeler un quelconque des numéros de téléphones de l'infrastructure routr
nous appartenant:
About the RTP protocol (I think ASterisk does use RTP) :