[Asterisk-Users] Delays in IVR

Adam Moffett adam at plexicomm.net
Mon Dec 26 13:28:18 MST 2005


> Please post the appropriate section in extensions.conf that is
>responsible for the IVR's operation.
>
>  
>
You asked for it.

The pleximenu context is reached from the default context by a simple 
goto, as in:
exten => [ourphonenumber],1,GoTo(pleximenu|s|1)

Everything works as I expect it to except for the long delay between 
dialing your option and actually getting your option. 

[pleximenu]
        exten => s,1,Answer()
        exten => s,2,GoToIfTime(${BUSHOURS}?pleximenu|s-OPENHOURS|1)
        exten => s,3,Noop("Must not be business hours")
        exten => s,4,GoTo(pleximenu|s-OFFHOURS|1)

        exten => s-OPENHOURS,1,Wait(1)
        exten => s-OPENHOURS,2,Background(plexicomm/Main_Greeting)
        exten => s-OPENHOURS,3,WaitExten(15)
        exten => s-OPENHOURS,4,Background(plexicomm/Main_Greeting)
        exten => s-OPENHOURS,5,WaitExten(15)
        exten => s-OPENHOURS,6,Hangup()

        exten => s-OFFHOURS,1,Wait(1)
        exten => s-OFFHOURS,2,BackGround(plexicomm/off_hours_greeting)
        exten => s-OFFHOURS,3,WaitExten(15)
        exten => s-OFFHOURS,4,BackGround(plexicomm/off_hours_greeting)
        exten => s-OFFHOURS,5,WaitExten(15)
        exten => s-OFFHOURS,6,Hangup()

        ;sales
        exten => 1,1,Wait(1)
        exten => 1,2,GoToIfTime(${BUSHOURS}?pleximenu|1-OPEN|1)
        exten => 1,3,Noop("Must be off hours")
        exten => 1,4,GoTo(pleximenu|1-OFFHOURS|1)

        exten => 1-OPEN,1,Playback(plexicomm/hold_for_sales)
        exten => 1-OPEN,2,Noop()
        exten => 1-OPEN,3,Dial(${OFFICEPHONES}|30|m)
        exten => 1-OPEN,4,Dial(${ONCALLPHONES}|${ONCALLTIMEOUT}|m)
        exten => 1-OPEN,5,Playback(plexicomm/sales_unavailable)
        exten => 1-OPEN,6,Voicemail(sales at plexicomm|s)
        exten => 1-OPEN,7,Playback(plexicomm/thanks_for_interest)
        exten => 1-OPEN,8,Hangup()
        exten => 1-OFFHOURS,1,voicemail(sales at plexicomm)
        exten => 1-OFFHOURS,2,Hangup()

        ;support
        exten => 2,1,Wait(1)
        exten => 2,2,GoToIfTime(${BUSHOURS}?pleximenu|2-OPEN|1)
        exten => 2,3,Noop("Must be off hours")
        exten => 2,4,GoTo(pleximenu|2-OFFHOURS|1)

        exten => 2-OPEN,1,Playback(plexicomm/hold_for_support)
        exten => 2-OPEN,2,Noop()
        exten => 2-OPEN,3,Dial(${OFFICEPHONES}|30|m)
        exten => 2-OPEN,4,Dial(${ONCALLPHONES}|${ONCALLTIMEOUT}|m)
        exten => 2-OPEN,5,Playback(plexicomm/support_unavailable)
        exten => 2-OPEN,6,Voicemail(support at plexicomm|s)
        exten => 2-OPEN,7,Playback(plexicomm/thanks_for_interest)
        exten => 2-OPEN,8,Hangup()
        exten => 2-OFFHOURS,1,voicemail(support at plexicomm)
        exten => 2-OFFHOURS,2,Hangup()

        ;Starts a variable called ATTEMPT at 1
        ; tries calling ONCALLPHONES
        ; increments ATTEMPT variable by 1
        ; tries again until ATTEMPT = 4
        ; should be 3 attempts total
        ; set ONCALLTIMEOUT to a number of seconds before your voicemail 
picks up.
        exten => 9,1,GoToIfTime(${BUSHOURS}?pleximenu|2-OPEN|1)
                ;we shouldn't be doing this during business hours
        exten => 9,2,Playback(plexicomm/page_support)
        exten => 9,3,Set(ATTEMPT=1)
        exten => 9,4,GoToIf($[${ATTEMPT} : 4]?9-FAILED|1)
        exten => 9,5,Dial(${ONCALLPHONES}|${ONCALLTIMEOUT}|m)
        exten => 9,6,Set(ATTEMPT=$[${ATTEMPT} + 1])
        exten => 9,7,Playback(plexicomm/keep_paging)
        exten => 9,8,Wait(2)
                ;waiting 2 seconds to allow cell connections to terminate
        exten => 9,9,GoTo(pleximenu|9|4)
        exten => 9,10,Hangup()
        exten => 9-FAILED,1,GoTo(pleximenu|2-OPEN|5)


        ;extensions for dan and adam
        ;dan - since people already know dan as extension 3, we keep 
that for compatibility
        exten => 3,1,GoTo(Pleximenu|103|1)
        exten => 103,1,GoTo(default|103|1)

        ;adam
        exten => 104,1,GoTo(default|104|1)




More information about the asterisk-users mailing list