Index: main/pbx.c =================================================================== --- main/pbx.c (revision 88114) +++ main/pbx.c (working copy) @@ -60,6 +60,7 @@ #include "asterisk/app.h" #include "asterisk/devicestate.h" #include "asterisk/stringfields.h" +#include "asterisk/indications.h" /*! * \note I M P O R T A N T : @@ -98,9 +99,11 @@ }); #define WAITEXTEN_MOH (1 << 0) +#define WAITEXTEN_DIALTONE (1 << 1) AST_APP_OPTIONS(waitexten_opts, { AST_APP_OPTION_ARG('m', WAITEXTEN_MOH, 0), + AST_APP_OPTION_ARG('d', WAITEXTEN_DIALTONE, 0), }); struct ast_context; @@ -5590,9 +5593,15 @@ if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) { ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n"); - } else if (ast_test_flag(&flags, WAITEXTEN_MOH)) + } else if (ast_test_flag(&flags, WAITEXTEN_MOH)) { ast_indicate_data(chan, AST_CONTROL_HOLD, opts[0], strlen(opts[0])); - + } else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE)) { + const struct tone_zone_sound *ts = ast_get_indication_tone(chan->zone, "dial"); + if (ts) + ast_playtones_start(chan, 0, ts->data, 0); + else + ast_tonepair_start(chan, 350, 440, 0, 0); + } /* Wait for "n" seconds */ if (args.timeout && (sec = atof(args.timeout)) > 0.0) ms = 1000 * sec; @@ -5617,6 +5626,8 @@ if (ast_test_flag(&flags, WAITEXTEN_MOH)) ast_indicate(chan, AST_CONTROL_UNHOLD); + else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE)) + ast_playtones_stop(chan); return res; }