Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #109 from ferjm/bug1059251.mcc
Browse files Browse the repository at this point in the history
Bug 1059251 - Need to adapt FxOS Loop client to send the MCC of the caller (follow up bug 1039444). r=borjasalguero
  • Loading branch information
ferjm committed Sep 4, 2014
2 parents b310728 + ef92475 commit 0c97c4f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
21 changes: 20 additions & 1 deletion js/helpers/client_request_helper.js
Expand Up @@ -271,12 +271,31 @@
return;
}

// In order to allow the server to normalize the given identity as an
// MSISDN, we need to also provide the current MCC.
var mcc;
var conn = navigator.mozMobileConnections;
if (conn && conn[0]) {
// TODO: So far we will only provide the MCC of the first SIM if
// available, but we'll need to provide the entire list after
// bug 1062324 is fixed.
var network = conn[0].lastKnownHomeNetwork || conn[0].lastKnownNetwork;
var mccParts = (network || '-').split('-');
if (mccParts.length >= 1) {
// mccParts contains at least mcc and mnc. Recent implementations
// includes the SPN as a third parameter, but we don't really care
// about it.
mcc = mccParts[0];
}
}

_request({
method: 'POST',
url: SERVER_URL + '/calls/',
body: {
calleeId: calleeId,
callType: isVideoCall ? 'audio-video' : 'audio'
callType: isVideoCall ? 'audio-video' : 'audio',
mcc: mcc
},
credentials: _hawkCredentials
}, onsuccess, onerror);
Expand Down
2 changes: 1 addition & 1 deletion js/version.js
@@ -1 +1 @@
Version = { id: '60b8da7' };
Version = { id: '29e370d' };
3 changes: 2 additions & 1 deletion manifest.webapp
Expand Up @@ -19,7 +19,8 @@
"speaker-control": {},
"moz-firefox-accounts": {},
"systemXHR":{},
"video-capture": {}
"video-capture": {},
"mobilenetwork": {}
},
"messages": [
{ "push": "/index.html" }
Expand Down

0 comments on commit 0c97c4f

Please sign in to comment.