What is an example of the GetAllChannels() or documentation on its usage?

From VESupport

Jump to: navigation, search


         List<ChannelResource> ChannelList = null;
           try
           {
               ChannelList = DialerEngine.TelephonyServer.GetAllChannels();
               for (int i = 0; i < ChannelList.Count; i++)
               {
                   ManagedChannel managedChannel = new ManagedChannel(ChannelList[i]);
                   managedChannel.Id = i + 1;
                   if (managedChannel.Type == ChannelType.MsiChannel)
                   {
                       MsiChannelList.Add(managedChannel);
                   }
                   else if (managedChannel.Type == ChannelType.SipChannel ||
                           managedChannel.Type == ChannelType.T1Channel ||
                           managedChannel.Type == ChannelType.DigitalChannel)
                   {
                       OutboundChannelList.Add(managedChannel);
                       AvailableOutboundCount++;
                   }
               }
           }
           catch (Exception ee)
           {
               Log.WriteException(ee, "Initialize Exception");
               if (ChannelList != null)
                   DisposeChannels(ChannelList);
               throw ee;
           }

In this example, ManagedChannel is a class that maintains the state of an individual channel.

Personal tools