Call confirmation with FreeSWITCH

FreeSWITCH has a great feature which is left unnoticed by many users:

When a call is sent to an endpoint, the server can be configured to ask the answering side for a confirmation. The server plays a sound message (e.g. “Press 1 to answer the call” and waits for input. As soon as the receiving party dials the digit, the call is considered as answered, and all other possible fork destinations are cancelled.

So, this feature allows you to forward the call to a mobile phone, and make sure it won’t end up in a voice mail or in the mobile operator telling that this user is currently unavailable.

The feature is controlled by a set of variables named “group_confirm_…“, although this function can also be used outside of the group context. Only the channel where group_confirm_key is defined, is actually asking for confirmation. So if you set this variable after the call fork, you can control the behavior  in each individual fork leg.

Pieces of configuration from my production server:

<!-- File:  conf/dialplan/default.xml 
   group_confirm_file is set for every call because I use only one phrase everywhere.
   default group_confirm_read_timeout is 5 seconds which is quite uncomfortable, 1 second is much more handy
-->
   <extension name="global" continue="true">
      <condition field="${call_debug}" expression="^true$" break="never">
        <action application="info"/>
      </condition>
      <condition>
        <action application="set" data="group_confirm_file=phrase:press_one_to_answer"/>
        <action application="set" data="group_confirm_read_timeout=1000"/>
        <!-- the rest is skipped, see the vanilla config in the distro -->
      </condition>
    </extension>

<!-- File:  conf/directory/dvop_groups/ssinyagin.xml 
   this is where I define call groups for every person in dvop.net context
-->
  <group name="hunt_5110">
    <users>
      <user id="5011" type="pointer"/>
      <user id="5012" type="pointer"/>
    </users>
  </group>

<!-- File: conf/directory/dvop_users/ssinyagin.xml 
   here I define every user's personal extensions
-->

<!-- this is my mobile phone. It requests the confirmation, otherwise the call may end up in my mailbox -->
 <user id="5011"> 
    <params>
      <param name="dial-string" value="[group_confirm_key=1]loopback/0794070224/default"/>
    </params>
  </user>

<!-- this is a Gigaset DECT phone in my office (mobile signal is too weak, so this is my primary phone). 
  My SIP trunk provider allows me to set the Caller ID, so I set it to my mobile number -->  
<user id="5012">
    <params>
      <param name="a1-hash" value="538db5a1d5555cd9df62bf2ff0430c4b"/>
    </params>
    <variables>
      <variable name="user_context" value="default"/>
      <variable name="outbound_caller_id_number" value="0794070224"/>
      <variable name="public_sip_caller_username" value="ssinyagin"/>
    </variables>
  </user>

<!-- File: conf/dialplan/default/20_groupcall.xml 
   this is part of my dial plan, and it rings the group for a person. -->

  <extension name="dvop_groupcall">
    <condition field="destination_number" expression="^(51[1-9]0)$">
      <action application="export" data="outbound_caller_id_number=${outbound_caller_id_number}"/>
      <action application="answer"/>
      <action application="set" data="ringback=$${hold_music}"/> 
      <action application="set" data="call_timeout=60"/>
      <action application="set" data="hangup_after_bridge=true"/>
      <action application="bridge" data="${group_call(hunt_$1@${domain_name}+A)}"/>
    </condition>
  </extension>

You should ignore all outbound caller ID manipulation as it’s not applicable to most of SIP trunk providers.

So, as a result, when the call is forwarded to the extension 5110, all my available phones ring simultaneously, and the mobile phone asks for a confirmation. The desk phone does not need any confirmation, so the call is answered by a simple pickup.

Advertisements

, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: