normalize_diallable_chars_only
Normalizes a string of characters representing a phone number. This strips all characters which are not diallable on a mobile phone keypad (including all non-ASCII digits).
This action does not use any parameters.
Consider the following dialplan fragments:
<action application="phonenumber" data="normalize_diallable_chars_only caller"/>
will set the phonenumber_caller_diallable_chars_only
channel variable to the resulting value.
<action application="phonenumber" data="normalize_diallable_chars_only destination"/>
will set the phonenumber_destination_diallable_chars_only
channel variable to the resulting value.
<action application="phonenumber" data="normalize_diallable_chars_only all"/>
will set both the phonenumber_caller_diallable_chars_only
and the phonenumber_destination_diallable_chars_only
channel variables to the resulting value.
<action application="phonenumber" data="normalize_diallable_chars_only ${variable}"/>
will set the phonenumber_number_diallable_chars_only
channel variable to the resulting value.
freeswitch@test> phonenumber normalize_diallable_chars_only 03*4-56&+a#234
03*456+234
freeswitch@test> phonenumber normalize_diallable_chars_only 1800MICROSOFT
1800
Consider the following hook definitions:
<hook>
<param name="scope" value="caller"/>
<param name="actions" value="normalize_diallable_chars_only"/>
</hook>
will set the phonenumber_caller_diallable_chars_only
channel variable to the resulting value.
<hook>
<param name="scope" value="destination"/>
<param name="actions" value="normalize_diallable_chars_only"/>
</hook>
will set the phonenumber_destination_diallable_chars_only
channel variable to the resulting value.
<hook>
<param name="scope" value="all"/>
<param name="actions" value="normalize_diallable_chars_only"/>
</hook>
will set both the phonenumber_caller_diallable_chars_only
and the phonenumber_destination_diallable_chars_only
channel variables to the resulting value.