diff -ru asterisk/apps/app_dial.c asterisk_work/apps/app_dial.c --- asterisk/apps/app_dial.c 2008-03-03 10:41:26.000000000 -0500 +++ asterisk_work/apps/app_dial.c 2008-03-03 11:17:00.000000000 -0500 @@ -105,11 +105,12 @@ " a call to be answered. Exit to that extension if it exists in the\n" " current context, or the context defined in the EXITCONTEXT variable,\n" " if it exists.\n" -" D([called][:calling]) - Send the specified DTMF strings *after* the called\n" +" D([called][:calling][:progress]) - Send the specified DTMF strings *after* the called\n" " party has answered, but before the call gets bridged. The 'called'\n" " DTMF string is sent to the called party, and the 'calling' DTMF\n" " string is sent to the calling party. Both parameters can be used\n" " alone.\n" +" If progress specified, it's DTMF will be send as soon as PROGRESS message is received.\n" " e - execute the 'h' extension for peer after the call ends\n" " f - Force the callerid of the *calling* channel to be set as the\n" " extension associated with the channel using a dialplan 'hint'.\n" @@ -559,7 +560,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct chanlist *outgoing, int *to, struct ast_flags64 *peerflags, struct privacy_args *pa, - const struct cause_args *num_in, int *result) + const struct cause_args *num_in, int *result, char *progress_dtmf) { struct cause_args num = *num_in; int prestart = num.busy + num.congestion + num.nochan; @@ -711,6 +712,9 @@ ast_channel_early_bridge(in, c); if (!ast_test_flag64(outgoing, OPT_RINGBACK)) ast_indicate(in, AST_CONTROL_PROGRESS); + if(!ast_strlen_zero(progress_dtmf)) { + ast_dtmf_stream(o->chan->name,in->name,progress_dtmf,250); + } break; case AST_CONTROL_VIDUPDATE: ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name); @@ -1235,7 +1239,7 @@ struct ast_bridge_config config = { { 0, } }; unsigned int calldurationlimit = 0; - char *dtmfcalled = NULL, *dtmfcalling = NULL; + char *dtmfcalled = NULL, *dtmfcalling = NULL, *dtmf_progress=NULL; struct privacy_args pa = { .sentringing = 0, .privdb_val = 0, @@ -1300,7 +1304,8 @@ if (ast_test_flag64(&opts, OPT_SENDDTMF) && !ast_strlen_zero(opt_args[OPT_ARG_SENDDTMF])) { dtmfcalling = opt_args[OPT_ARG_SENDDTMF]; - dtmfcalled = strsep(&dtmfcalling, ":"); + dtmfcalling = strsep(&parse, ":"); + dtmf_progress = parse; } if (ast_test_flag64(&opts, OPT_DURATION_LIMIT) && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_LIMIT])) { @@ -1600,7 +1605,7 @@ } time(&start_time); - peer = wait_for_answer(chan, outgoing, &to, peerflags, &pa, &num, &result); + peer = wait_for_answer(chan, outgoing, &to, peerflags, &pa, &num, &result, dtmf_progress); ast_channel_datastore_remove(chan, datastore); ast_channel_datastore_free(datastore);