[asterisk-commits] may: branch may/ooh323_qsig r397686 - in /team/may/ooh323_qsig: ./ apps/ chan...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 26 17:41:46 CDT 2013


Author: may
Date: Mon Aug 26 17:41:34 2013
New Revision: 397686

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397686
Log:
Multiple revisions 393410,393429,393442,393449,393463,393484-393485,393487,393489-393490,393493-393494,393496,393500,393508,393528-393530

........
  r393410 | kmoore | 2013-07-02 18:01:53 +0400 (Tue, 02 Jul 2013) | 10 lines
  
  Add CEL unit tests and do some cleanup
  
  This adds several unit tests for CEL functionality and provides the
  requisite framework for creating additional unit tests.
  
  This also cleans up some reference leaks that were occurring in
  Stasis-Core message callback code.
  
  Review: https://reviewboard.asterisk.org/r/2646/
........
  r393429 | kmoore | 2013-07-02 20:11:32 +0400 (Tue, 02 Jul 2013) | 1 line
  
  Fix transfer AMI event parameter naming
........
  r393442 | kharwell | 2013-07-02 21:06:06 +0400 (Tue, 02 Jul 2013) | 13 lines
  
  New SIP Channel driver: Always Auth Reject
  
  If no matching endpoint is found for the incoming request Asterisk will respond
  with a 401 Unauthorized (rejecting the request), but will first challenge if
  no authorization creditials are given.
  
  Changes also included moving ACL options into a new global 'security'
  configuration section in res_sip.conf.
  
  (closes issue ASTERISK-21433)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2554/
........
  r393449 | kharwell | 2013-07-02 21:20:20 +0400 (Tue, 02 Jul 2013) | 12 lines
  
  Stasis - Refactor AOC Events
  
  Refactored the AMI events in AOC onto Stasis-Core.  The ast_aoc_manager_event
  function now publishes a channel snapshot, along with a JSON blob describing
  the advice of charge.  A "to_ami" handler has also been added that converts
  the channel snapshot and AOC event data back into the appropriate data structure
  for use with AMI.
  
  (closes issue ASTERISK-21472)
  Reported by: Matt Jordan
  Review: https://reviewboard.asterisk.org/r/2643/
........
  r393463 | mmichelson | 2013-07-02 22:28:16 +0400 (Tue, 02 Jul 2013) | 6 lines
  
  Remove unused blind transfer publication structure.
  
  I ended up using a bridge blob, so this structure was
  unused. Keeping it in the header would just cause confusion.
........
  r393484 | dlee | 2013-07-03 00:34:42 +0400 (Wed, 03 Jul 2013) | 1 line
  
  Add pjproject dependency to res_sip_notify
........
  r393485 | rmudgett | 2013-07-03 00:43:10 +0400 (Wed, 03 Jul 2013) | 1 line
  
  Fix chan_gtalk.c compile error.
........
  r393487 | rmudgett | 2013-07-03 00:45:47 +0400 (Wed, 03 Jul 2013) | 5 lines
  
  Fix MixMonitor b option.
  
  The option had not been converted to use the replacement for
  ast_bridged_channel().  One touch mixmonitor now records files again.
........
  r393489 | rmudgett | 2013-07-03 00:56:13 +0400 (Wed, 03 Jul 2013) | 2 lines
  
  MixMonitor: Remove some unnecessary channel locking.
........
  r393490 | rmudgett | 2013-07-03 01:01:23 +0400 (Wed, 03 Jul 2013) | 2 lines
  
  MixMonitor: Fix refleak in manager_stop_mixmonitor() if could not stop monitoring.
........
  r393493 | rmudgett | 2013-07-03 01:12:26 +0400 (Wed, 03 Jul 2013) | 2 lines
  
  MixMonitor: Update XML documentation and CLI "mixmonitor {start|stop|list}" help.
........
  r393494 | rmudgett | 2013-07-03 01:13:56 +0400 (Wed, 03 Jul 2013) | 2 lines
  
  MixMonitor: Don't use ast_strdupa() in a loop.
........
  r393496 | rmudgett | 2013-07-03 01:16:25 +0400 (Wed, 03 Jul 2013) | 4 lines
  
  MixMonitor: Make start_mixmonitor_callback() options parameter NULL tolerant.
  
  * Removed some unnecessary code in start_mixmonitor_callback().
........
  r393500 | rmudgett | 2013-07-03 01:19:21 +0400 (Wed, 03 Jul 2013) | 2 lines
  
  MixMonitor: Minor code cleanup.
........
  r393508 | qwell | 2013-07-03 02:01:23 +0400 (Wed, 03 Jul 2013) | 6 lines
  
  Add a SystemName field to all AMI events.
  
  This only gets sent out if configured in asterisk.conf
  
  (closes issue ASTERISK-21494)
