Service Provider Database
- Service Provider Database
- How to Contribute
- Full XML Specification
When you want to configure a mobile broadband connection there usually is some service provider specific information you have to know before the connection can be established. The problem with this information is that it's highly technical for an ordinary consumer and it's available only from service providers web page or from Microsoft Windows installation media that comes with subscription devices.
The interesting side of this information is that it's the same for every user of a given service provider. This means that service provider specific information can be stored in a database. When this database is available the information can be fetched there and the ordinary user does not need to bother about it.
Mobile Broadband Configuration Assistant has its own database. This database is constructed by volunteers from different countries. The volunteers gather service provider specific information of all providers in their country and then add it to the database. After the information is added by even a single contributor all the users of the given country will benefit from that contribution and they will get their connections up and running with ease.
The database is released under Creative Commons Public Domain (CC-PD) and every contributor is obligated to accept it. Basically this means that contributors surrender all copyright and other rights they might have to their contributed work and the database can be used by anyone in any way. CC-PD was chosen because the database contains only information that is publicly available and the license doesn't restrict any project from using the database.
How to Contribute
Service provider specific information is stored in a XML file. XML is not the most optimized format for a database, but it's easy to read, understand and edit. Here is an example:
<?xml version="1.0"?> <!DOCTYPE serviceproviders SYSTEM "serviceproviders.2.dtd"> <serviceproviders format="2.0"> <!-- Britain --> <country code="gb"> <provider> <name>BT Mobile</name> <gsm> <apn value="btmobile.bt.com"> <username>bt</username> <password>bt</password> <gateway>22.214.171.124</gateway> </apn> </gsm> </provider> </country> <!-- Finland --> <country code="fi"> <provider> <name>DNA</name> <gsm> <apn value="internet"> <dns>217.078.192.078</dns> <dns>217.078.192.022</dns> </apn> </gsm> </provider> </country> </serviceproviders>
If this is the first time you want to edit the database you need to checkout the whole repository:
$ git clone git://git.gnome.org/mobile-broadband-provider-info $ cd mobile-broadband-provider-info/
If you already have an earlier version of the repository you have to update it:
$ cd mobile-broadband-provider-info/ $ git pull
Adding and Updating Information
Edit the database with your favorite editor. Make sure you indent the elements with tabs, not with spaces!
To prevent people from stepping on each others toes and wasting energy by working on the same subject, everyone who wishes to contribute should join the IRC chatroom at #nm on freenode and inform others about their plans. This way people can communicate and collaborate more easily.
Adding a New Country
A new country is added like this:
<!-- Finland --> <country code="fi"> </country>
That is, using the <country> tag. Every country has a mandatory attribute code that is the ISO 3166-1 (lower case) alpha-2 code of the country. If the country does not yet have an officially assigned code it can't be added to the database. Countries are sorted by codes. The comment containing the country name in English above <country> (<!-- Finland -->) element is preferably taken from /usr/share/zoneinfo/iso3166.tab.
That's how you begin. After you add a country however, you must also add a service provider.
Adding a New Service Provider
New service provider information is added between<provider> and </provider> elements. The <provider> tag must of course, be inside a <country tag.
<provider> <name>Elisa</name> <gsm> <apn value="internet"> <name>Internet</name> </apn> </gsm> </provider>
Note that there should be different provider declarations for every service provider in the country even if the providers have same settings. It's important that the users see a complete list of providers.
Please, keep the providers in sane order.
Here are the elements that a <provider> tag can contain. That is, the information that you must supply, in order to define a provider.
First element should be <name>. It's mandatory. Name will be written in native language and alphabets (latin, cyrillic, etc) of the country. If people of a country use multiple languages there can be multiple <name>elements with different xml:lang attribute. Note: the first element must not contain xml:lang attribute.
<provider> <name>Some Provider</name> <name xml:lang="ru">одна из услуг</name> <!-- http://translate.google.com :) -->
note: xml:lang feature is not intended for l10n junkies who want to translate everything that even remotely resembles letters!
After the <name> tag, there must be a network tag. Network can be either GSM or CDMA based.
If provider is using a GSM based network you should add a <gsm> tag:
<name>Some GSM Provider</name> <gsm> <apn>internet</apn> </gsm>
A GSM tag must contain one <apn> tag that defines the Access Point Name which the service provider uses.
If provider is using CDMA based network you should add a <cdma> tag:
note the '/' in the opening tag. It is depends. CDMA networks require less configuration information, and so the corresponding <cdma /> tag may be empty. That is why we need the '/' immediately before the '>'. If the CDMA provider requires a username and password pair for instance, then you need to supply that information. See the following section.
username and password
After the network tag, there can be an optional <username> and <password> tags if the service provider requires a generic username and password.
<cdma> <username>uname</username <password>password</password> </cdma>
For GSM networks, it should look like this:
<gsm> <apn value="access point name"> <name>Descriptive Name of this Access point</name> <username>user</username> <password>pass</password> </apn> </gsm>
Let us quickly recap what we have covered so far in an example.
<!-- Finland --> <country code="fi"> <provider> <name>Provider Name</name> <gsm> <!-- this will be <cdma> if this provider was a CDMA network --> <apn value="access point name"> <name>Descriptive name of this accesspoint</name> <username>user</username> <password>pass</password> </apn> </gsm> </provider> <provider> <name>Provider 2</name> <cdma> <username>user</username> <password>pass</password> </cdma> </provider> </country>
You should, as shown, include as many <provider> tags in a <country> as are necessary to capture all the service providers in that country.
Now, if the service provider uses manual DNS servers you can provide them with <dns> elements.
If no <dns> element is specified DNS servers are set automatically.
The gateway can be specified with the <gateway> tag:
DNS and Gateway information should be placed inside the <apn> tag.
Multiple Access Points (GSM)
If a provider has more than one access point (which is often the case in GSM networks, especially for billing purposes), you can and should add them simply by adding more <apn> tags containing the relevant information under the applicable <provider>.
Before Submitting Your Changes
After you have edited the database it must be validated against Document Type Definition, DTD. Validation detects errors on the format of the database. Validation is done using a program named xmllint which is part of libxml. On Ubuntu xmllint part of libxml2-utils package.
if the database is valid xmllint doesn't print anything.
$ xmllint --noout --valid serviceproviders.xml
Here's an example of error where country has additional attribute foo:
$ xmllint --noout --valid serviceproviders.xml serviceproviders.xml:40: element country: validity error : No declaration for attribute foo of element country <country code="ae" foo="baa"> ^ $
When you are ready it's time to create an unified diff of your changes, a patch.
First make sure there has been no conflicting changes meanwhile you made yours:
$ git pull
then make your patch:
$ git diff serviceproviders.xml > patch_file_name.patch
Give your patch a nice name that describes the changes.
Submit Your Patch
When you are happy with your patch, file a bug on Bugzilla against Modem Manager, and attach the patch. It will be reviewed and committed in due course.
Full XML Specification
Document Type Definition
<!ELEMENT serviceproviders (country*)> <!ATTLIST serviceproviders format CDATA #REQUIRED> <!ELEMENT country (provider*)> <!ATTLIST country code CDATA #REQUIRED> <!ELEMENT provider (name+, gsm?, cdma?)> <!ELEMENT gsm (network-id*, apn+)> <!ELEMENT apn (name*, gateway?, username?, password?, dns*)> <!ATTLIST apn value CDATA #REQUIRED> <!ELEMENT network-id EMPTY> <!ATTLIST network-id mcc CDATA #REQUIRED> <!ATTLIST network-id mnc CDATA #REQUIRED> <!ELEMENT username (#PCDATA)> <!ELEMENT password (#PCDATA)> <!ELEMENT dns (#PCDATA)> <!ELEMENT gateway (#PCDATA)> <!ELEMENT cdma (name*, username?, password?, dns*, sid*)> <!ELEMENT sid EMPTY> <!ATTLIST sid value CDATA #REQUIRED> <!ELEMENT name (#PCDATA)> <!ATTLIST name xml:lang CDATA #IMPLIED>
This is the document root. It can contain any number of the country element.
attribute: The format attribute of this element holds the document format version number. Currently, this should have the value "2.0".
Groups service providers by country.
attribute: The code attribute holds the ISO 3166-1 alpha-2 code of the country. The code will be used to localize the country names.
Contains all the configuration data of one service provider. It should contain a <name> and either of <gsm> or <cdma> tags which encapsulate the configuration information.
The name of the service provider. Name should be written in the native language and alphabets of the country.
The <name> tag is also applicable to the cdma and apn elements and means roughly the same thing.
Specifies the network-type as GSM, and provides for the ability to supply the configuration information that GSM networks typically need. Network data is needed because GSM modems use *99***<cid># as connection sequence, and cmda uses #777. Different networks also may have different parameters.
Allows to provide the MCC and MNC for a GSM network. Include as many of this element as are needed to capture all the codes that a particular network may have. [todo: explain this better]. It is an empty element, so the opening tag must be closed with a '/' before the usual '>'. Like this: <network-id mcc="000" mnc="00" />
attributes: network-id has two mandatory attributes. mnc and mcc.
Specifies the Access Point Name. attribute: value holds the access point name as required by the network.
The name element can be used within the apn tag to provide a user-visible "description" for the access point.
username if any. Service providers often use generic usernames. Only valid inside apn or cdma.
password if any. Service providers often use generic passwords. Only valid inside apn or cdma.
DNS server address. Of none are specified, DNS servers will be automatically acquired. Use multiple dns elements if more than one DNS servers are required.
Gateway address. if none is specified, will be automatically acquired.
specifies CDMA network.
The easiest way to understand the XML schema described above is to read the serviceproviders.xml file inside the repository you checked out. Look at any particular country's information and model your entries or modifications to after it.
'''TODO:''' *[[http://euc.jp/misc/cellphones.en.html#phs | PHS]]..? [[http://en.wikipedia.org/wiki/Personal_Handy-phone_System|wikipedia]] Can be added later should users emerge. AnttiKaijanmaki *XML information is not updated with changes of <serviceproviders format="2.0">. The information is for <serviceproviders format="1.0">
Example XML file
thanks, Bastien! I have a python script that I'm planning to use when the specification is solid. I received permission from the GPRS EC (ex-)maintainer Péter Simon to relicense the last version of GPRS EC database under Public Domain and I have also received updated provider information from Ross Barkman. AnttiKaijanmaki