{"_id":"@busanid/react-native-voip","_rev":"2-0669d647c3e5dc08332a47ad94bbaf0b","name":"@busanid/react-native-voip","dist-tags":{"latest":"1.1.3"},"versions":{"1.1.2":{"name":"@busanid/react-native-voip","version":"1.1.2","keywords":["react-native","ios","android"],"author":{"name":"busanid"},"license":"MIT","_id":"@busanid/react-native-voip@1.1.2","maintainers":[{"name":"busanid","email":"budi@busanid.dev"}],"homepage":"https://github.com/busanid/react-native-voip#readme","bugs":{"url":"https://github.com/busanid/react-native-voip/issues"},"dist":{"shasum":"f7685d94382a0099a22183547f09c4c86d693d74","tarball":"https://registry.npmjs.org/@busanid/react-native-voip/-/react-native-voip-1.1.2.tgz","fileCount":177,"integrity":"sha512-LJ81qXFjbowwYsz1u1q+4LHm7//AYrPArrZtMAM6LLKgsZiFnDwb2e8dLFXGJRWqKSqUHeJ/L+VsmTaDQ9/Y+A==","signatures":[{"sig":"MEYCIQCxyy1UCLNgnwGquTzL0qYL2Fs2fp6XxXkq5xpiWzoKpwIhAKNX34Y5lZHdH3O1pOPqe6AXLP/GpR4/cXr96bgV7I7K","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":694824},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","engines":{"node":">= 16.0.0"},"gitHead":"16dfb156a08418b52be2b60d791d335334abafe1","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build","example":"yarn --cwd example","prepack":"bob build","release":"release-it","bootstrap":"yarn example && yarn install && yarn example pods","typecheck":"tsc --noEmit"},"_npmUser":{"name":"busanid","email":"budi@busanid.dev"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/busanid/react-native-voip.git","type":"git"},"_npmVersion":"10.9.3","description":"React Native VoIP SDK built on Linphone — SIP calls, video, chat, push notifications, call screening, and more","directories":{},"resolutions":{"@types/react":"17.0.21"},"_nodeVersion":"22.18.0","dependencies":{"uuid":"^9.0.0","zustand":"^4.5.2","react-native-permissions":"^4.1.5","react-native-get-random-values":"^1.8.0"},"react-native":"src/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"^yarn@1.22.15","devDependencies":{"jest":"^28.1.1","react":"18.2.0","eslint":"^8.4.1","events":"^3.3.0","del-cli":"^5.0.0","prettier":"^2.0.5","commitlint":"^17.0.2","release-it":"^15.0.0","typescript":"^4.5.2","@types/jest":"^28.1.2","@types/uuid":"^9.0.1","pod-install":"^0.1.0","@types/react":"~17.0.21","react-native":"0.71.5","react-native-mmkv":"^2.11.0","react-fast-compare":"^3.2.2","@types/react-native":"0.70.0","@evilmartians/lefthook":"^1.2.2","@tsconfig/react-native":"^3.0.9","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","react-native-builder-bob":"^0.20.0","@commitlint/config-conventional":"^17.0.2","@babel/plugin-proposal-decorators":"^7.21.0","@release-it/conventional-changelog":"^5.0.0","@react-native-community/eslint-config":"^3.0.2"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-voip_1.1.2_1777456216193_0.4410017956901102","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"1.1.3":{"name":"@busanid/react-native-voip","version":"1.1.3","description":"React Native VoIP SDK built on Linphone — SIP calls, video, chat, push notifications, call screening, and more","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","prepack":"bob build","release":"release-it","example":"yarn --cwd example","bootstrap":"yarn example && yarn install && yarn example pods","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/busanid/react-native-voip.git"},"author":{"name":"busanid"},"license":"MIT","bugs":{"url":"https://github.com/busanid/react-native-voip/issues"},"homepage":"https://github.com/busanid/react-native-voip#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@babel/plugin-proposal-decorators":"^7.21.0","@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.2.2","@react-native-community/eslint-config":"^3.0.2","@release-it/conventional-changelog":"^5.0.0","@tsconfig/react-native":"^3.0.9","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","@types/uuid":"^9.0.1","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","events":"^3.3.0","jest":"^28.1.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"18.2.0","react-fast-compare":"^3.2.2","react-native":"0.71.5","react-native-builder-bob":"^0.20.0","react-native-mmkv":"^2.11.0","release-it":"^15.0.0","typescript":"^4.5.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"engines":{"node":">= 16.0.0"},"packageManager":"^yarn@1.22.15","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"dependencies":{"react-native-get-random-values":"^1.8.0","react-native-permissions":"^4.1.5","uuid":"^9.0.0","zustand":"^4.5.2"},"_id":"@busanid/react-native-voip@1.1.3","gitHead":"701628a1b27a6709cfebfe86347736afef2672e1","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-B5ken2dcL9YFzfYBywFHGp9onnZl/WVKofwbYKvjIL5H6ABf708MMSrzCBEoSes5qzm6EYXxAuDHgO/VrdtU+g==","shasum":"f6b8849c0a98a8ae12ca96aaddb176029c9c3008","tarball":"https://registry.npmjs.org/@busanid/react-native-voip/-/react-native-voip-1.1.3.tgz","fileCount":177,"unpackedSize":706491,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCtMtvh6gym7hlLLFxH7ecmNXNmbTPmUwFHMgSixJvHLAIhALcCFLkoGxsaQsUcdGT1s56sLjrS06jBRZaJVirSQosU"}]},"_npmUser":{"name":"busanid","email":"budi@busanid.dev"},"directories":{},"maintainers":[{"name":"busanid","email":"budi@busanid.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-voip_1.1.3_1777606622745_0.9221524094949098"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-29T09:50:16.124Z","modified":"2026-05-01T03:37:03.046Z","1.1.2":"2026-04-29T09:50:16.416Z","1.1.3":"2026-05-01T03:37:02.943Z"},"bugs":{"url":"https://github.com/busanid/react-native-voip/issues"},"author":{"name":"busanid"},"license":"MIT","homepage":"https://github.com/busanid/react-native-voip#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/busanid/react-native-voip.git"},"description":"React Native VoIP SDK built on Linphone — SIP calls, video, chat, push notifications, call screening, and more","maintainers":[{"name":"busanid","email":"budi@busanid.dev"}],"readme":"# react-native-voip\n\nA React Native VoIP SDK built on top of [Linphone SDK](https://www.linphone.org/), supporting SIP-based audio/video calls, chat messaging, multi-account management, and more — for both Android and iOS.\n\n## Features\n\n- SIP account registration / unregistration\n- Outgoing & incoming audio calls\n- Video calls with local preview and remote view\n- Multi-account SIP support\n- Chat / messaging\n- Call logs\n- Audio device management (speaker, earpiece, Bluetooth)\n- DTMF support\n- Call recording\n- Hold / Resume\n- Call transfer\n- RSA encryption utilities\n- Android permission helpers (microphone, camera, overlay, battery optimization)\n\n## Installation\n\n```sh\nnpm install react-native-voip\n# or\nyarn add react-native-voip\n```\n\n## Setup\n\n### iOS\n\n1. Add the Linphone podspec source to your `Podfile`:\n\n```ruby\nsource \"https://gitlab.linphone.org/BC/public/podspec.git\"\nsource \"https://github.com/CocoaPods/Specs.git\"\n```\n\n2. Run:\n\n```sh\ncd ios && pod install\n```\n\n### Android\n\n#### Step 1 — Add Linphone Maven repository\n\nReact Native **0.71+** uses `dependencyResolutionManagement` in `settings.gradle`.\nAdd the Linphone repo there:\n\n```gradle\n// android/settings.gradle\ndependencyResolutionManagement {\n    repositories {\n        google()\n        mavenCentral()\n        maven {\n            name \"linphone.org maven repository\"\n            url \"https://linphone.org/maven_repository/\"\n            content {\n                includeGroup \"org.linphone\"\n            }\n        }\n    }\n}\n```\n\nFor older React Native (< 0.71) that still uses `allprojects` in `build.gradle`:\n\n```gradle\n// android/build.gradle\nallprojects {\n    repositories {\n        maven {\n            name \"linphone.org maven repository\"\n            url \"https://linphone.org/maven_repository/\"\n            content {\n                includeGroup \"org.linphone\"\n            }\n        }\n    }\n}\n```\n\n#### Step 2 — Add media dependency\n\nAdd to your app's `android/app/build.gradle`:\n\n```gradle\nimplementation 'androidx.media:media:1.2.0'\n```\n\n#### Step 3 — Add permissions\n\nAdd to `AndroidManifest.xml`:\n\n```xml\n<uses-permission android:name=\"android.permission.CAMERA\" />\n<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />\n<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />\n```\n\n## Usage\n\n### Initialize SIP Provider\n\nWrap your app with `SipProvider` and configure your SIP accounts:\n\n```tsx\nimport { SipProvider } from 'react-native-voip';\n\nexport default function App() {\n  return (\n    <SipProvider\n      accounts={[\n        {\n          id: 'account1',\n          username: 'sip_user',\n          password: 'sip_password',\n          domain: 'sip.yourserver.com',\n          port: 5060,\n        },\n      ]}\n    >\n      <YourApp />\n    </SipProvider>\n  );\n}\n```\n\n### Make a Call\n\n```tsx\nimport { useSIPClient } from 'react-native-voip';\n\nfunction Dialer() {\n  const { call, terminate, answer, activeSession } = useSIPClient('account1');\n\n  return (\n    <>\n      <Button title=\"Call\" onPress={() => call('sip:target@yourserver.com')} />\n      <Button title=\"Hang Up\" onPress={() => terminate()} />\n      {activeSession && (\n        <Button title=\"Answer\" onPress={() => answer()} />\n      )}\n    </>\n  );\n}\n```\n\n### Video Call\n\n```tsx\nimport { useSIPClient, PreviewVideoView, RemoteVideoView } from 'react-native-voip';\n\nfunction VideoCall() {\n  const { call, previewVideoViewRef, remoteVideoViewRef } = useSIPClient('account1');\n\n  return (\n    <>\n      <RemoteVideoView ref={remoteVideoViewRef} style={{ flex: 1 }} />\n      <PreviewVideoView ref={previewVideoViewRef} style={{ width: 120, height: 160 }} />\n      <Button title=\"Video Call\" onPress={() => call('sip:target@yourserver.com', { mediaConstraints: { audio: true, video: true } })} />\n    </>\n  );\n}\n```\n\n### Audio Devices\n\n```tsx\nimport { useAudioDevices } from 'react-native-voip';\n\nfunction AudioControl() {\n  const { audioDeviceList, currentOutputDevice, setAudioDeviceByType } = useAudioDevices();\n\n  return (\n    <>\n      {audioDeviceList.map(device => (\n        <Button\n          key={device.id}\n          title={device.deviceName}\n          onPress={() => setAudioDeviceByType(device.type)}\n        />\n      ))}\n    </>\n  );\n}\n```\n\n### Chat / Messaging\n\n```tsx\nimport { useChat, useChatRoom } from 'react-native-voip';\n\nfunction ChatScreen() {\n  const { chatRooms, createChatRoom } = useChat('account1');\n  const { messages, sendMessage } = useChatRoom(chatRooms[0]);\n\n  return (\n    <>\n      {messages.map(msg => <Text key={msg.id}>{msg.text}</Text>)}\n      <Button title=\"Send\" onPress={() => sendMessage('Hello!')} />\n    </>\n  );\n}\n```\n\n### Permissions (Android)\n\n```tsx\nimport { useSIPPermission } from 'react-native-voip';\n\nfunction PermissionSetup() {\n  const { requestMicrophonePermission, requestCameraPermission } = useSIPPermission();\n\n  useEffect(() => {\n    requestMicrophonePermission();\n    requestCameraPermission();\n  }, []);\n}\n```\n\n## API Reference\n\n### Hooks\n\n| Hook | Description |\n|------|-------------|\n| `useSIPClient(id)` | Main hook for call control (call, answer, terminate, hold, mute, speaker, DTMF, record, transfer) |\n| `useSipAccount()` | Manage SIP accounts (add, remove, update, register) |\n| `useSIPClientStatus(id)` | Registration status of a specific account |\n| `useAudioDevices()` | List and switch audio devices |\n| `useChat(agentId)` | Chat room management |\n| `useChatRoom(chatRoom)` | Messages in a specific chat room |\n| `useSipCore()` | Access call logs |\n| `useSipSetting()` | App-level settings (echo cancellation, DTMF type, playback gain) |\n| `useSIPPermission()` | Android permission helpers |\n| `useUnreadCountInfo(agent)` | Unread message and missed call counts |\n\n### Components\n\n| Component | Description |\n|-----------|-------------|\n| `SipProvider` | Context provider — wrap your app with this |\n| `PreviewVideoView` | Local camera preview for video calls |\n| `RemoteVideoView` | Remote participant video display |\n\n## Dependencies\n\n| Package | Purpose |\n|---------|---------|\n| `react-native-permissions` | Permission management |\n| `react-native-get-random-values` | UUID generation |\n| `uuid` | Unique ID generation |\n| `zustand` | Audio device state management |\n\n## Architecture\n\n```\nJavaScript / TypeScript\n        │\n   Hooks & Context (Hooks.tsx)\n        │\n   Core EventEmitter (Core.tsx)\n        │\nReact Native Native Module Bridge\n    ┌───┴───┐\n Android   iOS\n (Kotlin) (Swift)\n    │         │\nLinphone SDK 5.3.x\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}