- while ((tok = strsep(&tmp, "#")) != NULL) {
- feature = find_feature(tok);
-
- if (feature) {
- /* Feature is up for consideration */
- if (!strcmp(feature->exten, code)) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
- res = feature->operation(chan, peer, config, code, sense);
- break;
- } else if (!strncmp(feature->exten, code, strlen(code))) {
- res = FEATURE_RETURN_STOREDIGITS;
- }
- }
+ while ((tok = strsep(&tmp, "#"))) {
+ ast_rwlock_rdlock(&features_lock);
+ if (!(feature = find_feature(tok))) {
+ ast_rwlock_unlock(&features_lock);
+ continue;