[asterisk-commits] jrose: branch jrose/bridge_projects r386543 - in /team/jrose/bridge_projects:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 25 13:46:21 CDT 2013


Author: jrose
Date: Thu Apr 25 13:46:17 2013
New Revision: 386543

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386543
Log:
update and resolve conflict. Leaving automerge off for now.

Modified:
    team/jrose/bridge_projects/   (props changed)
    team/jrose/bridge_projects/channels/chan_sip.c
    team/jrose/bridge_projects/include/asterisk/bridging.h
    team/jrose/bridge_projects/main/bridging.c
    team/jrose/bridge_projects/res/stasis_http/resource_asterisk.h
    team/jrose/bridge_projects/res/stasis_http/resource_bridges.h
    team/jrose/bridge_projects/res/stasis_http/resource_channels.h
    team/jrose/bridge_projects/res/stasis_http/resource_endpoints.h
    team/jrose/bridge_projects/res/stasis_http/resource_events.h
    team/jrose/bridge_projects/res/stasis_http/resource_playback.h
    team/jrose/bridge_projects/res/stasis_http/resource_recordings.h
    team/jrose/bridge_projects/res/stasis_http/resource_sounds.h
    team/jrose/bridge_projects/rest-api-templates/stasis_http_resource.h.mustache
    team/jrose/bridge_projects/rest-api-templates/swagger_model.py

Propchange: team/jrose/bridge_projects/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/jrose/bridge_projects/
------------------------------------------------------------------------------
--- bridge_construction-integrated (original)
+++ bridge_construction-integrated Thu Apr 25 13:46:17 2013
@@ -1,1 +1,1 @@
-/trunk:1-386376
+/trunk:1-386488

Propchange: team/jrose/bridge_projects/
------------------------------------------------------------------------------
--- bridge_projects-integrated (original)
+++ bridge_projects-integrated Thu Apr 25 13:46:17 2013
@@ -1,1 +1,1 @@
-/team/group/bridge_construction:1-386442
+/team/group/bridge_construction:1-386542

Modified: team/jrose/bridge_projects/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/channels/chan_sip.c?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/channels/chan_sip.c (original)
+++ team/jrose/bridge_projects/channels/chan_sip.c Thu Apr 25 13:46:17 2013
@@ -19078,7 +19078,7 @@
 		return CLI_SHOWUSAGE;
 	}
 
