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.).
- 📞 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
- Node.js (>= 14.0.0)
- React (>= 16.8.0)
- JsSIP library
- WebRTC-enabled modern web browser
- Running Asterisk server
- Clone the project:
git clone https://github.com/wwwakcan/React-JsSIP-Example.git
cd React-JsSIP-Example
- Install dependencies:
npm install
- Create
.env
file in the project root and set up the required environment variables:
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
- Start the application:
npm start
The application provides four main functions through its user interface:
- Making Calls:
- Click the "CALL" button to make a call
- Button is disabled when not connected to SIP server
- Ending Calls:
- Click the "END" button to terminate active call
- Button is disabled when no active call exists
- Answering Calls:
- Click the "ANSWER" button to accept incoming calls
- Button is disabled when no incoming call exists
- Rejecting Calls:
- Click the "REJECT" button to reject incoming calls
- Button is disabled when no incoming call exists
The application displays the current connection status which can be:
- disconnected
- connecting
- connected
- All sensitive information is stored in environment variables
- Uses secure WebSocket connection (WSS)
- Supports STUN/TURN server authentication
This project is licensed under the MIT License.
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.
- 📞 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
- 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
- Projeyi klonlayın:
git clone https://github.com/wwwakcan/React-JsSIP-Example.git
cd React-JsSIP-Example
- Bağımlılıkları yükleyin:
npm install
- Proje kök dizininde
.env
dosyası oluşturun ve gerekli ortam değişkenlerini ayarlayın:
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
- Uygulamayı başlatın:
npm start
Uygulama kullanıcı arayüzü üzerinden dört temel işlev sunar:
- Arama Yapma:
- "CALL" butonuna tıklayarak arama yapabilirsiniz
- SIP sunucusuna bağlı değilken buton devre dışıdır
- Aramayı Sonlandırma:
- "END" butonu ile aktif aramayı sonlandırabilirsiniz
- Aktif arama yokken buton devre dışıdır
- Aramayı Yanıtlama:
- "ANSWER" butonu ile gelen aramaları kabul edebilirsiniz
- Gelen arama yokken buton devre dışıdır
- Aramayı Reddetme:
- "REJECT" butonu ile gelen aramaları reddedebilirsiniz
- Gelen arama yokken buton devre dışıdır
Uygulama mevcut bağlantı durumunu gösterir:
- disconnected (bağlantı kesildi)
- connecting (bağlanıyor)
- connected (bağlandı)
- 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
Bu proje MIT lisansı altında lisanslanmıştır.
Proje Linki: https://github.com/wwwakcan/React-JsSIP-Example