fix: return engine call IDs
This commit is contained in:
+9
-11
@@ -159,18 +159,16 @@ initWebUi({
|
||||
port: appConfig.proxy.webUiPort,
|
||||
getStatus,
|
||||
log,
|
||||
onStartCall: (number, deviceId, providerId) => {
|
||||
onStartCall: async (number, deviceId, providerId) => {
|
||||
log(`[dashboard] start call: ${number} device=${deviceId || 'any'} provider=${providerId || 'auto'}`);
|
||||
void makeCall(number, deviceId, providerId).then((callId) => {
|
||||
if (callId) {
|
||||
log(`[dashboard] call started: ${callId}`);
|
||||
statusStore.noteDashboardCallStarted(callId, number, providerId);
|
||||
} else {
|
||||
log(`[dashboard] call failed for ${number}`);
|
||||
}
|
||||
});
|
||||
|
||||
return { id: `pending-${Date.now()}` };
|
||||
const callId = await makeCall(number, deviceId, providerId);
|
||||
if (!callId) {
|
||||
log(`[dashboard] call failed for ${number}`);
|
||||
return null;
|
||||
}
|
||||
log(`[dashboard] call started: ${callId}`);
|
||||
statusStore.noteDashboardCallStarted(callId, number, providerId);
|
||||
return { id: callId };
|
||||
},
|
||||
onHangupCall: (callId) => {
|
||||
void hangupCall(callId);
|
||||
|
||||
Reference in New Issue
Block a user