--- asterisk-1.2.10.orig/res/res_features.c 2006-07-19 10:36:44.000000000 +0100
+++ asterisk-1.2.10/res/res_features.c 2006-09-08 12:11:04.000000000 +0100
@@ -1967,6 +2233,8 @@
char old_parking_ext[AST_MAX_EXTENSION];
char old_parking_con[AST_MAX_EXTENSION] = "";
+ int parkenable = -1; // Enable by default
+
if (!ast_strlen_zero(parking_con)) {
strcpy(old_parking_ext, parking_ext);
strcpy(old_parking_con, parking_con);
@@ -2014,6 +2283,8 @@
parking_start = start;
parking_stop = end;
}
+ } else if (!strcasecmp(var->name, "parkenable")) {
+ parkenable = ast_true(var->value);
} else if (!strcasecmp(var->name, "findslot")) {
parkfindnext = (!strcasecmp(var->value, "next"));
} else if (!strcasecmp(var->name, "adsipark")) {
@@ -2128,13 +2399,18 @@
ast_log(LOG_DEBUG, "Removed old parking extension %s@%s\n", old_parking_ext, old_parking_con);
}
- if (!(con = ast_context_find(parking_con))) {
- if (!(con = ast_context_create(NULL, parking_con, registrar))) {
- ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
- return -1;
+ if (parkenable) {
+
+ if (!(con = ast_context_find(parking_con))) {
+ if (!(con = ast_context_create(NULL, parking_con, registrar))) {
+ ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
+ return -1;
+ }
}
+ return ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), FREE, registrar);
+ } else {
+ return 0;
}
- return ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), FREE, registrar);
}
int reload(void) {