Call Timer

We have limited incoming lines so we implemented a absolutre timeout after 15 minutes for any personal calls. Works fine but people are requesting a warning before the call drops:

Dial Plan:
[macro-dial_fromexternal_zap]
;include => from-internal
exten => s,1,AGI(dial_zap.php|${ARG1})
exten => s,2,Noop(${cfu},${cfb},${cfa})
exten => s,3,Gotoif($["${cfu}"!=“false”]?20)
exten => s,4,Set(TIMEOUT(absolute)=900)
exten => s,5,Dial(${desttype}/${exten}&Sip/${ARG2},60,r2)
exten => s,6,Gotoif($[${DIALSTATUS}=‘BUSY’]?s-BUSY,1)
exten => s,7,Gotoif($[${cfa}!=‘false’]?30)
exten => s,8,Goto(s,50)
exten => s,9,Hangup
exten => s,20,Goto(from-external,${cfunumber},1)
exten => s,21,Hangup
exten => s,30,Goto(from_external,${cfanumber},1)
exten => s,31,Hangup
exten => s,40,Goto(from-external,${cfbnumber},1)
exten => s,41,Hangup
exten => s,50,Macro(poplarvm,${ARG1})
exten => s,51,Playback(goodbye)
exten => s,52,Hangup
exten => s-BUSY,1,Gotoif($["${cfb}"!=“false”]?s,40)
exten => s-BUSY,2,Gotoif($["${vm}"!=“false”]?s,50)
exten => s-BUSY,3,Playback()
exten => s-BUSY,4,Hangup
exten => T,1,background(beep)
exten => T,2,Wait(30)
exten => T,3,Playback(goodbye)
exten => T,4,Hangup

When hitting the first T, the call is dropped but asterisk is saying its going through all the T steps - is there a better way to do this or no?

Thanks in advance?

The limit call feature should work perfectly but I can’t seem to implement it properly.

Have you tried the L option with the dial command? From voip-info.org/wiki/view/Asterisk+cmd+Dial

L(x[:y][:z]): Limit the call to ‘x’ ms, warning when ‘y’ ms are left, repeated every ‘z’ ms) Only ‘x’ is required, ‘y’ and ‘z’ are optional. The following special variables are optional for limit calls: (pasted from app_dial.c)

* LIMIT_PLAYAUDIO_CALLER - yes|no (default yes) - Play sounds to the caller.
* LIMIT_PLAYAUDIO_CALLEE - yes|no - 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. If LIMIT_WARNING_FILE is not defined, then the default behaviour is to announce ("You have [XX minutes] YY seconds").