awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.01k stars 304 forks source link

[QUESTION] How to delete Signaling Channel? #1073

Closed nguyenduynghia closed 3 years ago

nguyenduynghia commented 3 years ago

Is there any way to delete all Signaling Channels created. I used function signalingClientDeleteSync but they are still available in Amazon Console.

MushMal commented 3 years ago

If it returns STATUS_SUCCESS then the channel would be deleted. Double check your steps

nguyenduynghia commented 3 years ago

Yes, It return SUCCESS but stream was not deleted. Here are log message: [2021-02-18 11:34:47]-INFO-signalingClientDeleteSync(): Signaling Client Delete Sync [2021-02-18 11:34:48]-DEBUG-stepStateMachine(): State Machine - Current state: 0x0000000000000400, Next state: 0x0000000000000800 [2021-02-18 11:34:49]-INFO-freeSignalingClient(): Freeing Signaling Client

MushMal commented 3 years ago

From the snippet of logs it shows that the state machine has transitioned from DELETE to DELETED state so I assume it was successful. The channel delete operation is inherently ASYNC in the backend. Even if the SDK synchronously issues a delete API it will be eventually consistent. Normally, it takes less than a few seconds for the channel to actually get deleted and get delisted from the view.

Here is the API test for the client level API: https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/master/tst/SignalingApiTest.cpp#L120

All of our unit tests clear/delete the channel after their run (though, they use the internal non-public API but it's called directly).

Please check:

disa6302 commented 3 years ago

Closing based on tag. Feel free to re-open if you have any questions.

nguyenduynghia commented 3 years ago

I tried on kvsWebRTCClientMaster example. call function retStatus = signalingClientDeleteSync(pSampleConfiguration->signalingClientHandle); And put some break point and debug. It jumps in function fromDeleteSignalingState but never jump into function executeDeleteSignalingState. I don't debug into function stepStateMachine due to no source code.

MushMal commented 3 years ago

signalingClientDeleteSync steps state machinery by calling stepStateMachine which then exercises the state machine to delete. You might want to put some debug breakpoints.

Try to use the unit test which executes the delete API and ensure it works OK. From then on, try to model your application or create a repro so we can look into.