this is my code:
[increment]
exten => s,1,Verbose(2,Increment the counter variable)
; Set the initial value of the variable
same => n,Set(CounterVariable=1)
same => n,Verbose(2,Current value of CounterVariable is: ${CounterVariable})
same => n,Set(IncrementValue=0)
; Now we can increment the value of CounterVariable if IncrementValue returns 1
same => n,Set(CounterVariable=${IF($[${IncrementValue} = 1]?${INC(CounterVariable)}:${CounterVariable})})
same => n,Verbose(2,Our IncrementValue returned: ${IncrementValue})
same => n,Verbose(2, Our new value of CounterVariable is: ${CounterVariable})
same => n,Hangup()
NOW My Question: i think the IF function don't work properly and ${CounterVariable} in end of dialplan return 2 only.why?
Thank You.
Aucun commentaire:
Enregistrer un commentaire