Changing feature codes

Would it be possible to change some feature codes so that I can use “speed dial” buttons on a SIP phone to activate them?

Example: *97 to put extension in Do-Not-Disturb mode and take it back off when the person returns to desk – so that a softkey can be programmed to dial *97.

Or is there another way this is usually done?