[asterisk-commits] kmoore: branch kmoore/cel_transfers r393588 - in /team/kmoore/cel_transfers: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 3 16:09:03 CDT 2013


Author: kmoore
Date: Wed Jul  3 16:09:00 2013
New Revision: 393588

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393588
Log:
Fix merge conflict

Added:
    team/kmoore/cel_transfers/configs/ari.conf.sample
      - copied unchanged from r393586, trunk/configs/ari.conf.sample
    team/kmoore/cel_transfers/configs/stasis.conf.sample
      - copied unchanged from r393586, trunk/configs/stasis.conf.sample
    team/kmoore/cel_transfers/doc/rest-api/   (props changed)
      - copied from r393586, trunk/doc/rest-api/
    team/kmoore/cel_transfers/include/asterisk/stasis_app_recording.h
      - copied unchanged from r393586, trunk/include/asterisk/stasis_app_recording.h
    team/kmoore/cel_transfers/main/stasis_config.c
      - copied unchanged from r393586, trunk/main/stasis_config.c
    team/kmoore/cel_transfers/res/res_ari_model.c
      - copied unchanged from r393586, trunk/res/res_ari_model.c
    team/kmoore/cel_transfers/res/res_ari_model.exports.in
      - copied unchanged from r393586, trunk/res/res_ari_model.exports.in
    team/kmoore/cel_transfers/res/res_sip/config_security.c
      - copied unchanged from r393586, trunk/res/res_sip/config_security.c
    team/kmoore/cel_transfers/res/res_stasis_recording.c
      - copied unchanged from r393586, trunk/res/res_stasis_recording.c
    team/kmoore/cel_transfers/res/res_stasis_recording.exports.in
      - copied unchanged from r393586, trunk/res/res_stasis_recording.exports.in
    team/kmoore/cel_transfers/res/stasis_http/ari_model_validators.c
      - copied unchanged from r393586, trunk/res/stasis_http/ari_model_validators.c
    team/kmoore/cel_transfers/res/stasis_http/ari_model_validators.h
      - copied unchanged from r393586, trunk/res/stasis_http/ari_model_validators.h
    team/kmoore/cel_transfers/res/stasis_http/ari_websockets.c
      - copied unchanged from r393586, trunk/res/stasis_http/ari_websockets.c
    team/kmoore/cel_transfers/res/stasis_http/cli.c
      - copied unchanged from r393586, trunk/res/stasis_http/cli.c
    team/kmoore/cel_transfers/res/stasis_http/config.c
      - copied unchanged from r393586, trunk/res/stasis_http/config.c
    team/kmoore/cel_transfers/res/stasis_http/internal.h
      - copied unchanged from r393586, trunk/res/stasis_http/internal.h
    team/kmoore/cel_transfers/rest-api-templates/api.wiki.mustache
      - copied unchanged from r393586, trunk/rest-api-templates/api.wiki.mustache
    team/kmoore/cel_transfers/rest-api-templates/ari_model_validators.c.mustache
      - copied unchanged from r393586, trunk/rest-api-templates/ari_model_validators.c.mustache
    team/kmoore/cel_transfers/rest-api-templates/ari_model_validators.h.mustache
      - copied unchanged from r393586, trunk/rest-api-templates/ari_model_validators.h.mustache
    team/kmoore/cel_transfers/rest-api-templates/make_ari_stubs.py
      - copied unchanged from r393586, trunk/rest-api-templates/make_ari_stubs.py
    team/kmoore/cel_transfers/rest-api-templates/models.wiki.mustache
      - copied unchanged from r393586, trunk/rest-api-templates/models.wiki.mustache
    team/kmoore/cel_transfers/rest-api-templates/param_parsing.mustache
      - copied unchanged from r393586, trunk/rest-api-templates/param_parsing.mustache
    team/kmoore/cel_transfers/tests/test_ari_model.c
      - copied unchanged from r393586, trunk/tests/test_ari_model.c
Removed:
    team/kmoore/cel_transfers/configs/stasis_core.conf.sample
    team/kmoore/cel_transfers/configs/stasis_http.conf.sample
    team/kmoore/cel_transfers/res/res_stasis_json_asterisk.c
    team/kmoore/cel_transfers/res/res_stasis_json_asterisk.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_bridges.c
    team/kmoore/cel_transfers/res/res_stasis_json_bridges.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_channels.c
    team/kmoore/cel_transfers/res/res_stasis_json_channels.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_endpoints.c
    team/kmoore/cel_transfers/res/res_stasis_json_endpoints.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_events.c
    team/kmoore/cel_transfers/res/res_stasis_json_events.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_playback.c
    team/kmoore/cel_transfers/res/res_stasis_json_playback.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_recordings.c
    team/kmoore/cel_transfers/res/res_stasis_json_recordings.exports.in
    team/kmoore/cel_transfers/res/res_stasis_json_sounds.c
    team/kmoore/cel_transfers/res/res_stasis_json_sounds.exports.in
    team/kmoore/cel_transfers/res/res_stasis_websocket.c
    team/kmoore/cel_transfers/res/stasis_json/
    team/kmoore/cel_transfers/rest-api-templates/event_function_decl.mustache
    team/kmoore/cel_transfers/rest-api-templates/make_stasis_http_stubs.py
    team/kmoore/cel_transfers/rest-api-templates/res_stasis_json_resource.c.mustache
    team/kmoore/cel_transfers/rest-api-templates/res_stasis_json_resource.exports.mustache
    team/kmoore/cel_transfers/rest-api-templates/stasis_json_resource.h.mustache
