normalize_digits_only

normalize_digits_only

Normalizes a string of characters representing a phone number. This converts wide-ASCII and Arabic-Indic numerals to European numerals, and strips punctuation and alpha characters.

This action does not use any parameters.

Consider the following dialplan fragments:

  <action application="phonenumber" data="normalize_digits_only caller"/>

will set the phonenumber_caller_digits_only channel variable to the resulting value.


  <action application="phonenumber" data="normalize_digits_only destination"/>

will set the phonenumber_destination_digits_only channel variable to the resulting value.


  <action application="phonenumber" data="normalize_digits_only all"/>

will set both the phonenumber_caller_digits_only and the phonenumber_destination_digits_only channel variables to the resulting value.


  <action application="phonenumber" data="normalize_digits_only ${variable}"/>

will set the phonenumber_number_digits_only channel variable to the resulting value.

freeswitch@test> phonenumber normalize_digits_only 034-56&+a#234

03456234

freeswitch@test> phonenumber normalize_digits_only 1800MICROSOFT

1800

Consider the following hook definitions:

    <hook>
      <param name="scope" value="caller"/>
      <param name="actions" value="normalize_digits_only"/>
    </hook>

will set the phonenumber_caller_digits_only channel variable to the resulting value.


    <hook>
      <param name="scope" value="destination"/>
      <param name="actions" value="normalize_digits_only"/>
    </hook>

will set the phonenumber_destination_digits_only channel variable to the resulting value.


    <hook>
      <param name="scope" value="all"/>
      <param name="actions" value="normalize_digits_only"/>
    </hook>

will set both the phonenumber_caller_digits_only and the phonenumber_destination_digits_only channel variables to the resulting value.