Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 280909) +++ channels/chan_sip.c (working copy) @@ -17588,6 +17588,13 @@ per device. I don't want incoming callers to record calls in my pbx. */ + + if (!p->owner) { /* not a PBX call */ + transmit_response(p, "481 Call leg/transaction does not exist", req); + sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); + return; + } + /* first, get the feature string, if it exists */ struct ast_call_feature *feat; int j; @@ -17595,6 +17602,8 @@ ast_rdlock_call_features(); feat = ast_find_call_feature("automon"); + if (!feat || ast_strlen_zero(feat->exten)) + feat = ast_find_dynamic_feature("automon"); if (!feat || ast_strlen_zero(feat->exten)) { ast_log(LOG_WARNING, "Recording requested, but no One Touch Monitor registered. (See features.conf)\n"); /* 403 means that we don't support this feature, so don't request it again */ Index: include/asterisk/features.h =================================================================== --- include/asterisk/features.h (revision 280909) +++ include/asterisk/features.h (working copy) @@ -145,6 +145,12 @@ int ast_feature_detect(struct ast_channel *chan, struct ast_flags *features, const char *code, struct ast_call_feature *feature); /*! + * \brief find a call feature by name + * \param name a string ptr, the name to look for +*/ +struct ast_call_feature *ast_find_dynamic_feature(const char *name); + +/*! * \brief look for a call feature entry by its sname * \param name a string ptr, should match "automon", "blindxfer", "atxfer", etc. */ Index: main/features.c =================================================================== --- main/features.c (revision 280909) +++ main/features.c (working copy) @@ -2291,7 +2291,7 @@ } /*! \brief find a call feature by name */ -static struct ast_call_feature *find_dynamic_feature(const char *name) +struct ast_call_feature *ast_find_dynamic_feature(const char *name) { struct ast_call_feature *tmp; @@ -2546,7 +2546,7 @@ AST_RWLIST_RDLOCK(&feature_list); - if (!(tmpfeature = find_dynamic_feature(tok))) { + if (!(tmpfeature = ast_find_dynamic_feature(tok))) { AST_RWLIST_UNLOCK(&feature_list); continue; } @@ -2661,7 +2661,7 @@ AST_RWLIST_UNLOCK(&feature_groups); AST_RWLIST_RDLOCK(&feature_list); - if ((feature = find_dynamic_feature(tok)) && ast_test_flag(feature, AST_FEATURE_FLAG_NEEDSDTMF)) { + if ((feature = ast_find_dynamic_feature(tok)) && ast_test_flag(feature, AST_FEATURE_FLAG_NEEDSDTMF)) { if (ast_test_flag(feature, AST_FEATURE_FLAG_BYCALLER)) { ast_set_flag(config, AST_BRIDGE_DTMF_CHANNEL_0); } @@ -4552,7 +4552,7 @@ } AST_RWLIST_RDLOCK(&feature_list); - if ((feature = find_dynamic_feature(var->name))) { + if ((feature = ast_find_dynamic_feature(var->name))) { AST_RWLIST_UNLOCK(&feature_list); ast_log(LOG_WARNING, "Dynamic Feature '%s' specified more than once!\n", var->name); continue; @@ -4639,7 +4639,7 @@ struct ast_call_feature *feature; AST_RWLIST_RDLOCK(&feature_list); - if (!(feature = find_dynamic_feature(var->name)) && + if (!(feature = ast_find_dynamic_feature(var->name)) && !(feature = ast_find_call_feature(var->name))) { AST_RWLIST_UNLOCK(&feature_list); ast_log(LOG_WARNING, "Feature '%s' was not found.\n", var->name);