File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
"github.com/livekit/protocol/livekit"
27
27
lksdk "github.com/livekit/server-sdk-go/v2"
28
28
"github.com/urfave/cli/v3"
29
+ "google.golang.org/protobuf/types/known/durationpb"
29
30
)
30
31
31
32
//lint:file-ignore SA1019 we still support older APIs for compatibility
@@ -326,7 +327,7 @@ var (
326
327
},
327
328
& cli.DurationFlag {
328
329
Name : "timeout" ,
329
- Usage : "timeout for the call to dial (requires wait flag) " ,
330
+ Usage : "timeout for the call to dial" ,
330
331
Value : 80 * time .Second ,
331
332
},
332
333
},
@@ -1078,6 +1079,13 @@ func createSIPParticipant(ctx context.Context, cmd *cli.Command) error {
1078
1079
if dt := cmd .Duration ("timeout" ); dt != 0 {
1079
1080
timeout = dt
1080
1081
}
1082
+ req .RingingTimeout = durationpb .New (timeout - 500 * time .Millisecond )
1083
+ } else {
1084
+ // For async API we should use a default timeout for the RPC,
1085
+ // and set a ringing timeout for the call instead.
1086
+ if dt := cmd .Duration ("timeout" ); dt != 0 {
1087
+ req .RingingTimeout = durationpb .New (dt )
1088
+ }
1081
1089
}
1082
1090
ctx , cancel := context .WithTimeout (ctx , timeout )
1083
1091
defer cancel ()
You can’t perform that action at this time.
0 commit comments