This document was generated from CDN thread
Created by: Marty Burkel on 16-12-2010 11:11:42 PM
After I retrieve the list of calls for an agent, I get the following error when I
try to enumerate over the list using the GetElementKey method:
Collection was modified; enumeration operation may not execute.
at System.Collections.SortedList.SortedListEnumerator.MoveNext()
at Cisco.CtiOs.Cil.Arguments.FindItem(Int32 iIndex)
at Cisco.CtiOs.Cil.Arguments.FindItemAt(Int32 iIndex)
at Cisco.CtiOs.Cil.Arguments.GetElementKey(Int32 iIndex, String& strKey)
This is the code:
Dim callArgs As Arguments = curSession.GetAllCalls()
Dim i As Integer
For i = 1 To callArgs.NumElements()
Dim curCallKey As String = Nothing
If callArgs.GetElementKey(i, curCallKey) Then
....
....
....
End If
Next
Has anyone else run in to this? This looks like another thread (created by the
CIL maybe) is removing or adding a call at the same time my thread is going thru the returned list. This seems like a bug and I can't think of a way to avoid it.
BTW - I'm using the .Net CIL 7.5(4)