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

Transfer participant integration test #186

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

biglittlebigben
Copy link
Contributor

@biglittlebigben biglittlebigben commented Sep 26, 2024

This also makes sure that we do not cancel the transfer request if the RPC handler gets cancelled, and avoids situation where we may return an old transfer result to a 2nd transfer request if one failed before.

@biglittlebigben biglittlebigben requested a review from a team as a code owner September 26, 2024 21:46
@biglittlebigben biglittlebigben marked this pull request as draft September 26, 2024 21:46
@biglittlebigben biglittlebigben marked this pull request as ready for review September 27, 2024 17:57
pkg/siptest/client.go Outdated Show resolved Hide resolved
test/integration/sip_test.go Outdated Show resolved Hide resolved
Comment on lines +412 to +422
require.Equal(t, sipgo.REFER, referRequest.Method)
transferTo := referRequest.GetHeader("Refer-To")
require.Equal(t, "tel:"+transferNumber, transferTo.Value())

time.Sleep(notifyIntervalDelay)
err = cli.SendNotify(referRequest, "SIP/2.0 100 Trying")
require.NoError(t, err)

time.Sleep(notifyIntervalDelay)
err = cli.SendNotify(referRequest, "SIP/2.0 200 OK")
require.NoError(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part could be in onRefer callback, then there will be no need for a mutex and shared variable (referRequest). Same for the second test.

_, err = lk.SIP.TransferSIPParticipant(context.Background(), &livekit.TransferSIPParticipantRequest{
RoomName: "test-open",
ParticipantIdentity: "sip_" + clientNumber,
TransferTo: "tel:" + transferNumber,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to also see if we can properly refer for outbound. But that can be done separately.

pkg/sip/inbound.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants