I don’t have Asterisk running on any Ubuntu hosts. However, I do have 1 on Raspbian. Since both Ubuntu and Raspbian are Debian based, this may be relevant.
If you look at '/lib/systemd/system/asterisk.service' you should see:
And then just a couple of lines further on, you should see instructions on how to add or override existing directives in a way that should survive an update.