FormatAddress

Metreos.Native.DialPlan.FormatAddress

Summary

FormatAddress is a simple utility to take a string and attempt to apply a set of pattern/replacement regular expressions.

Usage

The intent of FormatAddress is to provide a simple way to process an unformatted phone number against one or more pattern/replacement regular expressions. The DialingRules action parameter must be a prepopulated hashtable of pattern/replacement regular expression strings, which the action will use to test for a match. The first match found will be processed using the Regex.Replace(string, string, string) overload, with the DialedNumber argument as the first string, the pattern regular expression being used as the second argument, and the replacement regular expression being used as the third argument. Once a match is made, FormatAddress will return with the result string from Regex.Replace as the ResultData result data parameter.

Remarks

If no match is made, the DialedNumber action parameter is returned in the ResultData result data parameter.

The regular expressions must conform to the .NET syntax of regular expressions.

Action Parameters
Parameter Name.NET TypeDefaultDescription
DialedNumber *System.StringThe unformatted phone number.
DialingRules *System.Collections.HashtableA prepopulated hashtable of pattern/replacement regular expressions. The Key must be the pattern regular expression to match against, and the corresponding Value entry must be the replacement regular expression.
Result Data
Parameter Name.NET TypeDescription
ResultDataSystem.StringThe processed phone number.

Branch Conditions 

Success

No description.

Failure

No description.