все в extensions.conf
[globals]
COUNT_1=0
[count]
exten =>s,1,ExecIF($[ "${COUNT_1}" == "" ]?Set(COUNT_1=0))
exten =>s,n,Set(COUNT_1=$[ ${COUNT_1} + 1 ])
exten =>s,n,ExecIF($[ ${COUNT_1} == 21 ]?Set(COUNT_1=0))
exten =>s,n,Return
использовать както так.
exten => _X,5,Gosub(count,s,1)
если версия астериска не новая, то прийдется заменить execif на gotoif както так
exten =>s,1,ExecIF($[ "${COUNT_1}" != "" ]?ok)
exten =>s,n,Set(COUNT_1=0))
exten =>s,n(ok),Set(COUNT_1=$[ ${COUNT_1} + 1 ])
exten =>s,n,GotoIF($[ ${COUNT_1} != 21 ]?ok2)
exten =>s,n,Set(COUNT_1=0)
exten =>s,n(ok2),Return
ответил
2011-12-09 16:37:31 +0400
meral 23347 ● 24 ● 20 ● 177
http://pro-sip.net/