mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
possible solution for accepting call
This commit is contained in:
1 parent
e5604bd544
commit
8d100a5ebd
3 files changed
+10
-6
No files matched your search
@@ -18,7 +18,7 @@ export const CallModal = () => {
|
|||||||
|
|
||||||
const handleAcceptCall = () => {
|
const handleAcceptCall = () => {
|
||||||
Nui.send('phone:acceptCall', {
|
Nui.send('phone:acceptCall', {
|
||||||
phoneNumber: call.phone_number,
|
phoneNumber: call.phone_number
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on(`__cfx_nui:${events.PHONE_BEGIN_CALL}`, (data: any) => {
|
|||||||
|
|
||||||
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string, isTransmitter: boolean, id: any) => {
|
onNet(events.PHONE_START_CALL, (target: string, phoneNumber: string, isTransmitter: boolean, id: any) => {
|
||||||
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
console.log(`You are talking to ${target} who has the number ${phoneNumber}`);
|
||||||
exp["mumble-voip"].SetCallChannel(id+1);
|
//exp["mumble-voip"].SetCallChannel(id+1);
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: "CALL",
|
app: "CALL",
|
||||||
@@ -40,7 +40,7 @@ on(`__cfx_nui:${events.PHONE_ACCEPT_CALL}`, (data: any) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onNet('phone:callAccepted', (id: number) => {
|
onNet('phone:callAccepted', (id: number) => {
|
||||||
exp["mumble-voip"].SetRadioChannel(id);
|
exp["mumble-voip"].SetCallChannel(id);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,10 +77,14 @@ onNet(events.PHONE_ACCEPT_CALL, async (phoneNumber: string) => {
|
|||||||
const targetIdentifier = await getIdentifierByPhoneNumber(phoneNumber);
|
const targetIdentifier = await getIdentifierByPhoneNumber(phoneNumber);
|
||||||
const targetPlayer = await getPlayerFromIdentifier(targetIdentifier);
|
const targetPlayer = await getPlayerFromIdentifier(targetIdentifier);
|
||||||
|
|
||||||
|
const channelId = pSource + targetPlayer.source;
|
||||||
|
|
||||||
// client that is calling
|
// client that is calling
|
||||||
emitNet('phone:callAccepted', pSource, targetPlayer.source);
|
emitNet('phone:callAccepted', pSource, channelId);
|
||||||
|
|
||||||
// client that is being called
|
// client that is being called
|
||||||
emitNet('phone:callAccepted', targetPlayer.source, pSource);
|
emitNet('phone:callAccepted', targetPlayer.source, channelId);
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user