[asterisk-commits] mmichelson: branch mmichelson/transfer_stasis r393181 - in /team/mmichelson/t...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 28 13:28:47 CDT 2013
Author: mmichelson
Date: Fri Jun 28 13:28:34 2013
New Revision: 393181
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393181
Log:
Get up to date and reset automerge.
Modified:
team/mmichelson/transfer_stasis/ (props changed)
team/mmichelson/transfer_stasis/CHANGES
team/mmichelson/transfer_stasis/Makefile
team/mmichelson/transfer_stasis/apps/app_celgenuserevent.c
team/mmichelson/transfer_stasis/apps/app_dial.c
team/mmichelson/transfer_stasis/apps/app_queue.c
team/mmichelson/transfer_stasis/apps/app_stasis.c
team/mmichelson/transfer_stasis/apps/confbridge/conf_chan_announce.c
team/mmichelson/transfer_stasis/channels/chan_motif.c
team/mmichelson/transfer_stasis/channels/chan_sip.c
team/mmichelson/transfer_stasis/doc/appdocsxml.dtd
team/mmichelson/transfer_stasis/funcs/func_channel.c
team/mmichelson/transfer_stasis/include/asterisk/bridging.h
team/mmichelson/transfer_stasis/include/asterisk/cdr.h
team/mmichelson/transfer_stasis/include/asterisk/cel.h
team/mmichelson/transfer_stasis/include/asterisk/config_options.h
team/mmichelson/transfer_stasis/include/asterisk/features.h
team/mmichelson/transfer_stasis/include/asterisk/parking.h
team/mmichelson/transfer_stasis/include/asterisk/sorcery.h
team/mmichelson/transfer_stasis/include/asterisk/stasis_app.h
team/mmichelson/transfer_stasis/include/asterisk/stasis_channels.h
team/mmichelson/transfer_stasis/main/asterisk.c
team/mmichelson/transfer_stasis/main/bridging.c
team/mmichelson/transfer_stasis/main/cdr.c
team/mmichelson/transfer_stasis/main/cel.c
team/mmichelson/transfer_stasis/main/config_options.c
team/mmichelson/transfer_stasis/main/devicestate.c
team/mmichelson/transfer_stasis/main/features.c
team/mmichelson/transfer_stasis/main/features_config.c
team/mmichelson/transfer_stasis/main/http.c
team/mmichelson/transfer_stasis/main/manager.c
team/mmichelson/transfer_stasis/main/named_acl.c
team/mmichelson/transfer_stasis/main/parking.c
team/mmichelson/transfer_stasis/main/presencestate.c
team/mmichelson/transfer_stasis/main/sorcery.c
team/mmichelson/transfer_stasis/main/stasis_bridging.c
team/mmichelson/transfer_stasis/main/stasis_channels.c
team/mmichelson/transfer_stasis/res/parking/parking_applications.c
team/mmichelson/transfer_stasis/res/parking/parking_bridge.c
team/mmichelson/transfer_stasis/res/parking/parking_bridge_features.c
team/mmichelson/transfer_stasis/res/parking/parking_controller.c
team/mmichelson/transfer_stasis/res/parking/parking_manager.c
team/mmichelson/transfer_stasis/res/parking/res_parking.h
team/mmichelson/transfer_stasis/res/res_calendar.c
team/mmichelson/transfer_stasis/res/res_chan_stats.c
team/mmichelson/transfer_stasis/res/res_parking.c
team/mmichelson/transfer_stasis/res/res_sip/sip_options.c
team/mmichelson/transfer_stasis/res/res_stasis.c
team/mmichelson/transfer_stasis/res/res_stasis_answer.c
team/mmichelson/transfer_stasis/res/res_stasis_bridge_add.c
team/mmichelson/transfer_stasis/res/res_stasis_http.c
team/mmichelson/transfer_stasis/res/res_stasis_http_asterisk.c
team/mmichelson/transfer_stasis/res/res_stasis_http_bridges.c
team/mmichelson/transfer_stasis/res/res_stasis_http_channels.c
team/mmichelson/transfer_stasis/res/res_stasis_http_endpoints.c
team/mmichelson/transfer_stasis/res/res_stasis_http_events.c
team/mmichelson/transfer_stasis/res/res_stasis_http_playback.c
team/mmichelson/transfer_stasis/res/res_stasis_http_recordings.c
team/mmichelson/transfer_stasis/res/res_stasis_http_sounds.c
team/mmichelson/transfer_stasis/res/res_stasis_json_asterisk.c
team/mmichelson/transfer_stasis/res/res_stasis_json_bridges.c
team/mmichelson/transfer_stasis/res/res_stasis_json_channels.c
team/mmichelson/transfer_stasis/res/res_stasis_json_endpoints.c
team/mmichelson/transfer_stasis/res/res_stasis_json_events.c
team/mmichelson/transfer_stasis/res/res_stasis_json_playback.c
team/mmichelson/transfer_stasis/res/res_stasis_json_recordings.c
team/mmichelson/transfer_stasis/res/res_stasis_json_sounds.c
team/mmichelson/transfer_stasis/res/res_stasis_playback.c
team/mmichelson/transfer_stasis/res/res_stasis_test.c
team/mmichelson/transfer_stasis/res/res_stasis_websocket.c
team/mmichelson/transfer_stasis/res/res_statsd.c
team/mmichelson/transfer_stasis/res/stasis/control.c
team/mmichelson/transfer_stasis/res/stasis_http/resource_channels.c
team/mmichelson/transfer_stasis/res/stasis_http/resource_channels.h
team/mmichelson/transfer_stasis/res/stasis_json/resource_sounds.h
team/mmichelson/transfer_stasis/rest-api-templates/res_stasis_http_resource.c.mustache
team/mmichelson/transfer_stasis/rest-api-templates/res_stasis_json_resource.c.mustache
team/mmichelson/transfer_stasis/rest-api/api-docs/channels.json
team/mmichelson/transfer_stasis/tests/test_cdr.c
team/mmichelson/transfer_stasis/tests/test_endpoints.c
team/mmichelson/transfer_stasis/tests/test_stasis_endpoints.c
Propchange: team/mmichelson/transfer_stasis/
------------------------------------------------------------------------------
automerge = *
Propchange: team/mmichelson/transfer_stasis/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/mmichelson/transfer_stasis/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 28 13:28:34 2013
@@ -1,1 +1,1 @@
-/trunk:1-392709
+/trunk:1-393171
Modified: team/mmichelson/transfer_stasis/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/CHANGES?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/CHANGES (original)
+++ team/mmichelson/transfer_stasis/CHANGES Fri Jun 28 13:28:34 2013
@@ -329,6 +329,11 @@
* The AMI command 'ParkedCalls' will now accept a 'ParkingLot' argument which
can be used to get a list of parked calls only for a specific parking lot.
+
+ * The AMI command 'Park' has had the argument 'Channel2' renamed to
+ 'TimeoutChannel'. 'TimeoutChannel' is no longer a required argument.
+ 'Channel2' can still be used as the argument name, but it is deprecated
+ and the 'TimeoutChannel' argument will be used if both are present.
* The ParkAndAnnounce application is now provided through res_parking instead
of through the separate app_parkandannounce module.
Modified: team/mmichelson/transfer_stasis/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/Makefile?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/Makefile (original)
+++ team/mmichelson/transfer_stasis/Makefile Fri Jun 28 13:28:34 2013
@@ -476,7 +476,7 @@
@echo "</docs>" >> $@
ifneq ($(GREP),)
- XMX_full_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ XML_full_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
endif
doc/full-en_US.xml: makeopts .lastclean $(XML_full_en_US)
Modified: team/mmichelson/transfer_stasis/apps/app_celgenuserevent.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/apps/app_celgenuserevent.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/apps/app_celgenuserevent.c (original)
+++ team/mmichelson/transfer_stasis/apps/app_celgenuserevent.c Fri Jun 28 13:28:34 2013
@@ -62,6 +62,7 @@
{
int res = 0;
char *parse;
+ RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(event);
AST_APP_ARG(extra);
@@ -74,7 +75,13 @@
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
- ast_cel_report_event(chan, AST_CEL_USER_DEFINED, args.event, args.extra, NULL);
+ blob = ast_json_pack("{s: s, s: s}",
+ "event", args.event,
+ "extra", args.extra);
+ if (!blob) {
+ return res;
+ }
+ ast_cel_publish_event(chan, AST_CEL_USER_DEFINED, blob);
return res;
}
Modified: team/mmichelson/transfer_stasis/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/apps/app_dial.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/apps/app_dial.c (original)
+++ team/mmichelson/transfer_stasis/apps/app_dial.c Fri Jun 28 13:28:34 2013
@@ -859,8 +859,6 @@
ast_clear_flag64(o, OPT_IGNORE_CONNECTEDLINE);
}
- ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(c), NULL);
-
/* Before processing channel, go ahead and check for forwarding */
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", ast_channel_name(in), tech, stuff, ast_channel_name(c));
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
@@ -1004,7 +1002,8 @@
ast_channel_unlock(c);
ast_channel_lock_both(original, in);
- ast_channel_publish_dial(in, original, NULL, "CANCEL");
+ ast_channel_publish_dial_forward(in, original, NULL, "CANCEL",
+ ast_channel_call_forward(c));
ast_channel_unlock(in);
ast_channel_unlock(original);
Modified: team/mmichelson/transfer_stasis/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/apps/app_queue.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/apps/app_queue.c (original)
+++ team/mmichelson/transfer_stasis/apps/app_queue.c Fri Jun 28 13:28:34 2013
@@ -4449,8 +4449,6 @@
o->block_connected_update = 0;
}
- ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(o->chan), NULL);
-
ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
/* Setup parameters */
o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &status);
@@ -4544,7 +4542,8 @@
ast_channel_unlock(qe->chan);
ast_channel_lock_both(qe->chan, original);
- ast_channel_publish_dial(qe->chan, original, NULL, "CANCEL");
+ ast_channel_publish_dial_forward(qe->chan, original, NULL, "CANCEL",
+ ast_channel_call_forward(original));
ast_channel_unlock(original);
ast_channel_unlock(qe->chan);
/* Hangup the original channel now, in case we needed it */
Modified: team/mmichelson/transfer_stasis/apps/app_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/apps/app_stasis.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/apps/app_stasis.c (original)
+++ team/mmichelson/transfer_stasis/apps/app_stasis.c Fri Jun 28 13:28:34 2013
@@ -106,9 +106,7 @@
return r;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY,
- AST_MODFLAG_DEFAULT,
- "Stasis dialplan application",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Stasis dialplan application",
.load = load_module,
.unload = unload_module,
.nonoptreq = "res_stasis",
Modified: team/mmichelson/transfer_stasis/apps/confbridge/conf_chan_announce.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/apps/confbridge/conf_chan_announce.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/apps/confbridge/conf_chan_announce.c (original)
+++ team/mmichelson/transfer_stasis/apps/confbridge/conf_chan_announce.c Fri Jun 28 13:28:34 2013
@@ -172,8 +172,8 @@
int conf_announce_channel_push(struct ast_channel *ast)
{
struct ast_bridge_features *features;
+ struct ast_channel *chan;
RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
- RAII_VAR(struct ast_channel *, chan, NULL, ast_channel_unref);
{
SCOPED_CHANNELLOCK(lock, ast);
@@ -192,12 +192,15 @@
features = ast_bridge_features_new();
if (!features) {
+ ast_channel_unref(chan);
return -1;
}
ast_set_flag(&features->feature_flags, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE);
/* Impart the output channel into the bridge */
if (ast_bridge_impart(p->bridge, chan, NULL, features, 0)) {
+ ast_bridge_features_destroy(features);
+ ast_channel_unref(chan);
return -1;
}
ao2_lock(p);
Modified: team/mmichelson/transfer_stasis/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/channels/chan_motif.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/channels/chan_motif.c (original)
+++ team/mmichelson/transfer_stasis/channels/chan_motif.c Fri Jun 28 13:28:34 2013
@@ -2711,9 +2711,9 @@
aco_option_register_custom(&cfg_info, "connection", ACO_EXACT, endpoint_options, NULL, custom_connection_handler, 0);
aco_option_register_custom(&cfg_info, "transport", ACO_EXACT, endpoint_options, NULL, custom_transport_handler, 0);
aco_option_register(&cfg_info, "maxicecandidates", ACO_EXACT, endpoint_options, DEFAULT_MAX_ICE_CANDIDATES, OPT_UINT_T, PARSE_DEFAULT,
- FLDSET(struct jingle_endpoint, maxicecandidates));
+ FLDSET(struct jingle_endpoint, maxicecandidates), DEFAULT_MAX_ICE_CANDIDATES);
aco_option_register(&cfg_info, "maxpayloads", ACO_EXACT, endpoint_options, DEFAULT_MAX_PAYLOADS, OPT_UINT_T, PARSE_DEFAULT,
- FLDSET(struct jingle_endpoint, maxpayloads));
+ FLDSET(struct jingle_endpoint, maxpayloads), DEFAULT_MAX_PAYLOADS);
ast_format_cap_add_all_by_type(jingle_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
@@ -2764,6 +2764,8 @@
static int unload_module(void)
{
ast_channel_unregister(&jingle_tech);
+ ast_format_cap_destroy(jingle_tech.capabilities);
+ jingle_tech.capabilities = NULL;
ast_rtp_glue_unregister(&jingle_rtp_glue);
ast_sched_context_destroy(sched);
aco_info_destroy(&cfg_info);
Modified: team/mmichelson/transfer_stasis/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/channels/chan_sip.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/channels/chan_sip.c (original)
+++ team/mmichelson/transfer_stasis/channels/chan_sip.c Fri Jun 28 13:28:34 2013
@@ -24777,8 +24777,8 @@
static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req,
int *nounlock, struct sip_pvt *replaces_pvt, struct ast_channel *replaces_chan)
{
+ struct ast_channel *c;
RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);
- RAII_VAR(struct ast_channel *, c, NULL, ao2_cleanup);
if (req->ignore) {
return 0;
@@ -24813,7 +24813,9 @@
ast_channel_unlock(replaces_chan);
if (bridge) {
- ast_bridge_impart(bridge, c, replaces_chan, NULL, 1);
+ if (ast_bridge_impart(bridge, c, replaces_chan, NULL, 1)) {
+ ast_hangup(c);
+ }
} else {
ast_channel_move(replaces_chan, c);
ast_hangup(c);
Modified: team/mmichelson/transfer_stasis/doc/appdocsxml.dtd
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/doc/appdocsxml.dtd?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/doc/appdocsxml.dtd (original)
+++ team/mmichelson/transfer_stasis/doc/appdocsxml.dtd Fri Jun 28 13:28:34 2013
@@ -71,7 +71,7 @@
<!ELEMENT see-also (ref|xi:include)*>
<!ELEMENT ref (#PCDATA)>
- <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi|manager|managerEvent) #REQUIRED>
+ <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi|manager|managerEvent|configOption) #REQUIRED>
<!ATTLIST ref module CDATA #IMPLIED>
<!ELEMENT synopsis (#PCDATA)>
Modified: team/mmichelson/transfer_stasis/funcs/func_channel.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/funcs/func_channel.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/funcs/func_channel.c (original)
+++ team/mmichelson/transfer_stasis/funcs/func_channel.c Fri Jun 28 13:28:34 2013
@@ -37,6 +37,7 @@
#include "asterisk/module.h"
#include "asterisk/channel.h"
+#include "asterisk/bridging.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
@@ -118,6 +119,12 @@
<enum name="checkhangup">
<para>R/O Whether the channel is hanging up (1/0)</para>
</enum>
+ <enum name="after_bridge_goto">
+ <para>R/W the parseable goto string indicating where the channel is
+ expected to return to in the PBX after exiting the next bridge it joins
+ on the condition that it doesn't hang up. The parseable goto string uses
+ the same syntax as the <literal>Goto</literal> application.</para>
+ </enum>
<enum name="hangup_handler_pop">
<para>W/O Replace the most recently added hangup handler
with a new hangup handler on the channel if supplied. The
@@ -475,6 +482,8 @@
struct ast_str *tmp_str = ast_str_alloca(1024);
locked_copy_string(chan, buf, ast_print_namedgroups(&tmp_str, ast_channel_named_pickupgroups(chan)), len);
+ } else if (!strcasecmp(data, "after_bridge_goto")) {
+ ast_after_bridge_goto_read(chan, buf, len);
} else if (!strcasecmp(data, "amaflags")) {
ast_channel_lock(chan);
snprintf(buf, len, "%d", ast_channel_amaflags(chan));
@@ -516,7 +525,13 @@
locked_string_field_set(chan, accountcode, value);
else if (!strcasecmp(data, "userfield"))
locked_string_field_set(chan, userfield, value);
- else if (!strcasecmp(data, "amaflags")) {
+ else if (!strcasecmp(data, "after_bridge_goto")) {
+ if (ast_strlen_zero(value)) {
+ ast_after_bridge_goto_discard(chan);
+ } else {
+ ast_after_bridge_set_go_on(chan, ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), value);
+ }
+ } else if (!strcasecmp(data, "amaflags")) {
ast_channel_lock(chan);
if (isdigit(*value)) {
int amaflags;
Modified: team/mmichelson/transfer_stasis/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/bridging.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/bridging.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/bridging.h Fri Jun 28 13:28:34 2013
@@ -654,7 +654,7 @@
* \brief Impart (non-blocking) a channel onto a bridge
*
* \param bridge Bridge to impart on
- * \param chan Channel to impart
+ * \param chan Channel to impart (The channel reference is stolen if impart successful.)
* \param swap Channel to swap out if swapping. NULL if not swapping.
* \param features Bridge features structure.
* \param independent TRUE if caller does not want to reclaim the channel using ast_bridge_depart().
@@ -1634,6 +1634,16 @@
* \return Nothing
*/
void ast_after_bridge_goto_discard(struct ast_channel *chan);
+
+/*!
+ * \brief Read after bridge goto if it exists
+ * \since 12.0.0
+ *
+ * \param chan Channel to read the after bridge goto parseable goto string from
+ * \param buffer Buffer to write the after bridge goto data to
+ * \param buf_size size of the buffer being written to
+ */
+void ast_after_bridge_goto_read(struct ast_channel *chan, char *buffer, size_t buf_size);
/*! Reason the the after bridge callback will not be called. */
enum ast_after_bridge_cb_reason {
Modified: team/mmichelson/transfer_stasis/include/asterisk/cdr.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/cdr.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/cdr.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/cdr.h Fri Jun 28 13:28:34 2013
@@ -99,6 +99,9 @@
* has hung up, the state transitions to Finalized
* \li If a \ref ast_bridge_blob_type is received indicating a Bridge Enter, the
* state transitions to Bridge
+ * \li If a \ref ast_bridge_blob_type message indicating an entrance to a
+ * holding bridge with a subclass type of "parking" is received, the CDR is
+ * transitioned to the Parked state.
*
* \par Dial
*
@@ -138,6 +141,9 @@
* if we have a Party B. Otherwise, we transition to the Single state.
* \li If a \ref ast_bridge_blob_type is received indicating a Bridge Enter, the
* state transitions to Bridge (through the Dial state)
+ * \li If a \ref ast_bridge_blob_type message indicating an entrance to a
+ * holding bridge with a subclass type of "parking" is received, the CDR is
+ * transitioned to the Parked state.
*
* \par Bridge
*
@@ -174,6 +180,31 @@
* \li If a \ref ast_bridge_blob_type message indicating a leave is received,
* the state transitions to the Pending state
*
+ * \par Parked
+ *
+ * Parking is technically just another bridge in the Asterisk bridging
+ * framework. Unlike other bridges, however there are several key distinctions:
+ * \li With normal bridges, you want to show paths of communication between
+ * the participants. In parking, however, each participant is independent.
+ * From the perspective of a CDR, a call in parking should look like a dialplan
+ * application just executed.
+ * \li Holding bridges are typically items using in more complex applications,
+ * and so we usually don't want to show them. However, with Park, there is no
+ * application execution - often, a channel will be put directly into the
+ * holding bridge, bypassing the dialplan. This occurs when a call is blind
+ * transferred to a parking extension.
+ *
+ * As such, if a channel enters a bridge and that happens to be a holding bridge
+ * with a subclass type of "parking", we transition the CDR into the Parked
+ * state. The parking Stasis message updates the application name and data to
+ * reflect that the channel is in parking. When this occurs, a special flag is
+ * set on the CDR that prevents the application name from being updates by
+ * subsequent channel snapshot updates.
+ *
+ * The following transitions can occur while in the Parked state:
+ * \li If a \ref ast_bridge_blob_type message indicating a leave is received,
+ * the state transitions to the Pending state
+ *
* \par Pending
*
* After a channel leaves a bridge, we often don't know what's going to happen
@@ -190,6 +221,9 @@
* Context/Extension/Priority, a new CDR is created and transitioned to the
* Single state. If the update indicates that the party has been hung up, the
* CDR is transitioned to the Finalized state.
+ * \li If a \ref ast_bridge_blob_type message indicating an entrance to a
+ * holding bridge with a subclass type of "parking" is received, the CDR is
+ * transitioned to the Parked state.
*
* \par Finalized
*
@@ -203,19 +237,19 @@
/*! \brief CDR engine settings */
enum ast_cdr_settings {
- CDR_ENABLED = 1 << 0, /*< Enable CDRs */
- CDR_BATCHMODE = 1 << 1, /*< Whether or not we should dispatch CDRs in batches */
- CDR_UNANSWERED = 1 << 2, /*< Log unanswered CDRs */
- CDR_CONGESTION = 1 << 3, /*< Treat congestion as if it were a failed call */
- CDR_END_BEFORE_H_EXTEN = 1 << 4, /*< End the CDR before the 'h' extension runs */
- CDR_INITIATED_SECONDS = 1 << 5, /*< Include microseconds into the billing time */
- CDR_DEBUG = 1 << 6, /*< Enables extra debug statements */
+ CDR_ENABLED = 1 << 0, /*< Enable CDRs */
+ CDR_BATCHMODE = 1 << 1, /*< Whether or not we should dispatch CDRs in batches */
+ CDR_UNANSWERED = 1 << 2, /*< Log unanswered CDRs */
+ CDR_CONGESTION = 1 << 3, /*< Treat congestion as if it were a failed call */
+ CDR_END_BEFORE_H_EXTEN = 1 << 4, /*< End the CDR before the 'h' extension runs */
+ CDR_INITIATED_SECONDS = 1 << 5, /*< Include microseconds into the billing time */
+ CDR_DEBUG = 1 << 6, /*< Enables extra debug statements */
};
/*! \brief CDR Batch Mode settings */
enum ast_cdr_batch_mode_settings {
- BATCH_MODE_SCHEDULER_ONLY = 1 << 0, /*< Don't spawn a thread to handle the batches - do it on the scheduler */
- BATCH_MODE_SAFE_SHUTDOWN = 1 << 1, /*< During safe shutdown, submit the batched CDRs */
+ BATCH_MODE_SCHEDULER_ONLY = 1 << 0, /*< Don't spawn a thread to handle the batches - do it on the scheduler */
+ BATCH_MODE_SAFE_SHUTDOWN = 1 << 1, /*< During safe shutdown, submit the batched CDRs */
};
/*!
@@ -223,24 +257,25 @@
* state of a CDR object based on these flags.
*/
enum ast_cdr_options {
- AST_CDR_FLAG_KEEP_VARS = (1 << 0), /*< Copy variables during the operation */
- AST_CDR_FLAG_DISABLE = (1 << 1), /*< Disable the current CDR */
- AST_CDR_FLAG_DISABLE_ALL = (3 << 1), /*< Disable the CDR and all future CDRs */
- AST_CDR_FLAG_PARTY_A = (1 << 3), /*< Set the channel as party A */
- AST_CDR_FLAG_FINALIZE = (1 << 4), /*< Finalize the current CDRs */
- AST_CDR_FLAG_SET_ANSWER = (1 << 5), /*< If the channel is answered, set the answer time to now */
- AST_CDR_FLAG_RESET = (1 << 6), /*< If set, set the start and answer time to now */
+ AST_CDR_FLAG_KEEP_VARS = (1 << 0), /*< Copy variables during the operation */
+ AST_CDR_FLAG_DISABLE = (1 << 1), /*< Disable the current CDR */
+ AST_CDR_FLAG_DISABLE_ALL = (3 << 1), /*< Disable the CDR and all future CDRs */
+ AST_CDR_FLAG_PARTY_A = (1 << 3), /*< Set the channel as party A */
+ AST_CDR_FLAG_FINALIZE = (1 << 4), /*< Finalize the current CDRs */
+ AST_CDR_FLAG_SET_ANSWER = (1 << 5), /*< If the channel is answered, set the answer time to now */
+ AST_CDR_FLAG_RESET = (1 << 6), /*< If set, set the start and answer time to now */
+ AST_CDR_LOCK_APP = (1 << 7), /*< Prevent any further changes to the application field/data field for this CDR */
};
/*!
* \brief CDR Flags - Disposition
*/
enum ast_cdr_disposition {
- AST_CDR_NOANSWER = 0,
- AST_CDR_NULL = (1 << 0),
- AST_CDR_FAILED = (1 << 1),
- AST_CDR_BUSY = (1 << 2),
- AST_CDR_ANSWERED = (1 << 3),
+ AST_CDR_NOANSWER = 0,
+ AST_CDR_NULL = (1 << 0),
+ AST_CDR_FAILED = (1 << 1),
+ AST_CDR_BUSY = (1 << 2),
+ AST_CDR_ANSWERED = (1 << 3),
AST_CDR_CONGESTION = (1 << 4),
};
Modified: team/mmichelson/transfer_stasis/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/cel.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/cel.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/cel.h Fri Jun 28 13:28:34 2013
@@ -83,8 +83,6 @@
AST_CEL_USER_DEFINED = 21,
/*! \brief the last channel with the given linkedid is retired */
AST_CEL_LINKEDID_END = 22,
- /*! \brief a masquerade happened to alter the participants on a bridge */
- AST_CEL_BRIDGE_UPDATE = 23,
/*! \brief a directed pickup was performed on this channel */
AST_CEL_PICKUP = 24,
/*! \brief this call was forwarded somewhere else */
@@ -245,6 +243,26 @@
*/
int ast_cel_fill_record(const struct ast_event *event, struct ast_cel_event_record *r);
+/*!
+ * \brief Publish a CEL event
+ * \since 12
+ *
+ * \param chan This is the primary channel associated with this channel event.
+ * \param event_type This is the type of call event being reported.
+ * \param blob This contains any additional parameters that need to be conveyed for this event.
+ */
+void ast_cel_publish_event(struct ast_channel *chan,
+ enum ast_cel_event_type event_type,
+ struct ast_json *blob);
+
+/*!
+ * \brief Get the CEL topic
+ *
+ * \retval The CEL topic
+ * \retval NULL if not allocated
+ */
+struct stasis_topic *ast_cel_topic(void);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
Modified: team/mmichelson/transfer_stasis/include/asterisk/config_options.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/config_options.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/config_options.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/config_options.h Fri Jun 28 13:28:34 2013
@@ -265,7 +265,7 @@
* struct test_item {
* int enabled;
* };
- aco_option_register(&cfg_info, "enabled", ACO_EXACT, my_types, "no", OPT_BOOL_T, 1, FLDSET(struct test_item, enabled));
+ * aco_option_register(&cfg_info, "enabled", ACO_EXACT, my_types, "no", OPT_BOOL_T, 1, FLDSET(struct test_item, enabled));
* {endcode}
*/
OPT_BOOL_T,
@@ -284,13 +284,15 @@
* struct test_item {
* unsigned int flags;
* };
- aco_option_register(&cfg_info, "quiet", ACO_EXACT, my_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct test_item, flags), MY_TYPE_ISQUIET);
- * {endcode}
- */
-
+ * aco_option_register(&cfg_info, "quiet", ACO_EXACT, my_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct test_item, flags), MY_TYPE_ISQUIET);
+ * {endcode}
+ */
OPT_BOOLFLAG_T,
- /*! \brief Type for default option handler for character arrays
+ /*! \brief Type for default option handler for character array strings
+ * \note aco_option_register flags:
+ * non-zero : String cannot be empty.
+ * 0 : String can be empty.
* \note aco_option_register varargs:
* CHARFLDSET macro with a field of type char[]
*
@@ -299,7 +301,7 @@
* struct test_item {
* char description[128];
* };
- * aco_option_register(&cfg_info, "description", ACO_EXACT, my_types, "none", OPT_CHAR_ARRAY_T, CHARFLDSET(struct test_item, description));
+ * aco_option_register(&cfg_info, "description", ACO_EXACT, my_types, "none", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct test_item, description));
* {endcode}
*/
OPT_CHAR_ARRAY_T,
@@ -338,7 +340,7 @@
* double dub;
* };
* {code}
- * aco_option_register(&cfg_info, "doubleopt", ACO_EXACT, my_types, "3", OPT_DOUBLE_T, FLDSET(struct test_item, dub));
+ * aco_option_register(&cfg_info, "doubleopt", ACO_EXACT, my_types, "3", OPT_DOUBLE_T, 0, FLDSET(struct test_item, dub));
* {endcode}
*/
OPT_DOUBLE_T,
@@ -393,7 +395,8 @@
/*! \brief Type for default option handler for stringfields
* \note aco_option_register flags:
- * none
+ * non-zero : String cannot be empty.
+ * 0 : String can be empty.
* aco_option_register varargs:
* STRFLDSET macro with the field being the field created by AST_STRING_FIELD
*
Modified: team/mmichelson/transfer_stasis/include/asterisk/features.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/features.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/features.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/features.h Fri Jun 28 13:28:34 2013
@@ -17,7 +17,7 @@
*/
/*! \file
- * \brief Call Parking and Pickup API
+ * \brief Call Parking and Pickup API
* Includes code and algorithms from the Zapata library.
*/
@@ -26,6 +26,7 @@
#include "asterisk/pbx.h"
#include "asterisk/linkedlists.h"
+#include "asterisk/bridging.h"
#define FEATURE_MAX_LEN 11
#define FEATURE_APP_LEN 64
@@ -168,6 +169,33 @@
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
/*!
+ * \brief Add an arbitrary channel to a bridge
+ * \since 12.0.0
+ *
+ * The channel that is being added to the bridge can be in any state: unbridged,
+ * bridged, answered, unanswered, etc. The channel will be added asynchronously,
+ * meaning that when this function returns once the channel has been added to
+ * the bridge, not once the channel has been removed from the bridge.
+ *
+ * In addition, a tone can optionally be played to the channel once the
+ * channel is placed into the bridge.
+ *
+ * \note When this function returns, there is no guarantee that the channel that
+ * was passed in is valid any longer. Do not attempt to operate on the channel
+ * after this function returns.
+ *
+ * \param bridge Bridge to which the channel should be added
+ * \param chan The channel to add to the bridge
+ * \param features Features for this channel in the bridge
+ * \param play_tone Indicates if a tone should be played to the channel
+ * \param xfersound Sound that should be used to indicate transfer with play_tone
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
+int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
+ struct ast_bridge_features *features, int play_tone, const char *xfersound);
+
+/*!
* \brief Test if a channel can be picked up.
*
* \param chan Channel to test if can be picked up.
Modified: team/mmichelson/transfer_stasis/include/asterisk/parking.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/parking.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/parking.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/parking.h Fri Jun 28 13:28:34 2013
@@ -55,6 +55,8 @@
AST_STRING_FIELD(parkinglot); /*!< Name of the parking lot used to park the parkee */
);
};
+
+struct ast_exten;
/*!
* \brief Constructor for parked_call_payload objects
Modified: team/mmichelson/transfer_stasis/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/sorcery.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/sorcery.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/sorcery.h Fri Jun 28 13:28:34 2013
@@ -588,6 +588,8 @@
*
* \retval 0 success
* \retval -1 failure
+ *
+ * \note You must be ready to accept observer invocations before this function is called
*/
int ast_sorcery_observer_add(const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks);
Modified: team/mmichelson/transfer_stasis/include/asterisk/stasis_app.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/stasis_app.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/stasis_app.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/stasis_app.h Fri Jun 28 13:28:34 2013
@@ -142,8 +142,14 @@
* If the channel is no longer in \c res_stasis, this function does nothing.
*
* \param control Control for \c res_stasis
- */
-void stasis_app_control_continue(struct stasis_app_control *control);
+ * \param context An optional context to continue to
+ * \param extension An optional extension to continue to
+ * \param priority An optional priority to continue to
+ *
+ * \return 0 for success
+ * \return -1 for error.
+ */
+int stasis_app_control_continue(struct stasis_app_control *control, const char *context, const char *extension, int priority);
/*!
* \brief Answer the channel associated with this control.
Modified: team/mmichelson/transfer_stasis/include/asterisk/stasis_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/stasis_channels.h?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/stasis_channels.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/stasis_channels.h Fri Jun 28 13:28:34 2013
@@ -456,6 +456,24 @@
/*!
* \since 12
+ * \brief Publish in the \ref ast_channel_topic or \ref ast_channel_topic_all
+ * topics a stasis message for the channels involved in a dial operation that
+ * is forwarded.
+ *
+ * \param caller The channel performing the dial operation
+ * \param peer The channel being dialed
+ * \param dialstring The information passed to the dialing application when beginning a dial
+ * \param dialstatus The current status of the dial operation
+ * \param forward The call forward string provided by the dialed channel
+ */
+void ast_channel_publish_dial_forward(struct ast_channel *caller,
+ struct ast_channel *peer,
+ const char *dialstring,
+ const char *dialstatus,
+ const char *forward);
+
+/*!
+ * \since 12
* \brief Publish in the \ref ast_channel_topic a \ref ast_channel_snapshot
* message indicating a change in channel state
*
Modified: team/mmichelson/transfer_stasis/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/main/asterisk.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/main/asterisk.c (original)
+++ team/mmichelson/transfer_stasis/main/asterisk.c Fri Jun 28 13:28:34 2013
@@ -4333,6 +4333,11 @@
exit(1);
}
+ if (ast_parking_stasis_init()) {
+ printf("%s", term_quit());
+ exit(1);
+ }
+
if (ast_cdr_engine_init()) {
printf("%s", term_quit());
exit(1);
@@ -4362,11 +4367,6 @@
}
if (load_pbx()) {
- printf("%s", term_quit());
- exit(1);
- }
-
- if (ast_parking_stasis_init()) {
printf("%s", term_quit());
exit(1);
}
Modified: team/mmichelson/transfer_stasis/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/main/bridging.c?view=diff&rev=393181&r1=393180&r2=393181
==============================================================================
--- team/mmichelson/transfer_stasis/main/bridging.c (original)
+++ team/mmichelson/transfer_stasis/main/bridging.c Fri Jun 28 13:28:34 2013
@@ -571,6 +571,42 @@
/*!
* \internal
+ * \brief Check if a bridge should dissolve because of a stolen channel and do it.
+ * \since 12.0.0
+ *
+ * \param bridge Bridge to check.
+ * \param bridge_channel Stolen channel causing the check. It is not in the bridge to check and may be in another bridge.
+ *
+ * \note On entry, bridge and bridge_channel->bridge are already locked.
+ *
+ * \return Nothing
+ */
+static void bridge_dissolve_check_stolen(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
+{
+ if (bridge->dissolved) {
+ return;
+ }
+
+ if (bridge_channel->features->usable
+ && ast_test_flag(&bridge_channel->features->feature_flags,
+ AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP)) {
+ /* The stolen channel controlled the bridge it was stolen from. */
+ bridge_dissolve(bridge);
+ return;
+ }
+ if (bridge->num_channels < 2
+ && ast_test_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_DISSOLVE_HANGUP)) {
+ /*
+ * The stolen channel has not left enough channels to keep the
+ * bridge alive. Assume the stolen channel hung up.
+ */
+ bridge_dissolve(bridge);
+ return;
+ }
+}
+
+/*!
+ * \internal
* \brief Pull the bridge channel out of its current bridge.
* \since 12.0.0
*
[... 3684 lines stripped ...]
More information about the asterisk-commits
mailing list