한국어

IPPBX/GW

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app


http://www.voip-info.org/wiki/view/Asterisk+tips+ivr+menu


Asterisk tips ivr menu

Interactive voice response menus


Implementing a simple 'push-1, push-2' menu structure

The key to creating this menu is to create an Extension (defined as 205 below) to record your menu prompts. This will put the sound file in/tmp/asterisk-recording.gsm. You'll have to move that file each time its created to /var/lib/asterisk/sounds and rename it to something pertinent to your design so it can be called from the dial-plan. Notice the line under [mainmenu] exten => s,5,Background(sai-welcome). The
sai-welcome is one of those .gsm sound files. The rest of the dial-plan just defines what happens when each option is pushed. If you want to be able to have regular users update the voice prompts, see asterisk tips phrase recording menu.

extensions.conf



[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"

 [default]
  include => mainmenu
  include => local
  include => longdistance
  include => joe-iax
  include => npi-iax

  ; Record voice file to /tmp directory
  exten => 205,1,Wait(2) ; Call 205 to Record new Sound Files
  exten => 205,2,Record(/tmp/asterisk-recording:gsm) ; Press # to stop recording
  exten => 205,3,Wait(2)
  exten => 205,4,Playback(/tmp/asterisk-recording) ; Listen to your voice
  exten => 205,5,wait(2)
  exten => 205,6,Hangup


Example menu with timeout and invalid option. Works with Asterisk 1.6 

exten => s,1,Set(NUMINVALID=0)
exten => s,2,Set(NUMTIMEOUTS=0)
exten => s,3,Background(thank-you-for-calling)
exten => s,4,Set(TIMEOUT(digit)=5)
exten => s,5,Set(TIMEOUT(response)=10)
exten => s,6,WaitExten(5)

exten => t,1,Set(NUMTIMEOUTS=$[${NUMTIMEOUTS}+1]})
exten => t,2,Gotoif($["${NUMTIMEOUTS}" < "3"]?s,3)
exten => t,3,Background(vm-goodbye)
exten => t,4,Hangup()

exten => i,1,Set(NUMINVALID=$[${NUMINVALID}+1]})
exten => i,2,Gotoif($["${NUMINVALID}" < "4"]?:10)
exten => i,3,Background(invalid)
exten => i,4,Goto(s,3)
exten => i,10,Playback(vm-goodbye)
exten => i,11,Hangup()



Implementing a high-density without wearing out your keyboard

Now consider an information delivery IVR, such as a bus schedule. The basic call flow goes something like:

Hear initial greeting
Hear root menu
Descend into to menu 1
Descend into to submenu 2
Play information message at option 4
Return to submenu 2
Descend into to submenu 7
Return to root menu
{and so on...}

The schedule that prompted creation of this code has 136 possible menu/message combinations.



[transit-ivr]
 exten => s,1,Answer
 exten => s,2,SetVar(ivrflag=transit)                                                    ; Unused at the moment
 exten => s,3,Background(transit-ivr/grtg-3)                                             ; Play the initial greeting (interruptable)
 exten => s,4,Goto(transit-ivrmain,s,1)                                                  ; Start the menuing system after the message completes

 exten => _x,1,Goto(transit-ivrmain,s,1)                                                 ; Start the menuing system if the user presses any key during the greeting

