Get TServerProtocol in WDE

I need to get a value from the user data in a specified event, so that I can decide what to be displayed in the WDE. How can I get the TServerProtocol in WDE?

Hi Alyw,

Hope this helps. I guess you will have an IAgent object:

IAgent agent (You can get it in any WDE registered class using DependencyInjection).

Afterwards, we check both, if FirstMediaVoice and Channel are not null… In that case, we can get the TServerProtocol.

if (agent.FirstMediaVoice != null)
{
channel = agent.FirstMediaVoice.Channel;
if (channel != null)
{
TServerProtocol tserver = (TServerProtocol)channel.Protocol;
}
}

Regards!

Why you need TServerProtocol to Show/Hide some part of WDE? Maybe you can try another way (more simple).

Regards.