........
  r393528 | dlee | 2013-07-03 20:32:00 +0400 (Wed, 03 Jul 2013) | 1 line
........
  r393529 | dlee | 2013-07-03 20:32:41 +0400 (Wed, 03 Jul 2013) | 1 line
........
  r393530 | dlee | 2013-07-03 20:33:13 +0400 (Wed, 03 Jul 2013) | 1 line
........

Merged revisions 393410,393429,393442,393449,393463,393484-393485,393487,393489-393490,393493-393494,393496,393500,393508,393528-393530 from http://svn.asterisk.org/svn/asterisk/trunk

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

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Aug 26 17:41:34 2013
@@ -1,1 +1,1 @@
-/trunk:1-380157,380165-391000,391012,391016-393400
+/trunk:1-380157,380165-391000,391012,391016-393400,393410-393530

Modified: team/may/ooh323_qsig/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/CHANGES?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/CHANGES (original)
+++ team/may/ooh323_qsig/CHANGES Mon Aug 26 17:41:34 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/may/ooh323_qsig/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/Makefile?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/Makefile (original)
+++ team/may/ooh323_qsig/Makefile Mon Aug 26 17:41:34 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
 
@@ -963,15 +964,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 +994,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/may/ooh323_qsig/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_mixmonitor.c?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/apps/app_mixmonitor.c (original)
+++ team/may/ooh323_qsig/apps/app_mixmonitor.c Mon Aug 26 17:41:34 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/may/ooh323_qsig/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_gtalk.c?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/channels/chan_gtalk.c (original)
+++ team/may/ooh323_qsig/channels/chan_gtalk.c Mon Aug 26 17:41:34 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/may/ooh323_qsig/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/configure.ac?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/configure.ac (original)
+++ team/may/ooh323_qsig/configure.ac Mon Aug 26 17:41:34 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/may/ooh323_qsig/doc/rest-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Aug 26 17:41:34 2013
@@ -1,0 +1,1 @@
+*.wiki

Modified: team/may/ooh323_qsig/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/autoconfig.h.in?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/autoconfig.h.in (original)
+++ team/may/ooh323_qsig/include/asterisk/autoconfig.h.in Mon Aug 26 17:41:34 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/may/ooh323_qsig/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/cel.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/cel.h (original)
+++ team/may/ooh323_qsig/include/asterisk/cel.h Mon Aug 26 17:41:34 2013
@@ -263,6 +263,68 @@
  */
 struct stasis_topic *ast_cel_topic(void);
 
+/*! \brief A structure to hold CEL global configuration options */
+struct ast_cel_general_config {
+	AST_DECLARE_STRING_FIELDS(
+		AST_STRING_FIELD(date_format); /*!< The desired date format for logging */
+	);
+	int enable;			/*!< Whether CEL is enabled */
+	int64_t events;			/*!< The events to be logged */
+	/*! 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;
+};
+
+/*!
+ * \brief Allocate a CEL configuration object
+ *
+ * \retval NULL on error
+ * \retval The new CEL configuration object
+ */
+void *ast_cel_general_config_alloc(void);
+
+/*!
+ * \since 12
+ * \brief Obtain the current CEL configuration
+ *
+ * The configuration is a ref counted object. The caller of this function must
+ * decrement the ref count when finished with the configuration.
+ *
+ * \retval NULL on error
+ * \retval The current CEL configuration
+ */
+struct ast_cel_general_config *ast_cel_get_config(void);
+
+/*!
+ * \since 12
+ * \brief Set the current CEL configuration
+ *
+ * \param config The new CEL configuration
+ */
+void ast_cel_set_config(struct ast_cel_general_config *config);
+
+struct ast_channel_snapshot;
+/*!
+ * \brief Allocate and populate a CEL event structure
+ *
+ * \param snapshot An ast_channel_snapshot of the primary channel associated
+ *        with this channel event.
+ * \param event_type The type of call event being reported.
+ * \param userdefevname Custom name for the call event. (optional)
+ * \param extra An opaque field that will go into the "CEL_EXTRA" information
+ *        element of the call event. (optional)
+ * \param peer_name The peer name to be placed into the event. (optional)
+ *
+ * \since 12
+ *
+ * \retval The created ast_event structure
+ * \retval NULL on failure
+ */
+struct ast_event *ast_cel_create_event(struct ast_channel_snapshot *snapshot,
+		enum ast_cel_event_type event_type, const char *userdefevname,
+		const char *extra, const char *peer_name);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif

Modified: team/may/ooh323_qsig/include/asterisk/http.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/http.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/http.h (original)
+++ team/may/ooh323_qsig/include/asterisk/http.h Mon Aug 26 17:41:34 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/may/ooh323_qsig/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/json.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/json.h (original)
+++ team/may/ooh323_qsig/include/asterisk/json.h Mon Aug 26 17:41:34 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/may/ooh323_qsig/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/res_sip.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/res_sip.h (original)
+++ team/may/ooh323_qsig/include/asterisk/res_sip.h Mon Aug 26 17:41:34 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);
 
 /*!
  * \page Threading model for SIP

Modified: team/may/ooh323_qsig/include/asterisk/stasis_bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/stasis_bridging.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/stasis_bridging.h (original)
+++ team/may/ooh323_qsig/include/asterisk/stasis_bridging.h Mon Aug 26 17:41:34 2013
@@ -228,24 +228,6 @@
 };
 
 /*!
- * \brief Message representing blind transfer
- */
-struct ast_blind_transfer_message {
-	AST_DECLARE_STRING_FIELDS(
-		/*! The destination context for the blind transfer */
-		AST_STRING_FIELD(context);
-		/*! The destination extension for the blind transfer */
-		AST_STRING_FIELD(exten);
-	);
-	/*! Result of the blind transfer */
-	enum ast_transfer_result result;
-	/*! If 0, was core DTMF transfer, otherwise occurred externally*/
-	int is_external;
-	/*! The transferer and its bridge before starting the transfer*/
-	struct ast_bridge_channel_snapshot_pair transferer;
-};
-
-/*!
  * \since 12
  * \brief Message type for \ref ast_blind_transfer_message.
  *

Modified: team/may/ooh323_qsig/include/asterisk/stasis_http.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/stasis_http.h?view=diff&rev=397686&r1=397685&r2=397686
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/stasis_http.h (original)
+++ team/may/ooh323_qsig/include/asterisk/stasis_http.h Mon Aug 26 17:41:34 2013
@@ -33,6 +33,12 @@
 #include "asterisk/json.h"
 #include "asterisk/http_websocket.h"
 
+/*!
+ * \brief Configured encoding format for JSON output.
+ * \return JSON output encoding (compact, pretty, etc.)
+ */
+enum ast_json_encoding_format stasis_http_json_format(void);
+
 struct stasis_http_response;
 
 /*!
@@ -53,13 +59,17 @@
 struct stasis_rest_handlers {
 	/*! Path segement to handle */
 	const char *path_segment;
