Skip to content

Commit

Permalink
Bug 807312 - Part 2:
Browse files Browse the repository at this point in the history
 Make an apns_conf-local.xml and update the .json file.
 Clarify the README.
 r=kaze, a=21
  • Loading branch information
hfiguiere authored and fabi1cazenave committed Dec 6, 2012
1 parent e7e40d2 commit 83ca96b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
3 changes: 2 additions & 1 deletion shared/resources/apn.json
Expand Up @@ -841,7 +841,8 @@
],
"720": [
{"carrier":"Rogers","apn":"rogers-core-appl1.apn","mmsc":"http://mms.gprs.rogers.com","mmsproxy":"10.128.1.69","mmsport":"80","type":["default","supl","mms"]},
{"carrier":"Chatr Internet","apn":"chatrweb.apn","mmsc":"http://mms.chatrwireless.com","mmsproxy":"205.151.11.11","mmsport":"80","type":["default","mms"]}
{"carrier":"Chatr Internet","apn":"chatrweb.apn","mmsc":"http://mms.chatrwireless.com","mmsproxy":"205.151.11.11","mmsport":"80","type":["default","mms"]},
{"carrier":"SpeakOut","apn":"goam.com","user":"wapuser1","password":"wap","proxy":"10.128.1.69","port":"80","mmsc":"http://mms.gprs.rogers.com","mmsproxy":"10.128.1.69","mmsport":"80","type":["default","mms"]}
],
"780": [
{"carrier":"SaskTel","apn":"pda.stm.sk.ca","mmsc":"http://mms.sasktel.com","mmsproxy":"mig.sasktel.com","mmsport":"80","type":["default","supl","mms"]}
Expand Down
19 changes: 14 additions & 5 deletions shared/resources/apn/README.md
@@ -1,11 +1,20 @@
Two APN (Access Point Name) databases are used:
Three APN (Access Point Name) databases are used:

* the Android database is the *de facto* standard we rely on;
* the Gnome database is probably less up-to-date but has a bit more information.
* the Android database `/shared/resources/apn/apns_conf.xml` is the *de facto* standard we rely on;
* a local database `/shared/resources/apn/apns_conf-local.xml` with the same format we merge with the above, used for where Google is lacking. Ideally this file should be empty as everything should be put upstream;
* the Gnome database `/shared/resources/apn/serviceproviders.xml` is probably less up-to-date but has a bit more information.

A fourth file `/shared/resources/apn/operator-variant.xml` is also used.

These files are only used to test and merge these APN databases.

The `/shared/resources/apn.json/` file is a JSON version of the Android database, with a few additional informations from the Gnome APN database (e.g. voicemail number).
The `/shared/resources/apn.json` file is a JSON version of the Android database, with a few additional informations from the Gnome APN database (e.g. voicemail number).

To regenerate the .json file, start from the parent directory a webserver. Like this:

cd .. ; python -m SimpleHTTPServer 4104

If this file is found, it will be used as is by the `index.html` file; if not present, the `index.html` file will generate a new one.
Then load http://0.0.0.0:4104/apn
This should regenerate the .json file into the left part of the page, and you can cut & paste this to your editor.

TODO: make this automatic. Patches Welcome™
14 changes: 0 additions & 14 deletions shared/resources/apn/apns_conf.xml
Expand Up @@ -3687,20 +3687,6 @@
type="default,mms"
/>

<apn carrier="SpeakOut"
mcc="302"
mnc="720"
apn="goam.com"
user="wapuser1"
password="wap"
proxy="10.128.1.69"
port="80"
mmsc="http://mms.gprs.rogers.com"
mmsproxy="10.128.1.69"
mmsport="80"
type="default,mms"
/>

<apn carrier="SaskTel"
mcc="302"
mnc="780"
Expand Down
10 changes: 9 additions & 1 deletion shared/resources/apn/query.js
Expand Up @@ -9,6 +9,7 @@ document.addEventListener('DOMContentLoaded', function onload() {
var OPERATOR_VARIANT_FILE = '../apn.json';
var GNOME_DB_FILE = 'serviceproviders.xml';
var ANDROID_DB_FILE = 'apns_conf.xml';
var LOCAL_ANDROID_DB_FILE = 'apns_conf-local.xml';
var OPERATOR_VARIANT_DB_FILE = 'operator-variant.xml';

var gGnomeDB = null;
Expand Down Expand Up @@ -221,9 +222,16 @@ document.addEventListener('DOMContentLoaded', function onload() {
// xhr.responseType = 'json' to be compatible with Chrome... sigh.
gAPN = JSON.parse(xhr.responseText);
} else {
// the JSON database is not available, merge the two XML databases
// the JSON database is not available, merge the three XML databases
output.textContent = '\n merging databases, this takes a while...';
gAndroidDB = loadXML(ANDROID_DB_FILE);
// First merge the local DB
var localAndroidDB = loadXML(LOCAL_ANDROID_DB_FILE);
var localApns = localAndroidDB.documentElement.getElementsByTagName("apn");
for (var i = 0; i < localApns.length; ++i) {
gAndroidDB.documentElement.appendChild(localApns[i]);
}
// Then the Gnome DB
gGnomeDB = loadXML(GNOME_DB_FILE);
gOperatorVariantDB = loadXML(OPERATOR_VARIANT_DB_FILE);
gAPN = mergeDBs();
Expand Down

0 comments on commit 83ca96b

Please sign in to comment.