Callgroup intercept
From FreeSWITCH Wiki
Dialplan Configuration
I'm using FreeSWITCH mostly as a PBX and found I need a callgroup (call group) configuration similar to one in Asterisk. Default examples show intercepting a last global call, but with the help of "db" application, one can easily configure "intercept" to work only inside a same callgroup. FreeSWITCH sets "uuid" variable for a every call. It is a unique variable representing a call. We check for the called user's "callgroup" variable value, and put a value of "uuid" variable of every call to a wanted extension in a separate database named after "callgroup" variable.
<action application="set" data="called_party_callgroup=${user_data(${dialed_ext}@${domain} var callgroup)}"/>
<action application="db" data="insert/last_dial/${called_party_callgroup}/${uuid}"/>
<action application="bridge" data="user/${dialed_ext}@$${domain}"/>
Extension to call which checks for user's "callgroup" variable value, and intercepts the call which uuid is extracted from the db:
<extension name="group-intercept">
<condition field="destination_number" expression="^\*8$">
<action application="answer"/>
<action application="intercept" data="${db(select/last_dial/${callgroup})}"/>
<action application="sleep" data="2000"/>
</condition>
</extension>
Directory configuration
We add "callgroup" variable inside user's directory xml file.
<user id="1001" mailbox="1001">
<params>
<param name="password" value="1234"/>
<param name="vm-password" value="1001"/>
</params>
<variables>
<variable name="accountcode" value="1001"/>
<variable name="user_context" value="default"/>
<variable name="effective_caller_id_name" value="Extension 1001"/>
<variable name="effective_caller_id_number" value="1001"/>
<variable name="callgroup" value="1"/>
</variables>
</user>
