Laravel 11 Voice CPaaS Portal
Latest call sessions with duration and audio playback
| Call ID | Caller | Callee | Duration | Status | Reason | Recording | Time |
|---|---|---|---|---|---|---|---|
| No call history recorded yet. | |||||||
Manage developer apps, API keys, Webhooks, and FCM Push credentials
| App Name | App ID | API Key | API Secret | Webhook | FCM VoIP | IVR Notice | Status | Actions |
|---|
Complete historical logs with duration, status, and audio playback
| Call ID | App ID | Caller | Callee | Duration | Status | Reason | Audio Recording | Timestamp |
|---|
Simulate real two-way WebRTC calling between Rider and Driver with live audio and automatic recording
Caller Device
Callee Device (Partner)
Ready-to-use SDKs and client implementations for Flutter, React Native, Web, and Backend
dependencies:
flutter:
sdk: flutter
flutter_webrtc: ^0.11.0
pusher_channels_flutter: ^2.2.1
http: ^1.2.0
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:pusher_channels_flutter/pusher_channels_flutter.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
class DevsroVoiceService {
final String serverUrl = 'https://calls.devsro.xyz';
final String appId = 'TARGET_APP_ID';
final String userId;
final String token;
RTCPeerConnection? _peerConnection;
MediaStream? _localStream;
PusherChannelsFlutter pusher = PusherChannelsFlutter.getInstance();
DevsroVoiceService({required this.userId, required this.token});
Future initialize({required Function(Map) onIncomingCall}) async {
// 1. Initialize Pusher for Laravel Reverb
await pusher.init(
apiKey: 'rxuexjdw8cjdw7dtkyq3',
cluster: 'mt1',
host: 'calls.devsro.xyz',
wsPort: 443,
wssPort: 443,
useTLS: true,
onEvent: (event) {
if (event.eventName == 'cpaas.call.incoming') {
final data = jsonDecode(event.data);
if (data['calleeId'] == userId) {
onIncomingCall(data);
}
}
},
);
await pusher.subscribe(channelName: 'presence-app.$appId');
await pusher.connect();
}
Future dial({required String calleeId, String? channelId}) async {
final res = await http.post(
Uri.parse('$serverUrl/api/v1/calls/initiate'),
headers: {'Content-Type': 'application/json', 'Authorization': 'Bearer $token'},
body: jsonEncode({'callerId': userId, 'calleeId': calleeId, 'channelId': channelId}),
);
final callData = jsonDecode(res.body);
_listenToCallChannel(callData['callId'], isCaller: true);
}
void _listenToCallChannel(String callId, {required bool isCaller}) async {
await pusher.subscribe(channelName: 'call.$callId');
}
}
npm install react-native-webrtc pusher-js
import { useEffect, useRef, useState } from 'react';
import { RTCPeerConnection, mediaDevices } from 'react-native-webrtc';
import Pusher from 'pusher-js';
export function useVoiceCall({ appId, userId, token }: { appId: string; userId: string; token: string }) {
const [callState, setCallState] = useState<'idle' | 'ringing' | 'connected'>('idle');
const pusherRef = useRef(null);
useEffect(() => {
const pusher = new Pusher('rxuexjdw8cjdw7dtkyq3', {
wsHost: 'calls.devsro.xyz',
wssPort: 443,
forceTLS: true,
enabledTransports: ['ws', 'wss'],
cluster: 'mt1'
});
const channel = pusher.subscribe(`presence-app.${appId}`);
channel.bind('cpaas.call.incoming', (data: any) => {
if (data.calleeId === userId) {
setCallState('ringing');
}
});
pusherRef.current = pusher;
return () => pusher.disconnect();
}, [appId, userId]);
const initiateCall = async (calleeId: string) => {
const res = await fetch('https://calls.devsro.xyz/api/v1/calls/initiate', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` },
body: JSON.stringify({ callerId: userId, calleeId })
});
const callData = await res.json();
setCallState('ringing');
};
return { callState, initiateCall };
}
<!-- Include Pusher JS -->
<script src="https://calls.devsro.xyz/js/pusher.min.js"></script>
<script src="https://calls.devsro.xyz/sdk/v1/voice-engine.js"></script>
<script>
const client = new VoiceEngine({
serverUrl: 'https://calls.devsro.xyz',
appId: 'TARGET_APP_ID',
token: 'USER_TOKEN',
userId: 'rider_101'
});
client.on('call:incoming', ({ callId, callerId, accept, reject }) => {
if (confirm(`Incoming call from ${callerId}. Accept?`)) {
accept();
} else {
reject();
}
});
// Dial
document.getElementById('call-btn').onclick = () => {
client.call({ targetId: 'driver_202' });
};
</script>
curl -X POST https://calls.devsro.xyz/api/v1/tokens/create \
-H "Content-Type: application/json" \
-H "x-api-secret: TARGET_API_SECRET" \
-d '{"userId": "rider_101", "role": "rider", "channelId": "trip_99"}'
curl -X POST https://calls.devsro.xyz/api/v1/calls/initiate \
-H "Content-Type: application/json" \
-H "x-api-secret: TARGET_API_SECRET" \
-d '{"callerId": "rider_101", "calleeId": "driver_202", "channelId": "trip_99"}'
When your mobile app launches, register the device's FCM token so our server wakes up the phone when an incoming call arrives:
POST https://calls.devsro.xyz/api/v1/devices/register
Headers:
x-api-key: TARGET_API_KEY
Content-Type: application/json
Body:
{
"userId": "driver_202",
"deviceToken": "fcm_token_from_firebase_messaging",
"platform": "android"
}