Hi Jacob,
I'm also very new to this forum as well as very very new to the S/W field. Just now I'm also working on the sms gateway s/w as a first project of my carrier. I have got the at+ commands for these, and I think that to get the sim no. you have to know about the PIN no of that SIM.
The PIN no you can get from the ESN no of the SIM.THis is my idea, please try it. And if I'm wrong then please...