[with_erlang="try"]
)
+AM_CONDITIONAL([HAVE_ERLANG],[false])
if test "$with_erlang" != "no"
then
save_CFLAGS="$CFLAGS"
AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS])
AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
+ AM_CONDITIONAL([HAVE_ERLANG],[true])
fi
LIBS="$save_LIBS"
freeswitch-mod-event-test (= \${binary:Version}),
freeswitch-mod-event-zmq (= \${binary:Version}),
freeswitch-mod-json-cdr (= \${binary:Version}),
+ freeswitch-mod-kazoo (= \${binary:Version}),
freeswitch-mod-radius-cdr (= \${binary:Version}),
freeswitch-mod-snmp (= \${binary:Version}),
freeswitch-mod-local-stream (= \${binary:Version}),
Description: mod_format_cdr
Adds mod_format_cdr.
+Module: event_handlers/mod_kazoo
+Description: mod_kazoo
+ Adds mod_kazoo.
+Build-Depends: erlang-dev
+Depends: erlang
+
Module: event_handlers/mod_json_cdr
Description: mod_json_cdr
Adds mod_json_cdr.
%description event-format-cdr
JSON and XML Logger for the FreeSWITCH open source telephony platform
+%package kazoo
+Summary: Kazoo Module for the FreeSWITCH open source telephony platform
+Group: System/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: erlang
+BuildRequires: erlang
+
+%description kazoo
+Kazoo Module for FreeSWITCH.
+
%package event-multicast
Summary: Multicast Event System for the FreeSWITCH open source telephony platform
Group: System/Libraries
######################################################################################################################
EVENT_HANDLERS_MODULES="event_handlers/mod_cdr_csv event_handlers/mod_cdr_pg_csv event_handlers/mod_cdr_sqlite \
event_handlers/mod_cdr_mongodb event_handlers/mod_format_cdr event_handlers/mod_erlang_event event_handlers/mod_event_multicast \
- event_handlers/mod_event_socket event_handlers/mod_json_cdr event_handlers/mod_radius_cdr \
+ event_handlers/mod_event_socket event_handlers/mod_json_cdr event_handlers/mod_kazoo event_handlers/mod_radius_cdr \
event_handlers/mod_snmp"
%if %{build_mod_rayo}
EVENT_HANDLERS_MODULES+=" event_handlers/mod_rayo"
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/http_cache.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/ivr.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/java.conf.xml
+%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/kazoo.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/lcr.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/local_stream.conf.xml
%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/logfile.conf.xml
%files event-json-cdr
%{MODINSTDIR}/mod_json_cdr.so*
+%files kazoo
+%{MODINSTDIR}/mod_kazoo.so*
+
%files event-radius-cdr
%{MODINSTDIR}/mod_radius_cdr.so*
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_kazoo
+
+if HAVE_ERLANG
+
mod_LTLIBRARIES = mod_kazoo.la
mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_node.c kazoo_event_stream.c kazoo_fetch_agent.c kazoo_commands.c kazoo_dptools.c
mod_kazoo_la_CFLAGS = $(AM_CFLAGS) @ERLANG_CFLAGS@ -D_REENTRANT
mod_kazoo_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_kazoo_la_LDFLAGS = -avoid-version -module -no-undefined -shared @ERLANG_LDFLAGS@
+
+else
+install: error
+all: error
+error:
+ $(error You must install erlang to build this module)
+endif
if (type == ERL_NIL_EXT) {
res = 0;
- dst = '\0';
+ *dst = '\0';
} else if (type == ERL_BINARY_EXT) {
res = ei_decode_binary(buf, index, dst, &len);
dst[len] = '\0'; /* binaries aren't null terminated */
#define KAZOO_DESC "kazoo information"
#define KAZOO_SYNTAX "<command> [<args>]"
+globals_t globals;
+
SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown);
SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime);
int event_stream_preallocate;
int send_msg_batch;
short event_stream_framing;
-} globals;
+};
typedef struct globals_s globals_t;
+extern globals_t globals;
/* kazoo_node.c */
switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn);