Is it possible to call a phone number using sipjs?

1,512 views
Skip to first unread message

Sports highfive

unread,
Dec 6, 2017, 6:17:42 AM12/6/17
to SIP.js
I am using sip js with freeswitch to call actual mobile phone number, but its not working. Although it works fine when I use Sipml. Is it possible with sipjs or am I trying in vain?

Thanks
Waqar

Eric Green

unread,
Dec 6, 2017, 9:48:43 AM12/6/17
to SIP.js
SIP.js can definitely do what you want. See our FreeSWITCH guide.

Sports highfive

unread,
Dec 14, 2017, 10:17:34 AM12/14/17
to SIP.js
It connects just fine and I get the log message

sip.transport | WebSocket wss://mydomain.com:wss_port connected
 sip.ua | connection state set to 0
 but I am trying to initiate an audio call and here is my code for that

var userAgent = new SIP.UA({
  uri: 'myuri',
  ws_servers: 'servers parameters',
  authorizationUser: 'user',
  password: 'pass'
});
var session=null;
var remote= document.getElementById('audio_remote');
var options = {
        media: {
            constraints: {
                audio: true                
            },
            render: {
                remote: document.getElementById('audio_remote')                
            }
        }
    };
var sipCall = function(){
session = userAgent.invite(document.getElementById('txtPhoneNumber').value, options);
}
var sipHangUp=function(){
session.bye();
}

it just turns on the webcam's light and does nothing. While I am able to call using sipml successfully. Can you help please?

Eric Green

unread,
Dec 14, 2017, 10:19:51 AM12/14/17
to SIP.js
Please include a gist of your logs.

Sports highfive

unread,
Dec 14, 2017, 10:26:45 AM12/14/17
to SIP.js


On Wednesday, December 6, 2017 at 4:17:42 PM UTC+5, Sports highfive wrote:

Sports highfive

unread,
Dec 14, 2017, 10:27:57 AM12/14/17
to SIP.js
I also got this after a while

Thu Dec 14 2017 20:26:08 GMT+0500 (Pakistan Standard Time) | sip.dialog | dialog 4b9lumsubqvucbe9q0mv5l1uf0h140U7DK7trSUXHaK  changed to CONFIRMED state
sip-0.9.0.min.js:38 Thu Dec 14 2017 20:26:08 GMT+0500 (Pakistan Standard Time) | sip.invitecontext.sessionDescriptionHandler | Using deprecated stream API
i.print @ sip-0.9.0.min.js:38
i.(anonymous function) @ sip-0.9.0.min.js:38
t.(anonymous function) @ sip-0.9.0.min.js:38
peerConnection.onaddstream @ sip-0.9.0.min.js:38
sip-0.9.0.min.js:38 Thu Dec 14 2017 20:26:08 GMT+0500 (Pakistan Standard Time) | sip.invitecontext.sessionDescriptionHandler | stream added



On Wednesday, December 6, 2017 at 4:17:42 PM UTC+5, Sports highfive wrote:

Eric Green

unread,
Dec 14, 2017, 10:29:37 AM12/14/17
to SIP.js
`render` is not valid with 0.9.X. See the session description handler documentation for how to attach your media. I will try and update that guide to the latest SIP.js in the near future.

Sports highfive

unread,
Dec 14, 2017, 10:39:27 AM12/14/17
to SIP.js
Thanks for the response.

Here is what happened when I tried sip js 0.8.3

can you have a look please?


On Wednesday, December 6, 2017 at 4:17:42 PM UTC+5, Sports highfive wrote:

Eric Green

unread,
Dec 14, 2017, 10:41:06 AM12/14/17
to SIP.js
`render` does not work with 0.8.X either. We are not supporting 0.7.X or 0.8.X. Please update your code to attach media correctly using 0.9.X.

Thanks

Sports highfive

unread,
Dec 14, 2017, 10:45:29 AM12/14/17
to SIP.js
Okays. Thanks a lot for the help


On Wednesday, December 6, 2017 at 4:17:42 PM UTC+5, Sports highfive wrote:
Reply all
Reply to author
Forward
0 new messages