Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Update 58
Browse files Browse the repository at this point in the history
WebRTC signalling added for the Call option and implementation a security hybrid model key and the status of listened voice messages
  • Loading branch information
RooyeKhat committed May 17, 2017
1 parent 26a684e commit 258c8f2
Show file tree
Hide file tree
Showing 31 changed files with 467 additions and 18 deletions.
3 changes: 2 additions & 1 deletion app/assets/proto/ClientCondition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ message ClientCondition {
UNCHANGED = 0;
MUTED = 1;
UNMUTED = 2;
// TODO [Amerehie] - 2016-08-10 11:48 AM - 1hour 8hour 2 days
}
OfflineMute offline_mute = 12;

repeated uint64 offline_listened = 13;
}
repeated Room rooms = 2;
}
Expand Down
4 changes: 3 additions & 1 deletion app/assets/proto/ConnectionSecuring.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ message ConnectionSecuringResponse {
message ConnectionSymmetricKey {
Request request = 1;
bytes symmetric_key = 2;
uint32 version = 3;
}

message ConnectionSymmetricKeyResponse {
Expand All @@ -28,4 +29,5 @@ message ConnectionSymmetricKeyResponse {
Status status = 2;
string symmetric_method = 3;
uint32 symmetric_iv_size = 4;
}
bool security_issue = 5;
}
7 changes: 7 additions & 0 deletions app/assets/proto/Global.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum RoomMessageStatus {
SENT = 2;
DELIVERED = 3;
SEEN = 4;
LISTENED = 5;
}

enum RoomMessageReaction {
Expand All @@ -80,6 +81,9 @@ message RoomMessageLog {
ROOM_CONVERTED_TO_PRIVATE = 7;
MEMBER_JOINED_BY_INVITE_LINK = 8;
ROOM_DELETED = 9;
MISSED_VOICE_CALL = 10;
MISSED_VIDEO_CALL = 11;
MISSED_SCREEN_SHARE = 12;
}
Type type = 1;

Expand Down Expand Up @@ -342,6 +346,9 @@ enum PrivacyType {
AVATAR = 1;
GROUP_INVITE = 2;
CHANNEL_INVITE = 3;
VOICE_CALLING = 4;
VIDEO_CALLING = 5;
SCREEN_SHARING = 6;
}


Expand Down
11 changes: 11 additions & 0 deletions app/assets/proto/PushRateSignaling.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";
package proto;
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoPushRateSignaling";

message PushRateSignalingResponse {
Response response = 1;
uint64 id = 2;
}
17 changes: 17 additions & 0 deletions app/assets/proto/SignalingAccept.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingAccept";

message SignalingAccept {
Request request = 1;
string called_sdp = 2;
}

message SignalingAcceptResponse {
Response response = 1;
string called_sdp = 2;
}
21 changes: 21 additions & 0 deletions app/assets/proto/SignalingCandidate.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingCandidate";

message SignalingCandidate {
Request request = 1;
string candidate = 2;
string sdp_m_id = 3;
uint32 sdp_m_line_index = 4;
}

message SignalingCandidateResponse {
Response response = 1;
string peer_candidate = 2;
string peer_sdp_m_id = 3;
uint32 peer_sdp_m_line_index = 4;
}
17 changes: 17 additions & 0 deletions app/assets/proto/SignalingClearLog.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingClearLog";

message SignalingClearLog {
Request request = 1;
uint64 clear_id = 2;
}

message SignalingClearLogResponse {
Response response = 1;
uint64 clear_id = 2;
}
26 changes: 26 additions & 0 deletions app/assets/proto/SignalingGetConfiguration.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingGetConfiguration";

message SignalingGetConfiguration {
Request request = 1;
}

message SignalingGetConfigurationResponse {
Response response = 1;

message IceServer {
string url = 1;
string credential = 2;
string username = 3;
}
repeated IceServer ice_server = 2;

bool voice_calling = 3;
bool video_calling = 4;
bool screen_sharing = 5;
}
37 changes: 37 additions & 0 deletions app/assets/proto/SignalingGetLog.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";
import "Global.proto";
import "SignalingOffer.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingGetLog";

message SignalingGetLog {
Request request = 1;
Pagination pagination = 2;
}

message SignalingGetLogResponse {
Response response = 1;

message SignalingLog {
uint64 id = 1;
SignalingOffer.Type type = 2;

enum Status {
MISSED = 0;
CANCELED = 1;
INCOMING = 2;
OUTGOING = 3;
}
Status status = 3;

RegisteredUser peer = 4;
uint32 offer_time = 5;
uint32 duration = 6;
}

repeated SignalingLog signaling_log = 2;
}
26 changes: 26 additions & 0 deletions app/assets/proto/SignalingLeave.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingLeave";

message SignalingLeave {
Request request = 1;
}

message SignalingLeaveResponse {
Response response = 1;

enum Type {
MISSED = 0;
REJECTED = 1;
ACCEPTED = 2;
NOT_ANSWERED = 3;
UNAVAILABLE = 4;
DISCONNECTED = 5;
FINISHED = 6;
}
Type type = 2;
}
29 changes: 29 additions & 0 deletions app/assets/proto/SignalingOffer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingOffer";

message SignalingOffer {
Request request = 1;
uint64 called_user_id = 2;

enum Type {
VOICE_CALLING = 0;
VIDEO_CALLING = 1;
SCREEN_SHARING = 2;
}
Type type = 3;

string caller_sdp = 4;
}

message SignalingOfferResponse {
Response response = 1;

uint64 caller_user_id = 2;
SignalingOffer.Type type = 3;
string caller_sdp = 4;
}
18 changes: 18 additions & 0 deletions app/assets/proto/SignalingRate.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingRate";

message SignalingRate {
Request request = 1;
uint64 id = 2;
uint32 rate = 3;
string reason = 4;
}

message SignalingRateResponse {
Response response = 1;
}
15 changes: 15 additions & 0 deletions app/assets/proto/SignalingRinging.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingRinging";

message SignalingRinging {
Request request = 1;
}

message SignalingRingingResponse {
Response response = 1;
}
17 changes: 17 additions & 0 deletions app/assets/proto/SignalingSessionHold.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package proto;
import "Request.proto";
import "Response.proto";

option java_package = "net.iGap.proto";
option java_outer_classname = "ProtoSignalingSessionHold";

message SignalingSessionHold {
Request request = 1;
bool hold = 2;
}

message SignalingSessionHoldResponse {
Response response = 1;
bool hold = 2;
}
18 changes: 15 additions & 3 deletions docs/guide/v1/Securing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@
## Step 1
After websocket connection is established , You will receive message [#30001](proto/README.md#action_30001)

You must generate random string called **symmetricKey** with length equal to _symmetricKeyLength_ and encrypt it with _publicKey_ using OpenSSL library (Padding mode is PKCS #1)
You must generate random string called **symmetricKey** with length equal to _symmetricKeyLength_ and encrypt it with _publicKey_ using OpenSSL library (Padding mode is PKCS #1) , next encrypt the result with the following public key using OpenSSL library (Padding mode is PKCS #1)

```
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo+inlAfd8Qior8IMKaJ+
BREJcEc9J9RhHgh6g/LvHKsnMaiEbAL70jQBQTLpCRu5Cnpj20+isOi++Wtf/pIP
FdJbD/1H+5jS+ja0RA6unp93DnBuYZ2JjV60vF3Ynj6F4Vr1ts5Xg5dJlEaOcOO2
YzOU97ZGP0ozrXIT5S+Y0BC4M9ieQmlGREzt3UZlTBbyUYPS4mMFh88YcT3QTiTA
k897qlJLxkYxVyAgwAD/0ihmWEkBQe9IxwVT/x5/QbixGSl4Zvd+5d+9sTZcSZQS
iJInT4E6DcmgAVYu5jFMWJDTEuurOQZ1W4nbmGyoY1bZXaFoiMPfzy72VIddkoHg
mwIDAQAB
-----END PUBLIC KEY-----
```


## Step 2
Send message [#2](proto/README.md#action_2) with encrypted **symmetricKey** to server , depending on your request there are three cases of response
Send message [#2](proto/README.md#action_2) with encrypted **symmetricKey** to server (If you use the aforementioned public key in encryption process , you must set _version_ as 2), depending on your request there are three cases of response

1. You send plaintext symmetricKey and we cannot accept this key so you will go back to step 1 (After 3 times , your request will be ignored)
2. Your encrypted symmetricKey length is not equal to _symmetricKeyLength_ , You will receive message [#30002](proto/README.md#action_30002) with **REJECTED** status . Websocket connection shall get closed permanently in this case.
2. Your encrypted symmetricKey length is not equal to _symmetricKeyLength_ or security issue is detected , You will receive message [#30002](proto/README.md#action_30002) with **REJECTED** status . Websocket connection shall get closed permanently in this case.
3. Your symmetricKey is accepted successfully , You will receive message [#30002](proto/README.md#action_30002) with **ACCEPTED** status

## Step 3
Expand Down
10 changes: 9 additions & 1 deletion docs/guide/v1/Transmission.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# WebSocket Connection
Open a WebSocket connection to the following address

wss://secure.igap.net/hybrid/

# Format
The packet of message has the following format:

Expand All @@ -6,4 +11,7 @@ The packet of message has the following format:

The first two bytes are unsigned short integer (little endian byte order) which are called **actionId** and other bytes are entitled as **payload**

Extract actionId and unpack payload according to [lookup table](proto/README.md)
Extract actionId and unpack payload according to [lookup table](proto/README.md)

# Uploading file over WebSocket
When you want to send a packet more that 50KB , you must customize WebSocket client to turn off masking otherwise, the server will close your connection
Loading

0 comments on commit 258c8f2

Please sign in to comment.