Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

437
Views
I want to run this javascript code with NodeJS but I get this error if (!window.RTCPeerConnection) { ^ ReferenceError: window is not defined

This is my script js I want to run this javascript code with NodeJS but i get error

const JsSIP = require('jssip');
const NodeWebSocket = require('jssip-node-websocket');
const {execSync} = require('child_process');

JsSIP.debug.enable('*');

async function sleep(ms) {
  return new Promise(resolve => {
    setTimeout(resolve, ms);
  });
}

let socket = new NodeWebSocket('ws://192.168.90.27:8088/ws');

let ua = new JsSIP.UA(
        {
                sockets : [socket],
                uri : 'sip:webrtc_client@192.168.90.27',
                password : '123456',
                display_name : 'webrtc_client'
        });

ua.start();
ua.register();

ua.on('connected', function(e){  });

ua.on('disconnected', function(e){  });

ua.on('newRTCSession', function(e){ console.log(e) });

ua.on('newMessage', function(e){ console.log(e) });
// option for call
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': false, 'video': false }
};
// make a call
var session = ua.call('sip:100@192.168.90.27', options);
i want to make a call with asterisk server with JSsip lib im trying to make a call with asterisk server with JSsip lib but i heard node js can not support WEBrtc and i want to know it this is correct ?

i installed packages like jssip node-jssip-websocket how i can fix the problem ? anybody can help me ?

enter link description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!