diff --git a/main/pbx.c b/main/pbx.c index 3c4d72c09d..58ef0cabed 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -6659,6 +6659,10 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_ /* Create all applicable autohint contexts */ context_table_create_autohints(contexts_table); + /* ctx_count is still the number of old contexts before the merge, + * use the new count when we tell the user how many contexts exist. */ + ctx_count = ast_hashtab_size(contexts_table); + ao2_unlock(hints); ast_unlock_contexts();