[Asterisk-code-review] app confbridge: No default template(s) (asterisk[11])

Kevin Harwell asteriskteam at digium.com
Thu Apr 23 15:34:02 CDT 2015


Kevin Harwell has uploaded a new change for review.

  https://gerrit.asterisk.org/242

Change subject: app_confbridge: No default template(s)
......................................................................

app_confbridge: No default template(s)

Dynamic confbridges did not have a default template. If a template was not set
prior to the dynamic bridge being created then some values were left with no
default values set. This patch makes it so the default template is set to the
default bridge and user profiles.

ASTERISK-24749 #close
Reported by: philippebolduc

Change-Id: I1bd6e94b38701ac2112d842db68de63d46f60e0a
---
M apps/confbridge/conf_config_parser.c
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/242/1

diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
index 1b1437b..f885e16 100644
--- a/apps/confbridge/conf_config_parser.c
+++ b/apps/confbridge/conf_config_parser.c
@@ -348,7 +348,7 @@
 	struct ast_datastore *datastore;
 	struct func_confbridge_data *b_data;
 	char *parse;
-	struct ast_variable tmpvar = { 0, };
+	struct ast_variable tmpvar = { .file = "CONFBRIDGE" };
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(type);
 		AST_APP_ARG(option);
@@ -390,6 +390,18 @@
 			ast_free(b_data);
 			return 0;
 		}
+
+		if (strcmp(args.option, "template")) {
+			tmpvar.name = "template";
+			if (!strcasecmp(args.type, "bridge")) {
+				tmpvar.value = DEFAULT_BRIDGE_PROFILE;
+				aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile);
+			} else if (!strcasecmp(args.type, "user")) {
+				tmpvar.value = DEFAULT_USER_PROFILE;
+				aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile);
+			}
+		}
+
 		datastore->data = b_data;
 		ast_channel_datastore_add(chan, datastore);
 	} else {
@@ -403,7 +415,6 @@
 	}
 	tmpvar.name = args.option;
 	tmpvar.value = value;
-	tmpvar.file = "CONFBRIDGE";
 	if (!strcasecmp(args.type, "bridge")) {
 		if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
 			b_data->b_usable = 1;

-- 
To view, visit https://gerrit.asterisk.org/242
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bd6e94b38701ac2112d842db68de63d46f60e0a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list