Discussing the nuts and bolts of software development

Tuesday, June 17, 2008

 

Obtaining the voicemail number on Windows Mobile phones

The voicemail number, if available, may be stored in various locations on the Windows Mobile phone device depending on the type and carrier. In most cases, the number will show up somewhere in the registry. From experience I have found them in one of several locations under HKEY_CURRENT_USER:

\Software\Microsoft\Vmail\PhoneNumber1
\Software\Microsoft\Vmail\PhoneNumber2
\Software\Microsoft\Vmail\UserProvidedNumber1
\Software\Microsoft\Vmail\CarrierProviderNumber1
\System\State\Messages\vmail\VMailNumber
\Palm\State\Messages\vmail\VMailNumber

On some GSM devices however the number isn’t always updated properly in the registry. In that case you would have to fetch it direct from the SIM card. In fact it is probably safest to fetch it from the SIM card first since this ensures a more accurate number.

If you do some internet searches and dig through some of the 3GPP specifications for (U)SIM (i.e. 3GPP TS 31.102, 51.011) you will find that the voicemail number is stored in the EFMBDN (Mailbox Dialing Numbers) file located at either 6FC7 for 3G devices or 6F17 for 2G.

We can get the voicemail file from the SIM using the SIM Manager API. Note that some of these are privileged functions. You also have to make sure to add “cellcore.lib” as a dependency to your project. The code would look as follows:


// include the SIM Manager API
#include

// set the voicemail addresses
#define EF_MBDN_2G 0x6F17
#define EF_MBDN_3G 0x6FC7



