Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 280942) +++ channels/chan_sip.c (working copy) @@ -16877,6 +16877,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; @@ -16884,6 +16891,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 280942) +++ include/asterisk/features.h (working copy) @@ -123,6 +123,10 @@ \param feature the ast_call_feature object which was registered before*/ void ast_unregister_feature(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. */ struct ast_call_feature *ast_find_call_feature(const char *name); Index: main/features.c =================================================================== --- main/features.c (revision 280942) +++ main/features.c (working copy) @@ -1851,7 +1851,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; @@ -2107,7 +2107,7 @@ AST_RWLIST_RDLOCK(&feature_list); - if (!(feature = find_dynamic_feature(tok))) { + if (!(feature = ast_find_dynamic_feature(tok))) { AST_RWLIST_UNLOCK(&feature_list); continue; } @@ -2177,7 +2177,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); } @@ -3955,7 +3955,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; @@ -4042,7 +4042,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);