From 8faf91ea1fe83201d729b84c70948e5d493b19c4 Mon Sep 17 00:00:00 2001 From: Cengiz AKCAN Date: Sun, 12 Jan 2025 17:46:23 +0100 Subject: [PATCH] Update README.md --- README.md | 215 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 145 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 58beeac..9a3e72b 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,145 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. - -The page will reload when you make changes.\ -You may also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can't go back!** - -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. - -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) +# React JsSIP Example +[English](#english) | [Türkçe](#turkish) +# English +This project is a WebRTC-based SIP (Session Initiation Protocol) client built using React and JsSIP. It supports basic VoIP functionalities (making calls, answering incoming calls, rejecting calls, etc.). +## Features +- 📞 Make voice calls +- 📱 Answer/reject incoming calls +- 🔄 End active calls +- 🔊 Audio-only support (no video support) +- ⚡ Low latency with WebRTC technology +- 🔒 STUN/TURN server support +## Requirements +- Node.js (>= 14.0.0) +- React (>= 16.8.0) +- JsSIP library +- WebRTC-enabled modern web browser +- Running Asterisk server +## Installation +1. Clone the project: +```bash +git clone https://github.com/wwwakcan/React-JsSIP-Example.git +cd React-JsSIP-Example +``` +2. Install dependencies: +```bash +npm install +``` +3. Create `.env` file in the project root and set up the required environment variables: +```env +REACT_APP_WEBSOCKET_URL=wss://your-asterisk-server:8089/ws +REACT_APP_SIP_DISPLAY_NAME=Your Name +REACT_APP_SIP_USERNAME=your-username +REACT_APP_SIP_PASSWORD=your-password +REACT_APP_SIP_DOMAIN=your-asterisk-domain +REACT_APP_TARGET_NUMBER=target-number +REACT_APP_STUN_SERVER=stun:your-stun-server:3478 +REACT_APP_STUN_USERNAME=stun-username +REACT_APP_STUN_PASSWORD=stun-password +REACT_APP_TURN_SERVER=turn:your-turn-server:3478 +REACT_APP_TURN_USERNAME=turn-username +REACT_APP_TURN_PASSWORD=turn-password +``` +4. Start the application: +```bash +npm start +``` +## Usage +The application provides four main functions through its user interface: +1. **Making Calls**: + - Click the "CALL" button to make a call + - Button is disabled when not connected to SIP server +2. **Ending Calls**: + - Click the "END" button to terminate active call + - Button is disabled when no active call exists +3. **Answering Calls**: + - Click the "ANSWER" button to accept incoming calls + - Button is disabled when no incoming call exists +4. **Rejecting Calls**: + - Click the "REJECT" button to reject incoming calls + - Button is disabled when no incoming call exists +## Connection Status +The application displays the current connection status which can be: +- disconnected +- connecting +- connected +## Security Notes +- All sensitive information is stored in environment variables +- Uses secure WebSocket connection (WSS) +- Supports STUN/TURN server authentication +## License +This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) License. +## Contact +Project Link: [https://github.com/wwwakcan/React-JsSIP-Example](https://github.com/wwwakcan/React-JsSIP-Example) +--- +# Türkçe +Bu proje, React ve JsSIP kullanarak oluşturulmuş bir WebRTC tabanlı SIP (Session Initiation Protocol) istemcisidir. Temel VoIP işlevlerini (arama yapma, gelen aramaları yanıtlama, reddetme vb.) destekler. +## Özellikler +- 📞 Sesli arama yapabilme +- 📱 Gelen aramaları yanıtlama/reddetme +- 🔄 Aktif aramaları sonlandırma +- 🔊 Yalnızca ses desteği (video desteği yok) +- ⚡ WebRTC teknolojisi ile düşük gecikme +- 🔒 STUN/TURN sunucu desteği +## Gereksinimler +- Node.js (>= 14.0.0) +- React (>= 16.8.0) +- JsSIP kütüphanesi +- WebRTC destekli modern bir web tarayıcısı +- Çalışan bir Asterisk sunucusu +## Kurulum +1. Projeyi klonlayın: +```bash +git clone https://github.com/wwwakcan/React-JsSIP-Example.git +cd React-JsSIP-Example +``` +2. Bağımlılıkları yükleyin: +```bash +npm install +``` +3. Proje kök dizininde `.env` dosyası oluşturun ve gerekli ortam değişkenlerini ayarlayın: +```env +REACT_APP_WEBSOCKET_URL=wss://your-asterisk-server:8089/ws +REACT_APP_SIP_DISPLAY_NAME=Your Name +REACT_APP_SIP_USERNAME=your-username +REACT_APP_SIP_PASSWORD=your-password +REACT_APP_SIP_DOMAIN=your-asterisk-domain +REACT_APP_TARGET_NUMBER=target-number +REACT_APP_STUN_SERVER=stun:your-stun-server:3478 +REACT_APP_STUN_USERNAME=stun-username +REACT_APP_STUN_PASSWORD=stun-password +REACT_APP_TURN_SERVER=turn:your-turn-server:3478 +REACT_APP_TURN_USERNAME=turn-username +REACT_APP_TURN_PASSWORD=turn-password +``` +4. Uygulamayı başlatın: +```bash +npm start +``` +## Kullanım +Uygulama kullanıcı arayüzü üzerinden dört temel işlev sunar: +1. **Arama Yapma**: + - "CALL" butonuna tıklayarak arama yapabilirsiniz + - SIP sunucusuna bağlı değilken buton devre dışıdır +2. **Aramayı Sonlandırma**: + - "END" butonu ile aktif aramayı sonlandırabilirsiniz + - Aktif arama yokken buton devre dışıdır +3. **Aramayı Yanıtlama**: + - "ANSWER" butonu ile gelen aramaları kabul edebilirsiniz + - Gelen arama yokken buton devre dışıdır +4. **Aramayı Reddetme**: + - "REJECT" butonu ile gelen aramaları reddedebilirsiniz + - Gelen arama yokken buton devre dışıdır +## Bağlantı Durumu +Uygulama mevcut bağlantı durumunu gösterir: +- disconnected (bağlantı kesildi) +- connecting (bağlanıyor) +- connected (bağlandı) +## Güvenlik Notları +- Tüm hassas bilgiler ortam değişkenlerinde saklanır +- Güvenli WebSocket bağlantısı (WSS) kullanır +- STUN/TURN sunucu kimlik doğrulamasını destekler +## Lisans +Bu proje [MIT](https://choosealicense.com/licenses/mit/) lisansı altında lisanslanmıştır. +## İletişim +Proje Linki: [https://github.com/wwwakcan/React-JsSIP-Example](https://github.com/wwwakcan/React-JsSIP-Example)