is_alpha_number
Returns true
if the number is a valid vanity (alpha) number such as 800 MICROSOFT
; it returns false
otherwise. A valid vanity number will start with at least 3 digits and will have three or more alpha characters. This does not do region-specific checks.
This action does not use any parameters.
Consider the following dialplan fragments:
<action application="phonenumber" data="is_alpha_number caller"/>
will set the phonenumber_caller_is_alpha_number
channel variable to either true
or false
.
<action application="phonenumber" data="is_alpha_number destination"/>
will set the phonenumber_destination_is_alpha_number
channel variable to either true
or false
.
<action application="phonenumber" data="is_alpha_number all"/>
will set both the phonenumber_caller_is_alpha_number
and the phonenumber_destination_is_alpha_number
channel variables to either true
or false
.
<action application="phonenumber" data="is_alpha_number ${variable}"/>
will set the phonenumber_number_is_alpha_number
channel variable to either true
or false
.
freeswitch@test> phonenumber is_alpha_number +18006427676
false
freeswitch@test> phonenumber is_alpha_number +1800MICROSOFT
true
Consider the following hook definitions:
<hook>
<param name="scope" value="caller"/>
<param name="actions" value="is_alpha_number"/>
</hook>
will set the phonenumber_caller_is_alpha_number
channel variable to either true
or false
.
<hook>
<param name="scope" value="destination"/>
<param name="actions" value="is_alpha_number"/>
</hook>
will set the phonenumber_destination_is_alpha_number
channel variable to either true
or false
.
<hook>
<param name="scope" value="all"/>
<param name="actions" value="is_alpha_number"/>
</hook>
will set both the phonenumber_caller_is_alpha_number
and the phonenumber_destination_is_alpha_number
channel variables to either true
or false
.