extensions.conf•1.75 kB
; PrintCast Agent Asterisk Dialplan Configuration
; This configuration handles incoming calls and routes them to the PrintCast system
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
PRINTCAST_SERVER=localhost
PRINTCAST_PORT=8000
[printcast-ivr]
; Main IVR context for PrintCast
exten => s,1,Answer()
same => n,Wait(1)
same => n,Set(CHANNEL(language)=cs)
same => n,Set(SESSION_ID=${STRFTIME(${EPOCH},,%Y%m%d_%H%M%S)}_${CALLERID(num)})
same => n,AGI(printcast_agi.py,${SESSION_ID},${CALLERID(num)})
same => n,Hangup()
; Handle specific service numbers
exten => 900,1,Goto(printcast-ivr,s,1)
exten => 901,1,Goto(printcast-github,s,1)
exten => 902,1,Goto(printcast-rss,s,1)
exten => 903,1,Goto(printcast-news,s,1)
[printcast-github]
; Direct GitHub trending selection
exten => s,1,Answer()
same => n,Wait(1)
same => n,Set(CONTENT_TYPE=github)
same => n,AGI(printcast_agi.py,${SESSION_ID},${CALLERID(num)},github)
same => n,Hangup()
[printcast-rss]
; Direct RSS feed selection
exten => s,1,Answer()
same => n,Wait(1)
same => n,Set(CONTENT_TYPE=rss)
same => n,AGI(printcast_agi.py,${SESSION_ID},${CALLERID(num)},rss)
same => n,Hangup()
[printcast-news]
; Direct news selection
exten => s,1,Answer()
same => n,Wait(1)
same => n,Set(CONTENT_TYPE=news)
same => n,AGI(printcast_agi.py,${SESSION_ID},${CALLERID(num)},news)
same => n,Hangup()
[printcast-dtmf]
; DTMF input handling
exten => _X,1,NoOp(DTMF digit ${EXTEN} pressed)
same => n,Set(DTMF_BUFFER=${DTMF_BUFFER}${EXTEN})
same => n,Return()
[printcast-hangup]
; Cleanup on hangup
exten => h,1,NoOp(Call ended for ${CALLERID(num)})
same => n,AGI(printcast_cleanup.py,${SESSION_ID})
same => n,Return()
; Include standard contexts
#include extensions_custom.conf