diff --git a/packages/@webex/plugin-cc/src/cc.ts b/packages/@webex/plugin-cc/src/cc.ts index a0599bbefe2..787508c4c62 100644 --- a/packages/@webex/plugin-cc/src/cc.ts +++ b/packages/@webex/plugin-cc/src/cc.ts @@ -197,11 +197,13 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter public async setAgentState(data: StateChange): Promise { try { - const agentStatusPromise = await this.services.agent.stateChange({data}); + const agentStatusResponse = await this.services.agent.stateChange({ + data: {...data, agentId: data.agentId || this.agentConfig.agentId}, + }); this.$webex.logger.log(`file: ${CC_FILE}: SET AGENT STATUS API SUCCESS`); - return Promise.resolve(agentStatusPromise); + return agentStatusResponse; } catch (error) { throw getErrorDetails(error, 'setAgentState'); }