Skip to content

Commit

Permalink
Update SIP protocol, print new metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennwc committed Apr 30, 2024
1 parent a36818a commit dfceb2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions cmd/livekit-cli/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ func listSipTrunk(c *cli.Context) error {

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{
"SipTrunkId",
"SipTrunkId", "Name",
"InboundAddresses", "InboundNumbers", "InboundAuth",
"OutboundAddress", "OutboundNumber", "OutboundAuth",
"Metadata",
})
for _, item := range res.Items {
if item == nil {
Expand All @@ -197,9 +198,10 @@ func listSipTrunk(c *cli.Context) error {
}

table.Append([]string{
item.SipTrunkId,
item.SipTrunkId, item.Name,
strings.Join(item.InboundAddresses, ","), strings.Join(inboundNumbers, ","), userPass(item.InboundUsername, item.InboundPassword != ""),
item.OutboundAddress, item.OutboundNumber, userPass(item.OutboundUsername, item.OutboundPassword != ""),
item.Metadata,
})
}
table.Render()
Expand Down Expand Up @@ -260,7 +262,7 @@ func listSipDispatchRule(c *cli.Context) error {
}

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"SipDispatchRuleId", "SipTrunks", "Type", "RoomName", "Pin", "HidePhone"})
table.SetHeader([]string{"SipDispatchRuleId", "Name", "SipTrunks", "Type", "RoomName", "Pin", "HidePhone", "Metadata"})
for _, item := range res.Items {
if item == nil {
continue
Expand All @@ -280,7 +282,7 @@ func listSipDispatchRule(c *cli.Context) error {
if trunks == "" {
trunks = "<any>"
}
table.Append([]string{item.SipDispatchRuleId, trunks, typ, room, pin, strconv.FormatBool(item.HidePhoneNumber)})
table.Append([]string{item.SipDispatchRuleId, item.Name, trunks, typ, room, pin, strconv.FormatBool(item.HidePhoneNumber), item.Metadata})
}
table.Render()

Expand Down Expand Up @@ -339,6 +341,7 @@ func createSIPParticipant(c *cli.Context) error {
}

func printSIPParticipantInfo(info *livekit.SIPParticipantInfo) {
fmt.Printf("SIPCallID: %v\n", info.SipCallId)
fmt.Printf("ParticipantID: %v\n", info.ParticipantId)
fmt.Printf("ParticipantIdentity: %v\n", info.ParticipantIdentity)
fmt.Printf("RoomName: %v\n", info.RoomName)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.22.2
require (
github.com/frostbyte73/core v0.0.10
github.com/go-logr/logr v1.4.1
github.com/livekit/protocol v1.14.0
github.com/livekit/server-sdk-go/v2 v2.1.2
github.com/livekit/protocol v1.14.1-0.20240426104403-e7962f444464
github.com/livekit/server-sdk-go/v2 v2.1.1
github.com/manifoldco/promptui v0.9.0
github.com/olekukonko/tablewriter v0.0.5
github.com/pion/rtcp v1.2.14
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ 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-20240302142739-1c3dd691a1b8 h1:xawydPEACNO5Ncs2LgioTjWghXQ0eUN1q1RnVUUyVnI=
github.com/livekit/mediatransportutil v0.0.0-20240302142739-1c3dd691a1b8/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
github.com/livekit/protocol v1.14.0 h1:W0i5HR2Efoy2j9NhmONolU3FIsUDVl6MAT5zWfALev0=
github.com/livekit/protocol v1.14.0/go.mod h1:pnn0Dv+/0K0OFqKHX6J6SreYO1dZxl6tDuAZ1ns8L/w=
github.com/livekit/protocol v1.14.1-0.20240426104403-e7962f444464 h1:5IxCPDkibpvnAYN6+djltH6Gj4dMOL0hNecHn5jZKmk=
github.com/livekit/protocol v1.14.1-0.20240426104403-e7962f444464/go.mod h1:pnn0Dv+/0K0OFqKHX6J6SreYO1dZxl6tDuAZ1ns8L/w=
github.com/livekit/psrpc v0.5.3-0.20240228172457-3724cb4adbc4 h1:253WtQ2VGVHzIIzW9MUZj7vUDDILESU3zsEbiRdxYF0=
github.com/livekit/psrpc v0.5.3-0.20240228172457-3724cb4adbc4/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
github.com/livekit/server-sdk-go/v2 v2.1.2 h1:3MhFqptHjzpsNAcisHYDtn77qrJ9szsAy4zJkeI3Mic=
github.com/livekit/server-sdk-go/v2 v2.1.2/go.mod h1:ZjOQBtoFcU+oq1c2xaMLHhcQ3DNcfkwC3FHG8DAvkZ8=
github.com/livekit/server-sdk-go/v2 v2.1.1 h1:TGMF3BHAyx+/A0iVZTGG+4mZMXrAY1WRbOMqbwGnrHI=
github.com/livekit/server-sdk-go/v2 v2.1.1/go.mod h1:4d3kLn4qLMwKnKGpivW29YUwcBQKXFXzwH+x/nua94E=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
Expand Down

0 comments on commit dfceb2d

Please sign in to comment.