2008-12-19 19:35:09 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <esl.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2008-12-21 16:54:43 -05:00
|
|
|
esl_handle_t handle = {{0}};
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2010-01-05 15:37:16 -05:00
|
|
|
esl_connect(&handle, "localhost", 8021, NULL, "ClueCon");
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2009-02-06 11:05:46 -05:00
|
|
|
esl_send_recv(&handle, "api status\n\n");
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2009-08-24 10:04:59 -04:00
|
|
|
if (handle.last_sr_event && handle.last_sr_event->body) {
|
|
|
|
printf("%s\n", handle.last_sr_event->body);
|
|
|
|
} else {
|
|
|
|
// this is unlikely to happen with api or bgapi (which is hardcoded above) but prefix but may be true for other commands
|
|
|
|
printf("%s\n", handle.last_sr_reply);
|
|
|
|
}
|
|
|
|
|
2008-12-19 19:35:09 -05:00
|
|
|
esl_disconnect(&handle);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|