Таймаут вызова
This commit is contained in:
@@ -12,7 +12,8 @@ export enum SignalType {
|
||||
ACTIVE = 4,
|
||||
END_CALL_BECAUSE_PEER_DISCONNECTED = 5,
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
this.src = stream.readString();
|
||||
@@ -60,7 +63,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){
|
||||
if(this.signalType == SignalType.END_CALL_BECAUSE_BUSY
|
||||
|| this.signalType == SignalType.RINGING_TIMEOUT
|
||||
|| this.signalType == SignalType.END_CALL_BECAUSE_PEER_DISCONNECTED){
|
||||
return stream;
|
||||
}
|
||||
stream.writeString(this.src);
|
||||
|
||||
Reference in New Issue
Block a user