--- asterisk-1.6.2.19/apps/app_senddtmf.c 2009-03-24 19:42:26.000000000 -0300 +++ asterisk-1.6.2.19/apps/app_senddtmf.c 2011-06-24 19:42:49.000000000 -0300 @@ -94,14 +94,17 @@ "Description: Plays a dtmf digit on the specified channel.\n" "Variables: (all are required)\n" " Channel: Channel name to send digit to\n" -" Digit: The dtmf digit to play\n"; +" Digit: The dtmf digit to play\n" +" Duration: Duration of each digit\n"; static int manager_play_dtmf(struct mansession *s, const struct message *m) { const char *channel = astman_get_header(m, "Channel"); const char *digit = astman_get_header(m, "Digit"); + const char *duration = astman_get_header(m, "Duration"); struct ast_channel *chan = ast_get_channel_by_name_locked(channel); - + unsigned int duration_l = 250; + if (!chan) { astman_send_error(s, m, "Channel not specified"); return 0; @@ -112,7 +115,12 @@ return 0; } - ast_senddigit(chan, *digit, 0); + if (!ast_strlen_zero(duration)) { + duration_l = atoi(duration); + } + + ast_senddigit(chan, *digit, duration_l); ast_channel_unlock(chan); astman_send_ack(s, m, "DTMF successfully queued");