Skip to content
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

4.3.caller id numbers #6655

Open
wants to merge 6 commits into
base: 4.3
Choose a base branch
from
Open

Conversation

kageds
Copy link

@kageds kageds commented Oct 30, 2020

Selecting a rate for an inbound call with caller_id_numbers filter was failing here:

matching_rate_on_caller_id(Rate, FromDID) ->

kzd_rates:caller_id_numbers(Rate, [<<".">>]) should be returning the list of regexes but it was returning a binary instead.

Also fixed up the CSV import/export so now the export CSV has the same format as the import CSV.

When we exported a ratedeck the caller_id_numbers in the CSV were in the internal regex format and so if that file was then imported back the field was corrupted and the filter no longer worked.

The CSV format of the caller_id_numbers should be ':' seperated list of prefixes in both import and export files

RegexList ->
try
RE = "^\\^\\\\\\+\\?(.*)\\\.\\+\\$",
<<":", ColonList/binary>> =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would look at using kz_binary:join([convert_regex_to_caller_id()], <<":">>) instead of the fold, personally.

@@ -68,7 +68,7 @@ caller_id_numbers(Doc) ->

-spec caller_id_numbers(doc(), Default) -> binary() | Default.
caller_id_numbers(Doc, Default) ->
kz_json:get_binary_value([<<"caller_id_numbers">>], Doc, Default).
kz_json:get_list_value([<<"caller_id_numbers">>], Doc, Default).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec needs updating if you're fetching a list here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants