All Projects → florindumitru → react-native-sip

florindumitru / react-native-sip

Licence: GPL-3.0 license
SIP module for React Native

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-sip

freepbx
FreePBX container (Asterisk 16; OpenPBX 15 with Backup and IVR modules installed)
Stars: ✭ 36 (-2.7%)
Mutual labels:  sip
Kalbi
Kalbi - Golang Session Initiated Protocol Framework
Stars: ✭ 85 (+129.73%)
Mutual labels:  sip
app
studio link - app - mirror repo only -> issues now https://gitlab.com/studio.link/app
Stars: ✭ 56 (+51.35%)
Mutual labels:  sip
WebphoneLib
Easier web calling by providing a layer of abstraction around SIP.js
Stars: ✭ 52 (+40.54%)
Mutual labels:  sip
siphub
sip capture server by hep。work with OpenSIPS, Kamailo, and FreeSWITCH。
Stars: ✭ 23 (-37.84%)
Mutual labels:  sip
SIPTorch
A "SIP Torture" (RFC 4475) testing suite.
Stars: ✭ 54 (+45.95%)
Mutual labels:  sip
awesome-rtc
📡 A curated list of awesome Real Time Communications resources
Stars: ✭ 196 (+429.73%)
Mutual labels:  sip
VAG.Node
GB28181 PS流转发网关服务<Node 版>,以GB28181对接的方式将摄像机/硬盘录像机 的PS流(H264/H265)打包推送到RTMP服务器。
Stars: ✭ 48 (+29.73%)
Mutual labels:  sip
vsaudit
VOIP Security Audit Framework
Stars: ✭ 104 (+181.08%)
Mutual labels:  sip
simlar-android
Simlar for android
Stars: ✭ 61 (+64.86%)
Mutual labels:  sip
rn-sip-app
React Native SIP App
Stars: ✭ 51 (+37.84%)
Mutual labels:  sip
go-sip-ua
Go SIP UA library for client/b2bua
Stars: ✭ 129 (+248.65%)
Mutual labels:  sip
Core
Free, easy to setup PBX for small business based on Asterisk 16 core
Stars: ✭ 190 (+413.51%)
Mutual labels:  sip
libjuice
JUICE is a UDP Interactive Connectivity Establishment library
Stars: ✭ 197 (+432.43%)
Mutual labels:  sip
Katari
Katari - Python Session Initiated Protocol Framework
Stars: ✭ 29 (-21.62%)
Mutual labels:  sip
sipsak
SIP swiss army knife
Stars: ✭ 96 (+159.46%)
Mutual labels:  sip
SentryPeer
A distributed peer to peer list of bad actor IP addresses and phone numbers collected via a SIP Honeypot.
Stars: ✭ 108 (+191.89%)
Mutual labels:  sip
pyfreebilling
Routing and rating VoIP application for service providers - API based - AGPL v3 - Based on kamailio
Stars: ✭ 75 (+102.7%)
Mutual labels:  sip
sip3-captain-ce
SIP3 Captain (Community Edition)
Stars: ✭ 73 (+97.3%)
Mutual labels:  sip
freeswitch-docker
Dockerfile for freeswitch
Stars: ✭ 40 (+8.11%)
Mutual labels:  sip

react-native-sip

npm version

UPDATE: Now is compatible with RN 0.60+ (iOS and AndroidX)

iOS - For RN 0.60+ you need to execute the following commands:

yarn add react-native-sip
cd ios
pod install

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

To do

  • Send SIP Messages (IM) iOS
  • Send SIP Messages (IM) Android
  • isTyping iOS
  • isTyping Android

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, sip 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 sip module.

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

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 sip 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

DOCUMENTATION

This repo it's based on a fork of datso/react-native-pjsip.

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].