Modified:
    team/kmoore/cel_transfers/   (props changed)
    team/kmoore/cel_transfers/CHANGES
    team/kmoore/cel_transfers/Makefile
    team/kmoore/cel_transfers/apps/app_minivm.c
    team/kmoore/cel_transfers/apps/app_mixmonitor.c
    team/kmoore/cel_transfers/apps/app_voicemail.c
    team/kmoore/cel_transfers/channels/chan_gtalk.c
    team/kmoore/cel_transfers/configure
    team/kmoore/cel_transfers/configure.ac
    team/kmoore/cel_transfers/include/asterisk/app.h
    team/kmoore/cel_transfers/include/asterisk/autoconfig.h.in
    team/kmoore/cel_transfers/include/asterisk/cel.h
    team/kmoore/cel_transfers/include/asterisk/channel.h
    team/kmoore/cel_transfers/include/asterisk/file.h
    team/kmoore/cel_transfers/include/asterisk/http.h
    team/kmoore/cel_transfers/include/asterisk/json.h
    team/kmoore/cel_transfers/include/asterisk/paths.h
    team/kmoore/cel_transfers/include/asterisk/res_sip.h
    team/kmoore/cel_transfers/include/asterisk/stasis.h
    team/kmoore/cel_transfers/include/asterisk/stasis_bridging.h
    team/kmoore/cel_transfers/include/asterisk/stasis_http.h
    team/kmoore/cel_transfers/include/asterisk/utils.h
    team/kmoore/cel_transfers/main/Makefile
    team/kmoore/cel_transfers/main/aoc.c
    team/kmoore/cel_transfers/main/app.c
    team/kmoore/cel_transfers/main/asterisk.c
    team/kmoore/cel_transfers/main/bridging.c
    team/kmoore/cel_transfers/main/channel.c
    team/kmoore/cel_transfers/main/file.c
    team/kmoore/cel_transfers/main/http.c
    team/kmoore/cel_transfers/main/json.c
    team/kmoore/cel_transfers/main/manager.c
    team/kmoore/cel_transfers/main/stasis.c
    team/kmoore/cel_transfers/main/stasis_bridging.c
    team/kmoore/cel_transfers/main/stasis_channels.c
    team/kmoore/cel_transfers/main/stasis_endpoints.c
    team/kmoore/cel_transfers/main/utils.c
    team/kmoore/cel_transfers/makeopts.in
    team/kmoore/cel_transfers/res/Makefile
    team/kmoore/cel_transfers/res/res_http_websocket.c
    team/kmoore/cel_transfers/res/res_http_websocket.exports.in
    team/kmoore/cel_transfers/res/res_sip.c
    team/kmoore/cel_transfers/res/res_sip.exports.in
    team/kmoore/cel_transfers/res/res_sip/config_auth.c
    team/kmoore/cel_transfers/res/res_sip/sip_configuration.c
    team/kmoore/cel_transfers/res/res_sip/sip_distributor.c
    team/kmoore/cel_transfers/res/res_sip_acl.c
    team/kmoore/cel_transfers/res/res_sip_authenticator_digest.c
    team/kmoore/cel_transfers/res/res_sip_notify.c
    team/kmoore/cel_transfers/res/res_sip_outbound_authenticator_digest.c
    team/kmoore/cel_transfers/res/res_stasis.c
    team/kmoore/cel_transfers/res/res_stasis_http.c
    team/kmoore/cel_transfers/res/res_stasis_http.exports.in
    team/kmoore/cel_transfers/res/res_stasis_http_asterisk.c
    team/kmoore/cel_transfers/res/res_stasis_http_bridges.c
    team/kmoore/cel_transfers/res/res_stasis_http_channels.c
    team/kmoore/cel_transfers/res/res_stasis_http_endpoints.c
    team/kmoore/cel_transfers/res/res_stasis_http_events.c
    team/kmoore/cel_transfers/res/res_stasis_http_playback.c
    team/kmoore/cel_transfers/res/res_stasis_http_recordings.c
    team/kmoore/cel_transfers/res/res_stasis_http_sounds.c
    team/kmoore/cel_transfers/res/res_stasis_playback.c
    team/kmoore/cel_transfers/res/stasis_http/resource_channels.c
    team/kmoore/cel_transfers/res/stasis_http/resource_channels.h
    team/kmoore/cel_transfers/res/stasis_http/resource_events.c
    team/kmoore/cel_transfers/res/stasis_http/resource_events.h
    team/kmoore/cel_transfers/res/stasis_http/resource_recordings.c
    team/kmoore/cel_transfers/res/stasis_http/resource_recordings.h
    team/kmoore/cel_transfers/rest-api-templates/asterisk_processor.py
    team/kmoore/cel_transfers/rest-api-templates/res_stasis_http_resource.c.mustache
    team/kmoore/cel_transfers/rest-api-templates/rest_handler.mustache
    team/kmoore/cel_transfers/rest-api-templates/stasis_http_resource.c.mustache
    team/kmoore/cel_transfers/rest-api-templates/stasis_http_resource.h.mustache
    team/kmoore/cel_transfers/rest-api-templates/swagger_model.py
    team/kmoore/cel_transfers/rest-api-templates/transform.py
    team/kmoore/cel_transfers/rest-api/api-docs/asterisk.json
    team/kmoore/cel_transfers/rest-api/api-docs/bridges.json
    team/kmoore/cel_transfers/rest-api/api-docs/channels.json
    team/kmoore/cel_transfers/rest-api/api-docs/endpoints.json
    team/kmoore/cel_transfers/rest-api/api-docs/events.json
    team/kmoore/cel_transfers/rest-api/api-docs/playback.json
    team/kmoore/cel_transfers/rest-api/api-docs/recordings.json
    team/kmoore/cel_transfers/rest-api/api-docs/sounds.json
    team/kmoore/cel_transfers/tests/test_res_stasis.c
    team/kmoore/cel_transfers/tests/test_stasis_channels.c
    team/kmoore/cel_transfers/tests/test_stasis_http.c
    team/kmoore/cel_transfers/tests/test_utils.c

