Last Comment Bug 773068 - B2G Voicemail: API to retrieve Voicemail number
: B2G Voicemail: API to retrieve Voicemail number
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Marshall Culpepper [:marshall_law]
:
Mentors:
Depends on: 736710 766862 771440
Blocks: b2g-voicemail
  Show dependency treegraph
 
Reported: 2012-07-11 15:39 PDT by Marshall Culpepper [:marshall_law]
Modified: 2013-12-12 08:55 PST (History)
11 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
?
+


Attachments
Part 1: DOM API - v1 (1.33 KB, patch)
2012-07-17 11:13 PDT, Marshall Culpepper [:marshall_law]
jonas: superreview+
Details | Diff | Review
Part 2: DOM impl (C++) - v1 (1.13 KB, patch)
2012-07-17 11:14 PDT, Marshall Culpepper [:marshall_law]
bugs: review+
Details | Diff | Review
Part 3: RIL impl of SIM EF_MBDN - v1 (7.14 KB, patch)
2012-07-17 11:15 PDT, Marshall Culpepper [:marshall_law]
no flags Details | Diff | Review
Part 4: Tests - v1 (1.51 KB, patch)
2012-07-17 11:15 PDT, Marshall Culpepper [:marshall_law]
vicamo: review+
Details | Diff | Review
Part 3: RIL impl of SIM EF_MBDN - v2 (6.60 KB, patch)
2012-07-17 11:24 PDT, Marshall Culpepper [:marshall_law]
vicamo: review+
Details | Diff | Review
Part 2: DOM impl (C++) - v2 (1.08 KB, patch)
2012-07-18 14:57 PDT, Marshall Culpepper [:marshall_law]
no flags Details | Diff | Review

Description Marshall Culpepper [:marshall_law] 2012-07-11 15:39:54 PDT
We will need to have an API for the Voicemail number avaialble in the SIM. There is already some discussion covering this on Bug 757235. The relevant SIM details can be found in 3GPP TS 31.102, Sections 4.2.60 (EF_MBDN) and 4.2.62 (EF_MBI).
Comment 1 Marshall Culpepper [:marshall_law] 2012-07-12 14:56:12 PDT
Fernando, do you have any details about the storage location of the "short" number you mentioned in b2g-voicemail? There seems to be only one number stored in EF_MBDN..
Comment 2 José Antonio Olivera Ortega [:jaoo] 2012-07-12 16:06:36 PDT
I'd like to answer here with Fernando's permission. As Ignacio pointed out in [1] some operators store the voicemail number in the SIM but other do not. In that case both short and long numbers are stored somehow on the phone by the OEM implementing
what is commonly known as the operator-software variant. Another option is that the voice mail number is not stored on the phone and the operator-software variant specifies somehow that the number has to be read from SIM.

I say "the numbers are stored on the phone somehow..." and "the operator-software variant specifies somehow..." because the OEM is responsible for implementing how to store them or how to specify it.

I guess you are surprised with that explanation or even with that topic but that's true. So your next question here will be, Where could I read those numbers from? The answer is not clear at the moment. I am currently trying to make a proposal about how implement that operator-software variant topic. My idea is to store those numbers as Android system properties in gonk or even as a setting value in the setting DB in gecko. Something like ro.carrier.voicemail.number.short = 177, ro.carrier.voicemail.number.long = 0034666777888 or even ro.carrier.voicemail.number.fromsim = true.

Maybe you could implement the API for the Voicemail number available in the SIM in the mean time and retrieve the short number from its location once we agree that location in a follow-up. Does it sond good to you? Comments?

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=757235#c5
Comment 3 Marshall Culpepper [:marshall_law] 2012-07-13 09:57:39 PDT
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #2)
> 
> I guess you are surprised with that explanation or even with that topic but
> that's true. 

Nothing surprises me about these telephony specifications any more :)

> Something like
> ro.carrier.voicemail.number.short = 177, ro.carrier.voicemail.number.long =
> 0034666777888 or even ro.carrier.voicemail.number.fromsim = true.
> 
> Maybe you could implement the API for the Voicemail number available in the
> SIM in the mean time and retrieve the short number from its location once we
> agree that location in a follow-up. Does it sond good to you? Comments?


That sounds good to me -- Can you open a follow up? This bug will just focus on retrieving the VM number from EF_MBDN. I also see in the Android implementation that look at EF_MAILBOX_CPHS -- I guess this is an extension specification of some kind?
Comment 4 Marshall Culpepper [:marshall_law] 2012-07-13 12:26:27 PDT
There are GET_SIM_STATUS and ICC IO modem bugs blocking from testing this on Otoro:

Bug 766862
Bug 771440
Comment 5 Marshall Culpepper [:marshall_law] 2012-07-17 11:13:59 PDT
Created attachment 643044 [details] [diff] [review]
Part 1: DOM API - v1
Comment 6 Marshall Culpepper [:marshall_law] 2012-07-17 11:14:44 PDT
Created attachment 643047 [details] [diff] [review]
Part 2: DOM impl (C++) - v1
Comment 7 Marshall Culpepper [:marshall_law] 2012-07-17 11:15:21 PDT
Created attachment 643048 [details] [diff] [review]
Part 3: RIL impl of SIM EF_MBDN - v1
Comment 8 Marshall Culpepper [:marshall_law] 2012-07-17 11:15:52 PDT
Created attachment 643049 [details] [diff] [review]
Part 4: Tests - v1
Comment 9 Marshall Culpepper [:marshall_law] 2012-07-17 11:24:57 PDT
Created attachment 643053 [details] [diff] [review]
Part 3: RIL impl of SIM EF_MBDN - v2

