Marc-andre Poupier hereby disclaims all copyright interest in the changes and enhancements made by Marc-andre Poupier to the program "asterisk" (the "Program"). Marc-andre Ppupier affirms that it has no other intellectual property interest that would undermine this release, or the use of the Program, and will do nothing to undermine it in the future. Marc-andre Poupier, 2006-05-03 Authorized Signature Date Index: include/asterisk/channel.h =================================================================== --- include/asterisk/channel.h (revision 12455) +++ include/asterisk/channel.h (working copy) @@ -459,6 +459,7 @@ #define AST_FEATURE_FLAG_NEEDSDTMF (1 << 0) #define AST_FEATURE_FLAG_CALLEE (1 << 1) #define AST_FEATURE_FLAG_CALLER (1 << 2) +#define AST_FEATURE_FLAG_DETECT (1 << 3) struct ast_bridge_config { struct ast_flags features_caller; Index: res/res_features.c =================================================================== --- res/res_features.c (revision 12455) +++ res/res_features.c (working copy) @@ -924,6 +924,16 @@ struct ast_channel *work = chan; if (ast_test_flag(feature, AST_FEATURE_FLAG_CALLEE)) work = peer; + if (ast_test_flag(feature, AST_FEATURE_FLAG_DETECT)) { + if(!strcasecmp(chan->tech->type, "Zap")) + work = chan; + else if(!strcasecmp(peer->tech->type, "Zap")) + work = peer; + else { + ast_log(LOG_WARNING, "There was no Zap channel and a detect feature was called"); + return -2; + } + } res = pbx_exec(work, app, feature->app_args, 1); if (res < 0) return res; @@ -2166,8 +2176,10 @@ ast_set_flag(feature,AST_FEATURE_FLAG_CALLER); else if (!strcasecmp(party, "callee")) ast_set_flag(feature,AST_FEATURE_FLAG_CALLEE); + else if (!strcasecmp(party, "detect")) + ast_set_flag(feature,AST_FEATURE_FLAG_DETECT); else { - ast_log(LOG_NOTICE, "Invalid party specification for feature '%s', must be caller, or callee\n", var->name); + ast_log(LOG_NOTICE, "Invalid party specification for feature '%s', must be caller, callee, or detect\n", var->name); var = var->next; continue; }