[transit-ivrmain]
 exten => s,1,NoOp(s,1 - Has ${digitstack} in the digitstack)
 exten => s,2,GotoIf($[${LEN(${digitstack})} = 0]?s-restart,1)                ; If there is nothing in the stack at all then restart the stack 
 exten => s,3,System(/var/lib/asterisk/sounds/transit-ivr/filexists /var/lib/asterisk/sounds/transit-ivr/${digitstack}.gsm)  ; test for the existance of this path as a recording
 exten => s,4,Background(transit-ivr/${digitstack})
 exten => s,5,NoOp()                                                                     ; insert padding to offset s,9 so it in turn is offset cleanly enough for it's n+101 jump
 exten => s,6,NoOp()
 exten => s,7,NoOp()
 exten => s,8,NoOp()
 exten => s,9,System(/var/lib/asterisk/sounds/transit-ivr/filexists /var/lib/asterisk/sounds/transit-ivr/${digitstack}?.gsm)  ; test for the existance of additional recordings underneath the current path

 exten => s,104,NoOp(we should warn the user they chose an invalid option...)                         ; Relative to s,3
 exten => s,105,SetVar(digitstack=${digitstack:0:$[${LEN(${digitstack})} - 1]})
 exten => s,106,Goto(s,1)

 exten => s,110,NoOp(there aren't any menus below this one, so go back up one level)     ; Relative to s,9
 exten => s,111,SetVar(digitstack=${digitstack:0:$[${LEN(${digitstack})} - 1]})
 exten => s,112,Goto(s,1)

 exten => s-restart,1,SetVar(digitstack=0)
 exten => s-restart,2,Goto(s,1)

 ; Capture keypresses
 exten => _X,1,SetVar(digitstack=${digitstack}${EXTEN})
 exten => _X,2,GotoIf($[${digitstack:$[${LEN(${digitstack})} - 1],1} = 8]?_X,10)
 exten => _X,3,Goto(s,1)
 exten => _X,10,SetVar(digitstack=${digitstack:0:$[${LEN(${digitstack})} - 2]})          ; Eight pops two digit off the stack... (including the 8 itself)
 exten => _X,11,Goto(s,1)



'.../transit-ivr/filexists' is a bash script containing:


 #!/bin/bash
 #  Test for the existance of files based on shell globbing patterns

 for a in $1;
 do
  if [ -f $a ] ; then
        # there are one or more files that match;
        exit;
  else
        # there aren't any files that match;
        exit 1;
 fi;
done;



Finally, the folder '.../transit-ivr/' contains a collection of .gsm recordings named according to their 'dialing path', thus:


 8192 Aug 27 00:53   .
 20480 Aug 27 00:53  ..
 54285 Aug 25 22:46  0.gsm                  This is the root menu
 66429 Aug 25 22:47  01.gsm                This is menu 1 off of the root
 17556 Aug 25 22:46  02.gsm                This is menu 2 off of the root
 17292 Aug 25 22:44  023.gsm               This is informational recording 3 off of menu 2 off of the root
 115533 Aug 25 22:48 03.gsm                This is menu 3 off the root
 {and so on...}



When creating the recordings, any recording that doesn't have another recording 'below' it in 'dialing path' is implicity an informational recording (a leaf on the tree). To work backwards up the tree 8 (or any other key) has to be assigned to 'go back to the previous menu'. Other global keys such as 'exit to operator' and 'end call/hangup' can be assigned similarly using dialplan logic.

The next refinement to this model would be to add a filename suffix parser to be able to embed jumps, transfers and out-dials inside the tree by encoding them into the filenames (ie. 029x1235551212.gsm).

All of this should be painfully familiar if you've worked with Nortel Norstar NAM3 based StarTalk IVRs before.


Advanced IVR Menu


Here is a more advanced IVR application that is assumed you know how it works. I found this example in a newsgroup but I don't have the url to reference. It was very helpful for me to see this type of setup different from the ones provided above.

This shows the flow between multiple IVR menus and how to control and display the information. I will show the basics of the IVR.





 [deeper]
exten => s,1,Background(demo-nomatch)
;exten => s,1,AGI(festival-script.pl|"deeper menu")
exten => s,2,Goto,options|s|1

[options]
exten => s,1,Background(demo-instruct)
;exten => s,1,AGI(festival-script.pl|"options menu")
exten => 1,1,Goto,deeper|s|1
exten => 2,1,Goto,sales|s|1

[sales]
exten => s,1,Background(demo-thanks)
;exten => s,1,AGI(festival-script.pl|"sales menu")
exten => 0,1,Goto,from-sip|1000
exten => 1,1,Goto,Menu|s|1

[Menu]
exten => s,1,Background(demo-congrats)
;exten => s,1,AGI(festival-script.pl|"menu menu")
exten => 1,1,Goto,sales|s|1
exten => 2,1,Goto,options|s|1
exten => i,1,Goto,s
exten => t,1,Goto,s


;The specific method to enter the menu is up to you but I used my sip phone to test.
[from-sip]

exten => 100,1,Answer
exten => 100,2,Goto,Menu|s|1





If you have sip configured this should work out of the box. I am not sure if it requires that you have the sample installed to have the default sound files but this is what i have setup above. If you have festival configured on the box then you can use the commented out lise for the festival-script.pl which does not require the running festival server but rather just have the binaries in the path.

The important piece that I really didn't realize on this site is the Goto that allow you to go to a context which was a simple piece that I was missing"exten => 100,2,Goto,Menu|s|1" or "exten => 100,2,Goto(Menu,s,1)". So each menu is a context and I can move back and forth through each one for a more advanced IVR setup.

Here is a portion of that listed above that accepts the call and plays the message. And accepts a 1 or 2 as menu options to change the option. When the 1 is pressed then the IVR will go to the sales context and when the 2 is pressed then I will go to the options context.



[Menu]
exten => s,1,Background(demo-congrats)
exten => 1,1,Goto,sales|s|1
exten => 2,1,Goto,options|s|1  




This may have been clear but from my reading I missed it and thought it should be added to the site.


IVR Menu with navigation history


Context voicemenu-mymenu_level0 is a top level.

CUR_LEVEL - global variable store current position in menu, with navigation history, items separated by #
For example

voicemenu-mymenu_level0#voicemenu-mysubmenu1_level1#voicemenu-mysubmenu3_level2#


macro-mymenu_addlevel - macros to push level into history stack.
macro-mymenu_prevlevel - macros to pop level from history stack.

user can press * at any level to go into previously visited menu level.

Advantages:
- wen you build menu, you don't care about reverse dependencies.
- don't use any external scripts
- possible to use same context in different branches with correct reverse navigation (look at voicemenu-mysubmenu3_level2 it available from voicemenu-mysubmenu1_level1 and voicemenu-mysubmenu2_level1)




;tested with Asterisk 1.6.2.5

[macro-mymenu_addlevel]
exten = s,1,NoOp(${MACRO_CONTEXT})
exten = s,2,Set(Count=${FIELDQTY(CUR_LEVEL,#)})
exten = s,n,Gotoif($[ "${CUT(CUR_LEVEL,#,$[${Count}])}" = "${MACRO_CONTEXT}" ] ]?s-exit) ;if last level in stack same as current context then exit.
exten = s,n,Set(PREV_LEVEL=${CUR_LEVEL})
exten = s,n,Set(__CUR_LEVEL=${IF($[ "${PREV_LEVEL}" != "" ]?${PREV_LEVEL}#:${PREV_LEVEL})}${MACRO_CONTEXT}); add MACRO_CONTEXT to stack
exten = s,n(s-exit),NoOp(Exit form macro-mymenu_addlevel)

[macro-mymenu_prevlevel]
exten = s,1,Set(Count=${FIELDQTY(CUR_LEVEL,#)})
exten = s,2,Set(TMP=${CUR_LEVEL})
exten = s,n,Set(TOGO=${CUT(TMP,#,$[${Count}-1])});Count alwayse >0
exten = s,n,Set(__CUR_LEVEL=${IF( $[${Count}>1]?${CUT(TMP,#,-$[${Count}-2])}:"")}); if count>1 set CUR_LEVEL, else clear it.
exten = s,n,NoOp(${CUR_LEVEL})
exten = s,n,Goto(${TOGO},s,1)

[voicemenu-mymenu_level0]
exten = s,1,Macro(mymenu_addlevel)
exten = s,n,Answer()
exten = s,n,Set(TIMEOUT(digit)=5)
exten = s,n,Set(TIMEOUT(response)=10)
exten = s,n,Background(greatings_1)
exten = s,n,WaitExten(5)
exten = 0,1,Dial(SIP/6051,300,r); fax
exten = 1,1,Goto(voicemenu-mysubmenu1_level1,s,1)
exten = 2,1,Goto(voicemenu-mysubmenu2_level1,s,1)
exten = i,1,Goto(s,1)
exten = t,1,Goto(voicemenu-mymenu-operator,s,1)

[voicemenu-mysubmenu1_level1]
exten = s,1,Macro(mymenu_addlevel)
exten = s,n,Background(payment_1)
exten = s,n,WaitExten(5)
exten = 0,1,Goto(voicemenu-mymenu-operator,s,1)
exten = 1,1,Goto(voicemenu-mysubmenu3_level2,s,1)
exten = *,1,Macro(mymenu_prevlevel)
exten = i,1,Goto(s,1)
exten = t,1,Goto(voicemenu-mymenu-operator,s,1)

[voicemenu-mysubmenu2_level1]
exten = s,1,Macro(mymenu_addlevel)
exten = s,n,Background(payment_2)
exten = s,n,WaitExten(5)
exten = 0,1,Goto(voicemenu-mymenu-operator2,s,1)
exten = 1,1,Goto(voicemenu-mysubmenu3_level2,s,1)
exten = *,1,Macro(mymenu_prevlevel)
exten = i,1,Goto(s,1)
exten = t,1,Goto(voicemenu-mymenu-operator2,s,1)

[voicemenu-mysubmenu3_level2]
exten = s,1,Macro(mymenu_addlevel)
exten = s,n,Background(howtodosomething)
exten = s,n,WaitExten(5)
exten = *,1,Macro(mymenu_prevlevel)
exten = i,1,Goto(s,1)
exten = t,1,Goto(voicemenu-mymenu-operator1,s,1)





Other way of doing this


The above are great ways to create simple IVR applications using Asterisk. But Asterisk is a PBX system, not a full featured IVR system. Capabilities like database connection, website connection, GUI design environment for IVR call flows are not the strong suite of PBX systems. Here are some of the options which may help with IVR development:


See Also


번호 제목 글쓴이 날짜 조회 수
98 php memory and filesize increase upload wav admin 2019.06.25 5082
97 changing SIP drivers to CHAN_PJSIP Please err 에러 admin 2019.06.21 6089
96 /dev/mapper/ubuntu--vg-root filling up admin 2019.04.08 12362
95 Asterisk dialolan detail explan good easy clean admin 2017.08.26 20749
94 how-to-freepbx-13-firewall-setup admin 2017.08.14 20796
93 Configuring Your PBX admin 2017.08.17 20810
92 RPi Text to Speech (Speech Synthesis) admin 2017.08.24 20839
91 Google letter agi admin 2017.08.26 20847
90 Asterisk based auto dialer test and verified by 300+ concurrent. admin 2017.08.31 20860
89 SUGAR CRM admin 2017.08.23 20925
88 /sbin/service httpd start stop web start stop admin 2017.08.16 20926
87 thirdlane PBX price admin 2017.08.23 20930
86 IVR actions asterisk admin 2017.08.31 20935
85 download Installing+AsteriskNOW admin 2017.08.25 20976
84 asterisk XactView V3-CRM Widget admin 2017.08.24 20993
83 FreePBX 12 – Getting Started Guide admin 2017.08.29 21049
82 asterisk CRM SUGARCRM SuiteCRM admin 2017.08.24 21055
81 NAT 와 VoIP 시그널과 RTP 전송 영향 NAT와 방화벽/STUN/TURN/ICE/SBC admin 2017.08.19 21057
80 asterisk freepbx TTS Engine Custom - Amazon Polly - 24 languages admin 2017.08.24 21064
79 User Control Panel (UCP) 14+ admin 2017.08.23 21072
78 Asterisk/IVR/PBX/VoIP/Contact center/Voicebroadcast engineer admin 2017.08.25 21078
77 AsterSwitchboard CTI Operator Panel for Asterisk admin 2017.08.08 21096
76 Asterisk 13 Debian 8 admin 2015.11.13 21102
75 github A2Billing is commercially supported by Star2Billing admin 2017.08.26 21126
74 Text to Speech User Guide admin 2017.08.24 21177
73 asterisk IVR 쉽게 설정하기 admin 2017.08.16 21201
72 iptables for asterisk simple example configuration admin 2017.08.31 21204
71 HOW TO INSTALL FREEPBX ON CENTOS 7 admin 2017.08.24 21241
70 Top 10 greater worker admin 2017.08.26 21243
69 FOIP: T.38 Fax Relay vs. G.711 Fax Pass-Through (Fax Over IP) admin 2015.09.24 21258
68 asterisk Chapter 6. Dialplan Basics admin 2017.08.25 21268
67 Capturing SIP and RTP traffic using tcpdump admin 2017.08.17 21270
66 TwistedWave Online A browser-based audio editor admin 2017.08.25 21322
65 음성통화 서버 Asterisk + FreePBX / 통화 시연해보기 admin 2017.08.18 21330
64 Configuring an Asterisk server admin 2015.05.05 21347
63 Asterisk Downloads AsteriskNOW Software PBX admin 2015.05.05 21361
62 Setup install Asterisk PBX telephony system | VOIP Tutorial admin 2015.05.05 21370
61 OPUS and VP9 Bitrates admin 2017.08.17 21408
60 Insert into dialplan Asterisk admin 2017.08.26 21411
59 asterisk FreePBX 14, Distro 14 & More! admin 2017.08.16 21423
58 Fax Configuration FREE PBX and asterisk FAX admin 2015.05.05 21453
57 우분투 Mumble VoIP 음성채팅서버 구축 admin 2017.08.18 21459
56 Asterisk Freepbx Install Guide (CentOS v7, Asterisk v13, Freepbx v13) admin 2017.08.23 21465
55 Considerations for Using T.38 versus G.711 for Fax over IP file admin 2015.09.24 21495
54 Brand New Sealed Sangoma FreePBX 60 - 75 Users or 30 Calls admin 2017.08.05 21504
53 fax licenses Asterisk admin 2015.05.05 21516
52 FreePBX – Custom FAX to email admin 2015.05.05 21528
51 How to Install Asterisk 13 on Ubuntu 16.04 from Source admin 2017.08.23 21530
50 Asterisk 설치 준비 admin 2015.11.15 21553
49 How to build an outbound Call Center with Newfies-Dialer and Asterisk/FreePBX admin 2017.08.31 21562
48 A simple IVR and Queue example where customer listens to marketing materials .. admin 2015.05.05 21599
47 FaxServer using Asterisk admin 2015.05.05 21617
46 User Control Panel (UCP) asterisk freepbx admin 2017.08.17 21617
45 Price ,,Install Commercial Modules on CentOS and RHEL based admin 2017.08.16 21621
44 WombatDialer is highly scalable, multi-server, works with your existing Asterisk PBX. admin 2017.08.31 21642
43 초보) Asterisk , AsteriskNow 무엇인가? 무슨차이인가? 시작 배우기 쉽게 이해 공부 사용 admin 2017.08.29 21664
42 Asterisk A simple IVR admin 2015.05.05 21669
41 Installing FreePBX 14 on Debian 8.8 These instructions work fine admin 2017.08.29 21671
40 Generic Asterisk SIP Configuration Guide admin 2015.05.05 21680
39 Installing SNG7 Official Distro admin 2017.08.17 21750
38 FAX over IP sofware admin 2015.05.05 21751
37 T.38 Fax Gateway Asterisk admin 2015.05.05 21754
36 Setup Asterisk 13 with FreePBX 13 in CentOS 7 admin 2017.08.24 21805
35 Incoming Fax Handling admin 2015.05.05 21824
34 How to install and setup Asterisk 14 (PBX) on CentOS 7 admin 2017.08.23 21836
33 Asterisk Answering Machine Detection (AMD) Configuration admin 2017.08.17 21837
32 Using Asterisk to Detect and Redirect Fax Calls for Communications Server admin 2015.05.05 21975
31 Smart Predictive Auto calling Software System: Automatic Phone Calling admin 2017.08.31 21984
30 Introducing Asterisk Call Distribution ACD asterisk admin 2017.08.31 22016
29 Dialplan handler routines allow customization admin 2017.08.26 22039
28 AGI asterisk gateway interface synopsis admin 2017.08.26 22041
27 Automatic Call Distribution (ACD) Asterisk as Call Center admin 2017.08.31 22068
26 Fax For Asterisk download add on 1 port free IVR prompt G.729 admin 2015.05.05 22069
25 MP3 to WAV, WMA to WAV, OGG Convert audio to WAV online admin 2015.05.09 22100
24 Setup FAX on Asterisk with DIDForSale SIP DIDs admin 2015.05.05 22109
23 Playing text to speech inside read function in asterisk admin 2017.08.28 22181
22 asterisk dialplan 설명 admin 2017.08.16 22202
21 Asterisk Answering Machine Detection (AMD) Configuration admin 2017.09.01 22228
20 VICIdial Scratch Installation CentOS 7 & MariaDB & Asterisk 11 & Latest VICIdial SVN admin 2017.09.02 22502
19 Text to speech for asterisk using Google Translate admin 2017.08.24 22511
» Asterisk tips ivr menu Interactive voice response menus admin 2015.05.05 22582
17 Hosting Cheap VPS Hosting that doesn’t feel cheap admin 2017.08.24 22902
16 Installing AsteriskNOW Official Distro admin 2015.05.05 22985
15 Speech Recognition on Asterisk: Getting Started admin 2017.08.28 23015
14 Asterisk 가장쉬운 설치 및 설정 사용 방법 이해 할수있게 배우는 순서 안내 설명 admin 2017.08.16 23247
13 List of 5 Open Source Call Center Software Programs admin 2017.08.31 23647
12 Freepbx on Debian (Debian v7, Asterisk v11, Freepbx v2.11) admin 2015.05.05 23750
11 Asterisk fax Asterisk and fax calls Fax over IP admin 2015.05.05 24168
10 Asterisk Quick Start Guide admin 2015.05.05 24381
9 A2Billing v2.2 Install Guide CentOS v7 Asterisk v11 v13 seems to work FreePBX v13 admin 2017.08.23 24654
8 A2Billing v2 Install Guide admin 2015.05.05 24952
7 Securing Your Asterisk VoIP Server with IPTables admin 2015.05.05 25167
6 Asterisk Freepbx Install Guide (CentOS v6, Asterisk v13, Freepbx v12) admin 2015.05.05 25793
5 Fusionpbx v4 Freeswitch v1.6 CentOS v7 Install Guide admin 2017.08.23 26406
4 How to Install Asterisk on CentOS 7 easy clean explain 깔금한 쉬운 설명 admin 2017.08.23 27750
3 라즈베리파이, 아스타리스크(asterisk) PBX(사설교환기) admin 2017.08.23 28564
2 Asterisk AGI/AMI to ARI Asterisk&FreePbx - IVR setting admin 2015.05.05 30881
1 Make Your Own IVR with Asterisk admin 2017.08.26 34826