Look at the extended tapi functions lineGetEquipmentState,
lineSetEquipmentState, lineRegister and lineUnregister. I have only
been able to do this using Embedded Visual C++.
I use these on Windows Mobile 2003 (Orange M1000, O2 XDA2) but I am
having problems with lineGetEquipmentState on Windows Mobile 2003 SE
(Orange M2000, O2 XDA2s) (it hangs about for about 10 seconds before
returning a failure code if the phone is off.)