Utilizing JsSIP in a real-world telephone device

After reviewing the JsSIP library, I found it to be quite promising. However, one downside is that there doesn't seem to be an actual demonstration or code provided for making calls to a mobile phone. My question is whether it's possible to call a phone that is offline or online using this library? Here's the code snippet from the documentation:

var ua = new JsSIP.UA(configuration);

ua.start();

// 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:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9dfff2ffddf8e5fcf0edf1f8b3fef2f0">[email protected]</a>', options);

The demo provided only demonstrates calling within web browsers, which can easily be achieved with WebRTC. But my goal is to make calls to a phone. Is it possible to do so, especially in OFFLINE mode?

Answer №1

The initial step is to find a PSTN provider that offers a SIP account for dialing phone numbers. This service usually comes at a cost. Following that, you'll need to set up the SIP account on your server and route calls from JsSIP to the PSTN provider. Additionally, you must handle accounting and other related tasks. It's definitely not a simple process.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using the fieldset element in AngularJS Material causes disruptions in my flex layout

My current issue can be illustrated through two code examples: The first example functions properly when the fieldset is not included. In the second example, including the fieldset causes the layout to extend beyond the window when there is long text (in ...

Best methods for deleting an element's attribute or style attribute

Imagine this snippet of CSS code: .notif-icon { display: inline-block; } In my HTML, I have the following element which starts off hidden by overriding the display property of the notif-icon class: <span id="error" class="notif-icon& ...

Printing a docx file from Node.js to a physical printer

I'm currently working on a project in node.js where I need to enable users to print a docx file directly from the printer. Is there anyone out there who can guide me on how to achieve this using Node.js? ...

Transferring request body data between routes in Express: A guide

In my MERN application, there are two specific routes in place. The first route is designated for 'Storing Data' and is referred to as the 'data' route. The second route is used for 'Register User' functionalities and is known ...

Error in Angular2: Internet Explorer 11 is having trouble accessing the property 'apply' because it is either undefined or null

After upgrading my angular2 packages to the latest versions, I encountered the following error: @angular/common": "^2.3.1 @angular/compiler": "^2.3.1 @angular/core": "^2.3.1 @angular/forms": "^2.3.1 @angular/http": "^2.3.1 @angular/platform-browser": ...

Remove any nulls or undefined values from the object

I have developed a custom function that eliminates null and undefined values from an object. However, it seems to be mistakenly removing keys where the value is 0 as well. For instance: { key1: 'value1', key2: 0 } Even though it shouldn&ap ...

Utilize Jquery to extract HTML content from an array of links and implement regular expressions

Currently, I am embarking on the journey of developing a Google Chrome extension despite my limited experience in this field. My aim is to create a tool that can identify individuals who have left reviews on Amazon products. Specifically, I am looking to l ...

Exploring the process of generating, monitoring, and initiating personalized events in ReactJS

To establish a global custom event for listening and triggering purposes, here is how it can be achieved using jQuery: $(document).on('myCustomEvent', function(){ console.log("myCustomEvent triggered"); }) $(document).trigger('myCustom ...

Position a camera at the center of a sphere using react-three

I've been working on creating a 360 image viewer using @react-three, but I'm struggling with getting the camera properly placed inside the view. Even though I have centered both elements at 0, 0, 0. Here's the link to my project on codesand ...

JavaScript decimal precision function malfunctioning with currency format conversion

My current snippet works perfectly with the currency format 249.00, but I need to adapt it for a site that uses euros with pricing in the format 249,00. When I make this change, the total calculation goes haywire and shows as 29.900,00. Can someone advise ...

display a screen based on conditions using conditional rendering techniques

As I work on the onboarding screen, my goal is to navigate to a different screen when the last item is displayed or clicked instead of just logging "last item" on the console. Here's the code snippet: import React,{useState,useRef} from 'react&a ...

Standardizing URLs with ExpressJS router

Seeking normalized/canonical URLs for a single page application running on an ExpressJS server. While the SPA is supported by a server-side router, templates can vary slightly for different app URLs. One particular difference is the presence of the <li ...

What is the method for obtaining the total number of steps taken in a day (pedometer) exclusively for the current day on the

Is there a way to retrieve the total steps count for the current day only? The tizen.humanactivitymonitor.setAccumulativePedometerListener function allows me to access the accumulativeTotalStepCount, which represents the cumulative walking and running ste ...

Having trouble getting the navigation function to work correctly for my ReactJS image slider

I am looking to create a simple image slider that contains 3 images in an array. I want to be able to navigate through the slider using just one function that can move back and forth between images. If you click "next" on the last image, it should bring ...

Tips for resolving the final item issue in Owl Carousel when using right-to-left (RTL)

Encountering a bug with the rtl setting in owl-carousel. When the rtl is applied to the slider and I reach the last item, the entire slider disappears! Here's the code snippet: var viewportWidth = $("body").innerWidth(); if (viewportWidth & ...

Error in AngularJS: Unable to access property 'get' as it is undefined

Upon examining my App, I found that it is structured as follows: var app = angular.module('cockpit', ['tenantService', 'ngMaterial', 'ngMdIcons']); The controller associated with my App appears like this: angula ...

Efficient PHP caching solution for optimizing JavaScript and CSS performance

I'm facing a unique challenge that I can't seem to solve through typical Google searches. I'm in the process of consolidating all my javascript and css into separate php files using require_once() to pull in the content. The structure of my ...

Executing MySQL queries synchronously in Node.js

When working with NodeJS and mysql2 to save data in a database, there are times when I need to perform database saves synchronously. An example of this is below: if(rent.client.id === 0){ //Save client connection.query('INSERT INTO clients (n ...

Although the xpath simulates a click on the button, it does not actually perform any action

I've been diligently working on an automation test suite for a web application that can be quite temperamental. Following a recent UI update, I decided to run some tests to ensure the GUI, buttons, and xpaths were functioning as expected. The night b ...

Retrieve the outcome from the PHP webpage

I have recently developed a contact page, but I am experiencing an issue with the submit button's functionality. When I click on the submit button, the form is supposed to send the information to a PHP file on the server-side. However, the button does ...