- /* clean up an old thread */
- int status;
-
-/*
- pthread_mutex_lock (&traffic_mutex);
- tr_queries = 0;
- tr_responses = 0;
- pthread_mutex_unlock (&traffic_mutex);
-*/
-
- if (esl_thread_init != 0)
- return (-1);
-
- status = pthread_create (&esl_thread, NULL, esl_child_loop,
- (void *) 0);
- if (status != 0)
- {
- char errbuf[1024];
- ERROR ("freeswitch plugin: pthread_create failed: %s",
- sstrerror (errno, errbuf, sizeof (errbuf)));
- return (-1);
- }
-
- esl_thread_init = 1;
-
+ esl_connect(&handle, "172.16.235.98", 8021, "ClueCon");
+ esl_thread_create_detached(msg_thread_run, &handle);