std::string getVoicemailNumber()
{

std::string number;
HSIM hSim = 0;
HRESULT hr = S_OK;

// initialize
hr = SimInitialize (0, 0, 0, (LPHSIM)&hSim);

if (S_OK == hr)
{
DWORD address = EF_MBDN_2G;
SIMRECORDINFO simRecordInfo = {0};
simRecordInfo.cbSize = sizeof(SIMRECORDINFO);

// check the 2G address for the file
hr = SimGetRecordInfo(hSim, address, &simRecordInfo);

// The file may hold more than one number for devices with
// multiple lines; however we will assume only one line.
// A valid file needs to be "linear" type and at least 14 bytes.
if ( S_OK != hr ||
SIM_RECORDTYPE_LINEAR != simRecordInfo.dwRecordType ||
simRecordInfo.dwItemCount == 0 ||
simRecordInfo.dwSize < 14 )
{
// no valid 2G file, check the 3G address
address = EF_MBDN_3G;
memset(&simRecordInfo, 0, sizeof(simRecordInfo));
simRecordInfo.cbSize = sizeof(SIMRECORDINFO);
hr = SimGetRecordInfo(hSim, address, &simRecordInfo);
}

if ( S_OK == hr &&
SIM_RECORDTYPE_LINEAR == simRecordInfo.dwRecordType &&
simRecordInfo.dwItemCount > 0 &&
simRecordInfo.dwSize >= 14)
{
// allocate the specified size
LPBYTE buf = (LPBYTE)LocalAlloc(LPTR, simRecordInfo.dwSize);
DWORD bytesRead = 0;

// read the SIM file
hr = SimReadRecord(hSim, address, SIM_RECORDTYPE_LINEAR, 1,
buf, simRecordInfo.dwSize, &bytesRead);

if (S_OK == hr && bytesRead >= 14)
{
// handle the bytes received
...


Now that we have the file, we need to interpret the bytes into a useful number. The 3GPP specifications show the EFMBDN structure as follows:


Bytes Description M/O Length
----------------------------------------------------------------------
1 to X Alpha Identifier O X bytes
X+1 Length of BCD number/SSC contents M 1 byte
X+2 TON and NPI M 1 byte
X+3 to X+12 Dialling Number/SSC contents M 10 bytes
X+13 Capability/Configuration2 Record Identifier M 1 byte
X+14 Extension 6 Record Identifier M 1 byte


The first few bytes (1 to X) are the optional identifier. In most cases it will just show the words “voicemail”. The last 14 bytes describe the voicemail number with up to 10 bytes representing the number as binary coded decimals. For our purpose we can ignore Capability/Configuration2 Record Identifier and Extension 6 Record Identifier. The way to interpret the bytes is described in the 3GPP specifications 31.102 clause 4.4.2.3 for EFADN (Abbreviated dialing numbers). We can proceed to get the number from the bytes as follows:


...

// use the last 14 bytes
char data[14];
memcpy(&data, &buf[bytesRead-14], 14);

// byte 0 (X+1) is the length of dialing number
int length = data[0];

std::stringstream ss;

// TON and NPI determines the type of number
// see 3GPP specifications 31.102 clause 4.4.2.3
if (0x90 == (0xF0 & data[1]))
{
// add the + for international numbers
ss << '+';
}

// convert the BCD bytes to Ascii chars
for (int idx=2; idx < length+1; idx++)
{
// break the byte into 2 nibbles
BYTE nibble[2];
nibble[0] = data[idx] & 0xF;
nibble[1] = (data[idx] >> 4) & 0xF;

for (int i=0; i<2; i++)
{
if (nibble[i] == 0xA)
{
// 0xA represents a *
ss << '*';
}
else if (nibble[i] == 0xB)
{
// 0xB represents a #
ss << '#';
}
else if (nibble[i] < 0xA)
{
// add the number
ss << (char) ('0' + nibble[i]);
}
}
}

// set the voicemail number
ss >> number;


Now that we have the voicemail number we should free the buffer and sim handle and return the number:


// free the buffer
LocalFree( buf );
}

// deinitialize
SimDeinitialize( hSim );
}
return number;

}


There are a couple of things to note. Here I’ve handled both the 2G and 3G cases, however it is probably better to detect which type is being used beforehand. Also note that I have assumed the case of only one voicemail number. For a multi-line scenario you would have to check if there are more than one number stored in the SIM file. For a more detailed look on how the numbers are stored please refer to the 3GPP specifications.

Labels:


Comments:
Thanks, Buddy.

Jacob
 
I am sure that education means a lot these days. You can even check this out if you want to know more about writing bibliography.
 
QuickBooks is a set of bookkeeping software, and the QuickBooks install diagnostic tool is a tool for repairing and diagnosing technical issues that may arise during the installation process.
 
I find all of this information fascinating, and it is full of useful information, so I'll be following your blog to learn new things.
 
Blink Mini Indoor camera helps to keep eye on your house all round the clock. Cameras have become a necessity now and this blink camera offers a great choice. If you have any query, you can visite my site.
 
Thanks so much for sharing this nice blog.
 
If you want to an easy setup guide of ap setup, you can visite my site.
 
To get started with the Meshforce M3 login and setup process, you can download the Mesh app. Make sure that you install the latest version of it. Your internet connection must be stable and smooth. Get expert supervision if you face any doubts or issues with the login or setup process. You can also visit the website for any further reference.
Meshforce M1
 
You can Belkin Router Login using the default IP address anytime. Just make sure that you are using a compatible browser only. Once you input the default IP address, you can press enter and the login window appears. Fill in the default login credentials and you will access the control panel of the Belkin router. Chat with our experts now on the toll-free number if you have any issues.

 
Here are the guide steps to start MSRM US750 Extender Setup via 192.168.10.1 or via WPS.
 
bose soundbar 500 factory reset without remote
 
To login to the Asus wireless router, use the default web address router.asus.com. Enter the default web address in the web browser and you will reach the Asus Router Login page. Put down the username and password of your router. After that, click on the Login button and you will be logged into the router successfully.
 
The Google Nest Camera is one of the best yet most reliable smart home security cameras. The Nest camera helps you safeguard your kids, parents, pets, and other things in your home from security break-ins or intrusions. To set up the Google Nest camera, you can download the Nest app or the Google Home app.
Nest Camera Login
 
Hello friends I am Camila Jones and I am software developer, recently I have created an amazing website, which tells you ip location of your device with just one click on instant ip address lookup .
 
If you are facing technical issues while accessing 192.168.10.1 setek web address, then feel free to contact us. and you can solve your problem.
 
D-LINK AC1200 Wi-Fi Range Extender DAP-1610 is one of the best plug-in repeaters , You can set up the extender by following a few simple steps.
 
This Mac filtration process helps you to remove devices from your network or create a whitelist for allowed devices that can connect to the internet.
 
With a powerful signal wifi booster, it helps to penetrate all the floors and the walls to expand the internet connection. It can cover 3000 square feet of the area very effectively and is specially designed for the home and the small office use.
 
If you feel that your crystal is heavier than before or maybe it has lost its shine then it just might need some energy to recharge. We can bring in chanting bowls, singing bowls, and a bell to recharge a crystals . Sound allows a pitch to wash over an area bringing the same vibrations as the tone.
 
TP-Link Omada AC1200 Extender delivers a maximum of wifi networks up to 1200 Mbps in multiple devices at the same time without any issue. There are some steps for the TP-Link Omada AC1200 Extender installation.
 
How to tackle with QuickBooks error 6000, 80 , most of the 6000 series errors are related to the company file and appear when you try to access the company file in QuickBooks Awesome blog!! Thank for providing excellent information. if you have any issues with Steps to fix QuickBooks error code 6000, 80, 80 you can go through the detailed steps mentioned in this article. +1(855)-738-0359 and get instant solutions within no time possible

 
Thanks for sharing with us such amazing information. If you want to get any information about Amazon Echo Dot 4th gen review, then visit our website .
 
Breeze Cool takes pleasure in providing reliable HVAC services to the residents of Dubai. Our years of understanding with a 100 advantageous consumer testimonial gives us the competence to the manual this organization due to the fact the principal air situation service groups in Dubai and its connecting states.
Best AC
AC Service Dubai

 
You can easily edimax br-6478ac v2 router login. If you want to login without any hassle, then you can do it easily with the steps given here .
 
QuickConnect app is available on your computer, if it is not available, download it and then apply the below-mentioned procedure to set up the device.
 
When you attempt to instal QuickBooks desktop on the machine, this problem is frequently encountered. This issue can also occur when installing or updating software. Want to get over error 1618 QuickBooks without putting in any effort on implementing the tedious troubleshooting methods! If yes, feel free to speak to our QuickBooks experts at the toll-free number +1-855-738-0359.

fix error 1618 QuickBooks

 
You make so many great post here. I read your article twice. Its good!
 
I bookmarked to check out new information on this great blog
 
Positive site, Read articles on this website, I really like your style.
 
Continue sharing such an excellent post. Glad that I found this
 
Thank you for sharing your info. I truly appreciate your efforts and I will be waiting for your further post thanks once again.
 
I was introduced to this site by a friend. There are a lot of good posts. I'll visit often.
 
I finally found great post here. Thanks for the information.
 
I feel strongly about it and really enjoyed learning more about this topic.
 


This design is wicked! You certainly know how to keep a reader entertained.

 


Excellent article. I will be dealing with many
of these issues as well



 


I admire this article for the well-researched content and excellent wording
 


Very useful information shared in this article, nicely written`
 

very nice information really like it if you want to read more like this please
 

Nice Blog. Thanks for sharing with us. Such amazing information.

 
Win Win Marketing & Developers is proud to be one of the top real estate marketing and development associations in Pakistan. Over the times of excellent service and excellent results, we've set unequaled quality norms in the real estate request. The name Win Win is associated with luxury and a high standard of living. Our workers regularly ameliorate our installation, relating and enforcing new ideas to keep your installation on the cutting edge of invention.
Multi Gardens Phase 2 Islamabad
 

Nice article. This is quite informative.
 
Viele Menschen haben während des Installationsprozesses des fritzbox login Setups Probleme. Hier erhalten Sie Informationen, wie Sie Ihren Fritzbox-Router mit den myfritz login Portal-Details einrichten können.
 
Wenn Sie einen fritzbox 7490 login Router besitzen und ihn einrichten möchten, lesen Sie einfach unseren Artikel, um die verschiedenen Methoden wie Standard-IP-Adresse 192.168.178.1 oder myfritz kennenzulernen.
 
Sie können die Netzwerkeinstellungen der fritzbox 7560 login jederzeit konfigurieren und sicherstellen, dass sie in Bezug auf die Geräte, die Sie daran anschließen möchten, korrekt sind. fritz.repeater
 
Thanks for sharing the unique article with us. To set up the wifi repeater login users access the ap.setup which is the default web address of the router.
ap.setup wavlink
 
If you want to setup the edimax wifi router via web browser, user have to type edimax.setup or edimaxext.setup in the address bar.
 


I must say it is very informative blog as well as interesting. Many thanks

 
Thank you , this is really useful information towards my assessment
 
To speedefy router login, launch a web browser and enter "192.168.0.1" or "router.speedefy.com" in the address bar. Input the default username and password (often "admin" for both) to access the router settings. Customize your network preferences and enjoy a fast and reliable internet connection.
 
"Adoring your post. It is invigorating to peruse this. I trust there will be significantly all the more coming.
"
 
Right away this website will probably unquestionably usually become well known with regards to most of website customers, as a result of meticulous accounts and in addition tests.

 
"Wonderful article, thank you for sharing the info. It isn’t too often that you simply read articles where the poster understands what they’re blogging about.
"
 
This insightful guide on obtaining voicemail numbers from Windows Mobile phones is a lifesaver for users navigating various locations. The detailed code snippet provides a clear roadmap. Thanks for the valuable information!
New Jersey Domestic Violence
 
Air conditioning services in Dubai

Air conditioning services in Dubai cover a spectrum of solutions, spanning expert repairs, installations, and thorough maintenance routines. Prioritizing efficiency and comfort, these services cater to various requirements, guaranteeing peak cooling performance and prolonging the lifespan of AC systems amidst the city's challenging climate conditions.
 
This comment has been removed by the author.
 
Looking for reliable AC services in Dubai? Look no further than Faj Services! Our team of skilled technicians specializes in AC installation, repair, maintenance, and cleaning to ensure your home or office stays cool and comfortable. With years of experience and a commitment to quality, we provide prompt and efficient solutions tailored to your needs. Trust Ac Service In Dubai by Faj Services for all your air conditioning needs. Visit our website to learn more: Ac Repair in Dubai
 
CNext Learning is a forward-thinking learning platform committed to redefining the way people learn and excel in today’s fast-paced world.Cnext learning With a diverse range of courses, cutting-edge technology, and a team of certified instructors, we aim to create a dynamic learning experience for all and generate Industry – ready resources.

 
When it comes to keeping your home or office cool, trust the expertise of our professional team at AC Repair Dubai. Our skilled technicians are trained to handle all types of air conditioning units, ensuring top-notch service and reliability. With years of experience and a commitment to excellence, our team performs thorough diagnostics, efficient repairs, and meticulous maintenance to keep your AC running smoothly.


 
What a good blog you have here. Please update it more often. This topics is my interest. Thank you. .

 
I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge

 
I completely agree with the importance of reliable medical equipment in providing quality healthcare. If you're looking for top-quality medical tools, I highly recommend checking out Jurhy. They offer a wide range of affordable and durable medical equipment, from diagnostic tools to advanced treatment devices. It's definitely worth exploring for healthcare professionals. Medical Equipment!
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?