Author Topic: Get TServerProtocol in WDE  (Read 2948 times)

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Get TServerProtocol in WDE
« on: May 16, 2016, 01:15:05 AM »
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?

Offline javiaf

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Get TServerProtocol in WDE
« Reply #1 on: May 19, 2016, 12:31:42 PM »
Hi Alyw,

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

[i]IAgent agent[/i] (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.


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

Regards!
« Last Edit: May 19, 2016, 12:33:24 PM by javiaf »

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Get TServerProtocol in WDE
« Reply #2 on: June 03, 2016, 03:10:21 PM »
[quote author=Alyw link=topic=9602.msg43352#msg43352 date=1463361305]
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?
[/quote]

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

Regards.