Piggy backing a telephone from software


I have a program which I want to use to do call control. However when acting as an agent and handling a call from the queue I would like to be able to dial digits from the software rather than have to use the telephone. For example in order to hangup, requires that I press “*” on the telephone. Likewise I would like to be able to invoke transfer functions from software which are available by pressing keys on the phone.

Any hints or suggestions welcome.

Thank you