The relationship between the SIM and the phone number is entirely within the network - it is not held on the SIM.
Some carriers provide a means to query your own number; eg, see: viewtopic.php?f=16&t=1083&p=3938&hilit=vodafone+own+number#p3938
Some SIMs are delivered with the phone number stored so that it can be retrieved with AT+CNUM
But neither of these can really be relied upon.
The best way is probably to have the device send a text or make a call, and then use the sender’s number from that…