Description:
After changing the feature code for a miscellaneous application entry, the Feature Codes page shows the correct value, but the "default" checkbox is unchecked. If the checkbox is checked, then the value reverts to the value used when originally creating the misc. app. entry.
Steps to recreate:
1. Click on Misc. Applications
2. Enter a description, feature code, and choose a destination.
3. Click Submit to save the misc. app.
4. Go to Feature Codes screen and verify the misc. app. appears
5. Go back to the Misc. Applications screen
6. Edit the misc. app. just created and change the feature code
7. Click Submit to save the misc. app.
8. Go to Feature Codes screen and verify the misc. app. appears -- the feature code will be updated, but the Default checkbox will be unchecked. Selecting the checkbox will change the feature code value to the old code.
Root Cause:
When the misc. app. is created, the original feature code entry is stored in the defaultcode column in the featurecodes table. When you edit the misc. app., the feature code is written to the customcode column whether it changes or not. If there is a value in the customcode column -- whether it differs from defaultcode or not -- FreePBX will indicate that the default code is not being used.
Additional Info:
I found that I could edit the entry directly in the asterisk database to fix things -- as long as I cleared the customcode field and correctly set the defaultcode, the misc. app. worked fine after reloading the configuration.
In addition, I found that deleting the misc. app. did not delete the entry from the featurecodes table (although it was properly deleted from the miscapps table) -- I had to delete it from featurecodes manually.