Propchange: team/kmoore/cel_transfers/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/kmoore/cel_transfers/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jul  3 16:09:00 2013
@@ -1,1 +1,1 @@
-/trunk:1-393398
+/trunk:1-393587

Modified: team/kmoore/cel_transfers/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/CHANGES?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/CHANGES (original)
+++ team/kmoore/cel_transfers/CHANGES Wed Jul  3 16:09:00 2013
@@ -196,8 +196,8 @@
    event, the various ChanVariable fields will contain a suffix that specifies
    which channel they correspond to.
 
-* The NewPeerAccount AMI event is no longer raised. The NewAccountCode AMI
-  event always conveys the AMI event for a particular channel.
+ * The NewPeerAccount AMI event is no longer raised. The NewAccountCode AMI
+   event always conveys the AMI event for a particular channel.
 
  * All "Reload" events have been consolidated into a single event type. This
    event will always contain a Module field specifying the name of the module
@@ -251,6 +251,8 @@
    renamed "DAHDIChannel" since it does not convey an Asterisk channel name.
 
  * "ChannelUpdate" events have been removed.
+
+ * AMI events now contain a SystemName field, if available.
 
 AGI (Asterisk Gateway Interface)
 ------------------

Modified: team/kmoore/cel_transfers/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/Makefile?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/Makefile (original)
+++ team/kmoore/cel_transfers/Makefile Wed Jul  3 16:09:00 2013
@@ -416,6 +416,7 @@
 	rm -f main/version.c
 	rm -f doc/core-en_US.xml
 	rm -f doc/full-en_US.xml
+	rm -f docs/rest-api/*.wiki
 	@$(MAKE) -C menuselect clean
 	cp -f .cleancount .lastclean
 
@@ -535,7 +536,8 @@
 INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \
 	"$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \
 	"$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \
-	"$(ASTSPOOLDIR)/voicemail" "$(ASTHEADERDIR)" "$(ASTHEADERDIR)/doxygen" \
+	"$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \
+	"$(ASTHEADERDIR)" "$(ASTHEADERDIR)/doxygen" \
 	"$(ASTLOGDIR)" "$(ASTLOGDIR)/cdr-csv" "$(ASTLOGDIR)/cdr-custom" \
 	"$(ASTLOGDIR)/cel-custom" "$(ASTDATADIR)" "$(ASTDATADIR)/documentation" \
 	"$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \
@@ -963,15 +965,15 @@
 
 # We don't want to require Python or Pystache for every build, so this is its
 # own target.
-stasis-stubs:
+ari-stubs:
 ifeq ($(PYTHON),:)
 	@echo "--------------------------------------------------------------------------"
-	@echo "---        Please install python to build Stasis HTTP stubs            ---"
+	@echo "---        Please install python to build ARI stubs            ---"
 	@echo "--------------------------------------------------------------------------"
 	@false
 else
-	$(PYTHON) rest-api-templates/make_stasis_http_stubs.py \
-		rest-api/resources.json res/
+	$(PYTHON) rest-api-templates/make_ari_stubs.py \
+		rest-api/resources.json .
 endif
 
 .PHONY: menuselect
@@ -993,7 +995,7 @@
 .PHONY: installdirs
 .PHONY: validate-docs
 .PHONY: _clean
-.PHONY: stasis-stubs
+.PHONY: ari-stubs
 .PHONY: $(SUBDIRS_INSTALL)
 .PHONY: $(SUBDIRS_DIST_CLEAN)
 .PHONY: $(SUBDIRS_CLEAN)

Modified: team/kmoore/cel_transfers/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/apps/app_minivm.c?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/apps/app_minivm.c (original)
+++ team/kmoore/cel_transfers/apps/app_minivm.c Wed Jul  3 16:09:00 2013
@@ -1674,7 +1674,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, MVM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf);
+			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
 			if (cmd == -1) /* User has hung up, no options to give */

