Thanks a lot @cynjut!
In case anyone is wondering, this is in fact really direct and easy to do.
Here are some examples.
For unconditional call forwarding:
22 is the extension
55 is the destination extension
CF means Call Forward (unconditional)
Get the current value:
asterisk -rx "database get CF 22"
(Returns “Database entry not found.” if not set)
Set unconditional forward:
asterisk -rx "database put CF 22 55"
Reset / Remove the forward:
asterisk -rx "database del CF 22"
If you want to list all the unconditional forwards:
asterisk -rx "database show CF"
If you want to list all the families and values in the database:
asterisk -rx "database show"
PS: CFU is the family (or “group”) for call forward when unavailable and CFB call forward when busy.