[asterisk-commits] qwell: branch qwell/fun_with_transports r387954 - in /team/qwell/fun_with_tra...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 8 09:24:58 CDT 2013
Author: qwell
Date: Wed May 8 09:24:54 2013
New Revision: 387954
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387954
Log:
Revert r387935.
Removed:
team/qwell/fun_with_transports/include/asterisk/endpoints.h
team/qwell/fun_with_transports/include/asterisk/stasis_endpoints.h
team/qwell/fun_with_transports/include/asterisk/stasis_test.h
team/qwell/fun_with_transports/main/endpoints.c
team/qwell/fun_with_transports/main/stasis_endpoints.c
team/qwell/fun_with_transports/res/res_stasis_test.c
team/qwell/fun_with_transports/res/res_stasis_test.exports.in
team/qwell/fun_with_transports/tests/test_endpoints.c
team/qwell/fun_with_transports/tests/test_stasis_endpoints.c
Modified:
team/qwell/fun_with_transports/ (props changed)
team/qwell/fun_with_transports/apps/app_meetme.c
team/qwell/fun_with_transports/apps/app_stack.c
team/qwell/fun_with_transports/build_tools/post_process_documentation.py
team/qwell/fun_with_transports/channels/chan_dahdi.c
team/qwell/fun_with_transports/channels/chan_gulp.c
team/qwell/fun_with_transports/channels/chan_iax2.c
team/qwell/fun_with_transports/channels/chan_sip.c
team/qwell/fun_with_transports/channels/sip/include/sip.h
team/qwell/fun_with_transports/funcs/func_global.c
team/qwell/fun_with_transports/include/asterisk.h
team/qwell/fun_with_transports/include/asterisk/astobj2.h
team/qwell/fun_with_transports/include/asterisk/json.h
team/qwell/fun_with_transports/include/asterisk/lock.h
team/qwell/fun_with_transports/include/asterisk/sorcery.h
team/qwell/fun_with_transports/include/asterisk/stasis.h
team/qwell/fun_with_transports/main/asterisk.c
team/qwell/fun_with_transports/main/astobj2.c
team/qwell/fun_with_transports/main/channel_internal_api.c
team/qwell/fun_with_transports/main/event.c
team/qwell/fun_with_transports/main/manager.c
team/qwell/fun_with_transports/main/sorcery.c
team/qwell/fun_with_transports/main/stasis_cache.c
team/qwell/fun_with_transports/res/res_config_pgsql.c
team/qwell/fun_with_transports/res/res_sip_sdp_rtp.c
team/qwell/fun_with_transports/res/res_sorcery_astdb.c
team/qwell/fun_with_transports/res/res_stasis_http_endpoints.c
team/qwell/fun_with_transports/res/res_stun_monitor.c
team/qwell/fun_with_transports/res/stasis_http/resource_endpoints.c
team/qwell/fun_with_transports/res/stasis_http/resource_endpoints.h
team/qwell/fun_with_transports/rest-api/api-docs/endpoints.json
team/qwell/fun_with_transports/tests/test_sorcery.c
Propchange: team/qwell/fun_with_transports/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/qwell/fun_with_transports/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 8 09:24:54 2013
@@ -1,1 +1,1 @@
-/trunk:1-387934
+/trunk:1-387426
Modified: team/qwell/fun_with_transports/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/apps/app_meetme.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/apps/app_meetme.c (original)
+++ team/qwell/fun_with_transports/apps/app_meetme.c Wed May 8 09:24:54 2013
@@ -6447,8 +6447,8 @@
struct sla_station *station;
struct sla_trunk *trunk;
- if (!AST_LIST_EMPTY(&sla.event_q) || !AST_LIST_EMPTY(&sla.ringing_trunks)
- || !AST_LIST_EMPTY(&sla.ringing_stations) || !AST_LIST_EMPTY(&sla.failed_stations)) {
+ if (!AST_LIST_EMPTY(&sla.event_q) || !AST_LIST_EMPTY(&sla.ringing_trunks)
+ || !AST_LIST_EMPTY(&sla.ringing_stations)) {
return;
}
@@ -6464,9 +6464,8 @@
AST_RWLIST_RDLOCK(&sla_trunks);
AST_RWLIST_TRAVERSE(&sla_trunks, trunk, entry) {
- if (trunk->ref_count || trunk->chan || trunk->active_stations || trunk->hold_stations) {
+ if (trunk->ref_count)
break;
- }
}
AST_RWLIST_UNLOCK(&sla_trunks);
if (trunk) {
@@ -6719,7 +6718,7 @@
return 0;
}
- AST_RWLIST_WRLOCK(&sla_stations);
+ AST_RWLIST_RDLOCK(&sla_stations);
station = sla_find_station(station_name);
if (station)
ast_atomic_fetchadd_int((int *) &station->ref_count, 1);
@@ -6931,7 +6930,7 @@
}
}
- AST_RWLIST_WRLOCK(&sla_trunks);
+ AST_RWLIST_RDLOCK(&sla_trunks);
trunk = sla_find_trunk(args.trunk_name);
if (trunk)
ast_atomic_fetchadd_int((int *) &trunk->ref_count, 1);
Modified: team/qwell/fun_with_transports/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/apps/app_stack.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/apps/app_stack.c (original)
+++ team/qwell/fun_with_transports/apps/app_stack.c Wed May 8 09:24:54 2013
@@ -40,7 +40,6 @@
#include "asterisk/manager.h"
#include "asterisk/channel.h"
#include "asterisk/agi.h"
-#include "asterisk/stasis_channels.h"
/*** DOCUMENTATION
<application name="Gosub" language="en_US">
@@ -203,32 +202,7 @@
<para>Cause the channel to execute the specified dialplan subroutine,
returning to the dialplan with execution of a Return().</para>
</description>
- <see-also>
- <ref type="application">GoSub</ref>
- </see-also>
</agi>
- <managerEvent language="en_US" name="VarSet">
- <managerEventInstance class="EVENT_FLAG_DIALPLAN">
- <synopsis>Raised when a variable local to the gosub stack frame is set due to a subroutine call.</synopsis>
- <syntax>
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='Newchannel']/managerEventInstance/syntax/parameter)" />
- <parameter name="Variable">
- <para>The LOCAL variable being set.</para>
- <note><para>The variable name will always be enclosed with
- <literal>LOCAL()</literal></para></note>
- </parameter>
- <parameter name="Value">
- <para>The new value of the variable.</para>
- </parameter>
- </syntax>
- <see-also>
- <ref type="application">GoSub</ref>
- <ref type="agi">gosub</ref>
- <ref type="function">LOCAL</ref>
- <ref type="function">LOCAL_PEEK</ref>
- </see-also>
- </managerEventInstance>
- </managerEvent>
***/
static const char app_gosub[] = "Gosub";
@@ -261,8 +235,6 @@
{
struct ast_var_t *variables;
int found = 0;
- int len;
- RAII_VAR(char *, local_buffer, NULL, ast_free);
/* Does this variable already exist? */
AST_LIST_TRAVERSE(&frame->varshead, variables, entries) {
@@ -280,13 +252,20 @@
pbx_builtin_setvar_helper(chan, var, value);
}
- len = 8 + strlen(var); /* LOCAL() + var */
- local_buffer = ast_malloc(len);
- if (!local_buffer) {
- return 0;
- }
- sprintf(local_buffer, "LOCAL(%s)", var);
- ast_channel_publish_varset(chan, local_buffer, value);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when a LOCAL channel variable is set due to a subroutine call.</synopsis>
+ <see-also>
+ <ref type="application">GoSub</ref>
+ </see-also>
+ </managerEventInstance>
+ ***/
+ manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
+ "Channel: %s\r\n"
+ "Variable: LOCAL(%s)\r\n"
+ "Value: %s\r\n"
+ "Uniqueid: %s\r\n",
+ ast_channel_name(chan), var, value, ast_channel_uniqueid(chan));
return 0;
}
Modified: team/qwell/fun_with_transports/build_tools/post_process_documentation.py
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/build_tools/post_process_documentation.py?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/build_tools/post_process_documentation.py (original)
+++ team/qwell/fun_with_transports/build_tools/post_process_documentation.py Wed May 8 09:24:54 2013
@@ -22,9 +22,9 @@
def __swap_parameter_documentation(one, two):
# See who has the better documentation and use it
- if (one.hasChildNodes() and not two.hasChildNodes()):
+ if (one.hasChildNodes()):
two.parentNode.replaceChild(one.cloneNode(True), two)
- elif (two.hasChildNodes() and not one.hasChildNodes()):
+ elif (two.hasChildNodes()):
one.parentNode.replaceChild(two.cloneNode(True), one)
def __merge_parameter(param, other_instances):
Modified: team/qwell/fun_with_transports/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/channels/chan_dahdi.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/channels/chan_dahdi.c (original)
+++ team/qwell/fun_with_transports/channels/chan_dahdi.c Wed May 8 09:24:54 2013
@@ -3271,7 +3271,7 @@
}
/* Fall through */
default:
- ast_log(LOG_NOTICE, "Got DAHDI event: %s (%d) on D-channel of span %d\n",
+ ast_log(LOG_NOTICE, "PRI got event: %s (%d) on D-channel of span %d\n",
event2str(x), x, pri->span);
break;
}
Modified: team/qwell/fun_with_transports/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/channels/chan_gulp.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/channels/chan_gulp.c (original)
+++ team/qwell/fun_with_transports/channels/chan_gulp.c Wed May 8 09:24:54 2013
@@ -434,7 +434,7 @@
pvt->media[SIP_MEDIA_VIDEO] = ao2_find(session->media, "video", OBJ_KEY);
ast_channel_tech_pvt_set(chan, pvt);
- if (ast_format_cap_is_empty(session->req_caps) || !ast_format_cap_has_joint(session->req_caps, session->endpoint->codecs)) {
+ if (ast_format_cap_is_empty(session->req_caps)) {
ast_format_cap_copy(ast_channel_nativeformats(chan), session->endpoint->codecs);
} else {
ast_format_cap_copy(ast_channel_nativeformats(chan), session->req_caps);
Modified: team/qwell/fun_with_transports/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/channels/chan_iax2.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/channels/chan_iax2.c (original)
+++ team/qwell/fun_with_transports/channels/chan_iax2.c Wed May 8 09:24:54 2013
@@ -283,9 +283,9 @@
static char language[MAX_LANGUAGE] = "";
static char regcontext[AST_MAX_CONTEXT] = "";
-static struct stasis_subscription *network_change_sub; /*!< subscription id for network change events */
+static struct ast_event_sub *network_change_event_subscription; /*!< subscription id for network change events */
static struct stasis_subscription *acl_change_sub; /*!< subscription id for ACL change events */
-static int network_change_sched_id = -1;
+static int network_change_event_sched_id = -1;
static int maxauthreq = 3;
static int max_retries = 4;
@@ -1254,7 +1254,7 @@
static int get_unused_callno(enum callno_type type, int validated, callno_entry *entry);
static int replace_callno(const void *obj);
static void sched_delay_remove(struct sockaddr_in *sin, callno_entry entry);
-static void network_change_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message);
+static void network_change_event_cb(const struct ast_event *, void *);
static void acl_change_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message);
static struct ast_channel_tech iax2_tech = {
@@ -1323,18 +1323,18 @@
* is time to send MWI, since it is only sent with a REGACK. */
}
-static void network_change_stasis_subscribe(void)
-{
- if (!network_change_sub) {
- network_change_sub = stasis_subscribe(ast_system_topic(),
- network_change_stasis_cb, NULL);
- }
-}
-
-static void network_change_stasis_unsubscribe(void)
-{
- if (network_change_sub) {
- network_change_sub = stasis_unsubscribe(network_change_sub);
+static void network_change_event_subscribe(void)
+{
+ if (!network_change_event_subscription) {
+ network_change_event_subscription = ast_event_subscribe(AST_EVENT_NETWORK_CHANGE,
+ network_change_event_cb, "IAX2 Network Change", NULL, AST_EVENT_IE_END);
+ }
+}
+
+static void network_change_event_unsubscribe(void)
+{
+ if (network_change_event_subscription) {
+ network_change_event_subscription = ast_event_unsubscribe(network_change_event_subscription);
}
}
@@ -1353,10 +1353,10 @@
}
}
-static int network_change_sched_cb(const void *data)
+static int network_change_event_sched_cb(const void *data)
{
struct iax2_registry *reg;
- network_change_sched_id = -1;
+ network_change_event_sched_id = -1;
AST_LIST_LOCK(®istrations);
AST_LIST_TRAVERSE(®istrations, reg, entry) {
iax2_do_register(reg);
@@ -1366,18 +1366,13 @@
return 0;
}
-static void network_change_stasis_cb(void *data, struct stasis_subscription *sub,
- struct stasis_topic *topic, struct stasis_message *message)
-{
- /* This callback is only concerned with network change messages from the system topic. */
- if (stasis_message_type(message) != ast_network_change_type()) {
- return;
- }
-
- ast_verb(1, "IAX, got a network change message, renewing all IAX registrations.\n");
- if (network_change_sched_id == -1) {
- network_change_sched_id = iax2_sched_add(sched, 1000, network_change_sched_cb, NULL);
- }
+static void network_change_event_cb(const struct ast_event *event, void *userdata)
+{
+ ast_debug(1, "IAX, got a network change event, renewing all IAX registrations.\n");
+ if (network_change_event_sched_id == -1) {
+ network_change_event_sched_id = iax2_sched_add(sched, 1000, network_change_event_sched_cb, NULL);
+ }
+
}
static void acl_change_stasis_cb(void *data, struct stasis_subscription *sub,
@@ -13447,9 +13442,9 @@
}
if (subscribe_network_change) {
- network_change_stasis_subscribe();
+ network_change_event_subscribe();
} else {
- network_change_stasis_unsubscribe();
+ network_change_event_unsubscribe();
}
if (defaultsockfd < 0) {
@@ -14292,7 +14287,7 @@
struct ast_context *con;
int x;
- network_change_stasis_unsubscribe();
+ network_change_event_unsubscribe();
acl_change_stasis_unsubscribe();
ast_manager_unregister("IAXpeers");
@@ -14794,7 +14789,7 @@
ast_realtime_require_field("iaxpeers", "name", RQ_CHAR, 10, "ipaddr", RQ_CHAR, 15, "port", RQ_UINTEGER2, 5, "regseconds", RQ_UINTEGER2, 6, SENTINEL);
- network_change_stasis_subscribe();
+ network_change_event_subscribe();
return AST_MODULE_LOAD_SUCCESS;
}
Modified: team/qwell/fun_with_transports/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/channels/chan_sip.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/channels/chan_sip.c (original)
+++ team/qwell/fun_with_transports/channels/chan_sip.c Wed May 8 09:24:54 2013
@@ -294,7 +294,6 @@
#include "sip/include/security_events.h"
#include "asterisk/sip_api.h"
#include "asterisk/app.h"
-#include "asterisk/stasis_endpoints.h"
/*** DOCUMENTATION
<application name="SIPDtmfMode" language="en_US">
@@ -843,9 +842,9 @@
static struct ast_flags global_flags[3] = {{0}}; /*!< global SIP_ flags */
static int global_t38_maxdatagram; /*!< global T.38 FaxMaxDatagram override */
-static struct stasis_subscription *network_change_sub; /*!< subscription id for network change events */
+static struct ast_event_sub *network_change_event_subscription; /*!< subscription id for network change events */
static struct stasis_subscription *acl_change_sub; /*!< subscription id for named ACL system change events */
-static int network_change_sched_id = -1;
+static int network_change_event_sched_id = -1;
static char used_context[AST_MAX_CONTEXT]; /*!< name of automatically created context for unloading */
@@ -1286,7 +1285,7 @@
static void sip_poke_all_peers(void);
static void sip_peer_hold(struct sip_pvt *p, int hold);
static void mwi_event_cb(void *, struct stasis_subscription *, struct stasis_topic *, struct stasis_message *);
-static void network_change_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message);
+static void network_change_event_cb(const struct ast_event *, void *);
static void acl_change_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message);
static void sip_keepalive_all_peers(void);
@@ -5325,9 +5324,6 @@
peer->caps = ast_format_cap_destroy(peer->caps);
ast_rtp_dtls_cfg_free(&peer->dtls_cfg);
-
- ast_endpoint_shutdown(peer->endpoint);
- peer->endpoint = NULL;
}
/*! \brief Update peer data in database (if used) */
@@ -8014,14 +8010,6 @@
return NULL;
}
- if (i->relatedpeer) {
- if (ast_endpoint_add_channel(i->relatedpeer->endpoint, tmp)) {
- ast_channel_unref(tmp);
- sip_pvt_lock(i);
- return NULL;
- }
- }
-
/* If we sent in a callid, bind it to the channel. */
if (callid) {
ast_channel_callid_set(tmp, callid);
@@ -14783,20 +14771,7 @@
p->pendinginvite = p->ocseq; /* Remember that we have a pending NOTIFY in order not to confuse the NOTIFY subsystem */
- /* Send as XMIT_CRITICAL as we may never receive a 200 OK Response which clears p->pendinginvite.
- *
- * extensionstate_update() uses p->pendinginvite for queuing control.
- * Updates stall if pendinginvite <> 0.
- *
- * The most appropriate solution is to remove the subscription when the NOTIFY transaction fails.
- * The client will re-subscribe after restarting or maxexpiry timeout.
- */
-
- /* RFC6665 4.2.2. Sending State Information to Subscribers
- * If the NOTIFY request fails due to expiration of SIP Timer F (transaction timeout),
- * the notifier SHOULD remove the subscription.
- */
- return send_request(p, &req, XMIT_CRITICAL, p->ocseq);
+ return send_request(p, &req, XMIT_RELIABLE, p->ocseq);
}
/*! \brief Notify user of messages waiting in voicemail (RFC3842)
@@ -16698,18 +16673,18 @@
}
}
-static void network_change_stasis_subscribe(void)
-{
- if (!network_change_sub) {
- network_change_sub = stasis_subscribe(ast_system_topic(),
- network_change_stasis_cb, NULL);
- }
-}
-
-static void network_change_stasis_unsubscribe(void)
-{
- if (network_change_sub) {
- network_change_sub = stasis_unsubscribe(network_change_sub);
+static void network_change_event_subscribe(void)
+{
+ if (!network_change_event_subscription) {
+ network_change_event_subscription = ast_event_subscribe(AST_EVENT_NETWORK_CHANGE,
+ network_change_event_cb, "SIP Network Change", NULL, AST_EVENT_IE_END);
+ }
+}
+
+static void network_change_event_unsubscribe(void)
+{
+ if (network_change_event_subscription) {
+ network_change_event_subscription = ast_event_unsubscribe(network_change_event_subscription);
}
}
@@ -16722,31 +16697,26 @@
}
-static void acl_change_event_stasis_unsubscribe(void)
+static void acl_change_event_unsubscribe(void)
{
if (acl_change_sub) {
acl_change_sub = stasis_unsubscribe(acl_change_sub);
}
}
-static int network_change_sched_cb(const void *data)
-{
- network_change_sched_id = -1;
+static int network_change_event_sched_cb(const void *data)
+{
+ network_change_event_sched_id = -1;
sip_send_all_registers();
sip_send_all_mwi_subscriptions();
return 0;
}
-static void network_change_stasis_cb(void *data, struct stasis_subscription *sub, struct stasis_topic *topic, struct stasis_message *message)
-{
- /* This callback is only concerned with network change messages from the system topic. */
- if (stasis_message_type(message) != ast_network_change_type()) {
- return;
- }
-
- ast_verb(1, "SIP, got a network change message, renewing all SIP registrations.\n");
- if (network_change_sched_id == -1) {
- network_change_sched_id = ast_sched_add(sched, 1000, network_change_sched_cb, NULL);
+static void network_change_event_cb(const struct ast_event *event, void *userdata)
+{
+ ast_debug(1, "SIP, got a network change event, renewing all SIP registrations.\n");
+ if (network_change_event_sched_id == -1) {
+ network_change_event_sched_id = ast_sched_add(sched, 1000, network_change_event_sched_cb, NULL);
}
}
@@ -30746,9 +30716,6 @@
firstpass = 0;
} else {
if (!(peer = ao2_t_alloc(sizeof(*peer), sip_destroy_peer_fn, "allocate a peer struct"))) {
- return NULL;
- }
- if (!(peer->endpoint = ast_endpoint_create("SIP", name))) {
return NULL;
}
if (!(peer->caps = ast_format_cap_alloc_nolock())) {
@@ -32328,9 +32295,9 @@
}
if (subscribe_network_change) {
- network_change_stasis_subscribe();
+ network_change_event_subscribe();
} else {
- network_change_stasis_unsubscribe();
+ network_change_event_unsubscribe();
}
if (global_t1 < global_t1min) {
@@ -34804,7 +34771,7 @@
sip_register_tests();
- network_change_stasis_subscribe();
+ network_change_event_subscribe();
ast_websocket_add_protocol("sip", sip_websocket_callback);
@@ -34824,8 +34791,8 @@
ast_websocket_remove_protocol("sip", sip_websocket_callback);
- network_change_stasis_unsubscribe();
- acl_change_event_stasis_unsubscribe();
+ network_change_event_unsubscribe();
+ acl_change_event_unsubscribe();
ast_sched_dump(sched);
Modified: team/qwell/fun_with_transports/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/channels/sip/include/sip.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/channels/sip/include/sip.h (original)
+++ team/qwell/fun_with_transports/channels/sip/include/sip.h Wed May 8 09:24:54 2013
@@ -1377,8 +1377,6 @@
unsigned int disallowed_methods;
struct ast_cc_config_params *cc_params;
- struct ast_endpoint *endpoint;
-
struct ast_rtp_dtls_cfg dtls_cfg;
};
Modified: team/qwell/fun_with_transports/funcs/func_global.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/funcs/func_global.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/funcs/func_global.c (original)
+++ team/qwell/fun_with_transports/funcs/func_global.c Wed May 8 09:24:54 2013
@@ -39,7 +39,7 @@
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
#include "asterisk/app.h"
-#include "asterisk/stasis_channels.h"
+#include "asterisk/manager.h"
/*** DOCUMENTATION
<function name="GLOBAL" language="en_US">
@@ -83,25 +83,7 @@
using it in a set of calculations (or you might be surprised by the result).</para>
</description>
</function>
- <managerEvent language="en_US" name="VarSet">
- <managerEventInstance class="EVENT_FLAG_DIALPLAN">
- <synopsis>Raised when a variable is shared between channels.</synopsis>
- <syntax>
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='Newchannel']/managerEventInstance/syntax/parameter)" />
- <parameter name="Variable">
- <para>The SHARED variable being set.</para>
- <note><para>The variable name will always be enclosed with
- <literal>SHARED()</literal></para></note>
- </parameter>
- <parameter name="Value">
- <para>The new value of the variable.</para>
- </parameter>
- </syntax>
- <see-also>
- <ref type="function">SHARED</ref>
- </see-also>
- </managerEventInstance>
- </managerEvent>
+
***/
static void shared_variable_free(void *data);
@@ -215,8 +197,6 @@
AST_APP_ARG(chan);
);
struct ast_channel *c_ref = NULL;
- int len;
- RAII_VAR(char *, shared_buffer, NULL, ast_free);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SHARED() requires an argument: SHARED(<var>[,<chan>])\n");
@@ -233,15 +213,6 @@
return -1;
}
chan = c_ref;
- }
-
- len = 9 + strlen(args.var); /* SHARED() + var */
- shared_buffer = ast_malloc(len);
- if (!shared_buffer) {
- if (c_ref) {
- ast_channel_unref(c_ref);
- }
- return -1;
}
ast_channel_lock(chan);
@@ -284,9 +255,13 @@
var = ast_var_assign(args.var, S_OR(value, ""));
AST_LIST_INSERT_HEAD(varshead, var, entries);
-
- sprintf(shared_buffer, "SHARED(%s)", args.var);
- ast_channel_publish_varset(chan, shared_buffer, value);
+ manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
+ "Channel: %s\r\n"
+ "Variable: SHARED(%s)\r\n"
+ "Value: %s\r\n"
+ "Uniqueid: %s\r\n",
+ chan ? ast_channel_name(chan) : "none", args.var, value,
+ chan ? ast_channel_uniqueid(chan) : "none");
ast_channel_unlock(chan);
Modified: team/qwell/fun_with_transports/include/asterisk.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk.h (original)
+++ team/qwell/fun_with_transports/include/asterisk.h Wed May 8 09:24:54 2013
@@ -200,27 +200,6 @@
#define ast_mark(a, b) do { } while (0)
#endif /* LOW_MEMORY */
-/*!
- * \since 12
- * \brief A \ref stasis topic which publishes messages regarding system changes
- *
- * \retval \ref stasis_topic for system level changes
- * \retval NULL on error
- */
-struct stasis_topic *ast_system_topic(void);
-
-/*!
- * \since 12
- * \brief A \ref stasis_message_type for network changes
- *
- * \retval NULL on error
- * \retval \ref stasis_message_type for network changes
- *
- * \note Messages of this type should always be issued on and expected from
- * the \ref ast_system_topic \ref stasis topic
- */
-struct stasis_message_type *ast_network_change_type(void);
-
/*! \brief
* Definition of various structures that many asterisk files need,
* but only because they need to know that the type exists.
Modified: team/qwell/fun_with_transports/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk/astobj2.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk/astobj2.h (original)
+++ team/qwell/fun_with_transports/include/asterisk/astobj2.h Wed May 8 09:24:54 2013
@@ -383,19 +383,12 @@
-/*!
- * \brief Typedef for an object destructor.
- *
- * \param vdoomed Object to destroy.
- *
- * \details
- * This is called just before freeing the memory for the object.
- * It is passed a pointer to the user-defined data of the
- * object.
- *
- * \return Nothing
- */
-typedef void (*ao2_destructor_fn)(void *vdoomed);
+/*! \brief
+ * Typedef for an object destructor. This is called just before freeing
+ * the memory for the object. It is passed a pointer to the user-defined
+ * data of the object.
+ */
+typedef void (*ao2_destructor_fn)(void *);
/*! \brief Options available when allocating an ao2 object. */
enum ao2_alloc_opts {
@@ -1890,55 +1883,4 @@
#define ao2_cleanup(obj) __ao2_cleanup(obj)
#endif
void ao2_iterator_cleanup(struct ao2_iterator *iter);
-
-
-/* XXX TODO BUGBUG and all the other things...
- * These functions should eventually be moved elsewhere, but the utils folder
- * won't compile with them in strings.h
- */
-
-/*!
- * \since 12
- * \brief Allocates a hash container for bare strings
- *
- * \param buckets The number of buckets to use for the hash container
- *
- * \retval AO2 container for strings
- * \retval NULL if allocation failed
- */
-#define ast_str_container_alloc(buckets) ast_str_container_alloc_options(AO2_ALLOC_OPT_LOCK_MUTEX, buckets)
-
-/*!
- * \since 12
- * \brief Allocates a hash container for bare strings
- *
- * \param opts Options to be provided to the container
- * \param buckets The number of buckets to use for the hash container
- *
- * \retval AO2 container for strings
- * \retval NULL if allocation failed
- */
-struct ao2_container *ast_str_container_alloc_options(enum ao2_container_opts opts, int buckets);
-
-/*!
- * \since 12
- * \brief Adds a string to a string container allocated by ast_str_container_alloc
- *
- * \param str_container The container to which to add a string
- * \param add The string to add to the container
- *
- * \retval zero on success
- * \retval non-zero if the operation failed
- */
-int ast_str_container_add(struct ao2_container *str_container, const char *add);
-
-/*!
- * \since 12
- * \brief Removes a string from a string container allocated by ast_str_container_alloc
- *
- * \param str_container The container from which to remove a string
- * \param remove The string to remove from the container
- */
-void ast_str_container_remove(struct ao2_container *str_container, const char *remove);
-
#endif /* _ASTERISK_ASTOBJ2_H */
Modified: team/qwell/fun_with_transports/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk/json.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk/json.h (original)
+++ team/qwell/fun_with_transports/include/asterisk/json.h Wed May 8 09:24:54 2013
@@ -24,54 +24,9 @@
* \brief Asterisk JSON abstraction layer.
* \since 12.0.0
*
- * This is a very thin wrapper around the Jansson API. For more details on it,
- * see its docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
- *
- * Rather than provide the multiple ways of doing things that the Jansson API
- * does, the Asterisk wrapper is always reference-stealing, and always NULL
- * safe.
- *
- * And by always, I mean that the reference is stolen even if the function
- * fails. This avoids lots of conditional logic, and also avoids having to track
- * zillions of local variables when building complex JSON objects. You can
- * instead chain \c ast_json_* calls together safely and only worry about
- * cleaning up the root object.
- *
- * In the cases where you have a need to introduce intermediate objects, just
- * wrap them with json_ref() when passing them to other \c ast_json_*()
- * functions.
- *
- * \code
- * // Example of how to use the Asterisk JSON API
- * static struct ast_json *foo(void) {
- * RAII_VAR(struct ast_json *, array, NULL, ast_json_unref);
- * RAII_VAR(struct ast_json *, obj, NULL, ast_json_unref);
- * int i, res;
- *
- * array = ast_json_array_create();
- * if (!array) { return NULL; }
- *
- * for (i = 0; i < 10; ++i) {
- * // NULL safety and object stealing means calls can
- * // be chained together directly.
- * res = ast_json_array_append(array,
- * ast_json_integer_create(i));
- * if (res != 0) { return NULL; }
- * }
- *
- * obj = ast_json_object_create();
- * if (!obj) { return NULL; }
- *
- * // If you already have an object reference, ast_json_ref()
- * // can be used inline to bump the ref before passing it along
- * // to a ref-stealing call
- * res = ast_json_object_set(obj, "foo", ast_json_ref(array));
- * if (!res) { return NULL; }
- *
- * return obj;
- * }
- * \endcode
- *
+ * This is a very thin wrapper around the Jansson API. For more details on it, see its
+ * docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
+
* \author David M. Lee, II <dlee at digium.com>
*/
Modified: team/qwell/fun_with_transports/include/asterisk/lock.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk/lock.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk/lock.h (original)
+++ team/qwell/fun_with_transports/include/asterisk/lock.h Wed May 8 09:24:54 2013
@@ -569,7 +569,7 @@
* the lock. When the lock goes out of scope, it will automatically
* be unlocked.
*
- * \code
+ * \example
* int some_function(struct ast_channel *chan)
* {
* SCOPED_LOCK(lock, chan, ast_channel_lock, ast_channel_unlock);
@@ -580,7 +580,6 @@
*
* return -1;
* }
- * \endcode
*
* In the above example, neither return path requires explicit unlocking
* of the channel.
Modified: team/qwell/fun_with_transports/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk/sorcery.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk/sorcery.h (original)
+++ team/qwell/fun_with_transports/include/asterisk/sorcery.h Wed May 8 09:24:54 2013
@@ -232,21 +232,6 @@
void (*close)(void *data);
};
-/*! \brief Interface for a sorcery object type observer */
-struct ast_sorcery_observer {
- /*! \brief Callback for when an object is created */
- void (*created)(const void *object);
-
- /*! \brief Callback for when an object is updated */
- void (*updated)(const void *object);
-
- /*! \brief Callback for when an object is deleted */
- void (*deleted)(const void *object);
-
- /*! \brief Callback for when an object type is loaded/reloaded */
- void (*loaded)(const char *object_type);
-};
-
/*! \brief Structure which contains details about a sorcery object */
struct ast_sorcery_object_details {
/*! \brief Unique identifier of this object */
@@ -487,19 +472,6 @@
struct ast_variable *ast_sorcery_objectset_create(const struct ast_sorcery *sorcery, const void *object);
/*!
- * \brief Create an object set in JSON format for an object
- *
- * \param sorcery Pointer to a sorcery structure
- * \param object Pointer to a sorcery object
- *
- * \retval non-NULL success
- * \retval NULL if error occurred
- *
- * \note The returned ast_json object must be unreferenced using ast_json_unref
- */
-struct ast_json *ast_sorcery_objectset_json_create(const struct ast_sorcery *sorcery, const void *object);
-
-/*!
* \brief Apply an object set (KVP list) to an object
*
* \param sorcery Pointer to a sorcery structure
@@ -569,30 +541,6 @@
int ast_sorcery_diff(const struct ast_sorcery *sorcery, const void *original, const void *modified, struct ast_variable **changes);
/*!
- * \brief Add an observer to a specific object type
- *
- * \param sorcery Pointer to a sorcery structure
- * \param type Type of object that should be observed
- * \param callbacks Implementation of the observer interface
- *
- * \retval 0 success
- * \retval -1 failure
- */
-int ast_sorcery_observer_add(const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks);
-
-/*!
- * \brief Remove an observer from a specific object type
- *
- * \param sorcery Pointer to a sorcery structure
- * \param type Type of object that should no longer be observed
- * \param callbacks Implementation of the observer interface
- *
- * \retval 0 success
- * \retval -1 failure
- */
-void ast_sorcery_observer_remove(const struct ast_sorcery *sorcery, const char *type, struct ast_sorcery_observer *callbacks);
-
-/*!
* \brief Create and potentially persist an object using an available wizard
*
* \param sorcery Pointer to a sorcery structure
Modified: team/qwell/fun_with_transports/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/include/asterisk/stasis.h?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/include/asterisk/stasis.h (original)
+++ team/qwell/fun_with_transports/include/asterisk/stasis.h Wed May 8 09:24:54 2013
@@ -431,22 +431,6 @@
};
/*!
- * \brief Cache clear message.
- */
-struct stasis_cache_clear {
- /*! Type of object being cleared from the cache */
- struct stasis_message_type *type;
- /*! Id of the object being cleared from the cache */
- char id[];
-};
-
-/*!
- * \brief Message type for \ref stasis_cache_clear.
- * \since 12
- */
-struct stasis_message_type *stasis_cache_clear_type(void);
-
-/*!
* \brief A message which instructs the caching topic to remove an entry from its cache.
* \param type Message type.
* \param id Unique id of the snapshot to clear.
Modified: team/qwell/fun_with_transports/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/main/asterisk.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/main/asterisk.c (original)
+++ team/qwell/fun_with_transports/main/asterisk.c Wed May 8 09:24:54 2013
@@ -242,7 +242,6 @@
#include "asterisk/sorcery.h"
#include "asterisk/stasis.h"
#include "asterisk/json.h"
-#include "asterisk/stasis_endpoints.h"
#include "../defaults.h"
@@ -410,12 +409,6 @@
unsigned int need_quit:1;
unsigned int need_quit_handler:1;
} sig_flags;
-
-/*! \brief The \ref stasis topic for system level changes */
-static struct stasis_topic *system_topic;
-
-/*!\ brief The \ref stasis_message_type for network changes */
-static struct stasis_message_type *network_change_type;
#if !defined(LOW_MEMORY)
struct file_version {
@@ -1057,42 +1050,6 @@
}
#endif /* ! LOW_MEMORY */
-
-struct stasis_topic *ast_system_topic(void)
-{
- return system_topic;
-}
-
-struct stasis_message_type *ast_network_change_type(void)
-{
- return network_change_type;
-}
-
-/*! \brief Cleanup the \ref stasis system level items */
-static void stasis_system_topic_cleanup(void)
-{
- ao2_ref(system_topic, -1);
- system_topic = NULL;
- ao2_ref(network_change_type, -1);
- network_change_type = NULL;
-}
-
-/*! \brief Initialize the system level items for \ref stasis */
-static int stasis_system_topic_init(void)
-{
- ast_register_atexit(stasis_system_topic_cleanup);
-
- system_topic = stasis_topic_create("ast_system");
- if (!system_topic) {
- return 1;
- }
-
- network_change_type = stasis_message_type_create("network_change");
- if (!network_change_type) {
- return -1;
- }
- return 0;
-}
static void ast_run_atexits(void)
{
@@ -4170,15 +4127,6 @@
printf("Stasis initialization failed.\n%s", term_quit());
exit(1);
}
- if (stasis_system_topic_init()) {
- printf("Stasis system-level information initialization failed.\n%s", term_quit());
- exit(1);
- }
-
- if (ast_endpoint_stasis_init()) {
- printf("Endpoint initialization failed.\n%s", term_quit());
- exit(1);
- }
ast_makesocket();
sigemptyset(&sigs);
Modified: team/qwell/fun_with_transports/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/main/astobj2.c?view=diff&rev=387954&r1=387953&r2=387954
==============================================================================
--- team/qwell/fun_with_transports/main/astobj2.c (original)
+++ team/qwell/fun_with_transports/main/astobj2.c Wed May 8 09:24:54 2013
@@ -5780,41 +5780,3 @@
return 0;
}
-
-/* XXX TODO BUGBUG and all the other things...
- * These functions should eventually be moved elsewhere, but the utils folder
- * won't compile with them in strings.h
- */
-static int str_hash(const void *obj, const int flags)
-{
- return ast_str_hash(obj);
-}
-
-static int str_cmp(void *lhs, void *rhs, int flags)
-{
- return strcmp(lhs, rhs) ? 0 : CMP_MATCH;
-}
-
-struct ao2_container *ast_str_container_alloc_options(enum ao2_container_opts opts, int buckets)
-{
- return ao2_container_alloc_options(opts, buckets, str_hash, str_cmp);
-}
-
-int ast_str_container_add(struct ao2_container *str_container, const char *add)
-{
- RAII_VAR(char *, ao2_add, ao2_alloc(strlen(add) + 1, NULL), ao2_cleanup);
-
- if (!ao2_add) {
- return -1;
- }
-
- /* safe strcpy */
- strcpy(ao2_add, add);
- ao2_link(str_container, ao2_add);
- return 0;
-}
-
-void ast_str_container_remove(struct ao2_container *str_container, const char *remove)
-{
[... 1610 lines stripped ...]
More information about the asterisk-commits
mailing list