FS-7776 #resolve add mod_kazoo to build system

This commit is contained in:
Luis Azedo 2015-07-04 01:20:02 +01:00
parent 369a8855a0
commit eaf6430e0d
9 changed files with 39 additions and 3 deletions

View File

@ -9,6 +9,7 @@ AC_ARG_WITH(
[with_erlang="try"]
)
AM_CONDITIONAL([HAVE_ERLANG],[false])
if test "$with_erlang" != "no"
then
save_CFLAGS="$CFLAGS"
@ -78,6 +79,7 @@ then
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"

1
debian/bootstrap.sh vendored
View File

@ -642,6 +642,7 @@ Recommends:
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}),

View File

@ -523,6 +523,12 @@ Module: event_handlers/mod_format_cdr
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.

View File

@ -1016,6 +1016,16 @@ Requires: %{name} = %{version}-%{release}
%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
@ -1485,7 +1495,7 @@ ENDPOINTS_MODULES="endpoints/mod_dingaling ../../libs/freetdm/mod_freetdm \
######################################################################################################################
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"
@ -1873,6 +1883,7 @@ fi
%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
@ -2257,6 +2268,9 @@ fi
%files event-json-cdr
%{MODINSTDIR}/mod_json_cdr.so*
%files kazoo
%{MODINSTDIR}/mod_kazoo.so*
%files event-radius-cdr
%{MODINSTDIR}/mod_radius_cdr.so*

View File

@ -1,7 +1,17 @@
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

View File

@ -328,7 +328,7 @@ int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char
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 */

View File

@ -35,6 +35,8 @@
#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);

View File

@ -111,8 +111,9 @@ struct globals_s {
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);