[asterisk-users] Expanding my answering-machine system

Doug Lytle support at drdos.info
Sat Jun 17 12:46:57 CDT 2023


On 6/17/23 08:47, Steve Matzura wrote:
>
> Both Background() and WaitExten()  allow the caller to enter DTMF 
> digits. Asterisk then attempts to find an extension in the current 
> context that matches the digits that the caller entered. If Asterisk 
> finds a match, it will send the call to that extension.
>
>
> My question then is, is "*" a valid exension, as in:
>

I'd have to assume yes.  I don't use WaitExten() and I set 
autofallthrough=no in the /etc/asterisk.conf, since that is the way I've 
always expected Asterisk to work; my dialplan examples are based on that.

The below example shows a call coming into a DID, playing background 
prompts and excepting input during play.


;****************
;* Auto attendant
;****************

exten => 5175551212,1,Gosub(check-blacklist,s,1)
      same => n,Gosub(check-hours,s,1)
      same => n,Gosub(holiday-check,s,1)
      same => n,Gosub(get-callerid,s,1)
      same => n,Goto(auto-attend,s,1)

[auto-attend]

include => dial-by-extension

;*************
;* Set timeouts
;*************

exten => s,1,Set(TIMEOUT(response)=8)
      same => n,Set(TIMEOUT(digit)=2)
      same => n,Set(LOOPCOUNT=0)

      same => n,GotoIf($["${Holiday}" = "YES"]?HOLIDAY:BEGIN)
      same => n(BEGIN),Answer()
      same => n,Wait(1)

;****************************************************
;* Play the 'Welcome message' and office hours message
;****************************************************

      same => n,Background(${voice}/welcome)
      same => n,Background(${voice}/business_hours)
      same => n,Background(${voice}/8am_5pm)
      same => n(HOLIDAY),Background(${voice}/dial_anytime)
      same => n(DIRECTORY),Background(${voice}/directory_assist)
      same => n,Background(${voice}/press_1)
      same => n,Background(${voice}/to_ring_after_hours)
      same => n,Background(${voice}/press_2)
      same => n,Background(${voice}/absence_delay)
      same => n,Background(${voice}/press_3)

;************************************
;* If 1 is pressed, go to Dial by name
;************************************

exten => 1,1,Goto(directory,s,1)

;***************************************
;* If 2 is pressed, dial the Foyer phone
;***************************************

exten => 2,1,Goto(dial-by-extension,4255,1)

;***********************************************
;* If 3 is pressed, dial absence/delay extension
;***********************************************

exten => 3,1,Gosub(cellphone-callerid,s,1)
exten => 3,n,Voicemail(3888 at sip,us)
exten => 3,n,Hangup()

;********************************************
;* If 8# is pressed, go to Voicemail Main menu
;********************************************

exten => 8#,1,VoiceMailMain(@sip)
exten => 8#,2,Hangup()

This is not the complete dialplan; I also have error checking and a loop 
counter.

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20230617/7932a2bf/attachment.html>


More information about the asterisk-users mailing list