Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

438
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda