All Projects → datso → React Native Pjsip

datso / React Native Pjsip

Licence: gpl-3.0
A PJSIP module for React Native.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to React Native Pjsip

Dart Sip Ua
A dart-lang version of the SIP UA stack.
Stars: ✭ 132 (-42.36%)
Mutual labels:  voip, sip
Vsaudit
VOIP Security Audit Framework
Stars: ✭ 97 (-57.64%)
Mutual labels:  voip, sip
Sip.js
A simple, intuitive, and powerful JavaScript signaling library
Stars: ✭ 1,282 (+459.83%)
Mutual labels:  voip, sip
Stun
A Go implementation of STUN
Stars: ✭ 141 (-38.43%)
Mutual labels:  voip, sip
Ivozprovider
IVOZ Provider - Multitenant solution for VoIP telephony providers
Stars: ✭ 127 (-44.54%)
Mutual labels:  voip, sip
Freeswitch
FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
Stars: ✭ 1,213 (+429.69%)
Mutual labels:  voip, sip
Browser Phone
A fully featured browser based WebRTC SIP phone for Asterisk
Stars: ✭ 95 (-58.52%)
Mutual labels:  voip, sip
Homer7 Docker
HOMER 7 Docker Images
Stars: ✭ 47 (-79.48%)
Mutual labels:  voip, sip
Sippts
Set of tools to audit SIP based VoIP Systems
Stars: ✭ 116 (-49.34%)
Mutual labels:  voip, sip
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-51.97%)
Mutual labels:  voip, sip
Asterisk Cdr Viewer Mod
Simple and fast viewer for Asterisk CDRs and Recordings (Mod)
Stars: ✭ 76 (-66.81%)
Mutual labels:  voip, sip
Linphone Desktop
Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of git://git.linphone.org/linphone-desktop.git
Stars: ✭ 212 (-7.42%)
Mutual labels:  voip, sip
Flexisip
Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
Stars: ✭ 75 (-67.25%)
Mutual labels:  voip, sip
Awesome Voip
🤙Learning VoIP, RTP, pjsip and SIP
Stars: ✭ 83 (-63.76%)
Mutual labels:  voip, sip
Sip3 Ansible
Ansible scripts to install and configure SIP3
Stars: ✭ 64 (-72.05%)
Mutual labels:  voip, sip
Homer App
HOMER 7.x Front-End and API Server
Stars: ✭ 88 (-61.57%)
Mutual labels:  voip, sip
Homer
HOMER - 100% Open-Source SIP / VoIP Packet Capture & Monitoring
Stars: ✭ 855 (+273.36%)
Mutual labels:  voip, sip
Telephone
SIP softphone for Mac
Stars: ✭ 882 (+285.15%)
Mutual labels:  voip, sip
Kamailio
Kamailio - The Open Source SIP Server for large VoIP and real-time communication platforms -
Stars: ✭ 1,358 (+493.01%)
Mutual labels:  voip, sip
Siprtcproxy
网关服务:Sip与Rtc互通,实现Web,Android,iOS,小程序,SIP座机,PSTN电话,手机互通。
Stars: ✭ 217 (-5.24%)
Mutual labels:  voip, sip

react-native-pjsip

A PJSIP module for React Native.

Support

  • Currently support for iOS and Android.
  • Support video and audio communication.
  • Ability to use Callkit and PushNotifications.
  • You can use it to build an iOS/Android app that can communicate with SIP server.
  • Android version is based on react-native-pjsip-builder
  • iOS version is based on Vialer-pjsip-iOS

Installation

Usage

First of all you have to initialize module to be able to work with it.

There are some interesting moment in initialization. When application goes to background, PJSIP module is still working and able to receive calls, but your javascipt is totally suspended. When User open your application, javascript start to work and now your js application need to know what status have your account or may be you have pending incoming call.

So thats why first step should call start method for pjsip module.

import {Endpoint} from 'react-native-pjsip'

let endpoint = new Endpoint();
let state = await endpoint.start(); // List of available accounts and calls when RN context is started, could not be empty because Background service is working on Android
let {accounts, calls, settings, connectivity} = state;

// Subscribe to endpoint events
endpoint.on("registration_changed", (account) => {});
endpoint.on("connectivity_changed", (online) => {});
endpoint.on("call_received", (call) => {});
endpoint.on("call_changed", (call) => {});
endpoint.on("call_terminated", (call) => {});
endpoint.on("call_screen_locked", (call) => {}); // Android only

Account creating is pretty strainghforward.

let configuration = {
  "name": "John",
  "username": "sip_username",
  "domain": "pbx.carusto.com",
  "password": "****",
  "proxy": null,
  "transport": null, // Default TCP
  "regServer": null, // Default wildcard
  "regTimeout": null // Default 3600
  "regHeaders": {
    "X-Custom-Header": "Value"
  },
  "regContactParams": ";unique-device-token-id=XXXXXXXXX"
};
endpoint.createAccount().then((account) => {
  console.log("Account created", account);
});

To be able to make a call first of all you should createAccount, and pass account instance into Endpoint.makeCall function. This function will return a promise that will be resolved when PjSIP initializes the call.

let options = {
  headers: {
    "P-Assserted-Identity": "Header example",
    "X-UA": "React native"
  }
}

let call = await endpoint.makeCall(account, destination, options);
call.getId() // Use this id to detect changes and make actions

endpoint.addListener("call_changed", (newCall) => {
  if (call.getId() === newCall.getId()) {
     // Our call changed, do smth.
  }
}
endpoint.addListener("call_terminated", (newCall) => {
  if (call.getId() === newCall.getId()) {
     // Our call terminated
  }
}

API

  1. Startup
  2. Accounts
  3. Calls
  4. Settings

Demo

The demo project is https://github.com/datso/react-native-pjsip-app. And you will need a SIP server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].