@ -1697,8 +1697,13 @@ static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer,
ast_autoservice_stop ( idle ) ;
ast_autoservice_stop ( idle ) ;
if ( res = = AST_PBX_KEEPALIVE )
if ( res = = AST_PBX_KEEPALIVE ) {
/* do not hangup peer if feature is to be activated on it */
if ( ( ast_test_flag ( feature , AST_FEATURE_FLAG_ONPEER ) & & sense = = FEATURE_SENSE_CHAN ) | | ( ast_test_flag ( feature , AST_FEATURE_FLAG_ONSELF ) & & sense = = FEATURE_SENSE_PEER ) )
return AST_FEATURE_RETURN_NO_HANGUP_PEER ;
else
return AST_FEATURE_RETURN_PBX_KEEPALIVE ;
return AST_FEATURE_RETURN_PBX_KEEPALIVE ;
}
else if ( res = = AST_PBX_NO_HANGUP_PEER )
else if ( res = = AST_PBX_NO_HANGUP_PEER )
return AST_FEATURE_RETURN_NO_HANGUP_PEER ;
return AST_FEATURE_RETURN_NO_HANGUP_PEER ;
else if ( res )
else if ( res )
@ -1747,12 +1752,13 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
{
{
int x ;
int x ;
struct ast_flags features ;
struct ast_flags features ;
int res = AST_FEATURE_RETURN_PASSDIGITS ;
struct ast_call_feature * feature ;
struct ast_call_feature * feature ;
struct feature_group * fg = NULL ;
struct feature_group * fg = NULL ;
struct feature_group_exten * fge ;
struct feature_group_exten * fge ;
const char * dynamic_features ;
const char * dynamic_features ;
char * tmp , * tok ;
char * tmp , * tok ;
int res = AST_FEATURE_RETURN_PASSDIGITS ;
int feature_detected = 0 ;
if ( sense = = FEATURE_SENSE_CHAN ) {
if ( sense = = FEATURE_SENSE_CHAN ) {
ast_copy_flags ( & features , & ( config - > features_caller ) , AST_FLAGS_ALL ) ;
ast_copy_flags ( & features , & ( config - > features_caller ) , AST_FLAGS_ALL ) ;
@ -1771,6 +1777,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
/* Feature is up for consideration */
/* Feature is up for consideration */
if ( ! strcmp ( builtin_features [ x ] . exten , code ) ) {
if ( ! strcmp ( builtin_features [ x ] . exten , code ) ) {
res = builtin_features [ x ] . operation ( chan , peer , config , code , sense , NULL ) ;
res = builtin_features [ x ] . operation ( chan , peer , config , code , sense , NULL ) ;
feature_detected = 1 ;
break ;
break ;
} else if ( ! strncmp ( builtin_features [ x ] . exten , code , strlen ( code ) ) ) {
} else if ( ! strncmp ( builtin_features [ x ] . exten , code , strlen ( code ) ) ) {
if ( res = = AST_FEATURE_RETURN_PASSDIGITS )
if ( res = = AST_FEATURE_RETURN_PASSDIGITS )
@ -1780,7 +1787,7 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
}
}
ast_rwlock_unlock ( & features_lock ) ;
ast_rwlock_unlock ( & features_lock ) ;
if ( ast_strlen_zero ( dynamic_features ) )
if ( ast_strlen_zero ( dynamic_features ) | | feature_detected )
return res ;
return res ;
tmp = ast_strdupa ( dynamic_features ) ;
tmp = ast_strdupa ( dynamic_features ) ;