get_national_significant_number
Gets the national significant number of a phone number. Note a national significant number doesn’t contain a national prefix or any formatting.
This action makes use of the default_region
parameter.
Consider the following dialplan fragments:
<action application="phonenumber" data="get_national_significant_number caller default_region=US"/>
will set the phonenumber_caller_national_significant_number
channel variable to the resulting value.
<action application="phonenumber" data="get_national_significant_number destination default_region=US"/>
will set the phonenumber_destination_national_significant_number
channel variable to the resulting value.
<action application="phonenumber" data="get_national_significant_number all default_region=US"/>
will set both the phonenumber_caller_national_significant_number
and the phonenumber_destination_national_significant_number
channel variables to the resulting value.
<action application="phonenumber" data="get_national_significant_number ${variable} default_region=US"/>
will set the phonenumber_number_national_significant_number
channel variable to the resulting value.
freeswitch@test> phonenumber get_national_significant_number +16172531000
6172531000
freeswitch@test> phonenumber get_national_significant_number +442076792000
2076792000
freeswitch@test> phonenumber get_national_significant_number 6172531000 default_region=US
6172531000
freeswitch@test> phonenumber get_national_significant_number 02076792000 default_region=GB
2076792000
Consider the following hook definitions:
<hook>
<param name="scope" value="caller"/>
<param name="actions" value="get_national_significant_number"/>
<param name="default_region" value="US"/>
</hook>
will set the phonenumber_caller_national_significant_number
channel variable to the resulting value.
<hook>
<param name="scope" value="destination"/>
<param name="actions" value="get_national_significant_number"/>
<param name="default_region" value="US"/>
</hook>
will set the phonenumber_destination_national_significant_number
channel variable to the resulting value.
<hook>
<param name="scope" value="all"/>
<param name="actions" value="get_national_significant_number"/>
<param name="default_region" value="US"/>
</hook>
will set both the phonenumber_caller_national_significant_number
and the phonenumber_destination_national_significant_number
channel variables to the resulting value.