Disabling outgoing voicemail calls in Android (rooted phone).

I hate voicemail. It's usually a total waste of time and money as the message itself tends to be "call me back at the number you already have" so I usually disable voicemail as a feature. This actually means that incoming calls are not forwarded to your voicemail. Seems like a problem solved only until I got a smartphone that has voicemail button right next to call button:
Android dialer call and voicemail buttons
I accidentally pressed this voicemail button twice in one day. Although voicemail forwarding is disabled, apparently I can still dial in and listen to absent messages, each call costing me 10 pence in network charges. No more.

Going to Settings->Call settings->Call Feature Settings->Voicemail settings seems as it's supposed to allow you changing your voicemail number only, not disabling it. Ok I thought, fine, I'll just put in some non-existent number such as "1" or "0", but this failed with a message similar to "Voicemail number change unsuccessful. Please contact your operator if this problem persists." No, I'm not going into trouble explaining my strange request to call center staff. After doing some research, I've found that the voicemail phone number (901 for O2 in my case) is actually taken from voicemail-conf.xml file located in /data/cust/xml/ directory on the phone system partition. Here's an extract from this file:

<!-- DTS2012032704392 fanluofei 20120327 begin -->
<voicemail numeric="23410"
    carrier="O2 - UK"
    vmnumber="901"
    vmtag="voicemail"
/>
<!-- DTS2012032704392 fanluofei 20120327 end -->

All you actually need to do is remove this section or just last "greater than" symbol in the first line so the whole section is commented out:

<!-- DTS2012032704392 fanluofei 20120327 begin --
<voicemail numeric="23410"
    carrier="O2 - UK"
    vmnumber="901"
    vmtag="voicemail"
/>
<!-- DTS2012032704392 fanluofei 20120327 end -->

If you can do it, fine, however sometimes this file is not easily editable even when you have a rooted phone and you've installed all "proper" file explorer tools. Here's what you need to do:

  1. Install Android SDK. For the purpose of this article you only need Android Debug Bridge (adb.exe), but the SDK could help you to tweak your phone further if need be.
  2. Run cmd.exe and navigate to the folder where you've installed Android SDK. You'll see this path at the top of Android SDK Manager if you run it. You'll need to run "adb.exe" with "shell" parameter in Windows Command prompt:
    C:\Users\YourUserName\AppData\Local\Android\android-sdk\platform-tools>adb shell
    $
    
  3. Long story short the reason you can't edit the /data/cust/xml/voicemail-conf.xml file is because /data/cust/ directory is a symlink for /cust/o2/uk/ directory or whatever's the name of your cell operator and that /cust/ directory is mounted as read-only. Type "mount" in adb shell and see for yourself:
    C:\Users\YourUserName\AppData\Local\Android\android-sdk\platform-tools>adb shell
    $ mount
    mount
    rootfs / rootfs ro,relatime 0 0
    tmpfs /dev tmpfs rw,relatime,mode=755 0 0
    devpts /dev/pts devpts rw,relatime,mode=600 0 0
    proc /proc proc rw,relatime 0 0
    sysfs /sys sysfs rw,relatime 0 0
    none /acct cgroup rw,relatime,cpuacct 0 0
    tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
    tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
    none /dev/cpuctl cgroup rw,relatime,cpu 0 0
    /dev/block/mtdblock4 /system yaffs2 ro,relatime 0 0
    /dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev,relatime 0 0
    /dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
    /dev/block/mtdblock7 /data/HWUserData yaffs2 rw,nosuid,nodev,relatime 0 0
    /dev/block/mtdblock8 /cust yaffs2 ro,relatime 0 0
    hwvefs /data/huawei_hwvefs fuse.hwvefs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
    ...
    
  4. You'll need to find what is mounted as /cust, in my case it's the line
    /dev/block/mtdblock8 /cust yaffs2 ro,relatime 0 0
    

    "ro" here means "read-only". Now remount it as writable (you'll need superuser access for that):

    $ su
    su
    # mount -ro remount,rw /dev/block/mtdblock8 /cust
    mount -ro remount,rw /dev/block/mtdblock8 /cust
    
  5. That's it, you can edit this file now. Find it in /cust/YourOperatorHere/xml directory, open with an editor of your choice or download ES File Explorer File Manager if you have no preference. Now delete or comment-out the section for your carrier and your voicemail number will be reset:
    Android: Voicemail number not set
    You should be able to manually change the number for voicemail here if you wish.