This is probably a beginner question, but I haven’t been able to find anything that works the way I expect it to.
I am trying to get a counter that increments with each call that gets placed into the system. Currently what happens is it uses my global variable and will increment that, but it resets the counter to the initial setting with each call(Ex: counter is 1016, call comes in and set to 1017. Second call comes in and it is also 1017.)
Here is the extensions file. Figure there are alot of things I am doing wrong. Let me know what else you need.
[default]
; Comments are good
; This is for when someone calls 1001
exten => 1001,1,Answer()
exten => 1001,2,Playback(hello-world)
exten => 1001,3,Hangup()
; Set a global variable:
; This is used when you try
; and call 2000 from the console
exten => 2000,1,Dial(SIP/2000,20)
exten => 2000,2,VoiceMail(2000,u)
; For 2001
exten => 2001,1,Dial(SIP/2001,20)
exten => 2001,2,VoiceMail(2000,u)
; For 2002
exten => 2002,1,Dial(SIP/2002)
; For 2003
exten => 2003,1,Dial(SIP/2003)
; For 2005
exten => 2005,1,Dial(SIP/2005)
exten => 2999,1,VoiceMailMain(${CALLERID(num)},s)
[globals]
COUNT=1016
[call-callegra]
exten => 10,1,Answer()
exten => 10,n,Set(COUNT=$[${COUNT} + 1],g)
;exten => 10,n,Wait(10)
exten => 10,n,WaitForSilence(500)
exten => 10,n,SendDTMF(${COUNT})
exten => 10,n,Wait(14)
exten => 10,n,Playback(hello-world)
exten => 10,n,Playback(hello-world)
exten => 10,n,Playback(hello-world)
exten => 10,n,Playback(hello-world)
exten => 10,n,Wait(5)
exten => 10,n,Hangup()
[from-sip-external]
exten => 2003,1,Dial(SIP/2003)
exten => 2005,1,Dial(SIP/2005)