Skip to content

Commit 6dc1946

Browse files
Allow setting and updating destination-country on outbound trunk (#583)
1 parent f70258b commit 6dc1946

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

cmd/lk/sip.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ var (
140140
Name: "transport",
141141
Usage: "Sets a transport for the trunk",
142142
},
143+
&cli.StringFlag{
144+
Name: "destination-country",
145+
Usage: "Sets a destination country for the trunk as ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
146+
},
143147
&cli.StringFlag{
144148
Name: "media-enc",
145149
Usage: "Sets media encryption for the trunk",
@@ -180,6 +184,10 @@ var (
180184
Name: "transport",
181185
Usage: "Sets a new transport for the trunk",
182186
},
187+
&cli.StringFlag{
188+
Name: "destination-country",
189+
Usage: "Sets a destination country for the trunk as ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
190+
},
183191
&cli.StringSliceFlag{
184192
Name: "numbers",
185193
Usage: "Sets a new list of numbers for the trunk",
@@ -562,6 +570,9 @@ func createSIPOutboundTrunk(ctx context.Context, cmd *cli.Command) error {
562570
}
563571
p.Transport = livekit.SIPTransport(v)
564572
}
573+
if val := cmd.String("destination-country"); val != "" {
574+
p.DestinationCountry = val
575+
}
565576
if val := cmd.String("media-enc"); val != "" {
566577
val = strings.ToUpper(val)
567578
v, ok := livekit.SIPMediaEncryption_value[val]
@@ -643,6 +654,9 @@ func updateSIPOutboundTrunk(ctx context.Context, cmd *cli.Command) error {
643654
tr := livekit.SIPTransport(trv)
644655
req.Transport = &tr
645656
}
657+
if val := cmd.String("destination-country"); val != "" {
658+
req.DestinationCountry = &val
659+
}
646660
if val := cmd.String("auth-user"); val != "" {
647661
req.AuthUsername = &val
648662
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/go-logr/logr v1.4.2
1414
github.com/go-task/task/v3 v3.43.3
1515
github.com/joho/godotenv v1.5.1
16-
github.com/livekit/protocol v1.38.1-0.20250514155317-3ee266441614
16+
github.com/livekit/protocol v1.38.1-0.20250523170657-fa4bb37c0caf
1717
github.com/livekit/server-sdk-go/v2 v2.8.2-0.20250515040018-ffbd52b92948
1818
github.com/moby/buildkit v0.21.1
1919
github.com/pion/rtcp v1.2.15
@@ -152,7 +152,7 @@ require (
152152
github.com/pion/srtp/v3 v3.0.4 // indirect
153153
github.com/pion/stun/v3 v3.0.0 // indirect
154154
github.com/pion/transport/v3 v3.0.7 // indirect
155-
github.com/pion/turn/v4 v4.0.1 // indirect
155+
github.com/pion/turn/v4 v4.0.2 // indirect
156156
github.com/pjbgf/sha1cd v0.3.2 // indirect
157157
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
158158
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 h1:9x+U2HGLrSw5AT
274274
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
275275
github.com/livekit/mediatransportutil v0.0.0-20250511054114-5f8c73435f62 h1:ooMExsbtVSrv0A/I47XDZ6sS7hhs31Ds5KV7JLNkMOA=
276276
github.com/livekit/mediatransportutil v0.0.0-20250511054114-5f8c73435f62/go.mod h1:wD1D23CU9z/WWoHrcd0mwVMayzYtRpkUgtOrgwk4m3c=
277-
github.com/livekit/protocol v1.38.1-0.20250514155317-3ee266441614 h1:BcC6Wn7l3TWyJTobffPsIEZzuMwM01r+tK4WHnS/5zA=
278-
github.com/livekit/protocol v1.38.1-0.20250514155317-3ee266441614/go.mod h1:F5GLzgMUFFFgm7ajoYLIEXxlZVnRNusV5Qlnok4dtlc=
277+
github.com/livekit/protocol v1.38.1-0.20250523170657-fa4bb37c0caf h1:2SLBiZN/lf9+YSawyAvI/v5c09dfcv2uEOgl0RF40HY=
278+
github.com/livekit/protocol v1.38.1-0.20250523170657-fa4bb37c0caf/go.mod h1:6HPISM0bkTXTk9RIaQTCe0IDbomBPz7Jwp+N3w5sqL0=
279279
github.com/livekit/psrpc v0.6.1-0.20250511053145-465289d72c3c h1:WwEr0YBejYbKzk8LSaO9h8h0G9MnE7shyDu8yXQWmEc=
280280
github.com/livekit/psrpc v0.6.1-0.20250511053145-465289d72c3c/go.mod h1:kmD+AZPkWu0MaXIMv57jhNlbiSZZ/Jx4bzlxBDVmJes=
281281
github.com/livekit/server-sdk-go/v2 v2.8.2-0.20250515040018-ffbd52b92948 h1:5Ou2QP5DOO1NEg8FnSGYIBYsSs+j+vRWrKEILmNtvvY=
@@ -375,8 +375,8 @@ github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw=
375375
github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU=
376376
github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=
377377
github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo=
378-
github.com/pion/turn/v4 v4.0.1 h1:01UTBhYToe8PDC8piB++i66q1mmctfhhoeguaFqB84c=
379-
github.com/pion/turn/v4 v4.0.1/go.mod h1:pMMKP/ieNAG/fN5cZiN4SDuyKsXtNTr0ccN7IToA1zs=
378+
github.com/pion/turn/v4 v4.0.2 h1:ZqgQ3+MjP32ug30xAbD6Mn+/K4Sxi3SdNOTFf+7mpps=
379+
github.com/pion/turn/v4 v4.0.2/go.mod h1:pMMKP/ieNAG/fN5cZiN4SDuyKsXtNTr0ccN7IToA1zs=
380380
github.com/pion/webrtc/v4 v4.1.0 h1:yq/p0G5nKGbHISf0YKNA8Yk+kmijbblBvuSLwaJ4QYg=
381381
github.com/pion/webrtc/v4 v4.1.0/go.mod h1:cgEGkcpxGkT6Di2ClBYO5lP9mFXbCfEOrkYUpjjCQO4=
382382
github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4=
@@ -390,8 +390,8 @@ github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1
390390
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
391391
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
392392
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
393-
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
394-
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
393+
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
394+
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
395395
github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg=
396396
github.com/puzpuzpuz/xsync/v3 v3.5.1/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
397397
github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI=

0 commit comments

Comments
 (0)