Which AT command should I use to read out what the phone number (MSISDN) is for the inserted SIM card?
I’ve tried AT+CNUM but only returns
I would like to use this to show the end-user which phone number it should send an SMS to,
to control the device.
You’re using the correct AT command.
The reason it’s not giving you the result you expect is that the MSISDN has not been written to the SIM card. It’s not needed there except for “documentation” purposes.
The SIM provider looks up the MSISDN in their own records as required from the IMSI.
You will need to write it as the first entry in the Own Numbers phonebook, using a phone or another modem.
Please see my earlier post: Unable to access "Own Numbers" phonebook
Thank you for the response.
From what I’ve seen the AT+CPBS and other phone book commands are not supported on the BG95-M3.
Is there another way to read out the phone number that is linked to the SIM connected to the BG95-M3 ?
We would like to make it as easy as possible for the end-user and display the phone number on an LCD display, so that the user knows to which phone number it has to send command SMS message to operate our device remotely.
The only other way I can think of, is giving the customer the option to make our device send out an Info SMS message to his phone number to see what the phone number of the device is.
If AT+CNUM can’t read it, then it’s simply not on the SIM.
If you have the SIM and know the number before you deliver your kit to a customer, you can investigate using another device to write it. Some phones allow the writing of “own number” - I had one.
And other modem brands support opening the “ON” phonebook and writing entries.
That’s exactly what I do if there is no other way.
Some networks/providers allow sending a free SMS to enquire on balance or other account details. The replies to these generally include the MSISDN.
Although I have not tried before, the command “AT+CRSM” allows you to read contents on the SIM card. You however need to read through the appropriate ETSI documents to understand the SIM card directories.
By all means try
But that’s just another way to read the non-existent MSISDN entry from the “ON” phonebook. It’s much easier to use AT+CNUM
It looks like I was wrong about that. It seems the SIM EF_MSISDN file at SIM address 0x6F40 is not the same as the “ON” phonebook.
I wrote a different number and name to “ON” phonebook entry 1, and the
AT+CRSM=242,28480 result remained unchanged.
Decoding the +CRSM result is another matter. The starting point is 3GPP 31.102, section 4.2.26.
If you haven’t already seen it, Quectel are offering a solution in this post: Unable to access "Own Numbers" phonebook - #3 by Stephen.Li-Q