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
- 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-sip2-builder
- iOS version is based on Vialer-pjsip-iOS
- Send SIP Messages (IM) iOS
- Send SIP Messages (IM) Android
- isTyping iOS
- isTyping Android
First of all you have to initialize module to be able to work with it.
So thats why first step should call start method for sip module.
let endpoint = ;let state = await endpointstart; // List of available accounts and calls when RN context is started, could not be empty because Background service is working on Androidlet accounts calls settings connectivity = state;// Subscribe to endpoint eventsendpoint;endpoint;endpoint;endpoint;endpoint;endpoint; // 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;
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;call // Use this id to detect changes and make actionsendpoint