is_possible_number
Checks whether a phone number is a possible number.
This action makes use of the default_region
parameter.
Consider the following dialplan fragments:
<action application="phonenumber" data="is_possible_number caller default_region=US"/>
will set the phonenumber_caller_is_possible_number
channel variable to the resulting value.
<action application="phonenumber" data="is_possible_number destination default_region=US"/>
will set the phonenumber_destination_is_possible_number
channel variable to the resulting value.
<action application="phonenumber" data="is_possible_number all default_region=US"/>
will set both the phonenumber_caller_is_possible_number
and the phonenumber_destination_is_possible_number
channel variables to the resulting value.
<action application="phonenumber" data="is_possible_number ${variable} default_region=US"/>
will set the phonenumber_number_is_possible_number
channel variable to the resulting value.
freeswitch@test> phonenumber is_possible_number +16172531000 default_region=US
true
freeswitch@test> phonenumber is_possible_number +999237000 default_region=US
false
freeswitch@test> phonenumber is_possible_number +1256300 default_region=US
false
freeswitch@test> phonenumber is_possible_number 077400982200 default_region=IT
false
Consider the following hook definitions:
<hook>
<param name="scope" value="caller"/>
<param name="actions" value="is_possible_number"/>
<param name="default_region" value="US"/>
</hook>
will set the phonenumber_caller_is_possible_number
channel variable to the resulting value.
<hook>
<param name="scope" value="destination"/>
<param name="actions" value="is_possible_number"/>
<param name="default_region" value="US"/>
</hook>
will set the phonenumber_destination_is_possible_number
channel variable to the resulting value.
<hook>
<param name="scope" value="all"/>
<param name="actions" value="is_possible_number"/>
<param name="default_region" value="US"/>
</hook>
will set both the phonenumber_caller_is_possible_number
and the phonenumber_destination_is_possible_number
channel variables to the resulting value.