[asterisk-commits] file: branch file/ari-extended-bridge-type r410513 - in /team/file/ari-extend...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 13 08:52:20 CDT 2014
Author: file
Date: Thu Mar 13 08:52:15 2014
New Revision: 410513
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410513
Log:
Experiment with a comma separated list of features for bridge type specification.
Modified:
team/file/ari-extended-bridge-type/res/res_stasis.c
team/file/ari-extended-bridge-type/rest-api/api-docs/bridges.json
Modified: team/file/ari-extended-bridge-type/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/file/ari-extended-bridge-type/res/res_stasis.c?view=diff&rev=410513&r1=410512&r2=410513
==============================================================================
--- team/file/ari-extended-bridge-type/res/res_stasis.c (original)
+++ team/file/ari-extended-bridge-type/res/res_stasis.c Thu Mar 13 08:52:15 2014
@@ -588,19 +588,29 @@
struct ast_bridge *stasis_app_bridge_create(const char *type, const char *name, const char *id)
{
struct ast_bridge *bridge;
- int capabilities;
+ char *requested_type, *requested_types = ast_strdupa(type);
+ int capabilities = 0;
int flags = AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM | AST_BRIDGE_FLAG_MERGE_INHIBIT_TO
| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_SWAP_INHIBIT_TO
| AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY;
- if (ast_strlen_zero(type) || !strcmp(type, "mixing")) {
- capabilities = AST_BRIDGE_CAPABILITY_1TO1MIX |
- AST_BRIDGE_CAPABILITY_MULTIMIX |
- AST_BRIDGE_CAPABILITY_NATIVE;
- flags |= AST_BRIDGE_FLAG_SMART;
- } else if (!strcmp(type, "holding")) {
- capabilities = AST_BRIDGE_CAPABILITY_HOLDING;
- } else {
+ while ((requested_type = strsep(&requested_types, ","))) {
+ requested_type = ast_strip(requested_type);
+
+ if (!strcmp(requested_type, "mixing")) {
+ capabilities |= AST_BRIDGE_CAPABILITY_1TO1MIX |
+ AST_BRIDGE_CAPABILITY_MULTIMIX |
+ AST_BRIDGE_CAPABILITY_NATIVE;
+ flags |= AST_BRIDGE_FLAG_SMART;
+ } else if (!strcmp(requested_type, "holding")) {
+ capabilities |= AST_BRIDGE_CAPABILITY_HOLDING;
+ } else if (!strcmp(requested_type, "dtmf_events") ||
+ !strcmp(requested_type, "proxy_media")) {
+ capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;
+ }
+ }
+
+ if (!capabilities) {
return NULL;
}
Modified: team/file/ari-extended-bridge-type/rest-api/api-docs/bridges.json
URL: http://svnview.digium.com/svn/asterisk/team/file/ari-extended-bridge-type/rest-api/api-docs/bridges.json?view=diff&rev=410513&r1=410512&r2=410513
==============================================================================
--- team/file/ari-extended-bridge-type/rest-api/api-docs/bridges.json (original)
+++ team/file/ari-extended-bridge-type/rest-api/api-docs/bridges.json Thu Mar 13 08:52:15 2014
@@ -35,6 +35,9 @@
"valueType": "LIST",
"values": [
"mixing",
+ "mixing,dtmf_events",
+ "mixing,proxy_media",
+ "mixing,dtmf_events,proxy_media",
"holding"
]
}
@@ -81,6 +84,9 @@
"valueType": "LIST",
"values": [
"mixing",
+ "mixing,dtmf_events",
+ "mixing,proxy_media",
+ "mixing,dtmf_events,proxy_media",
"holding"
]
}
More information about the asterisk-commits
mailing list