Modified: team/kmoore/cel_transfers/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/apps/app_mixmonitor.c?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/apps/app_mixmonitor.c (original)
+++ team/kmoore/cel_transfers/apps/app_mixmonitor.c Wed Jul  3 16:09:00 2013
@@ -79,7 +79,6 @@
 					</option>
 					<option name="b">
 						<para>Only save audio to the file while the channel is bridged.</para>
-						<note><para>Does not include conferences or sounds played to each bridged party</para></note>
 						<note><para>If you utilize this option inside a Local channel, you must make sure the Local
 						channel is not optimized away. To do this, be sure to call your Local channel with the
 						<literal>/n</literal> option. For example: Dial(Local/start at mycontext/n)</para></note>
@@ -104,7 +103,6 @@
 						<para>Use the specified file to record the <emphasis>receive</emphasis> audio feed.
 						Like with the basic filename argument, if an absolute path isn't given, it will create
 						the file in the configured monitoring directory.</para>
-
 					</option>
 					<option name="t">
 						<argument name="file" required="true" />
@@ -134,11 +132,7 @@
 			<para>Records the audio on the current channel to the specified file.</para>
 			<para>This application does not automatically answer and should be preceeded by
 			an application such as Answer or Progress().</para>
-			<note><para>MixMonitor runs as an audiohook. In order to keep it running through
-			a transfer, AUDIOHOOK_INHERIT must be set for the channel which ran mixmonitor.
-			For more information, including dialplan configuration set for using
-			AUDIOHOOK_INHERIT with MixMonitor, see the function documentation for
-			AUDIOHOOK_INHERIT.</para></note>
+			<note><para>MixMonitor runs as an audiohook.</para></note>
 			<variablelist>
 				<variable name="MIXMONITOR_FILENAME">
 					<para>Will contain the filename used to record.</para>
@@ -649,7 +643,9 @@
 		 * Unlock it, but remember to lock it before looping or exiting */
 		ast_audiohook_unlock(&mixmonitor->audiohook);
 
-		if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) || (mixmonitor->autochan->chan && ast_bridged_channel(mixmonitor->autochan->chan))) {
+		if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED)
+			|| (mixmonitor->autochan->chan
+				&& ast_channel_is_bridged(mixmonitor->autochan->chan))) {
 			ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
 
 			/* Write out the frame(s) */
@@ -808,7 +804,9 @@
 				*p2 = '$';
 			}
 		}
+		ast_channel_lock(chan);
 		pbx_substitute_variables_helper(chan, p1, postprocess2, sizeof(postprocess2) - 1);
+		ast_channel_unlock(chan);
 	}
 
 	/* Pre-allocate mixmonitor structure and spy */
@@ -947,7 +945,7 @@
 	char *filename_read = NULL;
 	char *filename_write = NULL;
 	char filename_buffer[1024] = "";
-        char *uid_channel_var = NULL;
+	char *uid_channel_var = NULL;
 
 	struct ast_flags flags = { 0 };
 	char *recipients = NULL;
@@ -1072,9 +1070,10 @@
 
 	ast_channel_lock(chan);
 
-	if (!(datastore = ast_channel_datastore_find(chan, &mixmonitor_ds_info, args.mixmonid))) {
+	datastore = ast_channel_datastore_find(chan, &mixmonitor_ds_info, args.mixmonid);
+	if (!datastore) {
 		ast_channel_unlock(chan);
-                return -1;
+		return -1;
 	}
 	mixmonitor_ds = datastore->data;
 
@@ -1124,9 +1123,11 @@
 	case CLI_INIT:
 		e->command = "mixmonitor {start|stop|list}";
 		e->usage =
-			"Usage: mixmonitor <start|stop|list> <chan_name> [args]\n"
-			"       The optional arguments are passed to the MixMonitor\n"
-			"       application when the 'start' command is used.\n";
+			"Usage: mixmonitor start <chan_name> [args]\n"
+			"         The optional arguments are passed to the MixMonitor application.\n"
+			"       mixmonitor stop <chan_name> [args]\n"
+			"         The optional arguments are passed to the StopMixMonitor application.\n"
+			"       mixmonitor list <chan_name>\n";
 		return NULL;
 	case CLI_GENERATE:
 		return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
@@ -1142,35 +1143,35 @@
 		return CLI_SUCCESS;
 	}
 
