diff --git a/CHANGES b/CHANGES index 8ddbf564f313ef62f442c00aa5d6d216272207e5..2551c0b5b94d4a68f2ec28ef757aa0b2c9c34093 100644 --- a/CHANGES +++ b/CHANGES @@ -103,6 +103,16 @@ Core * Exposed sorcery-based configuration files like pjsip.conf to dialplans via the new AST_SORCERY diaplan function. +======= +ARI +------------------ + * The live recording object on recording events now contains a target_uri + field which contains the URI of what is being recorded. + + * The bridge type used when creating a bridge is now a comma separated list of + bridge properties. Valid options are: mixing, holding, dtmf_events, and + proxy_media. + * A channelId can now be provided when creating a channel, either in the uri (POST channels/my-channel-id) or as query parameter. A local channel will suffix the second channel id with ';2' unless provided as query diff --git a/res/ari/resource_bridges.h b/res/ari/resource_bridges.h index 1b878231065fe68b8708071dd3477cb5095b88c3..5dca82781198001e94690f03594f9fbbf7b80efa 100644 --- a/res/ari/resource_bridges.h +++ b/res/ari/resource_bridges.h @@ -52,7 +52,7 @@ struct ast_ari_bridges_list_args { void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response); /*! \brief Argument struct for ast_ari_bridges_create() */ struct ast_ari_bridges_create_args { - /*! \brief Type of bridge to create. */ + /*! \brief Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media). */ const char *type; /*! \brief Unique ID to give to the bridge being created. */ const char *bridge_id; @@ -82,7 +82,7 @@ int ast_ari_bridges_create_parse_body( void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response); /*! \brief Argument struct for ast_ari_bridges_create_or_update_with_id() */ struct ast_ari_bridges_create_or_update_with_id_args { - /*! \brief Set the type of bridge. */ + /*! \brief Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. */ const char *type; /*! \brief Unique ID to give to the bridge being created. */ const char *bridge_id; diff --git a/res/res_stasis.c b/res/res_stasis.c index e7a8d983a4cb7272ca96a77d67594075ccfeb192..cfb1a7af1ce998608943b60820439f68b40222cf 100644 --- a/res/res_stasis.c +++ b/res/res_stasis.c @@ -588,19 +588,29 @@ static void control_unlink(struct stasis_app_control *control) 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; } diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json index 3e899788f7eee1c2a4431a98a7794cd3b450b6a6..0038510f412dd56b4c59c0161259b3597d7b57c2 100644 --- a/rest-api/api-docs/bridges.json +++ b/rest-api/api-docs/bridges.json @@ -26,18 +26,11 @@ "parameters": [ { "name": "type", - "description": "Type of bridge to create.", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", "paramType": "query", "required": false, "allowMultiple": false, - "dataType": "string", - "allowableValues": { - "valueType": "LIST", - "values": [ - "mixing", - "holding" - ] - } + "dataType": "string" }, { "name": "bridgeId", @@ -72,18 +65,11 @@ "parameters": [ { "name": "type", - "description": "Set the type of bridge.", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", "paramType": "query", "required": false, "allowMultiple": false, - "dataType": "string", - "allowableValues": { - "valueType": "LIST", - "values": [ - "mixing", - "holding" - ] - } + "dataType": "string" }, { "name": "bridgeId",