Files
cgrates/data/freeswitch/conf/dialplan/cgr_dialplan.xml

42 lines
1.6 KiB
XML

<!--
CGRateS config sample.
Add the bellow defined extensions to your own context before bridge application.
Ignore include and context defined here for the sake of avoiding errors if directly included in FreeSWITCH dialplan folder.
-->
<include>
<context name="cgrates">
<!-- Place all prepaid requests into park app. Notify must be empty so we do not loop. -->
<extension name="CGRateS_AuthPrepaid">
<condition field="${cgr_reqtype}" expression="^prepaid$" />
<condition field="${cgr_notify}" expression="^$">
<action application="park"/>
</condition>
</extension>
<!-- In case of CGRateS returning INSUFFICIENT_FUNDS, play the message (if recorded) and disconnect the call with 403. -->
<extension name="CGRateS_AuthForbidden">
<condition field="${cgr_reqtype}" expression="prepaid" />
<condition field="${cgr_notify}" expression="^-INSUFFICIENT_FUNDS$">
<action application="playback" data="tone_stream://path=$${sounds_dir}/insufficient_funds.wav"/>
<action application="set" data="proto_specific_hangup_cause=sip:403"/>
<action application="hangup"/>
</condition>
</extension>
<!-- In case of CGRateS returning SYSTEM_ERROR, disconnect the call so we do not risk prepaid calls going out. -->
<extension name="CGRateS_Error">
<condition field="${cgr_reqtype}" expression="^prepaid$" />
<condition field="${cgr_notify}" expression="^-SYSTEM_ERROR$">
<action application="set" data="proto_specific_hangup_cause=sip:503"/>
<action application="hangup"/>
</condition>
</extension>
</context>
</include>