Skip to content

Commit 3842342

Browse files
authored
Allow number filtering on Dispatch Rules (#707)
Allow inbound number filtering on SIP Dispatch Rules. It works similar to Trunks, where rules without a number filter are grouped together and take less priority than number-specific rules. While at it, simplify the rule evaluation. Previously it was doing some hand-crafted checks for evaluation path, that matched the validation path. Same double logic existed for priorities as well. Now the validation is always called from evaluation, thus sharing the logic. And rule selection is simplified by just picking the first one after priority filtering.
1 parent 72c0789 commit 3842342

File tree

6 files changed

+292
-245
lines changed

6 files changed

+292
-245
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"github.com/livekit/protocol": minor
3+
"@livekit/protocol": minor
4+
---
5+
6+
Allow inbound number filtering on SIP Dispatch Rules

livekit/livekit_sip.pb.go

Lines changed: 125 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit/livekit_sip.twirp.go

Lines changed: 65 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobufs/livekit_sip.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,32 @@ message CreateSIPDispatchRuleRequest {
173173
// If true a random value will be used instead
174174
bool hide_phone_number = 3;
175175

176+
// Dispatch Rule will only accept a call made to these numbers (if set).
177+
repeated string inbound_numbers = 6;
178+
176179
// Optional human-readable name for the Dispatch Rule.
177180
string name = 4;
178181
// Optional user-defined metadata for the Dispatch Rule.
179182
string metadata = 5;
183+
184+
// NEXT ID: 7
180185
}
181186

182187
message SIPDispatchRuleInfo {
183188
string sip_dispatch_rule_id = 1;
184189
SIPDispatchRule rule = 2;
185190
repeated string trunk_ids = 3;
186191
bool hide_phone_number = 4;
192+
// Dispatch Rule will only accept a call made to these numbers (if set).
193+
repeated string inbound_numbers = 7;
187194

188195
// Human-readable name for the Dispatch Rule.
189196
string name = 5;
190197
// User-defined metadata for the Dispatch Rule.
191198
// Participants created by this rule will inherit this metadata.
192199
string metadata = 6;
200+
201+
// NEXT ID: 8
193202
}
194203

195204
message ListSIPDispatchRuleRequest {

0 commit comments

Comments
 (0)