I have a Fritz!Box 6360 cable modem, and I believe this is the most common brand of cable or DSL modem supplied by German connectivity providers.
For some years now, our connectivity provider (which is also our telephony and television provider) has stopped providing a real telephone connection, and instead doing SIP between their systems and my cable modem, with analogue and ISDN sockets on the cable modem for plugging telephones into.
On the plus side (for the provider) this means our phone calls go over the same IP connection as our Internet data.
On the minus side (for us), if the Internet connection fails, we can't even phone the provider to make sure they know about it, unless we use a mobile phone.
So much for progress.
Anyway, the fact that the cable modem now speaks SIP means that:
The first of these is not entirely obvious - there's a specific gotcha which makes the cable modem try to register to the Asterisk server with a username of the incoming caller ID if you don't know how to turn this off.
So, here are some notes on how to get these features working. Note they are written for a Fritz!Box 6360, running firmware version 85.06.53, in German. The same instructions may well work for other models, other firmware versions, and other languages, but this is the combination I have here, so it's all I can write about.
Create a SIP account on your Asterisk server (it can be inside your own network, or out on the Internet; all that's needed is that the Fritz!Box can connect to it somehow).
Then create an account on the Fritz!Box to register to your Asterisk server:
Click on Weiter and the Fritz!Box should register to your Asterisk server.
To get calls forwarded, you can now go to Telefonie - Rufbehandlung - Rufumleitung and create a Neue Rufumleitung
Repeat the above for each inbound number you have (I have 3 on my modem, because I used to have ISDN service, which in Germany comes with 3 numbers as standard).
Calls in to your numbers will now ring any telephones you have directly plugged in, and also be passed through to the Asterisk server, where you can do what you want with them in your dialplan. This is not a tutorial on how to write an Asterisk dialplan.