Using Microsoft.WindowsMobile.Telephony


One of our MVPs pointed out today that using Phone.Talk was adding invalid characters at the end of the telephone.


Unfortunately it turns out we had a bug….we were passing a pointer to a string that was not null terminated.
This will be fixed, but until then here is the workaround:


   To call the number “555-0100” you would need to create the Phone object, and then call Talk as follows:


   Phone myPhone = new Microsoft.WindowsMobile.Telephony.Phone();


   myPhone.Talk(“555-0100\0“); //Notice the null character appended at the end.


-Luis Cabrera
SDE – Microsoft.


*I did not write this bug…although I have written my share of bugs 😐


Comments (19)

  1. Neil Cawse says:

    This blows me away!

    I really hope this is not indicative of the level of testing Microsoft has given the compact framework? IMHO the biggest failing of Microsoft’s Mobile operating system(s) is the lack of robustness caused by poor testing!

  2. Shane Church says:

    <sarcasm on> Another negative comment by a Windows Mobile developer. I guess it’s time to shut off the comments. <sarcasm off> I’ve seen so much openness out of Microsoft since this blogging initiative started, but this blog has been particularly bad about this. You shut off the comments to the Windows Mobile 5.0 Security Model FAQ post when the comments turned negative (http://blogs.msdn.com/windowsmobile/archive/2005/12/17/security_model_faq.aspx) without an actual response to any of the developer complaints. Why should this be any different?

    I have been a Windows Mobile developer since Pocket PC 2000 (look it up on my site), and I think it’s a great operating system, but I think the Windows Mobile team does the worst job of any Microsoft team that I’ve dealt with in dealing with and addressing user feedback.

  3. Cesar Fong says:

    Since this bug affect VB.NET too, the solution also works in vb.net

    myphone.Talk("+51739787799", True)

  4. windowsmobile says:

    Shane, we did block comments on the thread you pointed to, but we shouldn’t have. We’re sorry and it won’t happen again.

    Mike Calligaro

  5. p.janowski says:

    Error 1 The type or namespace name ‘WindowsMobile’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?) C:Documents and Settings…Visual Studio 2005ProjectsDeviceApplication7DeviceApplication7Form1.cs 8 17 DeviceApplication7

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Text;

    using System.Windows.Forms;

    using Microsoft.WindowsMobile.Telephony;

    namespace DeviceApplication7

    {

    public partial class Form1 : Form

    {

    public Form1()

    {

    InitializeComponent();

    }

    private void button1_Click(object sender, EventArgs e)

    {

    Phone myPhone = new Microsoft.WindowsMobile.Telephony.Phone();

    myPhone.Talk("555-0100");

    }

    }

    }

  6. AK says:

    Well, this is interesting, yet the real silver bullet would be if one could click on a phone number in IE in Windows Mobile and let the phone automatically dial this number.

    Or is this already implemented and just needs activation?

  7. LuisCa says:

    For p.janowski:

    Right click on your project and add a Microsoft.WindowsMobile.Telephony reference to your mobile application. To see it as one of the references, your application should be a Windows Mobile 5.0 .Net CF application.

    Good luck.

  8. Miguel says:

    How can i determine if the phone is currently muted using the Telephony namespace?

  9. LuisCa says:

    Unfortunately you cannot do using the Telephony, but you can do it easily using Microsoft.WindowsMobile.Status:

    There is a System State called PhoneRingerOff, and it gets a value indicating whether the phone’s ringer is off (i.e., if it rings and/or vibrates).

    i.e.

    if (SystemSate.PhoneRingerOff)

    {

     // do whatever

    }

    For a list of system states you can access take a look at  

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState_Members.asp

    Hope this helps!

    -Luis E. Cabrera

  10. LuisCa says:

    Unfortunately you cannot do using the Telephony, but you can do it easily using Microsoft.WindowsMobile.Status:

    There is a System State called PhoneRingerOff, and it gets a value indicating whether the phone’s ringer is off (i.e., if it rings and/or vibrates).

    i.e.

    if (SystemSate.PhoneRingerOff)

    {

     // do whatever

    }

    For a list of system states you can access take a look at  

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState_Members.asp

    Hope this helps!

    -Luis E. Cabrera

  11. Chris Angus says:

    Hi Luis,

    I wonder if you can help me with my phone volume problem?  I have an O2 Atom and the ear piece volume is way too low even when turned fully up.  Everyone comlains about it and we have reported it to O2 but 3 ROM revisions later and its still the same.  Is there a registry hack that i can use to increase the maximum volume level of the ear piece?

    Many thanx if you can spare the time to help me.

    Regards Chris

  12. Keith Burgoyne says:

    Given the comments about testing, I’d like to atleast make the positive comment congratulating the Microsoft team on standing up and actually posting blog entries about the bugs.  The entire software industry has a long history of simply not acknowledging bugs until the fix has been released — and in some cases, not even then.

    I would like to point out that while it certainly would have been preferable to not have the bug at all (which I’m sure the Microsoft team would have also preferred), this blog entry, and others, have saved me countless hours "guessing" whether I was doing something wrong or whether there really was a bug.

    The added information providing a recommended workaround also helps to avoid making my own workaround hack that perhaps Microsoft wouldn’t not have anticipated and might have potentially broken in the future.

    Thanks for providing this information, Luis.

    — Keith

  13. Olgunka-cv says:

    <a href= http://index2.arests.biz >stephanie michaud navy dental assistatnt</a> <a href= http://index1.arests.biz >sissy wears stockings lingerie masturbates</a> <a href= http://index3.arests.biz >adult videoes</a> <a href= http://index4.arests.biz >campgrounds in morris illinois area</a>

  14. Olgunka-cv says:

    <a href= http://index2.arests.biz >stephanie michaud navy dental assistatnt</a> <a href= http://index1.arests.biz >sissy wears stockings lingerie masturbates</a> <a href= http://index3.arests.biz >adult videoes</a> <a href= http://index4.arests.biz >campgrounds in morris illinois area</a>

  15. leon anderson says:

    I am wondering if anyone can point me to a great place

    for learning about auto dialing, as I am trying to save myself a lot of trouble, when I dial a number from speed dial, it usually means I am trying to avoid typing, I may have to enter some more numbers after the line connects, is there a way of dialing those numbers through the framework in order to not dial them on the pad, however I cant assign this to a speed dial, as it pops open another call separate from the first one placed

  16. Saravanan says:

    How to call *123# in wm6 compact framework?

  17. Mitch Todd says:

    I am also curious about Saravanan’s question above. It seems that any number containing a * or # results in a "call cannot be completed" error message. Is there a way around this? I have also attempted to use TAPI for this with no success…Thanks in advance!