[sr-dev] Iterative dialplan matching

Andreas Granig agranig at sipwise.com
Wed Aug 24 10:17:42 CEST 2016


Hi,

When translating strings with the dialplan module, you sometimes end up
with very complex patterns for sanitizing the target string and
performing some replacements, since for a given dialplan id, processing
stops on the first match within the dialplan entries for a given dpid.

The idea is to introduce a "continue" flag (default 0) in the dialplan
table indicating to proceed with processing further dialplan entries
within the given dpid after a match. The use case is to have a sanitize
rule with highest priority which e.g. removes any spaces, dashes and
parentheses from the target string, then with a lower priority do
further processing with the cleaned up string, e.g. stripping leading
double-zeroes or a plus when normalizing to E164 numbers, or replacing a
single leading zero with the country code and so on.

This is particularly useful when a user dials a number from an address
book of some sort (e.g. on a mobile app) where number formats are stored
with country-specific formating characters like "+1-(234)-567 890", and
catching all of that in one rule results in really messy match/replace
patterns.

Any objections or feedback on that?

Cheers,
Andreas



More information about the sr-dev mailing list