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

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


Kevin Harwell has uploaded a new change for review.

  https://gerrit.asterisk.org/243

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/43/243/1

diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
index af5dfce..d69e035 100644
--- a/apps/confbridge/conf_config_parser.c
+++ b/apps/confbridge/conf_config_parser.c
@@ -946,7 +946,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);
@@ -993,6 +993,18 @@
 			ast_datastore_free(datastore);
 			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);
+			}
+		}
+
 		ast_channel_datastore_add(chan, datastore);
 	} else {
 		b_data = datastore->data;
@@ -1005,7 +1017,6 @@
 	}
 	tmpvar.name = args.option;
 	tmpvar.value = value;
-	tmpvar.file = "CONFBRIDGE";
 	if (!strcasecmp(args.type, "bridge")) {
 		if (!strcasecmp(args.option, "clear")) {
 			b_data->b_usable = 0;

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

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



More information about the asterisk-code-review mailing list