-	ast_channel_lock(chan);
-
 	if (!strcasecmp(a->argv[1], "start")) {
 		mixmonitor_exec(chan, (a->argc >= 4) ? a->argv[3] : "");
-		ast_channel_unlock(chan);
 	} else if (!strcasecmp(a->argv[1], "stop")){
-		ast_channel_unlock(chan);
 		stop_mixmonitor_exec(chan, (a->argc >= 4) ? a->argv[3] : "");
 	} else if (!strcasecmp(a->argv[1], "list")) {
 		ast_cli(a->fd, "MixMonitor ID\tFile\tReceive File\tTransmit File\n");
 		ast_cli(a->fd, "=========================================================================\n");
+		ast_channel_lock(chan);
 		AST_LIST_TRAVERSE(ast_channel_datastores(chan), datastore, entry) {
 			if (datastore->info == &mixmonitor_ds_info) {
 				char *filename = "";
 				char *filename_read = "";
 				char *filename_write = "";
+
 				mixmonitor_ds = datastore->data;
-				if (mixmonitor_ds->fs)
-					filename = ast_strdupa(mixmonitor_ds->fs->filename);
-				if (mixmonitor_ds->fs_read)
-					filename_read = ast_strdupa(mixmonitor_ds->fs_read->filename);
-				if (mixmonitor_ds->fs_write)
-					filename_write = ast_strdupa(mixmonitor_ds->fs_write->filename);
+				if (mixmonitor_ds->fs) {
+					filename = mixmonitor_ds->fs->filename;
+				}
+				if (mixmonitor_ds->fs_read) {
+					filename_read = mixmonitor_ds->fs_read->filename;
+				}
+				if (mixmonitor_ds->fs_write) {
+					filename_write = mixmonitor_ds->fs_write->filename;
+				}
 				ast_cli(a->fd, "%p\t%s\t%s\t%s\n", mixmonitor_ds, filename, filename_read, filename_write);
 			}
 		}
 		ast_channel_unlock(chan);
 	} else {
-		ast_channel_unlock(chan);
 		chan = ast_channel_unref(chan);
 		return CLI_SHOWUSAGE;
 	}
@@ -1183,15 +1184,12 @@
 /*! \brief  Mute / unmute  a MixMonitor channel */
 static int manager_mute_mixmonitor(struct mansession *s, const struct message *m)
 {
-	struct ast_channel *c = NULL;
-
+	struct ast_channel *c;
 	const char *name = astman_get_header(m, "Channel");
 	const char *id = astman_get_header(m, "ActionID");
 	const char *state = astman_get_header(m, "State");
 	const char *direction = astman_get_header(m,"Direction");
-
 	int clearmute = 1;
-
 	enum ast_audiohook_flags flag;
 
 	if (ast_strlen_zero(direction)) {
@@ -1221,15 +1219,15 @@
 	}
 
 	clearmute = ast_false(state);
+
 	c = ast_channel_get_by_name(name);
-
 	if (!c) {
 		astman_send_error(s, m, "No such channel");
 		return AMI_SUCCESS;
 	}
 
 	if (ast_audiohook_set_mute(c, mixmonitor_spy_type, flag, clearmute)) {
-		c = ast_channel_unref(c);
+		ast_channel_unref(c);
 		astman_send_error(s, m, "Cannot set mute flag");
 		return AMI_SUCCESS;
 	}
@@ -1242,29 +1240,22 @@
 
 	astman_append(s, "\r\n");
 
-	c = ast_channel_unref(c);
+	ast_channel_unref(c);
 
 	return AMI_SUCCESS;
 }
 
 static int start_mixmonitor_callback(struct ast_channel *chan, const char *filename, const char *options)
 {
-	char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
-	struct ast_flags flags = { 0 };
-	char args[PATH_MAX] = "";
-	int res;
-
-	if (!ast_strlen_zero(options)) {
-		ast_app_parse_options(mixmonitor_opts, &flags, opts, ast_strdupa(options));
-	}
-
-	snprintf(args, sizeof(args), "%s,%s", filename, options);
-
-	ast_channel_lock(chan);
-	res = mixmonitor_exec(chan, args);
-	ast_channel_unlock(chan);
-
-	return res;
+	char args[PATH_MAX];
+
+	if (ast_strlen_zero(options)) {
+		snprintf(args, sizeof(args), "%s", filename);
+	} else {
+		snprintf(args, sizeof(args), "%s,%s", filename, options);
+	}
+
+	return mixmonitor_exec(chan, args);
 }
 
 static int stop_mixmonitor_callback(struct ast_channel *chan, const char *mixmonitor_id)
