Asterisk FreePBX FOP2 error disabling Do Not disturb DND

If you are getting a error attempting to disable DND on your Asterisk phone system and you have FOP2 installed and you have recent updates to the Asterisk program, this may be a fix for you.

 

The issue is the function DbDel which had been depreciated since Asterisk 1.4 appears to now be removed, at least in Asterisk 16.

 

To confirm the issue, you will see this error in the Asterisk logs: pbx.c:2906 pbx_extension_helper: No application ‘DB_DELETE’ for extension (from-internal, *79, 3)


To further confirm, run this command: asterisk -x ‘dialplan show *79@from-internal’ You will likely see the code has been overridden by FOP2

[ Included context 'app-dnd-off' created by 'pbx_config' ]
'*79' => 1. Macro(user-callerid,) [extensions_override_fop2.conf:189]
2. Set(CHAN=${CUT(CHANNEL,-,1)}) [extensions_override_fop2.conf:191]
3. dbDel(fop2state/${CHAN}) [extensions_override_fop2.conf:192]
4. UserEvent(FOP2ASTDB,Family: fop2state,Channel: ${CHAN},Value: ) [extensions_override_fop2.conf:193]
5. Set(CONNECTEDLINE(name-charset,i)=utf8) [extensions_override_fop2.conf:195]
6. Set(CONNECTEDLINE(name,i)=Do Not Disturb: OFF) [extensions_override_fop2.conf:196]
7. Set(CONNECTEDLINE(num,i)=${AMPUSER}) [extensions_override_fop2.conf:197]
8. Answer() [extensions_override_fop2.conf:198]
9. Wait(1) [extensions_override_fop2.conf:199]
10. Noop(Deleting: DND/${AMPUSER} ${DB_DELETE(DND/${AMPUSER})}) [extensions_override_fop2.conf:200]
11. Set(STATE=NOT_INUSE) [extensions_override_fop2.conf:201]
12. Gosub(app-dnd-off,sstate,1()) [extensions_override_fop2.conf:202]
[hook_1] 13. Playback(do-not-disturb&de-activated) [extensions_override_fop2.conf:203]
14. Macro(hangupcall,) [extensions_override_fop2.conf:204]

 

Per documentation the replacement for DbDel is DB_DELETE, however the syntax is different.

 

Edit: /etc/asterisk/extensions_override_fop2.conf
Around line 192 and 267 replace dbDel with DB_DELETE.
192: exten => *79,n,Noop(${DB_DELETE(fop2state/${CHAN})})
267: exten => *76,n,Noop(${DB_DELETE(fop2state/${CHAN})})

 

What is interesting is FOP2 is already using DB_DELETE in many places. It seems at least these two have been missed.

Leave a Comment