Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply signaling component #1950

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4507f5
Apply signaling component
ActoryOu Mar 8, 2024
43eb203
align cmake commands for sdp and signaling
ActoryOu Mar 11, 2024
4297549
apply signaling API&structure change
ActoryOu Mar 12, 2024
aab28f9
clang formatting
ActoryOu Mar 13, 2024
7e13449
Remove unused variables, fix webrtc_client_test build
ActoryOu Mar 13, 2024
4bc41c5
Add -fPIC for coreJSON if compiler is GNU or Clang
ActoryOu Mar 13, 2024
8611f19
Fix coreJSON cmake args.
ActoryOu Mar 13, 2024
298eaaf
Remove more unused variables and add debug log in sample-check.sh
ActoryOu Mar 14, 2024
7cb4e5b
Remove redundant spaces in cmake files.
ActoryOu Mar 14, 2024
813c8e7
Remove unused variables.
ActoryOu Mar 14, 2024
99e8e4e
Fix static compilation
ActoryOu Mar 15, 2024
0c09c9e
cast from SIZE_T to size_t for signaling APIs
ActoryOu Mar 18, 2024
5c9c1bc
Merge branch 'develop' into ApplySignalingComponent
ActoryOu May 15, 2024
ea246be
Remove signaling APIunit test cases those are moved into Signaling co…
ActoryOu May 16, 2024
56fa0f6
Remove context in Signaling APIs.
ActoryOu Jun 4, 2024
48daae4
Fix formatting
ActoryOu Jun 4, 2024
fa63887
Fix mac compilation
ActoryOu Jun 4, 2024
7e5631a
Fix MAC clang compilation
ActoryOu Jun 4, 2024
63494fe
Remove ICE server list in both send/recv websocket messages.
ActoryOu Jun 21, 2024
efdf809
Merge branch 'develop' into ApplySignalingComponent
ActoryOu Jun 21, 2024
dc01a7a
Fix compilation and fix comments.
ActoryOu Jun 21, 2024
40a1e66
Remove unnecessary includes/definitions.
ActoryOu Jun 21, 2024
9509ccd
Removing Ice server lists in SDP_OFFER or SDP_ANSWER in unit tests.
ActoryOu Jun 21, 2024
c116583
Empty commit to trigger CI.
ActoryOu Jun 21, 2024
0379d0c
Remove unused variables.
ActoryOu Jun 26, 2024
280e1f0
Fix CI - unused vars (#2017)
disa6302 Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove ICE server list in both send/recv websocket messages.
ActoryOu committed Jun 21, 2024
commit 63494fecb0d64a054f094ad58795ed5c646641fb
40 changes: 1 addition & 39 deletions src/source/Signaling/LwsApiCalls.c
Original file line number Diff line number Diff line change
@@ -1817,7 +1817,6 @@ STATUS sendLwsMessage(PSignalingClient pSignalingClient, SIGNALING_MESSAGE_TYPE
SignalingResult_t retSignal;
WssSendMessage_t wssSendMessage;
SIZE_T bufferSize;
SignalingIceServer_t iceServers[MAX_ICE_CONFIG_COUNT];

// Ensure we are in a connected state
CHK_STATUS(acceptSignalingStateMachineState(pSignalingClient, SIGNALING_STATE_CONNECTED | SIGNALING_STATE_JOIN_SESSION_CONNECTED));
@@ -1870,29 +1869,6 @@ STATUS sendLwsMessage(PSignalingClient pSignalingClient, SIGNALING_MESSAGE_TYPE
wssSendMessage.recipientClientIdLength = STRLEN(peerClientId);
wssSendMessage.pRecipientClientId = peerClientId;

// In case of an Offer, package the ICE candidates only if we have a set of non-expired ICE configs
if (messageType == SIGNALING_MESSAGE_TYPE_OFFER && pSignalingClient->iceConfigCount != 0 &&
(curTime = SIGNALING_GET_CURRENT_TIME(pSignalingClient)) <= pSignalingClient->iceConfigExpiration &&
STATUS_SUCCEEDED(validateIceConfiguration(pSignalingClient))) {
// Start the ice infos by copying the preamble, then the main body and then the ending
wssSendMessage.numIceServers = pSignalingClient->iceConfigCount;
wssSendMessage.pIceServers = iceServers;

for (iceCount = 0; iceCount < pSignalingClient->iceConfigCount; iceCount++) {
iceServers[iceCount].pUserName = pSignalingClient->iceConfigs[iceCount].userName;
iceServers[iceCount].userNameLength = STRLEN(pSignalingClient->iceConfigs[iceCount].userName);
iceServers[iceCount].pPassword = pSignalingClient->iceConfigs[iceCount].password;
iceServers[iceCount].passwordLength = STRLEN(pSignalingClient->iceConfigs[iceCount].password);
iceServers[iceCount].messageTtlSeconds =
(pSignalingClient->iceConfigs[iceCount].ttl - (curTime - pSignalingClient->iceConfigTime)) / HUNDREDS_OF_NANOS_IN_A_SECOND;
iceServers[iceCount].urisNum = pSignalingClient->iceConfigs[iceCount].uriCount;
for (uriCount = 0; uriCount < pSignalingClient->iceConfigs[iceCount].uriCount; uriCount++) {
iceServers[iceCount].urisLength[uriCount] = STRLEN(pSignalingClient->iceConfigs[iceCount].uris[uriCount]);
iceServers[iceCount].pUris[uriCount] = pSignalingClient->iceConfigs[iceCount].uris[uriCount];
}
}
}

// Prepare json message
bufferSize = SIZEOF(pSignalingClient->pOngoingCallInfo->sendBuffer) - LWS_PRE - 1; /* -1 for null terminator. */
retSignal =
@@ -2010,12 +1986,11 @@ STATUS receiveLwsMessage(PSignalingClient pSignalingClient, PCHAR pMessage, UINT
UINT32 outLen = MAX_SIGNALING_MESSAGE_LEN;
PSignalingMessageWrapper pSignalingMessageWrapper = NULL;
TID receivedTid = INVALID_TID_VALUE;
BOOL parsedMessageType = FALSE, jsonInIceServerList = FALSE;
BOOL parsedMessageType = FALSE;
PSignalingMessage pOngoingMessage;
SignalingResult_t retSignal;
WssRecvMessage_t wssRecvMessage;
UINT64 messageLength = messageLen;
SignalingIceServer_t iceServers[MAX_ICE_CONFIG_COUNT];

CHK(pSignalingClient != NULL, STATUS_NULL_ARG);

@@ -2038,9 +2013,6 @@ STATUS receiveLwsMessage(PSignalingClient pSignalingClient, PCHAR pMessage, UINT

// DLOGV("receive LWS Message:\n%s", pMessage);
MEMSET(&wssRecvMessage, 0, SIZEOF(WssRecvMessage_t));
// Prepare buffer to store ice server configs.
wssRecvMessage.numIceServers = MAX_ICE_CONFIG_COUNT;
wssRecvMessage.pIceServers = iceServers;
// Parse the response
retSignal = Signaling_ParseWssRecvMessage(pMessage, (SIZE_T) messageLength, &wssRecvMessage);
CHK(retSignal == SIGNALING_RESULT_OK, retSignal);
@@ -2101,11 +2073,6 @@ STATUS receiveLwsMessage(PSignalingClient pSignalingClient, PCHAR pMessage, UINT
pSignalingMessageWrapper->receivedSignalingMessage.description[wssRecvMessage.statusResponse.descriptionLength] = '\0';
}

if (wssRecvMessage.numIceServers > 0U &&
pSignalingMessageWrapper->receivedSignalingMessage.signalingMessage.messageType == SIGNALING_MESSAGE_TYPE_OFFER) {
CHK_STATUS(updateIceServerList(pSignalingClient, wssRecvMessage.pIceServers, wssRecvMessage.numIceServers));
}

// Message type is a mandatory field.
CHK(parsedMessageType, STATUS_SIGNALING_INVALID_MESSAGE_TYPE);
pSignalingMessageWrapper->pSignalingClient = pSignalingClient;
@@ -2184,11 +2151,6 @@ STATUS receiveLwsMessage(PSignalingClient pSignalingClient, PCHAR pMessage, UINT
DLOGD("Client received message of type: %s",
getMessageTypeInString(pSignalingMessageWrapper->receivedSignalingMessage.signalingMessage.messageType));

// Validate and process the ice config
if (jsonInIceServerList && STATUS_FAILED(validateIceConfiguration(pSignalingClient))) {
DLOGW("Failed to validate the ICE server configuration received with an Offer");
}

#ifdef ENABLE_KVS_THREADPOOL
// This would fail if threadpool was not created
CHK_STATUS(threadpoolContextPush(receiveLwsMessageWrapper, pSignalingMessageWrapper));