How can I set up some feature codes to allow someone to set a presence other than DND, like 'out to lunch', 'in meeting', etc?
How can I set up some feature codes to allow someone to set a presence other than DND, like 'out to lunch', 'in meeting', etc?
Look at the override contexts fop2 is using, and use them as a base. be careful as the contexts are different across freepbx versions, this is just an example, you will have to look at your own extensions_override_fop2.conf file:
[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(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()
I have highlighted the part where you set the "label" to Do not disturb, that you can change for something else.