-	/*! If true (non-zero), path_segment is a wildcard, and will match all values.
+	/*! If true (non-zero), path_segment is a wildcard, and will match all
+	 * values.
 	 *
-	 * Value of the segement will be passed into the \a path_vars parameter of the callback.
+	 * Value of the segement will be passed into the \a path_vars parameter
+	 * of the callback.
 	 */
 	int is_wildcard;
 	/*! Callbacks for all handled HTTP methods. */
 	stasis_rest_callback callbacks[AST_HTTP_MAX_METHOD];
+	/*! WebSocket server for handling WebSocket upgrades. */
+	struct ast_websocket_server *ws_server;
 	/*! Number of children in the children array */
 	size_t num_children;
 	/*! Handlers for sub-paths */
@@ -78,7 +88,9 @@
 	 * See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html */
 	int response_code;
 	/*! Corresponding text for the response code */
-	const char *response_text; // Shouldn't http.c handle this?
+	const char *response_text; /* Shouldn't http.c handle this? */
+	/*! Flag to indicate that no further response is needed */
+	int no_response:1;
 };
 
 /*!
@@ -104,14 +116,17 @@
  * Only call from res_stasis_http and test_stasis_http. Only public to allow
  * for unit testing.
  *
+ * \param ser TCP/TLS connection.
  * \param uri HTTP URI, relative to the API path.
  * \param method HTTP method.
  * \param get_params HTTP \c GET parameters.
  * \param headers HTTP headers.
  * \param[out] response RESTful HTTP response.
  */
-void stasis_http_invoke(const char *uri, enum ast_http_method method, struct ast_variable *get_params,
-			struct ast_variable *headers, struct stasis_http_response *response);
+void stasis_http_invoke(struct ast_tcptls_session_instance *ser,
+	const char *uri, enum ast_http_method method,
+	struct ast_variable *get_params, struct ast_variable *headers,
+	struct stasis_http_response *response);
 
 /*!
  * \internal
@@ -126,14 +141,53 @@
  */
 void stasis_http_get_docs(const char *uri, struct ast_variable *headers, struct stasis_http_response *response);
 
-/*!
- * \internal
- * \brief Stasis WebSocket connection handler
- * \param session WebSocket session.
- * \param parameters HTTP \c GET parameters.
- * \param headers HTTP headers.
- */
-void stasis_websocket_callback(struct ast_websocket *session, struct ast_variable *parameters, struct ast_variable *headers);
+/*! \brief Abstraction for reading/writing JSON to a WebSocket */
+struct ari_websocket_session;
+
+/*!
+ * \brief Create an ARI WebSocket session.
+ *

[... 7953 lines stripped ...]



More information about the asterisk-commits mailing list