提交 f25c4f6d authored 作者: Ken Rice's avatar Ken Rice

Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

......@@ -56,16 +56,23 @@ xread () {
}
avoid_mod_filter () {
local mods=("$(eval echo \${avoid_mods_$codename[@]})" "${avoid_mods[@]}")
local x="avoid_mods_$codename[@]"
local -a mods=("${avoid_mods[@]}" "${!x}")
for x in "${mods[@]}"; do
[ "$1" = "$x" ] && return 1
if [ "$1" = "$x" ]; then
[ "$2" = "show" ] && echo "excluding module $x" >&2
return 1
fi
done
return 0
}
modconf_filter () {
while xread line; do
[ "$1" = "$line" ] && return 0
while xread l; do
if [ "$1" = "$l" ]; then
[ "$2" = "show" ] && echo "including module $l" >&2
return 0
fi
done < modules.conf
return 1
}
......@@ -78,6 +85,10 @@ mod_filter () {
fi
}
mod_filter_show () {
mod_filter "$1" show
}
map_fs_modules () {
local filterfn="$1" percatfns="$2" permodfns="$3"
for x in $mod_dir/*; do
......@@ -803,30 +814,42 @@ echo "Bootstrapping debian/ for ${codename}" >&2
echo >&2
echo "Please wait, this takes a few seconds..." >&2
echo "Adding any new modules to control-modules..." >&2
parse_dir=control-modules.parse
map_fs_modules ':' 'genmodctl_new_cat' 'genmodctl_new_mod' >> control-modules
echo "Parsing control-modules..." >&2
parse_mod_control
echo "Displaying includes/excludes..." >&2
map_modules 'mod_filter_show' '' ''
echo "Generating control-modules.gen as sanity check..." >&2
(echo "# -*- mode:debian-control -*-"; echo; \
map_modules ':' 'genmodctl_cat' 'genmodctl_mod' \
) > control-modules.gen
print_edit_warning > modules_.conf
echo "Accumulating build dependencies from modules..." >&2
map_modules 'mod_filter' '' 'accumulate_build_depends'
echo "Generating debian/..." >&2
> control
(print_edit_warning; print_source_control; print_core_control) >> control
echo "Generating debian/ (music)..." >&2
for r in 8000 16000 32000 48000; do genmusic $r; done
echo "Generating debian/ (sounds)..." >&2
for x in 'en/us/callie'; do
for r in 8000 16000 32000 48000; do
gensound $r $x
done
done
echo "Generating debian/ (conf)..." >&2
(echo "### conf"; echo) >> control
map_confs 'genconf'
echo "Generating debian/ (modules)..." >&2
(echo "### modules"; echo) >> control
print_edit_warning > modules_.conf
map_modules "mod_filter" \
"gencontrol_per_cat genmodules_per_cat" \
"gencontrol_per_mod geninstall_per_mod genoverrides_per_mod genmodules_per_mod"
echo "Generating additional lintian overrides..." >&2
grep -e '^Package:' control | while xread l; do
m="${l#*: }"
f=$m.lintian-overrides
......@@ -839,4 +862,5 @@ f=freeswitch.lintian-overrides
[ -s $f ] || print_edit_warning >> $f
print_gpl_openssl_override "freeswitch" >> $f
echo "Done bootstrapping debian/" >&2
touch .stamp-bootstrap
......@@ -41,6 +41,7 @@
#define SWITCH_IVR_H
#include <switch.h>
#include "switch_json.h"
SWITCH_BEGIN_EXTERN_C struct switch_unicast_conninfo {
switch_core_session_t *session;
......@@ -82,6 +83,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_activate_unicast(switch_core_session_
char *local_ip,
switch_port_t local_port,
char *remote_ip, switch_port_t remote_port, char *transport, char *flags);
/*!
\brief Generate an JSON CDR report.
\param session the session to get the data from.
\param json_cdr pointer to the json object
\return SWITCH_STATUS_SUCCESS if successful
\note on success the json object must be freed
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_generate_json_cdr(switch_core_session_t *session, cJSON **json_cdr, switch_bool_t urlencode);
/*!
\brief Generate an XML CDR report.
......
......@@ -131,6 +131,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_READ_RESULT_VARIABLE "read_result"
#define SWITCH_ATT_XFER_RESULT_VARIABLE "att_xfer_result"
#define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
#define SWITCH_COPY_JSON_CDR_VARIABLE "copy_json_cdr"
#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
#define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
#define SWITCH_TRANSFER_HISTORY_VARIABLE "transfer_history"
......
json-c=json-c-0.9
BASE=../../../..
JSON_DIR=$(switch_srcdir)/libs/$(json-c)
JSON_BUILDDIR=$(switch_builddir)/libs/$(json-c)
JSONLA=$(JSON_BUILDDIR)/libjson.la
LOCAL_CFLAGS=-I$(JSON_DIR)
LOCAL_LIBADD=$(JSONLA)
include $(BASE)/build/modmake.rules
$(JSON_DIR):
$(GETLIB) $(json-c).tar.gz
$(JSON_BUILDDIR)/Makefile: $(JSON_DIR)
mkdir -p $(JSON_BUILDDIR)
cd $(JSON_BUILDDIR) && $(DEFAULT_VARS) $(JSON_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(JSON_DIR) CPPFLAGS= LDFLAGS=
$(TOUCH_TARGET)
$(JSONLA): $(JSON_BUILDDIR)/Makefile
cd $(JSON_BUILDDIR) && $(MAKE)
$(TOUCH_TARGET)
差异被折叠。
......@@ -1366,21 +1366,41 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE, switch_channel_cause2str(cause));
}
if (switch_channel_down_nosig(peer_channel) && switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
switch_xml_t cdr = NULL;
char *xml_text;
if (switch_channel_down_nosig(peer_channel)) {
switch_bool_t copy_xml_cdr = switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE));
switch_bool_t copy_json_cdr = switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_JSON_CDR_VARIABLE));
switch_channel_wait_for_state(peer_channel, caller_channel, CS_DESTROY);
if (copy_xml_cdr || copy_json_cdr) {
char *cdr_text = NULL;
if (switch_ivr_generate_xml_cdr(peer_session, &cdr) == SWITCH_STATUS_SUCCESS) {
if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
switch_channel_set_variable(caller_channel, "b_leg_cdr", xml_text);
switch_safe_free(xml_text);
switch_channel_wait_for_state(peer_channel, caller_channel, CS_DESTROY);
if (copy_xml_cdr) {
switch_xml_t cdr = NULL;
if (switch_ivr_generate_xml_cdr(peer_session, &cdr) == SWITCH_STATUS_SUCCESS) {
cdr_text = switch_xml_toxml(cdr, SWITCH_FALSE);
switch_xml_free(cdr);
}
}
if (copy_json_cdr) {
cJSON *cdr = NULL;
if (switch_ivr_generate_json_cdr(peer_session, &cdr, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
cdr_text = cJSON_PrintUnformatted(cdr);
cJSON_Delete(cdr);
}
}
if (cdr_text) {
switch_channel_set_variable(caller_channel, "b_leg_cdr", cdr_text);
switch_channel_set_variable_name_printf(caller_channel, cdr_text, "b_leg_cdr_%s", switch_core_session_get_uuid(peer_session));
switch_safe_free(cdr_text);
}
switch_xml_free(cdr);
}
}
switch_core_session_rwunlock(peer_session);
} else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论