Compartilhar via


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

  • Anonymous
    January 03, 2006
    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!

  • Anonymous
    January 04, 2006
    <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.

  • Anonymous
    January 05, 2006
    Since this bug affect VB.NET too, the solution also works in vb.net

    myphone.Talk("+51739787799�", True)

  • Anonymous
    January 06, 2006
    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

  • Anonymous
    January 17, 2006
    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�");

    }
    }
    }

  • Anonymous
    February 09, 2006
    The comment has been removed

  • Anonymous
    February 15, 2006
    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.

  • Anonymous
    May 13, 2006
    How can i determine if the phone is currently muted using the Telephony namespace?

  • Anonymous
    May 18, 2006
    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

  • Anonymous
    May 18, 2006
    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

  • Anonymous
    May 18, 2006
    The comment has been removed

  • Anonymous
    March 20, 2007
    The comment has been removed

  • Anonymous
    April 17, 2008
    <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>

  • Anonymous
    April 17, 2008
    <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>

  • Anonymous
    June 13, 2008
    The comment has been removed

  • Anonymous
    January 08, 2009
    How to call *123# in wm6 compact framework?

  • Anonymous
    May 26, 2009
    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!