-
Notifications
You must be signed in to change notification settings - Fork 122
Normalize trunk filtering #1126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…st Filter 1. Added normalization to the comparison of trunk and caller number in ListSIPInboundTrunkRequest 2. Moved NormalizeNumber to a utils number to prevent import cycle
🦋 Changeset detectedLatest commit: 58f54de The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR |
utils/sip/sip_processing.go
Outdated
| // NormalizeNumber normalizes a phone number by removing formatting characters and ensuring it starts with a "+". | ||
| // If the input is empty, it returns an empty string. | ||
| // If the input doesn't match the expected number pattern, it returns the original input unchanged. | ||
| func NormalizeNumber(num string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be in livekit/sip.go as well, instead of a new utils package.
livekit/sip.go
Outdated
| for _, num := range info.Numbers { | ||
| if slices.Contains(p.Numbers, num) { | ||
| ok = true | ||
| normalizedNum := siputils.NormalizeNumber(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also keep a direct slices.Contains(p.Numbers, num) check as well? We don't need to call regexp if the numbers match exactly.
No description provided.