8 Replies Latest reply: Nov 7, 2012 2:31 PM by Ramesh Theivendran RSS

Do we have to keep calling SuppressDialtone(true)?

Sangho Yang Newbie

Hi,

 

From the sample, SpokesSDKComSample, I have a question.

In the sample, whenever any headset button is pressed, a global function, KeepDialToneSuppressed(true), is called, and inside the global function a method, IDeviceListener->SuppressDialTone(true), is called. Do we have to call the method every time a button is pressed to recognize Talk button pressed ?

 

After running the sample, if I first press Talk button of my Blackwire C420, the sample does not recognize it. But, if I press any of other button like Mute, Volume Up/Down, the global function and the method is called, and then, the pressing of Talk button is recognized. From the doc of SDK, it is said that "For the devices that have default OC and Lync DialTone setting ON, you should call IDeviceListener.SuppressDialtone(true) to get TalkPressEvent on a client application." in 3.5.4.1 TalkPressed. I'm confused that calling the method, SuppressDialtone(true), one time is enough, or, need to be called every pressing button time.

 

And, although I pressed another button first, suddenly the sample stopped responding to my headset's Talk button, but, kept responding to other buttons. Do you think my headset is out of order ?

 

Thank you.

 

Sangho Yang

 

* My environment

- Windows 7 Ultimate(x86)

- Plantronics Blackwire C420

- Visual Studio 2008 SP1

- Plantronics Spokes software 2.6.54523.0

- PlantronicsURE SDK 2.6.54523.0

 