@@ -1274,8 +1265,7 @@
 
 static int manager_mixmonitor(struct mansession *s, const struct message *m)
 {
-	struct ast_channel *c = NULL;
-
+	struct ast_channel *c;
 	const char *name = astman_get_header(m, "Channel");
 	const char *id = astman_get_header(m, "ActionID");
 	const char *file = astman_get_header(m, "File");
@@ -1284,16 +1274,15 @@
 	struct ast_flags flags = { 0 };
 	char *uid_channel_var = NULL;
 	const char *mixmonitor_id = NULL;
-
 	int res;
-	char args[PATH_MAX] = "";
+	char args[PATH_MAX];
+
 	if (ast_strlen_zero(name)) {
 		astman_send_error(s, m, "No channel specified");
 		return AMI_SUCCESS;
 	}
 
 	c = ast_channel_get_by_name(name);
-
 	if (!c) {
 		astman_send_error(s, m, "No such channel");
 		return AMI_SUCCESS;
@@ -1305,17 +1294,18 @@
 
 	snprintf(args, sizeof(args), "%s,%s", file, options);
 
-	ast_channel_lock(c);
 	res = mixmonitor_exec(c, args);
 
 	if (ast_test_flag(&flags, MUXFLAG_UID)) {
 		uid_channel_var = opts[OPT_ARG_UID];
+		ast_channel_lock(c);
 		mixmonitor_id = pbx_builtin_getvar_helper(c, uid_channel_var);
-	}
-	ast_channel_unlock(c);
+		mixmonitor_id = ast_strdupa(S_OR(mixmonitor_id, ""));
+		ast_channel_unlock(c);
+	}
 
 	if (res) {
-		c = ast_channel_unref(c);
+		ast_channel_unref(c);
 		astman_send_error(s, m, "Could not start monitoring channel");
 		return AMI_SUCCESS;
 	}
@@ -1332,35 +1322,33 @@
 
 	astman_append(s, "\r\n");
 
-	c = ast_channel_unref(c);
+	ast_channel_unref(c);
 
 	return AMI_SUCCESS;
 }
 
 static int manager_stop_mixmonitor(struct mansession *s, const struct message *m)
 {
-	struct ast_channel *c = NULL;
-
+	struct ast_channel *c;
 	const char *name = astman_get_header(m, "Channel");
 	const char *id = astman_get_header(m, "ActionID");
 	const char *mixmonitor_id = astman_get_header(m, "MixMonitorID");
-
 	int res;
+
 	if (ast_strlen_zero(name)) {
 		astman_send_error(s, m, "No channel specified");
 		return AMI_SUCCESS;
 	}
 
 	c = ast_channel_get_by_name(name);
-
 	if (!c) {
 		astman_send_error(s, m, "No such channel");
 		return AMI_SUCCESS;
 	}
 
 	res = stop_mixmonitor_full(c, mixmonitor_id);
-
 	if (res) {
+		ast_channel_unref(c);
 		astman_send_error(s, m, "Could not stop monitoring channel");
 		return AMI_SUCCESS;
 	}
@@ -1373,7 +1361,7 @@
 
 	astman_append(s, "\r\n");
 
-	c = ast_channel_unref(c);
+	ast_channel_unref(c);
 
 	return AMI_SUCCESS;
 }

Modified: team/kmoore/cel_transfers/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/apps/app_voicemail.c?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/apps/app_voicemail.c (original)
+++ team/kmoore/cel_transfers/apps/app_voicemail.c Wed Jul  3 16:09:00 2013
@@ -14684,7 +14684,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, VM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, sound_duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf);
+			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, sound_duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf, 0, AST_RECORD_IF_EXISTS_OVERWRITE);
 			if (strchr(canceldtmf, cmd)) {
 			/* need this flag here to distinguish between pressing '0' during message recording or after */
 				canceleddtmf = 1;

Modified: team/kmoore/cel_transfers/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/channels/chan_gtalk.c?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/channels/chan_gtalk.c (original)
+++ team/kmoore/cel_transfers/channels/chan_gtalk.c Wed Jul  3 16:09:00 2013
@@ -1214,8 +1214,6 @@
 		ast_channel_hangupcause_set(tmp, AST_CAUSE_SWITCH_CONGESTION);
 		ast_hangup(tmp);
 		tmp = NULL;
-	} else {
-		send_channel_update(i->owner, i->sid);
 	}
 	return tmp;
 }

Modified: team/kmoore/cel_transfers/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/configure.ac?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/configure.ac (original)
+++ team/kmoore/cel_transfers/configure.ac Wed Jul  3 16:09:00 2013
@@ -388,6 +388,7 @@
 AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
 AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
+AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
 AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
 AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_SRTP], [OpenSSL SRTP Extension Support], [CRYPTO], [crypto])
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
@@ -2148,6 +2149,29 @@
 	exit 1
 fi
 
