;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your
; inbound and outbound calls in Asterisk.
;
; This configuration file is reloaded
; - With the "extensions reload" command in the CLI
; - With the "reload" command (that reloads everything) in the CLI
;
; The "General" category is for certain variables.
;
[general]
static=yes
writeprotect=no
[globals]
CONSOLE=Console/dsp                             ; Console interface for demo
IAXINFO=guest                                   ; IAXtel username/password
TRUNK=Zap/g1                                    ; Trunk interface
TRUNKMSD=1                                      ; MSD digits to strip (usually 1 or 0)


[CustContext]

exten => 41,1,Wait,1
exten => 41,2,Set(LANGUAGE()=it)
exten => 41,3,DBGet(segre=Segreteria/Stato)
exten => 41,4,GotoIf($[${segre} =  ON]?5:8)
exten => 41,5,Playback(ufficichiusi)
exten => 41,6,Voicemail(057555541@CustContext)
exten => 41,7,Hangup
exten => 41,8,Dial(SIP/0575555499,40,tr)
exten => 41,9,Playback(occupati)
exten => 41,10,SetMusicOnHold(default)
exten => 41,11,Queue(centralino,t)
exten => 41,12,Hangup



; Follow Me volatile
exten => _NXX,1,Wait,1
exten => _NXX,2,Set(LANGUAGE()=it)
exten => _NXX,3,DBGet(follow=0575555${EXTEN}/TransfDest) ; c'� una regola di transfer?
exten => _NXX,4,GotoIf($[X${follow} !=  X]?5:8)          ; se si esegui altrimenti chiama normale
exten => _NXX,5,Dial(SIP/${follow},40,rt)               ; trasferito ad interno
exten => _NXX,6,Dial(${TRUNK}/${follow})                 ; non interno quindi esterno
exten => _NXX,7,Hangup
exten => _NXX,8,Dial(SIP/0575555${EXTEN},40,tr)      ; normale ad interno
exten => _NXX/_0575555NXX,9,Hangup
exten => _NXX,9,Dial(SIP/057555499,,tr)
exten => _NXX,10,Hangup
exten => _NXX,108,Hangup
;exten => NXX,109,Dial(SIP/0575555499,,tr)
exten => _NXX,109,Busy

exten => t,1,Playtones(congestion)
exten => t,2,Hangup

[parkinglot]
exten => s,1,NoOp(once a parked call times out it will resume here)

include => parkedcalls
exten => i,1,Playback(pbx-invalidpark)
exten => i,2,Hangup


[default]
;
; By default we include the demo.  In a production system, you
; probably don't want to have the demo there.
;

exten => s,1,Answer
exten => s,2,DigitTimeout,10



; Virtual PBX for Cust
exten => _057555541,1,GoTo(CustContext,4${EXTEN:8},1)         ; external number of extension 499 (Operator)
exten => _0575555NX,1,GoTo(CustContext,4${EXTEN:8},1)        ; DDI other extensions
