Skip to main content

mod_dptools: answer

About

Answer the call for a channel.This sets up duplex audio between the calling ''A'' leg and the FreeSwitch server. It is not about other endpoints.

The server might need to 'answer' a call to play an audio file or to receive DTMF from the call.

Once answered, calls can still be bridged to other extensions. Because a bridge after an answer is actually a transfer, the ringback tones sent to the caller will be defined by transfer_ringback.

Click here to expand Table of Contents

Usage

answer

Example

<action application="answer"/>

Play A Tone

A simple example to answer in order to play a 1004kc test tone to the caller, then hangup.

    <extension name="play tone">
<condition field="destination_number" expression="^tone1$">
<action application="log" data="INFO *****Playing tone1***** "/>
<action application="answer"/>
<action application="sleep" data="1000"/>
<action application="playback" data="tone_stream://v=-6;%(10000,100,1004);loops=1"/>
<action application="hangup"/>
</condition>
</extension>


Answer a Call to Detect FAX Tones

We need to answer the call to let FreeSWITCH receive the audio to start detecting FAX tones. Because a bridge after an answer is actually a transfer, the ringback sent to the caller is now defined by transfer_ringback

  <extension name="sales_fax">
<condition field="destination_number" expression="^sales_fax$">
<action application="answer"/>
<action application="set" data="transfer_ringback=${us-ring}"/>
<action application="spandsp_start_fax_detect" data="transfer 'FAX XML default' 6"/>
<action application="bridge" data="${group_call(sales@${domain_name})}"/>
</condition>
</extension>

See Also