+# Find crypt support
+# * -lcrypt on *NIX
+# * in libsystem on OS X
+AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
+AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=""])
+
+if test "x$LIBCRYPT_LIB" != "x" ; then
+    CRYPT_LIB="$LIBCRYPT_LIB"
+    CRYPT_INCLUDE="$LIBCRYPT_INCLUDE"
+    AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' function.])
+elif test "x$SYSCRYPT" != "x" ; then
+    CRYPT_LIB=""
+    CRYPT_INCLUDE=""
+    AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' function.])
+fi
+
+AC_SUBST(CRYPT_LIB)
+AC_SUBST(CRYPT_INCLUDE)
+
+# Find crypt_r support
+AC_CHECK_LIB([crypt], [crypt_r],
+    [AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the `crypt_r' function.])])
+
 AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
 
 if test "$PBX_CRYPTO" = "1";

Propchange: team/kmoore/cel_transfers/doc/rest-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jul  3 16:09:00 2013
@@ -1,0 +1,1 @@
+*.wiki

Modified: team/kmoore/cel_transfers/include/asterisk/app.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/app.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/app.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/app.h Wed Jul  3 16:09:00 2013
@@ -691,8 +691,22 @@
 int ast_play_and_wait(struct ast_channel *chan, const char *fn);
 
 /*!
+ * Possible actions to take if a recording already exists
+ * \since 12
+ */
+enum ast_record_if_exists {
+	/*! Fail the recording. */
+	AST_RECORD_IF_EXISTS_FAIL,
+	/*! Overwrite the existing recording. */
+	AST_RECORD_IF_EXISTS_OVERWRITE,
+	/*! Append to the existing recording. */
+	AST_RECORD_IF_EXISTS_APPEND,
+};
+
+/*!
  * \brief Record a file based on input from a channel
- *        This function will play "auth-thankyou" upon successful recording.
+ *        This function will play "auth-thankyou" upon successful recording if
+ *        skip_confirmation_sound is false.
  *
  * \param chan the channel being recorded
  * \param playfile Filename of sound to play before recording begins
@@ -706,13 +720,15 @@
  * \param path Optional filesystem path to unlock
  * \param acceptdtmf Character of DTMF to end and accept the recording
  * \param canceldtmf Character of DTMF to end and cancel the recording
+ * \param skip_confirmation_sound If true, don't play auth-thankyou at end. Nice for custom recording prompts in apps.
+ * \param if_exists Action to take if recording already exists.
  *
  * \retval -1 failure or hangup
  * \retval 'S' Recording ended from silence timeout
  * \retval 't' Recording ended from the message exceeding the maximum duration
  * \retval dtmfchar Recording ended via the return value's DTMF character for either cancel or accept.
  */
-int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence_ms, const char *path, const char *acceptdtmf, const char *canceldtmf);
+int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int *sound_duration, int silencethreshold, int maxsilence_ms, const char *path, const char *acceptdtmf, const char *canceldtmf, int skip_confirmation_sound, enum ast_record_if_exists if_exists);
 
 /*!
  * \brief Record a file based on input from a channel. Use default accept and cancel DTMF.

Modified: team/kmoore/cel_transfers/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/autoconfig.h.in?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/autoconfig.h.in (original)
+++ team/kmoore/cel_transfers/include/asterisk/autoconfig.h.in Wed Jul  3 16:09:00 2013
@@ -149,8 +149,14 @@
 /* Define to 1 if you have the `cosl' function. */
 #undef HAVE_COSL
 
+/* Define to 1 if you have the `crypt' function. */
+#undef HAVE_CRYPT
+
 /* Define to 1 if you have the OpenSSL Cryptography library. */
 #undef HAVE_CRYPTO
+
+/* Define to 1 if you have the `crypt_r' function. */
+#undef HAVE_CRYPT_R
 
 /* Define to 1 if you have a functional curl library. */
 #undef HAVE_CURL

Modified: team/kmoore/cel_transfers/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/cel.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/cel.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/cel.h Wed Jul  3 16:09:00 2013
@@ -268,7 +268,10 @@
 	);
 	int enable;			/*!< Whether CEL is enabled */
 	int64_t events;			/*!< The events to be logged */
-	struct ao2_container *apps;	/*!< The apps for which to log app start and end events */
+	/*! The apps for which to log app start and end events. This is
+	 * ast_str_container_alloc()ed and filled with ao2-allocated
+	 * char* which are all-lowercase application names. */
+	struct ao2_container *apps;
 };
 
 /*!

Modified: team/kmoore/cel_transfers/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/channel.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/channel.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/channel.h Wed Jul  3 16:09:00 2013
@@ -1602,6 +1602,18 @@
  * \retval non-zero on failure
  */
 int ast_answer(struct ast_channel *chan);
+
+/*!
+ * \brief Answer a channel, if it's not already answered.
+ *
+ * \param chan channel to answer
+ *
+ * \details See ast_answer()
+ *
+ * \retval 0 on success
+ * \retval non-zero on failure
+ */
+int ast_auto_answer(struct ast_channel *chan);
 
 /*!
  * \brief Answer a channel

Modified: team/kmoore/cel_transfers/include/asterisk/file.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/file.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/file.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/file.h Wed Jul  3 16:09:00 2013
@@ -64,8 +64,8 @@
  */
 typedef void (ast_waitstream_fr_cb)(struct ast_channel *chan, long ms, enum ast_waitstream_fr_cb_values val);
 
-/*! 
- * \brief Streams a file 
+/*!
+ * \brief Streams a file
  * \param c channel to stream the file to
  * \param filename the name of the file you wish to stream, minus the extension
  * \param preflang the preferred language you wish to have the file streamed to you in
@@ -86,12 +86,12 @@
  */
 int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *digits);
 
