{"id":16562045,"url":"https://github.com/florindumitru/react-native-sip","last_synced_at":"2025-03-16T20:30:49.023Z","repository":{"id":57340116,"uuid":"196373621","full_name":"florindumitru/react-native-sip","owner":"florindumitru","description":"SIP module for React Native","archived":false,"fork":false,"pushed_at":"2019-12-18T11:59:01.000Z","size":94011,"stargazers_count":46,"open_issues_count":16,"forks_count":51,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T05:12:56.182Z","etag":null,"topics":["android","ios","react-native","sip"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/florindumitru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-11T10:31:02.000Z","updated_at":"2025-03-03T11:58:44.000Z","dependencies_parsed_at":"2022-08-26T04:30:26.912Z","dependency_job_id":null,"html_url":"https://github.com/florindumitru/react-native-sip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florindumitru%2Freact-native-sip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florindumitru%2Freact-native-sip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florindumitru%2Freact-native-sip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florindumitru%2Freact-native-sip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/florindumitru","download_url":"https://codeload.github.com/florindumitru/react-native-sip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243928223,"owners_count":20370255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","ios","react-native","sip"],"created_at":"2024-10-11T20:35:00.117Z","updated_at":"2025-03-16T20:30:48.665Z","avatar_url":"https://github.com/florindumitru.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# react-native-sip\n![npm version](https://badge.fury.io/js/react-native-sip.svg)\n\n**UPDATE**: Now is compatible with RN 0.60+ (iOS and AndroidX)\n\niOS - For RN 0.60+ you need to execute the following commands:\n\n    yarn add react-native-sip\n    cd ios\n    pod install\n\n\n## Support\n- Currently support for iOS and Android.  \n- Support video and audio communication.\n- Ability to use Callkit and PushNotifications.\n- You can use it to build an iOS/Android app that can communicate with SIP server.\n- Android version is based on [react-native-pjsip-builder](https://github.com/datso/react-native-pjsip-builder)\n- iOS version is based on [Vialer-pjsip-iOS](https://github.com/VoIPGRID/Vialer-pjsip-iOS)\n\n## To do\n\n - [x] Send SIP Messages (IM) iOS\n - [ ] Send SIP Messages (IM) Android\n -  [x] isTyping iOS\n - [ ] isTyping Android\n\n## Installation\n\n- [iOS](https://github.com/florindumitru/react-native-sip/blob/master/docs/installation_ios.md)\n- [Android](https://github.com/florindumitru/react-native-sip/blob/master/docs/installation_android.md)\n\n## Usage\n\nFirst of all you have to initialize module to be able to work with it.\n\nThere are some interesting moment in initialization.\nWhen application goes to background, sip module is still working and able to receive calls, but your javascipt is totally suspended.\nWhen 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.\n\nSo thats why first step should call start method for sip module.\n\n```javascript\nimport {Endpoint} from 'react-native-sip'\n\nlet endpoint = new Endpoint();\nlet 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\nlet {accounts, calls, settings, connectivity} = state;\n\n// Subscribe to endpoint events\nendpoint.on(\"registration_changed\", (account) =\u003e {});\nendpoint.on(\"connectivity_changed\", (online) =\u003e {});\nendpoint.on(\"call_received\", (call) =\u003e {});\nendpoint.on(\"call_changed\", (call) =\u003e {});\nendpoint.on(\"call_terminated\", (call) =\u003e {});\nendpoint.on(\"call_screen_locked\", (call) =\u003e {}); // Android only\n```\n\nAccount creating is pretty strainghforward.\n\n```javascript\nlet configuration = {\n  \"name\": \"John\",\n  \"username\": \"sip_username\",\n  \"domain\": \"pbx.carusto.com\",\n  \"password\": \"****\",\n  \"proxy\": null,\n  \"transport\": null, // Default TCP\n  \"regServer\": null, // Default wildcard\n  \"regTimeout\": null // Default 3600\n  \"regHeaders\": {\n    \"X-Custom-Header\": \"Value\"\n  },\n  \"regContactParams\": \";unique-device-token-id=XXXXXXXXX\"\n};\nendpoint.createAccount().then((account) =\u003e {\n  console.log(\"Account created\", account);\n});\n\n```\n\nTo be able to make a call first of all you should createAccount, and pass account instance into Endpoint.makeCall function.\nThis function will return a promise that will be resolved when sip initializes the call.\n\n```javascript\nlet options = {\n  headers: {\n    \"P-Assserted-Identity\": \"Header example\",\n    \"X-UA\": \"React native\"\n  }\n}\n\nlet call = await endpoint.makeCall(account, destination, options);\ncall.getId() // Use this id to detect changes and make actions\n\nendpoint.addListener(\"call_changed\", (newCall) =\u003e {\n  if (call.getId() === newCall.getId()) {\n     // Our call changed, do smth.\n  }\n}\nendpoint.addListener(\"call_terminated\", (newCall) =\u003e {\n  if (call.getId() === newCall.getId()) {\n     // Our call terminated\n  }\n}\n```\n\n## API\n\n[DOCUMENTATION](https://florindumitru.github.io/react-native-sip/)\n\n\n\n\n*This repo it's based on a fork of [datso/react-native-pjsip](https://github.com/datso/react-native-pjsip).* \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorindumitru%2Freact-native-sip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorindumitru%2Freact-native-sip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorindumitru%2Freact-native-sip/lists"}