Таймаут вызова
This commit is contained in:
@@ -216,15 +216,13 @@ export function CallProvider(props : CallProviderProps) {
|
|||||||
openCallsModal("The connection with the user was lost. The call has ended.")
|
openCallsModal("The connection with the user was lost. The call has ended.")
|
||||||
end();
|
end();
|
||||||
}
|
}
|
||||||
if(activeCall){
|
if(signalType == SignalType.RINGING_TIMEOUT) {
|
||||||
/**
|
/**
|
||||||
* У нас уже есть активный звонок, игнорируем все сигналы, кроме сигналов от текущего звонка
|
* Другой стороне был отправлен сигнал звонка, но она не ответила на него в течении определенного времени
|
||||||
*/
|
*/
|
||||||
if(packet.getSrc() != activeCall && packet.getSrc() != publicKey){
|
openCallsModal("The user did not answer the call in time. Please try again later.");
|
||||||
console.info("Received signal from " + packet.getSrc() + " but active call is with " + activeCall + ", ignoring");
|
end();
|
||||||
info("Received signal for another call, ignoring");
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(signalType == SignalType.END_CALL){
|
if(signalType == SignalType.END_CALL){
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ export enum SignalType {
|
|||||||
ACTIVE = 4,
|
ACTIVE = 4,
|
||||||
END_CALL_BECAUSE_PEER_DISCONNECTED = 5,
|
END_CALL_BECAUSE_PEER_DISCONNECTED = 5,
|
||||||
END_CALL_BECAUSE_BUSY = 6,
|
END_CALL_BECAUSE_BUSY = 6,
|
||||||
ACCEPT = 7
|
ACCEPT = 7,
|
||||||
|
RINGING_TIMEOUT = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +43,9 @@ export class PacketSignalPeer extends Packet {
|
|||||||
|
|
||||||
public _receive(stream: Stream): void {
|
public _receive(stream: Stream): void {
|
||||||
this.signalType = stream.readInt8();
|
this.signalType = stream.readInt8();
|
||||||
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY || this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
|
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY
|
||||||
|
|| this.signalType == SignalType.RINGING_TIMEOUT
|
||||||
|
|| this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.src = stream.readString();
|
this.src = stream.readString();
|
||||||
@@ -60,7 +63,9 @@ export class PacketSignalPeer extends Packet {
|
|||||||
const stream = new Stream();
|
const stream = new Stream();
|
||||||
stream.writeInt16(this.getPacketId());
|
stream.writeInt16(this.getPacketId());
|
||||||
stream.writeInt8(this.signalType);
|
stream.writeInt8(this.signalType);
|
||||||
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY || this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
|
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY
|
||||||
|
|| this.signalType == SignalType.RINGING_TIMEOUT
|
||||||
|
|| this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
stream.writeString(this.src);
|
stream.writeString(this.src);
|
||||||
|
|||||||
Reference in New Issue
Block a user