IVR Integration using asterisk in CentOS 5

423 Views Asked by At

How can I integrate IVR System using Asterisk in CentOS 5?
I've built an IPPABX system using asterisk and postgresql in CenOS 5. Agents can communicate among them and I can make outbound call.
In this scenario how can I integrate IVR for inbound calls?
I've searched over internet but I'm not getting specific/right procedure for my problem. I've come to know I need to do something in asterisk's extension.conf and sip.conf.
I know the procedure is lengthy but I got frustrated that I can't make it work.

1

There are 1 best solutions below

0
On

Here is simple ivr example

  [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

  ; Echo Test
  exten => 3,1,Playback(demo-echotest)
  exten => 3,2,Echo
  exten => 3,3,Playback(demo-echodone)
  exten => 3,4,Goto(mainmenu,s,6)

  ; EAGI Test
  exten => 4,1,Answer()
  exten => 4,2,Wait(1)
  exten => 4,3,AGI(sai-repid.agi)
  exten => 4,4,Wait(1)
  exten => 4,5,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"

For db-driven ivr you can use AGI interface(as example you can read code of a2billing.org project) or asterisk REALTIME architecture

http://www.voip-info.org/wiki/view/Asterisk+RealTime+Extensions

Also can be mix of dialplan and func_odbc,something like this

      [db_menu]
      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,n,Set(invalid_filename=silence/1)
      exten => s,n,Set(filename=${ODBC_getfile(${menuid})})
      exten => s,n(loop),Background(${invalid_filename}&${filename})

      ; return no if no choice or goto line like new_context,ext,prio 
      exten => _X,1,Set(have_choice=${ODBC_getivr_choice(${menuid},${EXTEN})})
      exten => _X,2,GotoIF($[ "${have_choice}" == "no" ]?invalid,1)
      exten => _X,n,Goto(${have_choice});

      exten => invalid,1,Set(invalid_filename=${ODBC_getfile_invalid(${menuid})})
      exten => invalid,n,Goto(s,loop)