[Freeswitch-users] Managed ESL: AccessViolationException
Duvid Rottenberg
adrottenberg at gmail.com
Fri May 16 18:01:18 MSD 2014
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 at 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 at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140516/ebf87dfb/attachment.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list