I attached Plantronics Log file for the trace of SpokesSDKComSample.exe at 2012/09/27, 09:20.

  • Re: Do we have to keep calling SuppressDialtone(true)?
    Lewis Collins Tracker

    Hi,

     

    Could you try this workaround?

     

    Run Start | Plantronics | Plantronics Control Panel

    (requires full Spokes software from http://www.plantronics.com/software)

     

    Go to the Preferences tab.

     

    Turn off the check box "Microsoft OC/Lync Dial-tone Enabled", then click Apply, then OK.

     

    PCP - Lync dial tone.png

     

    Retry your test. See if you can now see the talk button presses coming through.

     

    With that option turned off, or if you are using a UC standard variant Plantronics product (i.e. non-MOC/Lync variant) you should not need to call SupressDialTone at all.

     

    With the option turned on and a MOC/Lync variant product in use the SuppressDialtone function should allow you to intercept talk button presses on that MOC product and avoid them going to OC/Lync. However it does not seem to work too well in my experience and we have an open issue for that internally which is not planned to be addressed until next year.

     

    Please try the workaround for now and let me know the outcome. If you are still having issue please enable logging, repeat the test then attach the PlantronicsURE.log.* files covering time of test to this forum thread. Instructions to enable logging:

    How to enable detailed Spokes logging

     

    Thanks,

    Lewis

    • Re: Do we have to keep calling SuppressDialtone(true)?
      Sangho Yang Newbie

      Hi, Lewis,

      Thank you for your reply. Here are what I have done.

       

      1. Plantronics Control Panel

      Yesterday, I've already tried to do something in Plantronics Control Panel. But, I couldn't because the option, [Microsoft OC/Lync Dialtone Enabled] was always dimmed. The checkbox is not accessable. Please see the captured screen. When Plantronics C420 is connected, the checkbox is in CHECKED state but cannot uncheck it.(Sorry for the displayed language, Korean. But, every options are located at the same position as those in English.)

       

      <When no headset is connected>

      Plantronics Control Panel.01.png

       

      <When C420 is connected>

      Plantronics Control Panel.02.png

       

      <FYI, Plantronics Control Panel | About>

      Plantronics Control Panel.03.png

       

      2. Logging

      I enabled the logging and try my issue again.

      Please see the steps and the result screen(The circled numbers are showing each steps' results.)

      All of the followings has been started around 9:20, 2012-09-27.

      -- I started things without any Plantronics Headset connected.

      1) I changed the logging level into "Very High".

      2) Run command prompt and run the sample, SpokesSDKComSample.exe. -- ①

      3) I connected C420 to my labtop. -- ②

      4) I pushed Talk button two times. -- ③, ④

      5) I pushed Mute button. -- ⑤

      6) I pushed Mute button. -- ⑥

      7) I pushed Talk button. -- ⑦

      8) I pushed Talk button four times. -- ⑧⑨⑩⑪

      9) I disconnected C420 from my labtop. -- ⑫

      10) I quit the sample program by CTRL+C. -- ⑬

      <The results of the above>

      SpokesSDKComSample.exe.Explain.png

       

      The no response after successful TalkPressed event like ⑧,⑨, ⑩, ⑪ does not always happen. But, I can see the no response easily. I could see it many times when I repeated the above steps.

      I cannot find how to attach the log file at this post.

       

      3. Another headset has the same issue.

      I have another Plantronics headset, Blackwire C610, and with it the same things happen.

       

      Thank you.

      Sangho Yang

      • Re: Do we have to keep calling SuppressDialtone(true)?
        Sangho Yang Newbie

        I attached the log file at the original post.

         

        Sangho Yang

      • Re: Do we have to keep calling SuppressDialtone(true)?
        Lewis Collins Tracker

        Hi Sangho Yang,

         

        I have attempted to repeat the steps you show above.

         

        If Lync is running before I run the app and connect the C420:

        - pressing the Talk button results in Lync opening with dialtone.

        - pressing it again does not close Lync

        - pressing Mute button can be seen in SpokesSDKCOMSample

        - pressing Talk some more times CAN be seen in SpokesSDKCOMSample

        - but only 1 or sometimes a few Talk button events, then they stop coming through!

        - If you Mute and Unmute then Talk can come through again.

         

        If Lync is not running before I run the app and connect the C420:

        - initial Talk button event does NOT come through!

        - pressing Mute button can be seen in SpokesSDKCOMSample

        - subsequent Talk button events can be seen

        - but after quite a few Talk button events they STOP coming through again! (more come through than with Lync is running)

         

        There seems to be an issue here. I will ask the platform team to comment on that and get back to you.


        Thanks,

        Lewis.

         

        In the meantime have you considered trying the Spokes "high-level call management API". When you use it to integrate with e.g. a softphone you just tell Spokes about an incoming or outgoing call by a numeric call id, and you can let Spokes deal with the ringing of device, listening for talk button presses on your behalf and sending you a high-level CallStateEventHandler event to say the call was answered!

         

        There is more info on this here: High-level call management ICallCommand: benefits of newer Spokes SDK!

        • Re: Do we have to keep calling SuppressDialtone(true)?
          Sangho Yang Newbie

          Thank you for investigating it.

           

          For this issue I have been postponing integration of PlantronicsSDK 2.6 with my product.

           

          Please keep me updated on this issue.

           

          Thanks.

          Sangho Yang

          • Re: Do we have to keep calling SuppressDialtone(true)?
            Lewis Collins Tracker

            Hi Sangho Yang,

             

            The platform team here have advised a workaround to this issue to ensure our application keeps control of the device.

            See the lines in code below, identified with comments starting // ****

             

            Modify the KeepDialToneSuppressed function to add a call to InCall function, like this:

             

            void KeepDialToneSuppressed(bool bSuppress)

            {

                if( deviceListener != NULL )

                {

                    cout << "***Suppressing dial-tone in IDeviceListener." << endl;

                    deviceListener->SuppressDialTone(true);

                    deviceListener->InCall(true);     // **** Also call this function to make sure we keep control of the device!

                }

            }

             

            Modify the AttachDevice function to add an extra call to KeepDialToneSuppressed as soon as device is attached, like this:

             

            void AttachDevice()

            {

                // Get device from active session

                if( activeDevice == NULL && session != NULL)

                {

                    session->get_ActiveDevice(&activeDevice);

                }

             

                // If we have active device, then get HostCommad, DeviceListener and DeviceEvent

                if( activeDevice != NULL)

                {

                    activeDevice->get_HostCommand(&hostCommand);

             

                    PrintDevice();

                   

                    // hook to device event

                    if( SUCCEEDED(activeDevice->get_DeviceEvents(&deviceEvents)))

                    {

                        CComObject<DeviceEventSink>::CreateInstance(&deviceEventSink);

                        AtlAdvise(deviceEvents, deviceEventSink, __uuidof(IDeviceCOMEvents), &_pSinkDeviceCookie);

                    }

             

                    // hook to device listner event

                    if( SUCCEEDED(activeDevice->get_DeviceListener(&deviceListener)))

                    {

                        CComObject<DeviceListenerEventSink>::CreateInstance(&deviceListenerSink);

                        AtlAdvise(deviceListener, deviceListenerSink, __uuidof(IDeviceListenerCOMEvents), &_pSinkListenerCookie);

                    }

             

                    KeepDialToneSuppressed(true);  // **** Suppress the dialtone as soon as device is attached!

                }

            }

             

            Continue to call KeepDialToneSuppressed on each incoming button pressed event, as before:

             

            STDMETHOD(HeadsetButtonPressed)(VARIANT sender, struct _DeviceListenerEventArgs *args)  

                {

                KeepDialToneSuppressed(true);  // **** Call this to keep device control after each button event received!

             

               HeadsetButton button;
               args->get_HeadsetButtonPressed(&button);
               cout << "Device Listener Event: HeadsetButton " << getHeadstateButton(button) << std::endl;   
               return S_OK;

                }

             

            Let me know if this solves the problem and you can consistently obtain the talk button events.

             

            I will update the SpokesSDKComSample to reflect this.

             

            Thanks,
            Lewis.

            • Re: Do we have to keep calling SuppressDialtone(true)?
              Sangho Yang Newbie

              Hi Lewis,

               

              Thank you for providing me the workaround.

              Unfortunately I had to lend my Plantronics devices to my coworker for one week, I cannot test your workaround now. I will test it when they are available.

               

              I have one question.

              In this workaround, we have to call KeepDialToneSuppressed() whenever any incoming pressed event occurs. Is this solution temporary or official(formal way of using SpokesSDKCom) ?

              I think it should not be a official example because calling IDeviceListener's methods in DeviceListenerEventSink by using global variable for IDeviceListener, deviceListener, doesn't seem to be a good way. I hope I will not have to call the two methods repeatedly in each incoming button events.

               

              Thank you.

              Sangho