Index: configs/features.conf.sample =================================================================== --- configs/features.conf.sample (revision 56340) +++ configs/features.conf.sample (working copy) @@ -58,10 +58,12 @@ ; DYNAMIC_FEATURES variable to enable usage of this feature. ; DTMF_sequence -> This is the key sequence used to activate this feature. ; ActivateOn -> This is the channel of the call that the application will be executed -; on. Valid values are "self" and "peer". "self" means run the +; on. Valid values are "self", "peer" or "onzap". "self" means run the ; application on the same channel that activated the feature. "peer" ; means run the application on the opposite channel from the one that -; has activated the feature. +; has activated the feature. "onzap" will try to find a Zap channel to +; execute the feature on, useful for example when trying to Flash an FXO +; channel from a SIP phone. ; ActivatedBy -> This is which channel is allowed to activate this feature. Valid ; values are "caller", "callee", and "both". "both" is the default. ; The "caller" is the channel that executed the Dial application, while @@ -92,4 +94,5 @@ ; ;on their channel ;unpauseMonitor => #3,self/callee,UnPauseMonitor ;Allow the callee to unpause monitoring ; ;on their channel +;fxoFlash => **,onzap/both,Flash ;Execute the Flash app on the Zap channel ; Index: res/res_features.c =================================================================== --- res/res_features.c (revision 56340) +++ res/res_features.c (working copy) @@ -72,6 +72,7 @@ AST_FEATURE_FLAG_ONSELF = (1 << 2), AST_FEATURE_FLAG_BYCALLEE = (1 << 3), AST_FEATURE_FLAG_BYCALLER = (1 << 4), + AST_FEATURE_FLAG_ONZAP = (1 << 5), AST_FEATURE_FLAG_BYBOTH = (3 << 3), }; @@ -954,7 +955,18 @@ return -1; } - if (sense == FEATURE_SENSE_CHAN) { + if (ast_test_flag(feature, AST_FEATURE_FLAG_ONZAP)) { + if (!strcasecmp(chan->tech->type, "Zap")) { + work = chan; + idle = peer; + } else if (!strcasecmp(peer->tech->type, "Zap")) { + work = peer; + idle = chan; + } else { + ast_log(LOG_WARNING, "OnZap Feature called but no Zap Channel found!!"\n); + return -2; + } + } else if (sense == FEATURE_SENSE_CHAN) { if (!ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLER)) return FEATURE_RETURN_PASSDIGITS; if (ast_test_flag(feature, AST_FEATURE_FLAG_ONSELF)) { @@ -2276,9 +2288,11 @@ ast_set_flag(feature, AST_FEATURE_FLAG_ONSELF); else if (!strcasecmp(activateon, "peer") || !strcasecmp(activateon, "callee")) ast_set_flag(feature, AST_FEATURE_FLAG_ONPEER); + else if (!strcasecmp(activateon, "onzap")) + ast_set_flag(feature, AST_FEATURE_FLAG_ONZAP); else { ast_log(LOG_NOTICE, "Invalid 'ActivateOn' specification for feature '%s'," - " must be 'self', or 'peer'\n", var->name); + " must be 'self', 'peer' or 'onzap'\n", var->name); continue; }