1

I Have working with the FreePBX for 2 weeks. I have a running FREEPBX on my local server. I am able to connect Softphones both from PC & Android device to the FreePBX which are on the same network.

Right now I am trying to use JSSIP to connect to that same FREEPBX server & make/receive calls. Following is the sample code I am using to do so.

var URL = 'wss://10.0.0.90:8088';
var socket = new JsSIP.WebSocketInterface(URL);

var configuration = {
  sockets  : [ socket ],
  uri      : URL,
  password : '123456789'
};

var coolPhone = new JsSIP.UA(configuration);

coolPhone.on('registered', function(e){ console.log('Registered') });
coolPhone.on('unregistered', function(e){ console.log('Un-registered') });
coolPhone.on('registrationFailed', function(e){ console.log('Failed') });
coolPhone.start();

But I am ending up with following error on browser console.

Invalid value "wss://10.0.0.90:8088" for parameter "uri"

I guess I may need to configure something from FREEPBX admin panel. But not sure what. Can any one guide what needs to be here.

Thanks in Advance.

Yeasin Hossain
  • 769
  • 2
  • 6
  • 23

1 Answers1

2

uri should look like this sip:alice@mypbx.example.org

Here is my configuration sample:

var socket = new JsSIP.WebSocketInterface('wss://mypbx.example.org:8089/ws');

var configuration = {
    sockets           : [ socket ],
    authorization_user: 'alice',
    uri               : 'sip:alice@mypbx.example.org',
    ws_servers        : 'wss://mypbx.example.org:8089/ws',
    password          : 'secret',
    realm             : 'mypbx.example.org',
    display_name      : 'Alice Cooper',
    contact_uri       : 'sip:alice@mypbx.example.org'
};