source extensions_override_fop2.conf:
[app-dnd-off]
include => app-dnd-off-custom
exten => 79,1,Answer
exten => 79,n,Wait(1)
exten => 79,n,Macro(user-callerid,)
; added for fop2
exten => 79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => 79,n,dbDel(fop2state/${CHAN})
exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
; end fop2 addition
exten => 79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
exten => 79,n,Set(STATE=NOT_INUSE)
exten => 79,n,Gosub(app-dnd-off,sstate,1)
exten => 79,n(hook_1),Playback(agent-loginok)
exten => 79,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
[app-dnd-on]
include => app-dnd-on-custom
exten => 78,1,Answer
exten => 78,n,Wait(1)
exten => 78,n,Macro(user-callerid,)
; added for fop2
exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
exten => 78,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => 78,n,Set(DB(fop2state/${CHAN})=Do not Disturb)
exten => 78,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Do not Disturb)
; end fop2 addition
exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
exten => 78,n,Set(STATE=BUSY)
exten => 78,n,Gosub(app-dnd-on,sstate,1)
exten => 78,n(hook_1),Playback(agent-loggedoff)
exten => 78,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
a new one, after source was changed:
[app-dnd-off]
include => app-dnd-off-custom
exten => 79,1,Answer
exten => 79,n,Wait(1)
exten => 79,n,Macro(user-callerid,)
; added for fop2
exten => 79,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => 79,n,dbDel(fop2state/USER/${AMPUSER})
exten => 79,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: )
; end fop2 addition
exten => 79,n,Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
exten => 79,n,Set(STATE=NOT_INUSE)
exten => 79,n,Gosub(app-dnd-off,sstate,1)
exten => 79,n(hook_1),Playback(do-not-disturb&de-activated)
exten => 79,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
[app-dnd-on]
include => app-dnd-on-custom
exten => 78,1,Answer
exten => 78,n,Wait(1)
exten => 78,n,Macro(user-callerid,)
; added for fop2
exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
exten => 78,n,Set(CHAN=${CUT(CHANNEL,-,1)}) ; guess we don't need this one???
exten => 78,n,Set(DB(fop2state/USER/${AMPUSER})=Do not Disturb)
exten => 78,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: USER/${AMPUSER},Value: Do not Disturb)
; end fop2 addition
exten => 78,n,Set(DB(DND/${AMPUSER})=YES)
exten => 78,n,Set(STATE=BUSY)
exten => 78,n,Gosub(app-dnd-on,sstate,1)
exten => 78,n(hook_1),Playback(do-not-disturb&activated)
exten => 78,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:DND${AMPUSER})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => sstate,n,GotoIf($["${DEVICES}" = "" ]?return)
exten => sstate,n,Set(LOOPCNT=${FIELDQTY(DEVICES,&)})
exten => sstate,n,Set(ITER=1)
exten => sstate,n(begin),Set(DEVICE_STATE(Custom:DEVDND${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
Unfortunately it still doesn't show DND