How automatically set an APN depending on network provider?
Asked Answered
C

3

5

When a new SIM (never used) is inserted in a new smartphone (never used), smartphone seems to set a right APN without any manual settings. Is there a global table (inside smartphone) with associations APN <-> network operator?

Note: Querying new SIM cards with AT commands seems they have preferred network operators, but no APN saved in memory.

Crocein answered 27/1, 2017 at 16:48 Comment(3)
I'm not sure how this is ontopic for this site.Bland
@Andy, please note that the topic is also related to AT command.. in your opinion, what is the best site related to?Crocein
id say superuser. Issuing at commands is no more programming than using telnet or ssh.Bland
D
4

I can comment on the SIM side and confirm that APN settings are not held within the SIM. And yes in terms of network operators there is a file called EF_PLMN which holds the Mobile Country Code (MCC) and Mobile Network Code (MNC) to allow a device to connect to the correct network faster.

On the point of APN, it is my understanding that devices have internal (memory) APN listings for major operators in that territory. When an operator orders a device they ensure that "their" APN is correct. Yes a big issue is incorrect APNs for operators within the device and that is the reason network operators need to send APN settings when they detect a SIM in a new Device.

I do not have information on how to query this internal APN listing as it may be part of the Firmware.

Doubleacting answered 9/2, 2017 at 12:55 Comment(5)
About the first point: ok, preferred PLMN list can be inside EF_PLMN file, but it can be obtained from network if you use EF_OPLMNwACT policy (please correct me if I'm wrong). About the second point: what do you mean with "When an operator orders a device"? and how can network operator know that a new SIM has been inserted and send APN settings?Crocein
EF_OPLMNwACT is not obtained from the network. it is set by the network operator when they order the SIM. it allows an operator (Vodaphone, Orange etc.) to set the preferred roaming networks including which access technology to use (2G,3G,4G).Doubleacting
When a large operator (Vodaphone, Orange etc) orders some phones like Samsung, Nokia, Apple etc. They first test a single device and ensure that the APN is correct.Doubleacting
When you connect to a network your devices identifier "IMEI" is sent with some of the signalling (This is how devices can be blacklisted). If the operator detects a change in IMEI it knows that the SIM is now in a new phone.Doubleacting
QuickPrototype, I understand what you mean and I thankyou for all informations. But, related to my first question, "Is there a global table (inside smartphone) with associations APN <-> network operator?", do you know any open source project with this table available?Crocein
D
2

For Android, the mobile devices pull the The MCC (Mobile Country One) and the MNC (Mobile Network code) from the SIM card, and maybe other values.

Then, it configures the APN based on an internal SQlite database created by Android based on XML files that contain APN settings in the following format:

<apn carrier="CarrierXYZ"
  mcc="123"
  mnc="123"
  apn="carrierxyz"
  type="default,supl,mms,ims,cbs"
  mmsc="http://mms.carrierxyz.com"
  mmsproxy="0.0.0.0"
  mmsport="80"
  bearer_bitmask="4|5|6|7|8|12"
/>

https://android.googlesource.com/device/sample/+/master/etc/apns-full-conf.xml https://source.android.com/devices/tech/config/update

Driftage answered 7/3, 2022 at 12:17 Comment(0)
H
1

Having been through the approval's procedure for a big USA mobile network operator (MNO), part of the approval's process involved automatically selecting the correct default APN when the modem connects to the network. This can be overridden for special cases, for example if the user needs to use an MNO supplied VPN which requires a special APN.

While I do not know if this is the same for every case, all phones go through an approval process, and if it is a phone approved by the MNO then it is quite likely the MNO will insist that at least a default APN is loaded if none has been supplied by the user. The network that the SIM allows the phone to connect to can be read from the modem without an APN being supplied, so it is quite easy to use this to look up a default APN from list. As phone companies really do not want to change their software for each MNO, maintaining a list makes it easier for the phone manufacturer, the MNO and the end user.

Harrison answered 13/10, 2020 at 11:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.