[general]
static                          = yes
writeprotect                    = no
extenpatternmatchnew            = yes           ; Using new pattern matcher as a test
clearglobalvars                 = no
userscontext                    = default       ; User context is where entries from users.conf are registered.


[globals]
;CONSOLE=Console/dsp                            ; Console interface for demo


[init-agi]
exten => SetAgi,1,NoOP(SET AGI)
same  => n,Set(__agiUrl=${PJSIP_HEADER(read,x-redact-agi-url)})
same  => n,Return()


[dial]
exten => _.,1,NoOP(AGI: ${agiUrl})
same => n,GosubIf($[${LEN(${agiUrl})} = 0]?init-agi,SetAgi,1)
same => n,AGI(agi://${agiUrl}/dial)
same => n,Hangup()

exten => h,1,NoOP(Hangup)

exten => failed,1,NoOP(Origination Failed)
same =>  n,Hangup()


[inbound-default]
exten => _.,1,NoOP(AGI: ${agiUrl})
same => n,GosubIf($[${LEN(${agiUrl})} = 0]?init-agi,SetAgi,1)
same => n,AGI(agi://${agiUrl}/inbound)
same => n,Hangup()

exten => h,1,NoOP(Hangup)