-/*! 
- * \brief Stops a stream 
+/*!
+ * \brief Stops a stream
  *
  * \param c The channel you wish to stop playback on
  *
- * Stop playback of a stream 
+ * Stop playback of a stream
  *
  * \retval 0 always
  *

Modified: team/kmoore/cel_transfers/include/asterisk/http.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/http.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/http.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/http.h Wed Jul  3 16:09:00 2013
@@ -112,6 +112,26 @@
 /*! \brief Get cookie from Request headers */
 struct ast_variable *ast_http_get_cookies(struct ast_variable *headers);
 
+/*! \brief HTTP authentication information. */
+struct ast_http_auth {
+	/*! Provided userid. */
+	char *userid;
+	/*! For Basic auth, the provided password. */
+	char *password;
+};
+
+/*!
+ * \brief Get HTTP authentication information from headers.
+ *
+ * The returned object is AO2 managed, so clean up with ao2_cleanup().
+ *
+ * \param headers HTTP request headers.
+ * \return HTTP auth structure.
+ * \return \c NULL if no supported HTTP auth headers present.
+ * \since 12
+ */
+struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers);
+
 /*! \brief Register a URI handler */
 int ast_http_uri_link(struct ast_http_uri *urihandler);
 

Modified: team/kmoore/cel_transfers/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/json.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/json.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/json.h Wed Jul  3 16:09:00 2013
@@ -157,6 +157,15 @@
  * \return Type of \a value.
  */
 enum ast_json_type ast_json_typeof(const struct ast_json *value);
+
+/*!
+ * \brief Get the string name for the given type.
+ * \since 12.0.0
+ * \param type Type to convert to string.
+ * \return Simple string for the type name (object, array, string, etc.)
+ * \return \c "?" for invalid types.
+ */
+const char *ast_json_typename(enum ast_json_type type);
 
 /*!@}*/
 

Modified: team/kmoore/cel_transfers/include/asterisk/paths.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/paths.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/paths.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/paths.h Wed Jul  3 16:09:00 2013
@@ -23,6 +23,7 @@
 extern const char *ast_config_AST_MODULE_DIR;
 extern const char *ast_config_AST_SPOOL_DIR;
 extern const char *ast_config_AST_MONITOR_DIR;
+extern const char *ast_config_AST_RECORDING_DIR;
 extern const char *ast_config_AST_VAR_DIR;
 extern const char *ast_config_AST_DATA_DIR;
 extern const char *ast_config_AST_LOG_DIR;

Modified: team/kmoore/cel_transfers/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/res_sip.h?view=diff&rev=393588&r1=393587&r2=393588
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/res_sip.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/res_sip.h Wed Jul  3 16:09:00 2013
@@ -237,6 +237,8 @@
 	AST_SIP_AUTH_TYPE_USER_PASS,
 	/*! Credentials stored as an MD5 sum */
 	AST_SIP_AUTH_TYPE_MD5,
+	/*! Credentials not stored this is a fake auth */
+	AST_SIP_AUTH_TYPE_ARTIFICIAL
 };
 
 #define SIP_SORCERY_AUTH_TYPE "auth"
@@ -481,6 +483,17 @@
     struct ast_sip_endpoint *(*identify_endpoint)(pjsip_rx_data *rdata);
 };
 
+#define SIP_SORCERY_SECURITY_TYPE "security"
+
+/*!
+ * \brief SIP security details and configuration.
+ */
+struct ast_sip_security {
+	SORCERY_OBJECT(details);
+	struct ast_acl_list *acl;
+	struct ast_acl_list *contact_acl;
+};
+
 /*!
  * \brief Register a SIP service in Asterisk.
  *
@@ -778,6 +791,16 @@
 int ast_sip_initialize_sorcery_auth(struct ast_sorcery *sorcery);
 
 /*!
+ * \brief Initialize security support on a sorcery instance
+ *
+ * \param sorcery The sorcery instance
+ *
+ * \retval -1 failure
+ * \retval 0 success
+ */
+int ast_sip_initialize_sorcery_security(struct ast_sorcery *sorcery);
+
+/*!
  * \brief Callback called when an outbound request with authentication credentials is to be sent in dialog
  *
  * This callback will have the created request on it. The callback's purpose is to do any extra
@@ -824,6 +847,27 @@
  * \retval 0 Success
  */
 int ast_sip_initialize_distributor(void);
+
+/*!
+ * \brief Destruct the distributor module.
+ *
+ * Unregisters pjsip modules and cleans up any allocated resources.
+ */
+void ast_sip_destroy_distributor(void);
+
+/*!
+ * \brief Retrieves a reference to the artificial auth.
+ *
+ * \retval The artificial auth
+ */
+struct ast_sip_auth *ast_sip_get_artificial_auth(void);
+
+/*!
+ * \brief Retrieves a reference to the artificial endpoint.
+ *
+ * \retval The artificial endpoint
+ */
+struct ast_sip_endpoint *ast_sip_get_artificial_endpoint(void);
 
 /*!

[... 9155 lines stripped ...]



More information about the asterisk-commits mailing list