freeswitch plugin: Added esl header files and modified freeswitch.c to use it
[collectd.git] / src / freeswitch.c
index dc013fe..4e67dc6 100644 (file)
@@ -25,8 +25,8 @@
 
 /*
 #include "utils_match.h"
-#include <esl.h>
 */
+#include <esl.h>
 
 #define FREESWITCH_DEF_HOST "127.0.0.1"
 #define FREESWITCH_DEF_PORT "8021"
@@ -87,20 +87,18 @@ static int freeswitch_read (void)
        if (password == NULL)
                password = FREESWITCH_DEF_PASSWORD;
 
-/*
        esl_handle_t handle = {{0}};
-       esl_connect(&handle, host, port, password);
+       esl_connect(&handle, host, atoi(port), password);
 
        esl_send_recv(&handle, "api show channels\n\n");
-*/
        
        // DO YOUR THING HERE TO PARSE &handle
        
-/*
        esl_disconnect(&handle);
-*/
 
-       freeswitch_submit ("res-public", "channels", 3, 5);
+DEBUG ("FreeSWITCH SUBMIT: res-public fs_channels 3 5");
+
+       freeswitch_submit ("res-public", "fs_channels", 3, 5);
 
        return (0);
 } /* int freeswitch_read */