Forgot to remove unused addition of mbdn to nsICCRecords
Comment 10 Jonas Sicking (:sicking) 2012-07-17 15:11:48 PDT
Comment on attachment 643044 [details] [diff] [review]
Part 1: DOM API - v1

Review of attachment 643044 [details] [diff] [review]:
-----------------------------------------------------------------

I assume v2 is intended to be instead of this one.
Comment 11 Marshall Culpepper [:marshall_law] 2012-07-17 17:02:17 PDT
Comment on attachment 643044 [details] [diff] [review]
Part 1: DOM API - v1

Nope, v2 was another patch (not the DOM APIs) :)
Comment 12 Vicamo Yang [:vicamo][:vyang] 2012-07-17 20:42:53 PDT
Comment on attachment 643053 [details] [diff] [review]
Part 3: RIL impl of SIM EF_MBDN - v2

Review of attachment 643053 [details] [diff] [review]:
-----------------------------------------------------------------

I've done some research about your implementation. There is still something to be done, but I think that's not what this patch should deal with. Thank you.

::: dom/system/gonk/ril_worker.js
@@ +985,5 @@
>      this.getIMSI();
>      this.getMSISDN();
>      this.getAD();
>      this.getUST();
> +    this.getMBDN();

According to TS 131.102 clause 4.2.60, `If service n°47 is "available", this file shall be present.` It means we have to check UST first? But I just found Android loads MBI/MBDN before UST loading.

Besides, same clause also has `Each dialling number shall be
associated with a message waiting indication group type using EFmbi.` So we should check MBI for Mailbox Dialing Number Identifier of Voicemail first, which is also Android's implementation now. However, specifying the record number is a missing function in current ICC utility functions and is beyond the scope of this issue. I think that would be a minor issue and probably never be an issue at all.
Comment 13 Vicamo Yang [:vicamo][:vyang] 2012-07-17 21:09:42 PDT
Comment on attachment 643049 [details] [diff] [review]
Part 4: Tests - v1

Review of attachment 643049 [details] [diff] [review]:
-----------------------------------------------------------------

Nice! But I'm really curious about how do you know the number in qemu. I do find some web pages showing the same number, but just can't find it in the code.
Comment 14 Olli Pettay [:smaug] 2012-07-18 11:58:46 PDT
Comment on attachment 643047 [details] [diff] [review]
Part 2: DOM impl (C++) - v1


>+NS_IMETHODIMP
>+Voicemail::GetNumber(nsAString& aNumber)
>+{
>+  aNumber.SetIsVoid(true);
>+  NS_ENSURE_TRUE(mRIL, NS_ERROR_FAILURE);
>+
>+  return mRIL->GetVoicemailNumber(aNumber);
>+}
If it is really unexpected to have null mRil,
I'd do

  NS_ENSURE_STATE(mRil);
  aNumber.SetIsVoid(true);
  return mRIL->GetVoicemailNumber(aNumber);

Similar with GetDisplayName
Comment 15 Marshall Culpepper [:marshall_law] 2012-07-18 12:12:11 PDT
(In reply to Vicamo Yang [:vicamo] from comment #12)
> Besides, same clause also has `Each dialling number shall be
> associated with a message waiting indication group type using EFmbi.` So we
> should check MBI for Mailbox Dialing Number Identifier of Voicemail first,
> which is also Android's implementation now. However, specifying the record
> number is a missing function in current ICC utility functions and is beyond
> the scope of this issue. I think that would be a minor issue and probably
> never be an issue at all.

Yeah, that was the code I originally read as well. I'm fully behind supporting the EF_MBI / index, but we can open up a lower priority follow up for that, thoughts?
Comment 16 Marshall Culpepper [:marshall_law] 2012-07-18 12:23:03 PDT
(In reply to Vicamo Yang [:vicamo] from comment #13)
> Nice! But I'm really curious about how do you know the number in qemu. I do
> find some web pages showing the same number, but just can't find it in the
> code.

Once I had this patch working on my Nexus S, I built and tested on the emulator, and that was the number that showed up :)

I went looking through the qemu sim card code [1], there are several hard coded responses and EF files, but it's not 100% clear which has the voicemail data from a cursory glance.

[1] https://github.com/mozilla-b2g/platform_external_qemu/blob/master/telephony/sim_card.c
Comment 17 Marshall Culpepper [:marshall_law] 2012-07-18 14:57:17 PDT
Created attachment 643607 [details] [diff] [review]
Part 2: DOM impl (C++) - v2

Macro nit update
Comment 18 Vicamo Yang [:vicamo][:vyang] 2012-07-18 20:07:35 PDT
(In reply to Marshall Culpepper [:marshall_law] from comment #16)
> (In reply to Vicamo Yang [:vicamo] from comment #13)
> > Nice! But I'm really curious about how do you know the number in qemu. I do
> > find some web pages showing the same number, but just can't find it in the
> > code.
> 
> Once I had this patch working on my Nexus S, I built and tested on the
> emulator, and that was the number that showed up :)
> 
> I went looking through the qemu sim card code [1], there are several hard
> coded responses and EF files, but it's not 100% clear which has the
> voicemail data from a cursory glance.
> 
> [1]
> https://github.com/mozilla-b2g/platform_external_qemu/blob/master/telephony/
> sim_card.c

It's in line 371. EFmbdn = 0x6FC7 = 28615. "+CRSM=178" means "restricted SIM access: read record". Then the number you got is extracted from "5155125740f9" with hi/lo half byte inverted. That totally explains the magic number.

Thank you. I learned one more thing. ;)
Comment 21 Jeremie Patonnier :Jeremie 2013-12-12 08:55:41 PST
Documentation available here: https://developer.mozilla.org/en-US/docs/tag/voicemail

Note You need to log in before you can comment on or make changes to this bug.