mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 20:59:53 +05:00
72 lines
2.9 KiB
XML
72 lines
2.9 KiB
XML
<!--
|
|
Exemplify the integration between CGRateS and FreeSWITCH.
|
|
-->
|
|
|
|
<include>
|
|
<context name="default">
|
|
|
|
<extension name="unloop">
|
|
<condition field="${unroll_loops}" expression="^true$" />
|
|
<condition field="${sip_looped_call}" expression="^true$">
|
|
<action application="deflect" data="${destination_number}" />
|
|
</condition>
|
|
</extension>
|
|
|
|
<extension name="call_debug" continue="true">
|
|
<condition field="${call_debug}" expression="^true$" break="never">
|
|
<action application="info" />
|
|
</condition>
|
|
</extension>
|
|
|
|
<!--- CGRateS related extensions -->
|
|
<!-- Place all requests into park app. Notify must be empty so we do not loop. Order Lcr computation -->
|
|
<extension name="CGRateS_Auth">
|
|
<condition field="${cgr_notify}" expression="^$">
|
|
<!---<action application="set" data="cgr_computelcr=true" />-->
|
|
<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_notify}" expression="^-INSUFFICIENT_FUNDS$">
|
|
<action application="set" data="proto_specific_hangup_cause=sip:403" />
|
|
<action application="hangup" />
|
|
</condition>
|
|
</extension>
|
|
|
|
<!-- In case of CGRateS returning UNAUTHORIZED_DESTINATION, play the message (if recorded) and disconnect the call with 403. -->
|
|
<extension name="CGRateS_AuthForbidden">
|
|
<condition field="${cgr_notify}" expression="^-UNAUTHORIZED_DESTINATION$">
|
|
<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_notify}" expression="^-SYSTEM_ERROR$">
|
|
<action application="set" data="proto_specific_hangup_cause=sip:503" />
|
|
<action application="hangup" />
|
|
</condition>
|
|
</extension>
|
|
|
|
<!-- Use Suppliers information to simulate calls to suppliers, replace here with real gateway ids out of suppliers -->
|
|
<extension name="CGR Suppliers">
|
|
<condition field="cgr_suppliers" expression=".+">
|
|
<action application="set" data="cgr_supplier=${cgr_suppliers[1]}" />
|
|
</condition>
|
|
</extension>
|
|
|
|
<!-- Connect call normally, it was not influenced so far by CGRateS -->
|
|
<extension name="Local_Extension">
|
|
<condition field="destination_number" expression="^(10[01][0-9])$">
|
|
<action application="set" data="ringback=${us-ring}" />
|
|
<action application="set" data="call_timeout=30" />
|
|
<action application="bridge" data="user/${destination_number}@${domain_name}" />
|
|
</condition>
|
|
</extension>
|
|
|
|
</context>
|
|
</include>
|