X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ffreeswitch.c;h=c5277e456b5cbb21acca13dcb7cf25cf7fec96c7;hb=0f6df5fb167f900ff9e46a37c82ca559a123d604;hp=dbe3eab0270498fade783e215fd387c04a314f0a;hpb=67bb5e685095d2218cc63b7195993d85054af554;p=collectd.git diff --git a/src/freeswitch.c b/src/freeswitch.c index dbe3eab0..c5277e45 100644 --- a/src/freeswitch.c +++ b/src/freeswitch.c @@ -24,7 +24,7 @@ #include "common.h" #include "plugin.h" #include "utils_match.h" -#include +#include "esl.h" #define FS_DEF_HOST "127.0.0.1" #define FS_DEF_PORT "8021" @@ -38,10 +38,10 @@ * * Instance "profile-sofia-res-public" * - * Regex "\\" - * DSType "CounterInc" - * Type "counter" * Instance "calls-in" + * Regex "CALLS-IN\\s+([0-9]+)" + * DSType "GaugeLast" + * Type "gauge" * * * @@ -402,17 +402,6 @@ static int fs_complex_config (oconfig_item_t *ci) static void fs_submit (const fs_command_t *fc, const fs_match_t *fm, const cu_match_value_t *mv) { - DEBUG ("freeswitch plugin: in fs_submit"); - - DEBUG ("fc->instance"); - DEBUG (fc->instance); - - DEBUG ("fm->type"); - DEBUG (fm->type); - - DEBUG ("mv->value"); - //DEBUG (mv->value); - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -446,7 +435,6 @@ static int fs_read_command (fs_command_t *fc) if (esl_handle.last_sr_event && esl_handle.last_sr_event->body) { - DEBUG ("freeswitch plugin: output from esl (truncated):\n%s\n\n", esl_handle.last_sr_event->body); sfree(fc->buffer); fc->buffer = strdup(esl_handle.last_sr_event->body); fc->buffer_size = strlen(fc->buffer); @@ -457,6 +445,10 @@ static int fs_read_command (fs_command_t *fc) { cu_match_value_t *mv; +printf("BUFFER SIZE = %lu\n", fc->buffer_size); + +printf("### Trying match\n"); + status = match_apply (fm->match, fc->buffer); if (status != 0) {