Assuming that the internal modem exposes a virtual port you could use the serial library to communicate with it.
If the port is described in the registry, you can use the code from this post to find it:
Reading com ports information from the registry
What are you trying to achieve? Maybe there is a simpler way to do it.