This is the full content of the now working 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(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)})
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()
[app-dnd-toggle]
include => app-dnd-toggle-custom
exten => *76,1,Answer
exten => *76,n,Wait(1)
exten => *76,n,Macro(user-callerid,)
exten => *76,n,GotoIf($["${DB(DND/${AMPUSER})}" = ""]?activate:deactivate)
exten => *76,n(activate),Set(DB(DND/${AMPUSER})=YES)
; added for fop2
exten => *76,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => *76,n,Set(DB(fop2state/${CHAN})=Do not Disturb)
exten => *76,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: Do not Disturb)
; end fop2 addition
exten => *76,n,Set(STATE=BUSY)
exten => *76,n,Gosub(app-dnd-toggle,sstate,1())
exten => *76,n(hook_on),Playback(do-not-disturb&activated)
exten => *76,n,Macro(hangupcall,)
exten => *76,n(deactivate),Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})})
; added for fop2
exten => *76,n,Set(CHAN=${CUT(CHANNEL,-,1)})
exten => *76,n,dbDel(fop2state/${CHAN})
exten => *76,n,UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: )
; end fop2 addition
exten => *76,n,Set(STATE=NOT_INUSE)
exten => *76,n,Gosub(app-dnd-toggle,sstate,1())
exten => *76,n(hook_off),Playback(do-not-disturb&de-activated)
exten => *76,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-cf-off]
include => app-cf-off-custom
exten => *73,1,Answer
exten => *73,n,Wait(1)
exten => *73,n,Macro(user-callerid,)
exten => *73,n,Set(fromext=${AMPUSER})
exten => *73,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
; added for fop2
exten => *73,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *73,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: )
; end fop2 addition
exten => *73,n,Set(STATE=NOT_INUSE)
exten => *73,n,Gosub(app-cf-off,sstate,1())
exten => *73,n(hook_1),Playback(call-fwd-unconditional&de-activated)
exten => *73,n,Macro(hangupcall,)
exten => _*73.,1,Answer
exten => _*73.,n,Wait(1)
exten => _*73.,n,Set(fromext=${EXTEN:3})
exten => _*73.,n,Noop(Deleting: CF/${fromext} ${DB_DELETE(CF/${fromext})})
; added for fop2
exten => _*73.,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => _*73.,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: )
; end fop2 addition
exten => _*73.,n,Set(STATE=NOT_INUSE)
exten => _*73.,n,Gosub(app-cf-off,sstate,1())
exten => _*73.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*73.,n,SayDigits(${fromext})
exten => _*73.,n,Playback(cancelled)
exten => _*73.,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/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:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
[app-cf-on]
include => app-cf-on-custom
exten => *72,1,Answer
exten => *72,n,Wait(1)
exten => *72,n,Macro(user-callerid,)
exten => *72,n,Read(fromext,call-fwd-unconditional&please-enter-your&extension&then-press-pound,,,,)
exten => *72,n,Set(fromext=${IF($["foo${fromext}"="foo"]?${AMPUSER}:${fromext})})
exten => *72,n,Wait(1)
exten => *72,n(startread),Read(toext,ent-target-attendant&then-press-pound,,,,)
exten => *72,n,GotoIf($["foo${toext}"="foo"]?startread)
exten => *72,n,Wait(1)
exten => *72,n,Set(DB(CF/${fromext})=${toext})
; added for fop2
exten => *72,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => *72,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: ${toext} )
; end fop2 addition
exten => *72,n,Set(STATE=BUSY)
exten => *72,n,Gosub(app-cf-on,sstate,1())
exten => *72,n(hook_1),Playback(call-fwd-unconditional&for&extension)
exten => *72,n,SayDigits(${fromext})
exten => *72,n,Playback(is-set-to)
exten => *72,n,SayDigits(${toext})
exten => *72,n,Macro(hangupcall,)
exten => _*72.,1,Answer
exten => _*72.,n,Wait(1)
exten => _*72.,n,Macro(user-callerid,)
exten => _*72.,n,Set(fromext=${AMPUSER})
exten => _*72.,n,Set(toext=${EXTEN:3})
exten => _*72.,n,Set(DB(CF/${fromext})=${toext})
; added for fop2
exten => _*72.,n,Set(CHAN=${DB(DEVICE/${fromext}/dial)})
exten => _*72.,n,UserEvent(FOP2CUST,Family: astdbcust,Channel: ${CHAN},Value: ${toext} )
; end fop2 addition
exten => _*72.,n,Set(STATE=BUSY)
exten => _*72.,n,Gosub(app-cf-on,sstate,1())
exten => _*72.,n(hook_2),Playback(call-fwd-unconditional&for&extension)
exten => _*72.,n,SayDigits(${fromext})
exten => _*72.,n,Playback(is-set-to)
exten => _*72.,n,SayDigits(${toext})
exten => _*72.,n,Macro(hangupcall,)
exten => sstate,1,Set(DEVICE_STATE(Custom:CF${fromext})=${STATE})
exten => sstate,n,Set(DEVICES=${DB(AMPUSER/${fromext}/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:DEVCF${CUT(DEVICES,&,${ITER})})=${STATE})
exten => sstate,n,Set(ITER=$[${ITER} + 1])
exten => sstate,n,GotoIf($[${ITER} <= ${LOOPCNT}]?begin)
exten => sstate,n(return),Return()
;[fop2-park]
; Old fop2-park for asterisk 1.2 or some older 1.4
;exten => _X.,1,Set(ARRAY(RETURN_EXTENSION,RETURN_CONTEXT)=${CUT(EXTEN,:,1)},${CUT(EXTEN,:,2)})
;exten => _X.,n,ParkAndAnnounce(PARKED,,Console/dsp,${RETURN_CONTEXT},${RETURN_EXTENSION},1)
;exten => _X.,n,Goto(${RETURN_CONTEXT},${RETURN_EXTENSION},1)
;exten => _X.,n,Hangup
[fop2-park]
exten => _X.,1,Set(ARRAY(RETURN_EXTENSION,RETURN_CONTEXT,PARKBUTTON)=${CUT(EXTEN,:,1)},${CUT(EXTEN,:,2)},${CUT(EXTEN,:,3)})
exten => _X.,2,GotoIf($["${PARKBUTTON}" = "PARK/default"?5)
exten => _X.,3,GotoIf($["${PARKBUTTON}" = ""?5)
exten => _X.,4,Set(PARKINGLOT=${PARKBUTTON:5})
exten => _X.,5,Park(,${RETURN_CONTEXT},${RETURN_EXTENSION},1,s)
[fop2-dummy]
exten => dummy,1,Answer
exten => dummy,2,Wait(1)
exten => dummy,3,Hangup