Setting call limit using Dial command

Using asterisk ver 1.09. What to limit call time to time reported by aaa billing.

Problem: Asterisk is not ending the calls when time limit is reached. Users are allowed to chat beyond call limit.

I am using Dial()

see my config below:
; Authentificated, Get Destination
exten => s,30,Macro(Say_Credit_Amount)
exten => s,31,SetVar(RetryCnt=3)
exten => s,32,Read(Destination,${Prompts}${IVRLang}telephone-number)
exten => s,33,GotoIf($["${Destination}" != “”]?40)
exten => s,34,SetVar(RetryCnt=$[${RetryCnt} - 1])
exten => s,35,GotoIf($[${RetryCnt} > 0]?32)
exten => s,36,Goto(500)
exten => s,40,aaa_Resolve(${UserID}@${UserPass}/${Destination})
exten => s,41,GotoIf($[${aaa_Result} > 0]?50)
exten => s,42,Macro(Say_Credit_Time)
exten => s,43,SetCDRUserField(ignore)
exten => s,44,SetVar(_aaa_Credit_Time=${aaa_Credit_Time})
exten => s,45,Dial(Local/${Destination}${DST_CTX},60,S(${aaa_Credit_Time}))
exten => s,46,GotoIf($["${DIALSTATUS}" != “CHANUNAVAIL”]?500)
exten => s,47,SetCDRUserField(ivr)
exten => s,48,Dial(Local/${Destination}@wrong_numbers,30)
exten => s,49,Goto(500)

easier way of doing it:

http://www.voip-info.org/wiki-Asterisk+cmd+Dial

see the ‘L’ flag specifically.

[code]# 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"). [/code]

i don’t even think you need to upgrade to a new version of asterisk for this…