I'll suggest this workflow if you want to solve this problem:
1. Google for your modems user manual. Initialization-strings syntax might differ between modem-brands. It's many years since i used modems, but I think the init-string "AT&CID=1" was enabling the called id on one modem that I once owned.
2. Open PureBasic's help files (help-menu) and go to "Reference Manual" - "SerialPort". Read the whole section it's not very much and it's fairly easy to grasp. You open a serial-port (with a few parameters for speed etc.). You write and read data on the port and then you close it when finished.
3. Write a small program that writes "ATZ" to the modem and then reads a string from the serial-port. Usually the modem will answer "OK".
4. If point #3 does not work, try the windows built-in program "hyperterminal" and write "ATZ" and press <return>. See if you get "OK". Then read on the screen the hyperterminal connection settings (baud-speed, flow-control etc.) usually something similar to 1200,n,8,1. Translate these settings into your PB program (#3) and try again.
5. Rewrite the program to send an initialization string that enables the caller id on your modem, and waits for an additional incoming strings (from modem) and prints them to the screen. (you might use the command Debug for this)
6. Call the phone-nr that your modem is attached to and see what is printed.
7. Based on the output from #6, rewrite the program slightly to parse the caller-id response string so you get only the phone nr in a string.
8. Profit?