-	ast_cli(a->fd, FORMAT, "Username", "Secret", "Accountcode", "Def.Context", "ACL", "ForcerPort");
+	ast_cli(a->fd, FORMAT, "Username", "Secret", "Accountcode", "Def.Context", "ACL", "Forcerport");
 
 	user_iter = ao2_iterator_init(peers, 0);
 	while ((user = ao2_t_iterator_next(&user_iter, "iterate thru peers table"))) {
@@ -20927,7 +20927,7 @@
 	ast_cli(a->fd, "\n");
 	ast_cli(a->fd, "  Relax DTMF:             %s\n", AST_CLI_YESNO(global_relaxdtmf));
 	ast_cli(a->fd, "  RFC2833 Compensation:   %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_RFC2833_COMPENSATE)));
-	ast_cli(a->fd, "  Symmetric RTP:          %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_SYMMETRICRTP)));
+	ast_cli(a->fd, "  Symmetric RTP:          %s\n", comedia_string(global_flags));
 	ast_cli(a->fd, "  Compact SIP headers:    %s\n", AST_CLI_YESNO(sip_cfg.compactheaders));
 	ast_cli(a->fd, "  RTP Keepalive:          %d %s\n", global_rtpkeepalive, global_rtpkeepalive ? "" : "(Disabled)" );
 	ast_cli(a->fd, "  RTP Timeout:            %d %s\n", global_rtptimeout, global_rtptimeout ? "" : "(Disabled)" );

Modified: team/jrose/bridge_projects/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/include/asterisk/bridging.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/include/asterisk/bridging.h (original)
+++ team/jrose/bridge_projects/include/asterisk/bridging.h Thu Apr 25 13:46:17 2013
@@ -548,6 +548,19 @@
 	__ao2_unlock(bridge, file, function, line, var);
 }
 
+/*! \brief Lock two bridges. */
+#define ast_bridge_lock_both(bridge1, bridge2)		\
+	do {											\
+		for (;;) {									\
+			ast_bridge_lock(bridge1);				\
+			if (!ast_bridge_trylock(bridge2)) {		\
+				break;								\
+			}										\
+			ast_bridge_unlock(bridge1);				\
+			sched_yield();							\
+		}											\
+	} while (0)
+
 /*!
  * \brief See if it is possible to create a bridge
  *

Modified: team/jrose/bridge_projects/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/main/bridging.c?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/main/bridging.c (original)
+++ team/jrose/bridge_projects/main/bridging.c Thu Apr 25 13:46:17 2013
@@ -3196,15 +3196,7 @@
 {
 	int res = -1;
 
-	/* Deadlock avoidance. */
-	for (;;) {
-		ast_bridge_lock(dst_bridge);
-		if (!ast_bridge_trylock(src_bridge)) {
-			break;
-		}
-		ast_bridge_unlock(dst_bridge);
-		sched_yield();
-	}
+	ast_bridge_lock_both(dst_bridge, src_bridge);
 
 	if (dst_bridge->dissolved || src_bridge->dissolved) {
 		ast_debug(1, "Can't merge bridge %s into bridge %s, one or both bridges are dissolved.\n",
@@ -3221,11 +3213,7 @@
 		ast_debug(1, "Can't merge bridge %s into bridge %s, multimix is needed and it cannot be acquired.\n",
 			src_bridge->uniqueid, dst_bridge->uniqueid);
 	} else {
-		++dst_bridge->inhibit_merge;
-		++src_bridge->inhibit_merge;
 		bridge_merge_do(dst_bridge, src_bridge, NULL, 0);
-		--src_bridge->inhibit_merge;
-		--dst_bridge->inhibit_merge;
 		res = 0;
 	}
 

Modified: team/jrose/bridge_projects/res/stasis_http/resource_asterisk.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_asterisk.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_asterisk.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_asterisk.h Thu Apr 25 13:46:17 2013
@@ -53,4 +53,10 @@
  */
 void stasis_http_get_asterisk_info(struct ast_variable *headers, struct ast_get_asterisk_info_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * AsteriskInfo
+ */
+
 #endif /* _ASTERISK_RESOURCE_ASTERISK_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_bridges.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_bridges.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_bridges.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_bridges.h Thu Apr 25 13:46:17 2013
@@ -151,4 +151,12 @@
  */
 void stasis_http_record_bridge(struct ast_variable *headers, struct ast_record_bridge_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Bridge
+ * - channels: List[string] (required)
+ * - bridgeType: string (required)
+ */
+
 #endif /* _ASTERISK_RESOURCE_BRIDGES_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_channels.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_channels.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_channels.h Thu Apr 25 13:46:17 2013
@@ -241,4 +241,34 @@
  */
 void stasis_http_record_channel(struct ast_variable *headers, struct ast_record_channel_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Originated
+ * DialplanCEP
+ * - priority: long (required)
+ * - exten: string (required)
+ * - context: string (required)
+ * Channel
+ * - accountcode: string (required)
+ * - linkedid: string (required)
+ * - name: string (required)
+ * - userfield: string (required)
+ * - caller: CallerID (required)
+ * - creationtime: Date (required)
+ * - state: string (required)
+ * - parkinglot: string (required)
+ * - peeraccount: string (required)
+ * - appl: string (required)
+ * - connected: CallerID (required)
+ * - uniqueid: string (required)
+ * - hangupsource: string (required)
+ * - dialplan: DialplanCEP (required)
+ * - data: string (required)
+ * CallerID
+ * - name: string (required)
+ * - number: string (required)
+ * Dialed
+ */
+
 #endif /* _ASTERISK_RESOURCE_CHANNELS_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_endpoints.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_endpoints.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_endpoints.h Thu Apr 25 13:46:17 2013
@@ -66,4 +66,12 @@
  */
 void stasis_http_get_endpoint(struct ast_variable *headers, struct ast_get_endpoint_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Endpoint
+ * - technology: string (required)
+ * - name: string (required)
+ */
+
 #endif /* _ASTERISK_RESOURCE_ENDPOINTS_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_events.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_events.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_events.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_events.h Thu Apr 25 13:46:17 2013
@@ -55,4 +55,42 @@
  */
 void stasis_http_event_websocket(struct ast_variable *headers, struct ast_event_websocket_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * DtmfReceived
+ * - digit: string 
+ * - channel: Channel 
+ * BridgeCreated
+ * - bridge: Bridge 
+ * BridgeDestroyed
+ * - bridge: Bridge 
+ * ApplicationReplaced
+ * - application: string 
+ * ChannelLeftBridge
+ * - bridge: Bridge 
+ * - channel: Channel 
+ * StasisStart
+ * - args: List[string] 
+ * - channel_info: Channel 
+ * StasisEnd
+ * - channel_info: Channel 
+ * ChannelStateChange
+ * - channel_info: Channel 
+ * ChannelEnteredBridge
+ * - bridge: Bridge 
+ * - channel: Channel 
+ * Event
+ * - stasis_start: StasisStart 
+ * - channel_entered_bridge: ChannelEnteredBridge 
+ * - channel_left_bridge: ChannelLeftBridge 
+ * - application_replaced: ApplicationReplaced 
+ * - channel_state_change: ChannelStateChange 
+ * - bridge_created: BridgeCreated 
+ * - application: string (required)
+ * - stasis_end: StasisEnd 
+ * - dtmf_received: DtmfReceived 
+ * - bridge_destroyed: BridgeDestroyed 
+ */
+
 #endif /* _ASTERISK_RESOURCE_EVENTS_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_playback.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_playback.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_playback.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_playback.h Thu Apr 25 13:46:17 2013
@@ -81,4 +81,11 @@
  */
 void stasis_http_control_playback(struct ast_variable *headers, struct ast_control_playback_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Playback
+ * - id: string (required)
+ */
+
 #endif /* _ASTERISK_RESOURCE_PLAYBACK_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_recordings.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_recordings.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_recordings.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_recordings.h Thu Apr 25 13:46:17 2013
@@ -190,4 +190,18 @@
  */
 void stasis_http_unmute_recording(struct ast_variable *headers, struct ast_unmute_recording_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Recording
+ * - id: string (required)
+ * StoredRecording
+ * - durationSeconds: int 
+ * - time: Date 
+ * - id: string (required)
+ * - formats: List[string] (required)
+ * LiveRecording
+ * - id: string (required)
+ */
+
 #endif /* _ASTERISK_RESOURCE_RECORDINGS_H */

Modified: team/jrose/bridge_projects/res/stasis_http/resource_sounds.h
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/stasis_http/resource_sounds.h?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/res/stasis_http/resource_sounds.h (original)
+++ team/jrose/bridge_projects/res/stasis_http/resource_sounds.h Thu Apr 25 13:46:17 2013
@@ -66,4 +66,14 @@
  */
 void stasis_http_get_stored_sound(struct ast_variable *headers, struct ast_get_stored_sound_args *args, struct stasis_http_response *response);
 
+/*
+ * JSON models
+ *
+ * Sound
+ * - lang: string (required)
+ * - text: string 
+ * - id: string (required)
+ * - formats: List[string] (required)
+ */
+
 #endif /* _ASTERISK_RESOURCE_SOUNDS_H */

Modified: team/jrose/bridge_projects/rest-api-templates/stasis_http_resource.h.mustache
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/rest-api-templates/stasis_http_resource.h.mustache?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/rest-api-templates/stasis_http_resource.h.mustache (original)
+++ team/jrose/bridge_projects/rest-api-templates/stasis_http_resource.h.mustache Thu Apr 25 13:46:17 2013
@@ -64,5 +64,16 @@
 {{/operations}}
 {{/apis}}
 
+/*
+ * JSON models
+ *
+{{#models}}
+ * {{id}}
+{{#properties}}
+ * - {{name}}: {{type}} {{#required}}(required){{/required}}
+{{/properties}}
+{{/models}}
+ */
+
 #endif /* _ASTERISK_RESOURCE_{{name_caps}}_H */
 {{/api_declaration}}

Modified: team/jrose/bridge_projects/rest-api-templates/swagger_model.py
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/rest-api-templates/swagger_model.py?view=diff&rev=386543&r1=386542&r2=386543
==============================================================================
--- team/jrose/bridge_projects/rest-api-templates/swagger_model.py (original)
+++ team/jrose/bridge_projects/rest-api-templates/swagger_model.py Thu Apr 25 13:46:17 2013
@@ -297,9 +297,11 @@
         self.id = None
         self.properties = None
 
-    def load(self, model_json, processor, context):
+    def load(self, id, model_json, processor, context):
         context = add_context(context, model_json, 'id')
         self.id = model_json.get('id')
+        if id != self.id:
+            raise SwaggerError("Model id doesn't match name", c)
         props = model_json.get('properties').items() or []
         self.properties = [
             Property(k).load(j, processor, context) for (k, j) in props]
@@ -372,13 +374,9 @@
         self.apis = [
             Api().load(j, processor, context) for j in api_json]
         models = api_decl_json.get('models').items() or []
-        self.models = OrderedDict(
-            (k, Model().load(j, processor, context)) for (k, j) in models)
-
-        for (name, model) in self.models.items():
-            c = list(context).append('model = %s' % name)
-            if name != model.id:
-                raise SwaggerError("Model id doesn't match name", c)
+        self.models = [
+            Model().load(k, j, processor, context) for (k, j) in models]
+
         return self
 
 




More information about the asterisk-commits mailing list