Foniva Contact Center Software
Asterisk Experts Support

Set dial maximum time and play warning audio

The topic of this post is to show how you can use the Dial cmd option in the dialplan

to limit the duration of a call and tell caller/callee that call is about to finish.

To do this, you can use the L option in your dialplan.

L(x[:y][:z]) - Limit the call to ‘x’ ms. Play a warning when ‘y’ ms are
left. Repeat the warning every ‘z’ ms. The following special
variables can be used with this option:
* LIMIT_PLAYAUDIO_CALLER   yes|no (default yes)
Play sounds to the caller.
Play sounds to the callee.
* LIMIT_TIMEOUT_FILE       File to play when time is up.
* LIMIT_CONNECT_FILE       File to play when call begins.
* LIMIT_WARNING_FILE       File to play as warning if ‘y’ is defined.
The default is to say the time remaining.

Example :

If you want to set a maximum of 10 minutes conversation and atone minute before the end, tell both the caller and the callee that the call is about to be drop :

exten => 5140000000,1,Set(LIMIT_PLAYAUDIO_CALLER=yes)

exten => 5140000000,n,Set(LIMIT_PLAYAUDIO_CALLEE=yes)

exten => 5140000000,n,Set(LIMIT_WARNING_FILE=call-about-to-drop)

exten => 5140000000,n,Dial(${EXTEN},30,L(600000:60000))

exten => 5140000000,n,Hangup

So, after 9 minutes of conversation, the caller and the callee will hear call-about-to-drop audio file.


Leave a Reply

Our sponsors

Asterisk Experts Support