Обработка END_CALL_BECAUSE_BUSY и END_CALL_BECAUSE_PEER_DISCONNECTED

This commit is contained in:
RoyceDa
2026-03-17 18:39:06 +02:00
parent 6dd348230f
commit fcf4204063
2 changed files with 51 additions and 1 deletions

View File

@@ -6,7 +6,9 @@ export enum SignalType {
KEY_EXCHANGE = 1,
ACTIVE_CALL = 2,
END_CALL = 3,
CREATE_ROOM = 4
CREATE_ROOM = 4,
END_CALL_BECAUSE_PEER_DISCONNECTED = 5,
END_CALL_BECAUSE_BUSY = 6
}
/**
@@ -40,6 +42,9 @@ export class PacketSignalPeer extends Packet {
public _receive(stream: Stream): void {
this.signalType = stream.readInt8();
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY || this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
return;
}
this.src = stream.readString();
this.dst = stream.readString();
if(this.signalType == SignalType.KEY_EXCHANGE){
@@ -54,6 +59,9 @@ export class PacketSignalPeer extends Packet {
const stream = new Stream();
stream.writeInt16(this.getPacketId());
stream.writeInt8(this.signalType);
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY || this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
return stream;
}
stream.writeString(this.src);
stream.writeString(this.dst);
if(this.signalType == SignalType.KEY_EXCHANGE){