I've added the following CallStateChanged event, but I'm still not getting the call on my headset.
I'm not sure I should stop listening for the TalkButton, because I want the agent to be able to answer/disconnect a call by pressing that button.
void _SessionManager_CallStateChanged(object sender, CallStateEventArgs e)
{
Log("Call is ID: {}, State: {}, Source: {}", e.CallId.ToString(), e.Action.ToString(), e.CallSource);
if (e.CallSource == _Name)
{
switch (e.Action)
{
caseCallState.AcceptCall:
caseCallState.CallInProgress:
Log("Turning headset speaker on.");
_IDevice.HostCommand.AudioState = AudioType.MonoOn;
break;
caseCallState.CallEnded:
Log("Turning headset speaker off.");
_IDevice.HostCommand.AudioState = AudioType.MonoOff;
break;
default:
break;
}
}
}
}