From edcd47f11dc79255cd067edc7bf981214faa72f6 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 14 Oct 2024 15:53:56 -0700 Subject: [PATCH 1/5] Remove deprecated create-sip-trunk --- cmd/lk/sip.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/cmd/lk/sip.go b/cmd/lk/sip.go index 5d02e2a9..281eedac 100644 --- a/cmd/lk/sip.go +++ b/cmd/lk/sip.go @@ -148,17 +148,6 @@ var ( }, // Deprecated commands kept for compatibility - { - Hidden: true, // deprecated: use `sip trunk create` - Name: "create-sip-trunk", - Usage: "Create a SIP Trunk", - Action: createSIPTrunkLegacy, - Category: sipCategory, - Flags: []cli.Flag{ - //lint:ignore SA1019 we still support it - RequestFlag[livekit.CreateSIPTrunkRequest](), - }, - }, { Hidden: true, // deprecated: use `sip trunk list` Name: "list-sip-trunk", @@ -232,15 +221,6 @@ func createSIPClient(cmd *cli.Command) (*lksdk.SIPClient, error) { return lksdk.NewSIPClient(pc.URL, pc.APIKey, pc.APISecret, withDefaultClientOpts(pc)...), nil } -func createSIPTrunkLegacy(ctx context.Context, cmd *cli.Command) error { - cli, err := createSIPClient(cmd) - if err != nil { - return err - } - //lint:ignore SA1019 we still support it - return createAndPrintLegacy(ctx, cmd, cli.CreateSIPTrunk, printSIPTrunkID) -} - func createSIPInboundTrunk(ctx context.Context, cmd *cli.Command) error { cli, err := createSIPClient(cmd) if err != nil { From f7f69199a34aa8de6c3c6fe815f7692b356bfeeb Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Sun, 20 Oct 2024 20:21:13 -0700 Subject: [PATCH 2/5] Allow requesting a ringtone during SIP call tramsfers --- cmd/lk/sip.go | 21 +++++++++++++++++++++ go.mod | 6 ++++-- go.sum | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cmd/lk/sip.go b/cmd/lk/sip.go index 281eedac..f0eec4c3 100644 --- a/cmd/lk/sip.go +++ b/cmd/lk/sip.go @@ -140,6 +140,10 @@ var ( Required: true, Usage: "`SIP URL` to transfer the call to. Use 'tel:' to transfer to a phone", }, + &cli.BoolFlag{ + Name: "play-ringtone", + Usage: "if set, a ring tone will be played to the SIP participant while the transfer is being attempted", + }, }, }, }, @@ -148,6 +152,17 @@ var ( }, // Deprecated commands kept for compatibility + { + Hidden: true, // deprecated: use `sip trunk create` + Name: "create-sip-trunk", + Usage: "Create a SIP Trunk", + Action: createSIPTrunkLegacy, + Category: sipCategory, + Flags: []cli.Flag{ + //lint:ignore SA1019 we still support it + RequestFlag[livekit.CreateSIPTrunkRequest](), + }, + }, { Hidden: true, // deprecated: use `sip trunk list` Name: "list-sip-trunk", @@ -221,6 +236,10 @@ func createSIPClient(cmd *cli.Command) (*lksdk.SIPClient, error) { return lksdk.NewSIPClient(pc.URL, pc.APIKey, pc.APISecret, withDefaultClientOpts(pc)...), nil } +func createSIPTrunkLegacy(ctx context.Context, cmd *cli.Command) error { + return fmt.Errorf("create-sip-trunk is deprecated and not supported anymore. Use 'sip in create' or 'sip out create' instead.") +} + func createSIPInboundTrunk(ctx context.Context, cmd *cli.Command) error { cli, err := createSIPClient(cmd) if err != nil { @@ -478,11 +497,13 @@ func createSIPParticipantLegacy(ctx context.Context, cmd *cli.Command) error { func transferSIPParticipant(ctx context.Context, cmd *cli.Command) error { roomName, identity := participantInfoFromArgOrFlags(cmd) to := cmd.String("to") + ringtone := cmd.Bool("play-ringtone") req := livekit.TransferSIPParticipantRequest{ RoomName: roomName, ParticipantIdentity: identity, TransferTo: to, + PlayRingtone: ringtone, } cli, err := createSIPClient(cmd) diff --git a/go.mod b/go.mod index 2ff32463..8736385f 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,11 @@ module github.com/livekit/livekit-cli -go 1.22.0 +go 1.22.7 toolchain go1.23.1 +replace github.com/livekit/protocol => ../protocol + require ( github.com/charmbracelet/huh v0.6.0 github.com/charmbracelet/huh/spinner v0.0.0-20241011224433-983a50776b31 @@ -13,7 +15,7 @@ require ( github.com/go-task/task/v3 v3.39.2 github.com/joho/godotenv v1.5.1 github.com/livekit/protocol v1.24.0 - github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241007155002-76007e61480f + github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b github.com/pion/rtcp v1.2.14 github.com/pion/rtp v1.8.9 github.com/pion/webrtc/v3 v3.3.4 diff --git a/go.sum b/go.sum index 681234ab..af85165a 100644 --- a/go.sum +++ b/go.sum @@ -131,6 +131,8 @@ github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDX github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241007155002-76007e61480f h1:7Vb/gkzVnnNdsV3K47LsWOCQpMfqM927V3XogwUM3jI= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241007155002-76007e61480f/go.mod h1:AERqUiaZiAZjMxB5bxZn+M8PJlDD3TAOZn0PieQjnXk= +github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b h1:R1GpKwVbSYsG08k5sIkNCukvnrkOE18R8IO1YeujR8o= +github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b/go.mod h1:m2IukIyPCvJCdx04mdWIud9FoCBUAWc3526x3KgT8qY= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= From 6f5175d2ac81eb419d5ea213acf3a14eff58d216 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 21 Oct 2024 19:47:03 -0700 Subject: [PATCH 3/5] ringtone -> dialtone --- cmd/lk/sip.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/lk/sip.go b/cmd/lk/sip.go index c07e5ef1..46edfadb 100644 --- a/cmd/lk/sip.go +++ b/cmd/lk/sip.go @@ -141,7 +141,7 @@ var ( Usage: "`SIP URL` to transfer the call to. Use 'tel:' to transfer to a phone", }, &cli.BoolFlag{ - Name: "play-ringtone", + Name: "play-dialtone", Usage: "if set, a ring tone will be played to the SIP participant while the transfer is being attempted", }, }, @@ -482,13 +482,13 @@ func createSIPParticipantLegacy(ctx context.Context, cmd *cli.Command) error { func transferSIPParticipant(ctx context.Context, cmd *cli.Command) error { roomName, identity := participantInfoFromArgOrFlags(cmd) to := cmd.String("to") - ringtone := cmd.Bool("play-ringtone") + dialtone := cmd.Bool("play-dialtone") req := livekit.TransferSIPParticipantRequest{ RoomName: roomName, ParticipantIdentity: identity, TransferTo: to, - PlayRingtone: ringtone, + PlayDialtone: dialtone, } cli, err := createSIPClient(cmd) From d09eed083eb4596525231a8fb539fa5b5adb8d1f Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 21 Oct 2024 19:49:58 -0700 Subject: [PATCH 4/5] typo --- cmd/lk/sip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lk/sip.go b/cmd/lk/sip.go index 46edfadb..43e26dc3 100644 --- a/cmd/lk/sip.go +++ b/cmd/lk/sip.go @@ -142,7 +142,7 @@ var ( }, &cli.BoolFlag{ Name: "play-dialtone", - Usage: "if set, a ring tone will be played to the SIP participant while the transfer is being attempted", + Usage: "if set, a dial tone will be played to the SIP participant while the transfer is being attempted", }, }, }, From 030877c7da515a0bfcba3d4f5f6707a4e8417a3f Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 21 Oct 2024 20:39:40 -0700 Subject: [PATCH 5/5] Update protocol --- go.mod | 4 +--- go.sum | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8f8ca319..a0025e1d 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ go 1.22.7 toolchain go1.23.2 -replace github.com/livekit/protocol => ../protocol - require ( github.com/charmbracelet/huh v0.6.0 github.com/charmbracelet/huh/spinner v0.0.0-20241011224433-983a50776b31 @@ -14,7 +12,7 @@ require ( github.com/go-logr/logr v1.4.2 github.com/go-task/task/v3 v3.39.2 github.com/joho/godotenv v1.5.1 - github.com/livekit/protocol v1.26.0 + github.com/livekit/protocol v1.26.1-0.20241022031344-538889e5de0a github.com/livekit/server-sdk-go/v2 v2.3.0 github.com/pion/rtcp v1.2.14 github.com/pion/rtp v1.8.9 diff --git a/go.sum b/go.sum index 3e6ae910..54baccc8 100644 --- a/go.sum +++ b/go.sum @@ -125,6 +125,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ= github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598 h1:yLlkHk2feSLHstD9n4VKg7YEBR4rLODTI4WE8gNBEnQ= github.com/livekit/mediatransportutil v0.0.0-20240730083616-559fa5ece598/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE= +github.com/livekit/protocol v1.26.1-0.20241022031344-538889e5de0a h1:31YXXJLEwCflp7KEe9rRAwmONyCwHFujTl4MdxegTxw= +github.com/livekit/protocol v1.26.1-0.20241022031344-538889e5de0a/go.mod h1:nxRzmQBKSYK64gqr7ABWwt78hvrgiO2wYuCojRYb7Gs= github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDXQU42tnHl8eCX9G6PVUToBVuCUyOs= github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.3.0 h1:k6kpBwJNZYUypv9567hfmLpxQumL463dNGUBfoF0bzQ=