Quantcast
Channel: Plantronics Developer Connection: Message List
Viewing all articles
Browse latest Browse all 377

Re: How to Mute headset controlled by other program?

$
0
0

Hi Simon,

 

First let me explain that for a wireless device such as the Voyager voice is transmitted between the headset and the PC through the radio frequency link (RFLink). Setting audio state to MonoOn and MonoOff is to bring up or take down the RFLink. This is totally different from mute/unmute the headset. If you are using the COM interface, the command to mute/unmute is

 

IHostCommand hostCmd= m_currentDevice.HostCommand;

IHostCommandExt hostCmdExt= (IHostCommandExt)hostCmd;

hostCmdExt.SetHeadsetMute(true);

 

See sample code SpokesSDKNETSample.

 

For setting mute in REST see sample code below:

 

Plugin.prototype.muteCall = function( name, callID, muted, callback )
{
    // Error handling
  if( callID == undefined || callID.getName() != "SpokesCallId" || !isNumber(
callID.Id ) ) {
    callback( new SpokesResponse( {isError:true, Err: {Type:2,
Description:"MuteCall invalid parameters", Error_Code:0} } ) );
  return false;
  }
 
    //Register callback
  var action = new SpokesAction( callback );
  SpokesAction.Action_List.unshift( action );
 
  callID = JSON.stringify(callID);

  // Call services. Notifies Spokes about a softphone call muted or unmuted
via the softphone GUI.
  // API:
http://127.0.0.1:32001/Spokes/CallServices/{name}/MuteCall?{callID}=callID&{muted}=muted
  // Params: {name} Plugin name
  // Params: {callID} Object of SpokesCallId type. Containes Id property of int type
  // Params: {muted} true or false. Defines is call muted or unmuted
  // Returns: true or false (success or failure)
  $.getJSON(this.Path + "/CallServices/" + name + "/MuteCall" +
                                            "?callID=" + callID +
                                            "&muted=" + muted +
                                            "&callback=?", function(data)
            {
                //Create a nice object, and ensure its of the right type
              var resp = new SpokesResponse( data );
              if ( resp.Type != SpokesResponseType.Bool  )
                resp.isValid = false;

                //Pass my result back to the user
              action.isValid = false;
              if ( action.Callback != null && action.Callback != undefined )
                action.Callback( resp );
            } );

  return true;
}

See sample code :ZeusRestJsClient

Wei Chu


Viewing all articles
Browse latest Browse all 377

Trending Articles