[Freeswitch-users] UNALLOCATED_NUMBER handling

Jerry Kendall Jerry.Kendall at FiberConX.com
Fri Feb 19 22:28:19 MSK 2016


Hello all....

I'm trying to add code to the dialplan to handle the UNALLOCATED_NUMBER error.

I'm in Canada, when I call a US based 800 number I should, and now am getting UNALLOCATED_NUMBER 
error from the Canadian based ITSP.
However, I want to handle it in the DialPlan. I want to tell the users, via audio file playback, 
that the number is not assigned/allocated.

I have looked in lots of places and found references to transfer_on_fail and a few other ideas and 
have tried many but, I just can't seem to make this work.

Not sure if this is the best way to handle this.

my 'default' dialplan has this-------------
<include>
         <!--
                 North American Outbound call:
                 DID: 1NxxNxxXXXX
                 GW: GW-0
         -->
         <extension name="public_did_11234567890" continue="true">
                 <condition field="${caller_id_number}" expression="^11234567890$"/>
                 <condition field="${destination_number}" expression="^1?([2-9]\d{2}[2-9]\d{2}\d{4})$">

                     <action application="set" data="hangup_after_bridge=true"/>
                     <action application="set" data="continue_on_fail=true"/>
                     <action application="set" data="transfer_on_fail=UNALLOCATED_NUMBER 
UNALLOCATED_NUMBER xml error"/>

                     <action application="bridge" data="sofia/gateway/GW-0/1$1"/>

                 </condition>

         </extension>
</include>

and I have the following in for UNALLOCATED_NUMBER extension----
<include>
         <extension name="UNALLOCATED_NUMBER" continue="true">
                 <condition field="destination_number" expression="UNALLOCATED_NUMBER" 
continue="false" break="on-true">
                         <action application="sleep" data="1000"/>
                         <action application="playback" 
data="$${conf_dir}/sounds/unallocated_number.wav"/>
                         <action application="hangup" data="NORMAL_CLEARING"/>
                 </condition>
         </extension>
</include>



Jerry



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list