freeswitch plugin: Added channels to types.db and modified freeswitch.c a bit to...
authorLeon de Rooij <leon@scarlet-internet.nl>
Tue, 21 Apr 2009 11:03:55 +0000 (13:03 +0200)
committerFlorian Forster <sifnfors@informatik.stud.uni-erlangen.de>
Thu, 16 Jul 2009 08:53:27 +0000 (10:53 +0200)
src/freeswitch.c
src/types.db

index 52b7a1d..dc013fe 100644 (file)
@@ -51,7 +51,7 @@ static char *freeswitch_host = NULL;
 static char freeswitch_port[16];
 static char *freeswitch_password = NULL;
 
-static void freeswitch_submit (const char *type_instance, gauge_t inbound, gauge_t outbound)
+static void freeswitch_submit (const char *profile, const char *type, gauge_t inbound, gauge_t outbound)
 {
        value_t values[2];
        value_list_t vl = VALUE_LIST_INIT;
@@ -63,8 +63,8 @@ static void freeswitch_submit (const char *type_instance, gauge_t inbound, gauge
        vl.values_len = 2;
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "freeswitch", sizeof (vl.plugin));
-       sstrncpy (vl.type, "freeswitch", sizeof (vl.type));
-        sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
+       sstrncpy (vl.type, type, sizeof (vl.type));
+        sstrncpy (vl.type_instance, profile, sizeof (vl.type_instance));
 
        plugin_dispatch_values (&vl);
 } /* void freeswitch_submit */
@@ -100,7 +100,7 @@ static int freeswitch_read (void)
        esl_disconnect(&handle);
 */
 
-       freeswitch_submit ("profilename", 0, 0);
+       freeswitch_submit ("res-public", "channels", 3, 5);
 
        return (0);
 } /* int freeswitch_read */
index 1acdaf6..04292e9 100644 (file)
@@ -7,6 +7,7 @@ bitrate                 value:GAUGE:0:4294967295
 bytes                  value:GAUGE:0:U
 cache_result           value:COUNTER:0:4294967295
 cache_size             value:GAUGE:0:4294967295
+channels                inbound:GAUGE:0:U, outbound:GAUGE:0:U
 charge                 value:GAUGE:0:U
 compression_ratio      value:GAUGE:0:2
 connections            value:COUNTER:0:U