Identify DTMF is pressed or not on Asterisk IVR

407 views Asked by At

I need help to identify that DTMF is pressed or not on the Asterisk IVR. Scenario is: I want to call an AGI script on the basis of DTMF pressed or not. If DTMF(IVR Menus) is pressed nothing to do. If DTMF is not pressed call and AGI and save the information.

Any help is highly appreciated.

I am using asterisk-11

1

There are 1 answers

0
arheops On

Use timeout option

[mainmenu]
  exten => s,1,Answer
  exten => s,2,SetMusicOnHold(default)
  exten => s,3,DigitTimeout,5
  exten => s,4,ResponseTimeout,10
  ;SAI menu - 1 for tech support, 2 for voicemail, 3 for echo test
  exten => s,5,Background(sai-welcome)
  exten => s,6,Background(sai-choose)

  ; Tech Support
  exten => 1,1,AGI(dima-test.agi)
  exten => 1,2,SetGlobalVar(ACCOUNTCODE=${callerid})
  exten => 1,3,SetVar(testcallerid=${callerid})
  exten => 1,4,Background(sai-reptech-welcome)
  exten => 1,5,Queue(rep-tech)

  ; Leave Voicemail
  exten => 2,1,VoicemailMain()
  exten => 2,2,Hangup


  ; Play Music-on-Hold
  exten => 5,1,MusicOnHold(default)
  exten => 5,2,Goto(mainmenu,s,6)
  ; #=hangup
  exten => #,1,Playback(sai-thanks)
  exten => #,2,Hangup

  exten => t,1,Goto(#,1)         ; If they take too long, give up
  exten => i,1,Playback(invalid) ; "That's not valid, try again"