-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: main
Are you sure you want to change the base?
Conversation
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) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
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.