[asterisk-commits] dlee: branch dlee/record r390757 - in /team/dlee/record: ./ addons/ apps/ app...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 6 17:05:15 CDT 2013
Author: dlee
Date: Thu Jun 6 17:05:12 2013
New Revision: 390757
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390757
Log:
Merged revisions 390042-390751 from http://svn.asterisk.org/svn/asterisk/trunk
Added:
team/dlee/record/include/asterisk/features_config.h
- copied unchanged from r390751, trunk/include/asterisk/features_config.h
team/dlee/record/main/features_config.c
- copied unchanged from r390751, trunk/main/features_config.c
Modified:
team/dlee/record/ (props changed)
team/dlee/record/CHANGES
team/dlee/record/Makefile
team/dlee/record/addons/chan_ooh323.c
team/dlee/record/apps/app_bridgewait.c
team/dlee/record/apps/app_confbridge.c
team/dlee/record/apps/app_dial.c
team/dlee/record/apps/app_userevent.c
team/dlee/record/apps/confbridge/confbridge_manager.c
team/dlee/record/apps/confbridge/include/confbridge.h
team/dlee/record/bridges/bridge_builtin_features.c
team/dlee/record/bridges/bridge_builtin_interval_features.c
team/dlee/record/bridges/bridge_native_rtp.c
team/dlee/record/channels/chan_dahdi.c
team/dlee/record/channels/chan_mgcp.c
team/dlee/record/channels/chan_misdn.c
team/dlee/record/channels/chan_sip.c
team/dlee/record/channels/chan_unistim.c
team/dlee/record/channels/sig_analog.c
team/dlee/record/channels/sip/include/sip.h
team/dlee/record/configure
team/dlee/record/configure.ac
team/dlee/record/include/asterisk.h
team/dlee/record/include/asterisk/autoconfig.h.in
team/dlee/record/include/asterisk/bridging.h
team/dlee/record/include/asterisk/bridging_features.h
team/dlee/record/include/asterisk/channel.h
team/dlee/record/include/asterisk/features.h
team/dlee/record/include/asterisk/manager.h
team/dlee/record/include/asterisk/security_events.h
team/dlee/record/include/asterisk/stasis.h
team/dlee/record/include/asterisk/stasis_bridging.h
team/dlee/record/include/asterisk/stasis_channels.h
team/dlee/record/include/asterisk/stasis_message_router.h
team/dlee/record/main/Makefile
team/dlee/record/main/app.c
team/dlee/record/main/asterisk.c
team/dlee/record/main/bridging.c
team/dlee/record/main/bridging_basic.c
team/dlee/record/main/channel.c
team/dlee/record/main/channel_internal_api.c
team/dlee/record/main/core_local.c
team/dlee/record/main/devicestate.c
team/dlee/record/main/features.c
team/dlee/record/main/manager.c
team/dlee/record/main/manager_channels.c
team/dlee/record/main/named_acl.c
team/dlee/record/main/pbx.c
team/dlee/record/main/presencestate.c
team/dlee/record/main/security_events.c
team/dlee/record/main/stasis.c
team/dlee/record/main/stasis_bridging.c
team/dlee/record/main/stasis_cache.c
team/dlee/record/main/stasis_channels.c
team/dlee/record/main/stasis_message_router.c
team/dlee/record/main/test.c
team/dlee/record/makeopts.in
team/dlee/record/res/parking/parking_bridge_features.c
team/dlee/record/res/parking/parking_manager.c
team/dlee/record/res/res_agi.c
Propchange: team/dlee/record/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/dlee/record/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 6 17:05:12 2013
@@ -1,1 +1,1 @@
-/trunk:1-390021
+/trunk:1-390754
Modified: team/dlee/record/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/CHANGES?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/CHANGES (original)
+++ team/dlee/record/CHANGES Thu Jun 6 17:05:12 2013
@@ -105,6 +105,13 @@
* The AMI 'Hold' event has been moved out of individual channel drivers, into
core, and is now two events: Hold and Unhold. The status field has been
removed.
+
+AGI (Asterisk Gateway Interface)
+------------------
+ * The manager event AGIExec has been split into AGIExecStart and AGIExecEnd.
+
+ * The manager event AsyncAGI has been split into AsyncAGIStart, AsyncAGIExec,
+ and AsyncAGIEnd.
Channel Drivers
------------------
Modified: team/dlee/record/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/Makefile?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/Makefile (original)
+++ team/dlee/record/Makefile Thu Jun 6 17:05:12 2013
@@ -468,7 +468,7 @@
@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
@for x in $(MOD_SUBDIRS); do \
printf "$$x " ; \
- for i in `find $$x -name *.c`; do \
+ for i in `find $$x -name '*.c'`; do \
$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
done ; \
done
Modified: team/dlee/record/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/addons/chan_ooh323.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/addons/chan_ooh323.c (original)
+++ team/dlee/record/addons/chan_ooh323.c Thu Jun 6 17:05:12 2013
@@ -307,6 +307,8 @@
int onCallCleared(ooCallData *call);
void onModeChanged(ooCallData *call, int t38mode);
+extern OOH323EndPoint gH323ep;
+
static char gLogFile[256] = DEFAULT_LOGFILE;
static int gPort = 1720;
static char gIP[2+8*4+7]; /* Max for IPv6 addr */
@@ -642,6 +644,7 @@
ooh323_destroy(p);
ast_mutex_unlock(&iflock);
ast_log(LOG_ERROR, "Destination format is not supported\n");
+ *cause = AST_CAUSE_INVALID_NUMBER_FORMAT;
return NULL;
}
@@ -688,6 +691,10 @@
ast_mutex_unlock(&p->lock);
ooh323_destroy(p);
ast_mutex_unlock(&iflock);
+ return NULL;
+ } else if (gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered) {
+ ast_log(LOG_ERROR, "Gatekeeper client is configured but not registered\n");
+ *cause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
return NULL;
}
p->g729onlyA = g729onlyA;
@@ -2615,8 +2622,6 @@
static int ooh323_do_reload(void)
{
- extern OOH323EndPoint gH323ep;
-
if (gH323Debug) {
ast_verb(0, "--- ooh323_do_reload\n");
}
@@ -3369,7 +3374,6 @@
static char *handle_cli_ooh323_show_gk(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
char value[FORMAT_STRING_SIZE];
- extern OOH323EndPoint gH323ep;
switch (cmd) {
case CLI_INIT:
Modified: team/dlee/record/apps/app_bridgewait.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_bridgewait.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/app_bridgewait.c (original)
+++ team/dlee/record/apps/app_bridgewait.c Thu Jun 6 17:05:12 2013
@@ -141,7 +141,7 @@
/* Limits struct holds time as milliseconds, so muliply 1000x */
hold_limits.duration *= 1000;
- ast_bridge_features_set_limits(features, &hold_limits, 1 /* remove_on_pull */);
+ ast_bridge_features_set_limits(features, &hold_limits, AST_BRIDGE_HOOK_REMOVE_ON_PULL);
ast_bridge_features_limits_destroy(&hold_limits);
return 0;
Modified: team/dlee/record/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_confbridge.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/app_confbridge.c (original)
+++ team/dlee/record/apps/app_confbridge.c Thu Jun 6 17:05:12 2013
@@ -415,13 +415,12 @@
return "";
}
-static void send_conf_stasis(struct confbridge_conference *conference, struct ast_channel *chan, const char *type, struct ast_json *extras, int channel_topic)
+static void send_conf_stasis(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *extras, int channel_topic)
{
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
- json_object = ast_json_pack("{s: s, s: s}",
- "type", type,
+ json_object = ast_json_pack("{s: s}",
"conference", conference->name);
if (!json_object) {
@@ -432,10 +431,10 @@
ast_json_object_update(json_object, extras);
}
- msg = ast_bridge_blob_create(confbridge_message_type(),
- conference->bridge,
- chan,
- json_object);
+ msg = ast_bridge_blob_create(type,
+ conference->bridge,
+ chan,
+ json_object);
if (!msg) {
return;
}
@@ -450,42 +449,42 @@
static void send_conf_start_event(struct confbridge_conference *conference)
{
- send_conf_stasis(conference, NULL, "confbridge_start", NULL, 0);
+ send_conf_stasis(conference, NULL, confbridge_start_type(), NULL, 0);
}
static void send_conf_end_event(struct confbridge_conference *conference)
{
- send_conf_stasis(conference, NULL, "confbridge_end", NULL, 0);
+ send_conf_stasis(conference, NULL, confbridge_end_type(), NULL, 0);
}
static void send_join_event(struct ast_channel *chan, struct confbridge_conference *conference)
{
- send_conf_stasis(conference, chan, "confbridge_join", NULL, 0);
+ send_conf_stasis(conference, chan, confbridge_join_type(), NULL, 0);
}
static void send_leave_event(struct ast_channel *chan, struct confbridge_conference *conference)
{
- send_conf_stasis(conference, chan, "confbridge_leave", NULL, 0);
+ send_conf_stasis(conference, chan, confbridge_leave_type(), NULL, 0);
}
static void send_start_record_event(struct confbridge_conference *conference)
{
- send_conf_stasis(conference, NULL, "confbridge_record", NULL, 0);
+ send_conf_stasis(conference, NULL, confbridge_start_record_type(), NULL, 0);
}
static void send_stop_record_event(struct confbridge_conference *conference)
{
- send_conf_stasis(conference, NULL, "confbridge_stop_record", NULL, 0);
+ send_conf_stasis(conference, NULL, confbridge_stop_record_type(), NULL, 0);
}
static void send_mute_event(struct ast_channel *chan, struct confbridge_conference *conference)
{
- send_conf_stasis(conference, chan, "confbridge_mute", NULL, 1);
+ send_conf_stasis(conference, chan, confbridge_mute_type(), NULL, 1);
}
static void send_unmute_event(struct ast_channel *chan, struct confbridge_conference *conference)
{
- send_conf_stasis(conference, chan, "confbridge_unmute", NULL, 1);
+ send_conf_stasis(conference, chan, confbridge_unmute_type(), NULL, 1);
}
static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
@@ -1420,7 +1419,7 @@
return;
}
- send_conf_stasis(conference, bridge_channel->chan, "confbridge_talking", talking_extras, 0);
+ send_conf_stasis(conference, bridge_channel->chan, confbridge_talking_type(), talking_extras, 0);
ast_json_unref(talking_extras);
}
Modified: team/dlee/record/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_dial.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/app_dial.c (original)
+++ team/dlee/record/apps/app_dial.c Thu Jun 6 17:05:12 2013
@@ -69,6 +69,7 @@
#include "asterisk/dial.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/bridging.h"
+#include "asterisk/features_config.h"
/*** DOCUMENTATION
<application name="Dial" language="en_US">
@@ -1074,7 +1075,7 @@
int caller_entertained = outgoing
&& ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
struct ast_party_connected_line connected_caller;
- struct ast_str *featurecode = ast_str_alloca(FEATURE_MAX_LEN + 1);
+ struct ast_str *featurecode = ast_str_alloca(AST_FEATURE_MAX_LEN + 1);
int cc_recall_core_id;
int is_cc_recall;
int cc_frame_received = 0;
@@ -1701,22 +1702,31 @@
static int detect_disconnect(struct ast_channel *chan, char code, struct ast_str **featurecode)
{
- struct ast_flags features = { AST_FEATURE_DISCONNECT }; /* only concerned with disconnect feature */
- struct ast_call_feature feature = { 0, };
+ char disconnect_code[AST_FEATURE_MAX_LEN];
int res;
ast_str_append(featurecode, 1, "%c", code);
- res = ast_feature_detect(chan, &features, ast_str_buffer(*featurecode), &feature);
-
- if (res != AST_FEATURE_RETURN_STOREDIGITS) {
+ res = ast_get_builtin_feature(chan, "disconnect", disconnect_code, sizeof(disconnect_code));
+ if (res) {
ast_str_reset(*featurecode);
- }
- if (feature.feature_mask & AST_FEATURE_DISCONNECT) {
- return 1;
- }
-
- return 0;
+ return 0;
+ }
+
+ if (strlen(disconnect_code) > ast_str_strlen(*featurecode)) {
+ /* Could be a partial match, anyway */
+ if (strncmp(disconnect_code, ast_str_buffer(*featurecode), ast_str_strlen(*featurecode))) {
+ ast_str_reset(*featurecode);
+ }
+ return 0;
+ }
+
+ if (strcmp(disconnect_code, ast_str_buffer(*featurecode))) {
+ ast_str_reset(*featurecode);
+ return 0;
+ }
+
+ return 1;
}
/* returns true if there is a valid privacy reply */
Modified: team/dlee/record/apps/app_userevent.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/app_userevent.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/app_userevent.c (original)
+++ team/dlee/record/apps/app_userevent.c Thu Jun 6 17:05:12 2013
@@ -76,7 +76,6 @@
AST_APP_ARG(extra)[100];
);
RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
- RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "UserEvent requires an argument (eventname,optional event body)\n");
@@ -115,14 +114,7 @@
}
}
- msg = ast_channel_blob_create(
- chan, ast_channel_user_event_type(), blob);
- if (!msg) {
- return -1;
- }
-
- stasis_publish(ast_channel_topic(chan), msg);
-
+ ast_channel_publish_blob(chan, ast_channel_user_event_type(), blob);
return 0;
}
Modified: team/dlee/record/apps/confbridge/confbridge_manager.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/confbridge/confbridge_manager.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/confbridge/confbridge_manager.c (original)
+++ team/dlee/record/apps/confbridge/confbridge_manager.c Thu Jun 6 17:05:12 2013
@@ -206,61 +206,24 @@
header, value);
}
-static void stasis_confbridge_cb(void *data, struct stasis_subscription *sub,
- struct stasis_topic *topic,
- struct stasis_message *message)
+static void confbridge_publish_manager_event(
+ struct stasis_message *message,
+ const char *event,
+ struct ast_str *extra_text)
{
struct ast_bridge_blob *blob = stasis_message_data(message);
- const char *type = ast_bridge_blob_json_type(blob);
const char *conference_name;
- RAII_VAR(struct ast_str *, bridge_text, NULL, ast_free);
+ RAII_VAR(struct ast_str *, bridge_text,
+ ast_manager_build_bridge_state_string(blob->bridge, ""),
+ ast_free);
RAII_VAR(struct ast_str *, channel_text, NULL, ast_free);
- RAII_VAR(struct ast_str *, extra_text, NULL, ast_free);
- char *event;
-
- if (!blob || !type) {
- ast_assert(0);
- return;
- }
-
- if (!strcmp("confbridge_start", type)) {
- event = "ConfbridgeStart";
- } else if (!strcmp("confbridge_end", type)) {
- event = "ConfbridgeEnd";
- } else if (!strcmp("confbridge_leave", type)) {
- event = "ConfbridgeLeave";
- } else if (!strcmp("confbridge_join", type)) {
- event = "ConfbridgeJoin";
- } else if (!strcmp("confbridge_record", type)) {
- event = "ConfbridgeRecord";
- } else if (!strcmp("confbridge_stop_record", type)) {
- event = "ConfbridgeStopRecord";
- } else if (!strcmp("confbridge_mute", type)) {
- event = "ConfbridgeMute";
- } else if (!strcmp("confbridge_unmute", type)) {
- event = "ConfbridgeUnmute";
- } else if (!strcmp("confbridge_talking", type)) {
- const char *talking_status = ast_json_string_get(ast_json_object_get(blob->blob, "talking_status"));
- event = "ConfbridgeTalking";
-
- if (!talking_status) {
- return;
- }
-
- append_event_header(&extra_text, "TalkingStatus", talking_status);
-
- } else {
- return;
- }
+
+ ast_assert(blob != NULL);
+ ast_assert(event != NULL);
conference_name = ast_json_string_get(ast_json_object_get(blob->blob, "conference"));
-
- if (!conference_name) {
- ast_assert(0);
- return;
- }
-
- bridge_text = ast_manager_build_bridge_state_string(blob->bridge, "");
+ ast_assert(conference_name != NULL);
+
if (blob->channel) {
channel_text = ast_manager_build_channel_state_string(blob->channel);
}
@@ -272,20 +235,105 @@
"%s",
conference_name,
ast_str_buffer(bridge_text),
- channel_text ? ast_str_buffer(channel_text) : "",
- extra_text ? ast_str_buffer(extra_text) : "");
-}
-
-static struct stasis_message_type *confbridge_msg_type;
-
-struct stasis_message_type *confbridge_message_type(void)
-{
- return confbridge_msg_type;
-}
+ S_COR(channel_text, ast_str_buffer(channel_text), ""),
+ S_COR(extra_text, ast_str_buffer(extra_text), ""));
+}
+
+static void confbridge_start_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeStart", NULL);
+}
+
+static void confbridge_end_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeEnd", NULL);
+}
+
+static void confbridge_leave_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeLeave", NULL);
+}
+
+static void confbridge_join_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeJoin", NULL);
+}
+
+static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeRecord", NULL);
+}
+
+static void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeStopRecord", NULL);
+}
+
+static void confbridge_mute_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeMute", NULL);
+}
+
+static void confbridge_unmute_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ confbridge_publish_manager_event(message, "ConfbridgeUnmute", NULL);
+}
+
+static void confbridge_talking_cb(void *data, struct stasis_subscription *sub,
+ struct stasis_topic *topic,
+ struct stasis_message *message)
+{
+ RAII_VAR(struct ast_str *, extra_text, NULL, ast_free);
+ struct ast_bridge_blob *blob = stasis_message_data(message);
+ const char *talking_status = ast_json_string_get(ast_json_object_get(blob->blob, "talking_status"));
+ if (!talking_status) {
+ return;
+ }
+
+ append_event_header(&extra_text, "TalkingStatus", talking_status);
+ if (!extra_text) {
+ return;
+ }
+
+ confbridge_publish_manager_event(message, "ConfbridgeTalking", extra_text);
+}
+
+STASIS_MESSAGE_TYPE_DEFN(confbridge_start_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_end_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_join_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_leave_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_start_record_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_stop_record_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_mute_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_unmute_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_talking_type);
void manager_confbridge_shutdown(void) {
- ao2_cleanup(confbridge_msg_type);
- confbridge_msg_type = NULL;
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_start_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_end_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_join_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_leave_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_start_record_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_stop_record_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_mute_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_unmute_type);
+ STASIS_MESSAGE_TYPE_CLEANUP(confbridge_talking_type);
if (bridge_state_router) {
stasis_message_router_unsubscribe(bridge_state_router);
@@ -300,9 +348,15 @@
int manager_confbridge_init(void)
{
- if (!(confbridge_msg_type = stasis_message_type_create("confbridge"))) {
- return -1;
- }
+ STASIS_MESSAGE_TYPE_INIT(confbridge_start_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_end_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_join_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_leave_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_start_record_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_stop_record_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_mute_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_unmute_type);
+ STASIS_MESSAGE_TYPE_INIT(confbridge_talking_type);
bridge_state_router = stasis_message_router_create(
stasis_caching_get_topic(ast_bridge_topic_all_cached()));
@@ -312,9 +366,65 @@
}
if (stasis_message_router_add(bridge_state_router,
- confbridge_message_type(),
- stasis_confbridge_cb,
- NULL)) {
+ confbridge_start_type(),
+ confbridge_start_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_end_type(),
+ confbridge_end_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_join_type(),
+ confbridge_join_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_leave_type(),
+ confbridge_leave_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_start_record_type(),
+ confbridge_start_record_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_stop_record_type(),
+ confbridge_stop_record_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_mute_type(),
+ confbridge_mute_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_unmute_type(),
+ confbridge_unmute_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(bridge_state_router,
+ confbridge_talking_type(),
+ confbridge_talking_cb,
+ NULL)) {
manager_confbridge_shutdown();
return -1;
}
@@ -328,9 +438,65 @@
}
if (stasis_message_router_add(channel_state_router,
- confbridge_message_type(),
- stasis_confbridge_cb,
- NULL)) {
+ confbridge_start_type(),
+ confbridge_start_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_end_type(),
+ confbridge_end_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_join_type(),
+ confbridge_join_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_leave_type(),
+ confbridge_leave_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_start_record_type(),
+ confbridge_start_record_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_stop_record_type(),
+ confbridge_stop_record_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_mute_type(),
+ confbridge_mute_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_unmute_type(),
+ confbridge_unmute_cb,
+ NULL)) {
+ manager_confbridge_shutdown();
+ return -1;
+ }
+ if (stasis_message_router_add(channel_state_router,
+ confbridge_talking_type(),
+ confbridge_talking_cb,
+ NULL)) {
manager_confbridge_shutdown();
return -1;
}
Modified: team/dlee/record/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/apps/confbridge/include/confbridge.h?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/apps/confbridge/include/confbridge.h (original)
+++ team/dlee/record/apps/confbridge/include/confbridge.h Thu Jun 6 17:05:12 2013
@@ -465,12 +465,84 @@
/*!
* \since 12.0
- * \brief get the confbridge stasis message type
- *
- * \retval stasis message type for confbridge messages if it's available
- * \retval NULL if it isn't
- */
-struct stasis_message_type *confbridge_message_type(void);
+ * \brief get the confbridge start stasis message type
+ *
+ * \retval stasis message type for confbridge start messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_start_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge end stasis message type
+ *
+ * \retval stasis message type for confbridge end messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_end_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge join stasis message type
+ *
+ * \retval stasis message type for confbridge join messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_join_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge leave stasis message type
+ *
+ * \retval stasis message type for confbridge leave messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_leave_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge start_record stasis message type
+ *
+ * \retval stasis message type for confbridge start_record messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_start_record_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge stop_record stasis message type
+ *
+ * \retval stasis message type for confbridge stop_record messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_stop_record_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge mute stasis message type
+ *
+ * \retval stasis message type for confbridge mute messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_mute_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge unmute stasis message type
+ *
+ * \retval stasis message type for confbridge unmute messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_unmute_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge talking stasis message type
+ *
+ * \retval stasis message type for confbridge talking messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_talking_type(void);
/*!
* \since 12.0
Modified: team/dlee/record/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/bridges/bridge_builtin_features.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/bridges/bridge_builtin_features.c (original)
+++ team/dlee/record/bridges/bridge_builtin_features.c Thu Jun 6 17:05:12 2013
@@ -49,6 +49,7 @@
#include "asterisk/astobj2.h"
#include "asterisk/pbx.h"
#include "asterisk/parking.h"
+#include "asterisk/features_config.h"
/*!
* \brief Helper function that presents dialtone and grabs extension
@@ -59,6 +60,18 @@
static int grab_transfer(struct ast_channel *chan, char *exten, size_t exten_len, const char *context)
{
int res;
+ int digit_timeout;
+ RAII_VAR(struct ast_features_xfer_config *, xfer_cfg, NULL, ao2_cleanup);
+
+ ast_channel_lock(chan);
+ xfer_cfg = ast_get_chan_features_xfer_config(chan);
+ if (!xfer_cfg) {
+ ast_log(LOG_ERROR, "Unable to get transfer configuration\n");
+ ast_channel_unlock(chan);
+ return -1;
+ }
+ digit_timeout = xfer_cfg->transferdigittimeout;
+ ast_channel_unlock(chan);
/* Play the simple "transfer" prompt out and wait */
res = ast_stream_and_wait(chan, "pbx-transfer", AST_DIGIT_ANY);
@@ -73,8 +86,7 @@
}
/* Drop to dialtone so they can enter the extension they want to transfer to */
-/* BUGBUG the timeout needs to be configurable from features.conf. */
- res = ast_app_dtget(chan, context, exten, exten_len, exten_len - 1, 3000);
+ res = ast_app_dtget(chan, context, exten, exten_len, exten_len - 1, digit_timeout);
if (res < 0) {
/* Hangup or error */
res = -1;
@@ -182,7 +194,8 @@
const char *context;
char *goto_on_blindxfr;
-/* BUGBUG the peer needs to be put on hold for the transfer. */
+ ast_bridge_channel_write_hold(bridge_channel, NULL);
+
ast_channel_lock(bridge_channel->chan);
context = ast_strdupa(get_transfer_context(bridge_channel->chan,
blind_transfer ? blind_transfer->context : NULL));
@@ -192,6 +205,7 @@
/* Grab the extension to transfer to */
if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) {
+ ast_bridge_channel_write_unhold(bridge_channel);
return 0;
}
@@ -263,19 +277,42 @@
struct ast_bridge_features_attended_transfer *attended_transfer = hook_pvt;
const char *context;
enum atxfer_code transfer_code = ATXFER_INCOMPLETE;
+ const char *atxfer_abort;
+ const char *atxfer_threeway;
+ const char *atxfer_complete;
+ const char *fail_sound;
+ RAII_VAR(struct ast_features_xfer_config *, xfer_cfg, NULL, ao2_cleanup);
+
+ ast_bridge_channel_write_hold(bridge_channel, NULL);
bridge = ast_bridge_channel_merge_inhibit(bridge_channel, +1);
-/* BUGBUG the peer needs to be put on hold for the transfer. */
ast_channel_lock(bridge_channel->chan);
context = ast_strdupa(get_transfer_context(bridge_channel->chan,
attended_transfer ? attended_transfer->context : NULL));
+ xfer_cfg = ast_get_chan_features_xfer_config(bridge_channel->chan);
+ if (!xfer_cfg) {
+ ast_log(LOG_ERROR, "Unable to get transfer configuration options\n");
+ ast_channel_unlock(bridge_channel->chan);
+ return 0;
+ }
+ if (attended_transfer) {
+ atxfer_abort = ast_strdupa(S_OR(attended_transfer->abort, xfer_cfg->atxferabort));
+ atxfer_threeway = ast_strdupa(S_OR(attended_transfer->threeway, xfer_cfg->atxferthreeway));
+ atxfer_complete = ast_strdupa(S_OR(attended_transfer->complete, xfer_cfg->atxfercomplete));
+ } else {
+ atxfer_abort = ast_strdupa(xfer_cfg->atxferabort);
+ atxfer_threeway = ast_strdupa(xfer_cfg->atxferthreeway);
+ atxfer_complete = ast_strdupa(xfer_cfg->atxfercomplete);
+ }
+ fail_sound = ast_strdupa(xfer_cfg->xferfailsound);
ast_channel_unlock(bridge_channel->chan);
/* Grab the extension to transfer to */
if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) {
ast_bridge_merge_inhibit(bridge, -1);
ao2_ref(bridge, -1);
+ ast_bridge_channel_write_unhold(bridge_channel);
return 0;
}
@@ -284,35 +321,28 @@
if (!peer) {
ast_bridge_merge_inhibit(bridge, -1);
ao2_ref(bridge, -1);
-/* BUGBUG beeperr needs to be configurable from features.conf */
- ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
- return 0;
- }
-
-/* BUGBUG bridging API features does not support features.conf featuremap */
+ ast_stream_and_wait(bridge_channel->chan, fail_sound, AST_DIGIT_NONE);
+ ast_bridge_channel_write_unhold(bridge_channel);
+ return 0;
+ }
+
/* BUGBUG bridging API features does not support the features.conf atxfer bounce between C & B channels */
/* Setup a DTMF menu to control the transfer. */
if (ast_bridge_features_init(&caller_features)
|| ast_bridge_hangup_hook(&caller_features,
attended_transfer_complete, &transfer_code, NULL, 0)
- || ast_bridge_dtmf_hook(&caller_features,
- attended_transfer && !ast_strlen_zero(attended_transfer->abort)
- ? attended_transfer->abort : "*1",
+ || ast_bridge_dtmf_hook(&caller_features, atxfer_abort,
attended_transfer_abort, &transfer_code, NULL, 0)
- || ast_bridge_dtmf_hook(&caller_features,
- attended_transfer && !ast_strlen_zero(attended_transfer->complete)
- ? attended_transfer->complete : "*2",
+ || ast_bridge_dtmf_hook(&caller_features, atxfer_complete,
attended_transfer_complete, &transfer_code, NULL, 0)
- || ast_bridge_dtmf_hook(&caller_features,
- attended_transfer && !ast_strlen_zero(attended_transfer->threeway)
- ? attended_transfer->threeway : "*3",
+ || ast_bridge_dtmf_hook(&caller_features, atxfer_threeway,
attended_transfer_threeway, &transfer_code, NULL, 0)) {
ast_bridge_features_cleanup(&caller_features);
ast_hangup(peer);
ast_bridge_merge_inhibit(bridge, -1);
ao2_ref(bridge, -1);
-/* BUGBUG beeperr needs to be configurable from features.conf */
- ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+ ast_stream_and_wait(bridge_channel->chan, fail_sound, AST_DIGIT_NONE);
+ ast_bridge_channel_write_unhold(bridge_channel);
return 0;
}
@@ -324,8 +354,8 @@
ast_hangup(peer);
ast_bridge_merge_inhibit(bridge, -1);
ao2_ref(bridge, -1);
-/* BUGBUG beeperr needs to be configurable from features.conf */
- ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+ ast_stream_and_wait(bridge_channel->chan, fail_sound, AST_DIGIT_NONE);
+ ast_bridge_channel_write_unhold(bridge_channel);
return 0;
}
ast_bridge_merge_inhibit(attended_bridge, +1);
@@ -338,8 +368,8 @@
ast_hangup(peer);
ast_bridge_merge_inhibit(bridge, -1);
ao2_ref(bridge, -1);
-/* BUGBUG beeperr needs to be configurable from features.conf */
- ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+ ast_stream_and_wait(bridge_channel->chan, fail_sound, AST_DIGIT_NONE);
+ ast_bridge_channel_write_unhold(bridge_channel);
return 0;
}
@@ -384,6 +414,7 @@
break;
case ATXFER_COMPLETE:
/* The peer takes our place in the bridge. */
+ ast_bridge_channel_write_unhold(bridge_channel);
ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP);
xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, bridge_channel->chan, NULL, 1);
break;
@@ -394,6 +425,7 @@
* Just impart the peer onto the bridge and have us return to it
* as normal.
*/
+ ast_bridge_channel_write_unhold(bridge_channel);
xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, NULL, NULL, 1);
break;
case ATXFER_ABORT:
@@ -405,8 +437,9 @@
if (xfer_failed) {
ast_hangup(peer);
if (!ast_check_hangup_locked(bridge_channel->chan)) {
- ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+ ast_stream_and_wait(bridge_channel->chan, fail_sound, AST_DIGIT_NONE);
}
+ ast_bridge_channel_write_unhold(bridge_channel);
}
return 0;
Modified: team/dlee/record/bridges/bridge_builtin_interval_features.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/bridges/bridge_builtin_interval_features.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/bridges/bridge_builtin_interval_features.c (original)
+++ team/dlee/record/bridges/bridge_builtin_interval_features.c Thu Jun 6 17:05:12 2013
@@ -146,7 +146,8 @@
ast_string_field_set(dst, connect_sound, src->connect_sound);
}
-static int bridge_builtin_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull)
+static int bridge_builtin_set_limits(struct ast_bridge_features *features,
+ struct ast_bridge_features_limits *limits, enum ast_bridge_hook_remove_flags remove_flags)
{
struct ast_bridge_features_limits *feature_limits;
@@ -173,7 +174,7 @@
/* BUGBUG feature interval hooks need to be reimplemented to be more stand alone. */
if (ast_bridge_interval_hook(features, feature_limits->duration,
- bridge_features_duration_callback, feature_limits, NULL, remove_on_pull)) {
+ bridge_features_duration_callback, feature_limits, NULL, remove_flags)) {
ast_log(LOG_ERROR, "Failed to schedule the duration limiter to the bridge channel.\n");
return -1;
}
@@ -182,14 +183,14 @@
if (!ast_strlen_zero(feature_limits->connect_sound)) {
if (ast_bridge_interval_hook(features, 1,
- bridge_features_connect_callback, feature_limits, NULL, remove_on_pull)) {
+ bridge_features_connect_callback, feature_limits, NULL, remove_flags)) {
ast_log(LOG_WARNING, "Failed to schedule connect sound to the bridge channel.\n");
}
}
if (feature_limits->warning && feature_limits->warning < feature_limits->duration) {
if (ast_bridge_interval_hook(features, feature_limits->duration - feature_limits->warning,
- bridge_features_warning_callback, feature_limits, NULL, remove_on_pull)) {
+ bridge_features_warning_callback, feature_limits, NULL, remove_flags)) {
ast_log(LOG_WARNING, "Failed to schedule warning sound playback to the bridge channel.\n");
}
}
Modified: team/dlee/record/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/bridges/bridge_native_rtp.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/bridges/bridge_native_rtp.c (original)
+++ team/dlee/record/bridges/bridge_native_rtp.c Thu Jun 6 17:05:12 2013
@@ -18,7 +18,7 @@
/*! \file
*
- * \brief Native RTP bridging module
+ * \brief Native RTP bridging technology module
*
* \author Joshua Colp <jcolp at digium.com>
*
@@ -251,15 +251,21 @@
}
ast_channel_lock(bridge_channel->chan);
-
- if (!(data->id = ast_framehook_attach(bridge_channel->chan, &hook)) < 0) {
- ast_channel_unlock(bridge_channel->chan);
+ data->id = ast_framehook_attach(bridge_channel->chan, &hook);
+ ast_channel_unlock(bridge_channel->chan);
+ if (!data->id < 0) {
ao2_cleanup(data);
return -1;
}
- ast_channel_unlock(bridge_channel->chan);
-
+/*
+ * BUGBUG The RTP native bridge technology should use tech_pvt not bridge_pvt.
+ *
+ * This technology needs to be reworked to not change the
+ * tech_pvt of channels other than the one that is currently
+ * entering/leaving before it can actually use the correct
+ * pointer.
+ */
bridge_channel->bridge_pvt = data;
return 0;
Modified: team/dlee/record/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/channels/chan_dahdi.c?view=diff&rev=390757&r1=390756&r2=390757
==============================================================================
--- team/dlee/record/channels/chan_dahdi.c (original)
+++ team/dlee/record/channels/chan_dahdi.c Thu Jun 6 17:05:12 2013
@@ -130,6 +130,7 @@
#include "asterisk/paths.h"
#include "asterisk/ccss.h"
#include "asterisk/data.h"
+#include "asterisk/features_config.h"
/*** DOCUMENTATION
<application name="DAHDISendKeypadFacility" language="en_US">
@@ -1554,6 +1555,7 @@
static int dahdi_cc_callback(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback);
[... 7858 lines stripped ...]
More information about the asterisk-commits
mailing list