In this code example, ManagedChannel is a class that maintains the state of an individual channel.
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; }
For more information, see GetAllChannels Method in the Voice Elements Developer Help site.