npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-kit-voip

v1.0.3

Published

V9 VOIP SDK for React Native

Downloads

126

Readme

V9 VOIP SDK -- @v9sdk/react-native-voip

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.

Installation

npm i @v9sdk/react-native-voip

Configuation Android/iOS

[Android]

Add permissions & service to android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application>
    ...
    <service
        android:name="com.v9company.ReactNativeV9Sip.V9SipService"
        android:enabled="true"
        android:exported="true" />
    ...
</application>

If your Android targetSdk is 23 or above you should grant android.permission.RECORD_AUDIO at runtime before making/receiving an audio call.

[iOS]

Set permission in info.plist file

<dict>
  ...
  <key>NSMicrophoneUsageDescription</key>
  <string>${PRODUCT_NAME} always microphone for voice call</string>
  <key>NSCameraUsageDescription</key>
  <string>${PRODUCT_NAME} always camera for video call</string>
</dict>

In targets product with Xcode select tab Build Phases Xcode > Open Project > Target > Build Phases

Link Binary With Libraries - Add Framework :

  • AudioToolbox.framework
  • CoreAudio.framework
  • libc++.tbd
  • libc.tbd
  • Accelerate.framework
  • Accessibility.framework

Usage

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

import { V9Voip } from '@v9sdk/react-native-voip';

let voip = new V9Voip();
let state = await voip.start();
let {accounts, calls, settings, connectivity} = state;

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

Account creating is pretty strainghforward.

let configuration = {
  "name": "V9 Team",
  "username": "sip_username",
  "domain": "pbx.v9.com.vn",
  "password": "****"
};

voip.addAccount(configuration).then((account) => {
  console.log("Account created", account);
});

To be able to make a call first of all you should addAccount, and pass account instance into voip.makeCall function.

let options = {
  headers: {
    "P-Assserted-Identity": "Header example",
    "X-UA": "V9 SDK React Native Voip"
  }
}
let destination = '0123456798'; // phone number , example 'sip:0123456798@{configuration.domain}' or 0123456798

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

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

METHOD SUPPORTED

| Command | Description | | --- | --- | | addAccount(account) | information configuation account | | registerAccount(account, renew) | information configuation account, bool renew Nếu đối số renew bằng false => hủy đăng ký. | | deleteAccount(account ) | remove account register | | makeCall(account, destination, options) | {account} , destination {String} Số điện thoại được chỉ định gọi., {options} Cài đặt cuộc gọi đi. | | answerCall(call) | {Call} Call instance | | hangupCall(call) | {Call} Call instance | | declineCall(call) | {Call} Call instance | | holdCall(call) / unholdCall(call) | {Call} Call instance | | muteCall(call) / unMuteCall(call) | {Call} Call instance | | transferCall(account, call, destination) | {Account} Tài khoản được liên kết với cuộc gọi. {Call} Cuộc gọi được chuyển. destination URI của mục tiêu mới sẽ được liên hệ. |

API

Comming soon!!!