Hi Kasper,
Try taking a look at the following link:
http://www.3cx.com/blog/docs/command-line-api/
There are some other useful tips in this part of the 3CX website as well that you may want to take a look at.
Make sure you have your TAPI drivers working as well...
Cheers, Brendan