--- /usr/src/patches/app_followme.c 2015-02-16 15:50:49.000000000 -0600 +++ app_followme.c 2015-02-16 18:26:26.832125508 -0600 @@ -1,4 +1,4 @@ -/* +/*7 * Asterisk -- An open source telephony toolkit. * * A full-featured Find-Me/Follow-Me Application @@ -130,6 +130,9 @@ Playback the incoming status message prior to starting the follow-me step(s) + @@ -237,6 +240,7 @@ FOLLOWMEFLAG_IGNORE_CONNECTEDLINE = (1 << 6), FOLLOWMEFLAG_PREDIAL_CALLER = (1 << 7), FOLLOWMEFLAG_PREDIAL_CALLEE = (1 << 8), + FOLLOWMEFLAG_DISABLEFROMPROMPT = (1 << 9), }; enum { @@ -257,6 +261,7 @@ AST_APP_OPTION('N', FOLLOWMEFLAG_NOANSWER), AST_APP_OPTION('n', FOLLOWMEFLAG_UNREACHABLEMSG), AST_APP_OPTION('s', FOLLOWMEFLAG_STATUSMSG), + AST_APP_OPTION('f', FOLLOWMEFLAG_DISABLEFROMPROMPT), }); static const char *featuredigittostr; @@ -642,6 +647,9 @@ if (!tmpuser->ochan) { continue; } + if (ast_test_flag(&tpargs->followmeflags, FOLLOWMEFLAG_DISABLEFROMPROMPT)) { + tmpuser->state = 4; + } if (tmpuser->state == 3) { tmpuser->digts += (towas - wtd); } @@ -784,6 +792,11 @@ /* If call has been answered, then the eventual hangup is likely to be normal hangup */ ast_channel_hangupcause_set(winner, AST_CAUSE_NORMAL_CLEARING); ast_channel_hangupcause_set(caller, AST_CAUSE_NORMAL_CLEARING); + /* Return the channel if no prompt is required */ + if (tmpuser->state == 4) { + ast_frfree(f); + return tmpuser->ochan; + } ast_verb(3, "Starting playback of %s\n", callfromname); if (!ast_strlen_zero(tpargs->namerecloc)) { if (!ast_streamfile(winner, callfromname, ast_channel_language(winner))) { @@ -1424,7 +1437,13 @@ if (ast_waitstream(chan, "") < 0) goto outrun; } - ast_moh_start(chan, targs->mohclass, NULL); + + if (ast_test_flag(&targs->followmeflags, FOLLOWMEFLAG_DISABLEFROMPROMPT)) { + ast_indicate(chan, AST_CONTROL_RINGING); + } + else { + ast_moh_start(chan, targs->mohclass, NULL); + } } ast_channel_lock(chan);