Make menu interruptible (bug #2377), Also fix PBX "add extension" CLI (bug #2289)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-09-07 01:22:57 +00:00
parent a703e927b1
commit 64b9a563f2
3 changed files with 32 additions and 15 deletions

View File

@@ -1195,13 +1195,21 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
}
}
}
app = strsep(&whole_exten, ",");
app = whole_exten;
if (app && (start = strchr(app, '(')) && (end = strrchr(app, ')'))) {
*start = *end = '\0';
app_data = start + 1;
process_quotes_and_slashes(app_data, ',', '|');
} else
app_data = whole_exten;
} else {
if (app) {
app_data = strchr(app, ',');
if (app_data) {
*app_data = '\0';
app_data++;
}
} else
app_data = NULL;
}
if (!exten || !prior || !app || (!app_data && iprior != PRIORITY_HINT)) return RESULT_SHOWUSAGE;