diff options
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_config.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 39fd33244..b067e2fe4 100755 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -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; |