; In the [global] section of extensions.conf add LIMIT_RTCC_INTERVAL=5000 LIMIT_RTCC_APP=Log(NOTICE|$ LIMIT_RTCC_APP=${LIMIT_RTCC_APP}{EXTEN},$ LIMIT_RTCC_APP=${LIMIT_RTCC_APP}{UNIQUEID},$ LIMIT_RTCC_APP=${LIMIT_RTCC_APP}{RAND()}) ; then in section [default] or other exten => AnswerAndWait,1,Wait(10) exten => AnswerAndWait,2,Answer() exten => AnswerAndWait,3,Wait(10) exten => AnswerAndWait,4,Goto(3) exten => 12345,1,SET(CALL_LIMIT=90000) exten => 12345,n,Dial(Local/AnswerAndWait@default||rL(${CALL_LIMIT}:30000:2000)) ; Or any other values ; By dialing 12345 you will hear ringing for 10sec then the call will be answered and each 5sec you will get a message with a new RAND() value each time and each 10sec you will see the new loop of AnswerAndWait ; If you update the CALL_LIMIT variable via Manager or your own LIMIT_RTCC_APP application, the call limit will be updated too. ; If your verbosity level is more than 10 - you will see some output from the app processing. ; You can not execute application or use a function, that starts autoservice on the channel like System() or CURL(), because it is allready in a call. ; To call a webpage it is possible to use an AGI script. ; For using an AGI script in [global] section (or on the calling channel before Dial) change the LIMIT_RTCC_APP to "AGI(GetLIMIT)" ; If you set LIMIT_RTCC_APP as: LIMIT_RTCC_APP=AGI(GetLIMIT|$ LIMIT_RTCC_APP=${LIMIT_RTCC_APP}{UNIQUEID}) ; your GetLIMIT AGI could be as simple as: #!/bin/sh RES=`wget "http://127.0.0.1/GetCallLimit.php?call=${1}" -O -` echo "SET VARIABLE CALL_LIMIT ${RES}" ; and then you may also call it for the initial call limit by replacing ;exten => 12345,1,SET(CALL_LIMIT=90000) ; with exten => 12345,1,EXEC(${LIMIT_RTCC_APP})