Try pulling the latest git
This issue was reported in http://jira.freeswitch.org/browse/ESL-81 and appears to have been resolved in February.


On Fri, May 16, 2014 at 7:24 AM, Grant Bagdasarian <GB@cm.nl> wrote:

Hello,

 

I’m trying to run the following code, but after a few seconds I get AccessViolationException:

 

class Program {

        static void Main(string[] args) {

 

            ESLconnection connection = new ESLconnection("192.168.1.1", 8021, "ClueCon");

            connection.SendRecv("event plain ALL");

            Task task1 = Task.Run(() => Receive(1, connection));

            Task task2 = Task.Run(() => Receive(2, connection));

            Console.ReadLine();

        }

 

        static void Receive(int id, ESLconnection connection) {

            while (connection.Connected() == 1) {

                ESLevent eslEvent = connection.RecvEvent();

                Console.WriteLine("{0} - {1}", id, eslEvent.Serialize("").Split(new char[] { '\r', '\n' })[0]);

            }

        }

    }

 

What the basic idea behind this is, is to have a Task continuously listening for a CHANNEL_HANGUP event, and have the other Task process the call in parallel.

Does the exception occur because multiple parallel tasks are trying to access the connection object?

 

Is the only solution to create a second ESLconnection (HANGUP Handler) and register it to receive only calls for a given UUID?

 

Regards,

 

Grant


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org