What kind of card/device do I need?

This is the setup:

4 lines in ====>>> Digitum Stuff ====>>> Phones

4 regular pots lines - will not change
4 line phone extentions (which type open to suggestion but prefer headset jack model)
ubuntu linux - setup seems straight forward and ok
The other things I need are call on hold, call que auto answer on hold, transfer calls between stations and call each station internally.

What type of card and/or other device am I looking for?

I know I need 4 ports in or 4 FXO card and an echo cancel module. Got that.

The phones will have all four lines, but the cards I see for 8 ports will give me 4 lines in, and 4 separate lines out for 4 single line extensions Digitum TDM800: 4FXO, 4FXS, echo module).

What else do I need to convert the 4 output lines to each of the four lines going into each phone?

In my mind, it’s like 4 ports FXO in, echo module, and 4 ports out with 4 lines each.

What am I missing?

I recommend Linksys SPA400, 4 FXO lines. For FXS we are using Linksys PAP2T and AG-188