that the request is against a known peer. It also issues a new event,
'SIPqualifypeerdone', once the qualify action has been completed.
+ * The PlayDTMF action now supports an optional 'Duration' parameter. This
+ specifies the duration of the digit to be played, in milliseconds.
+
* Added VoicemailRefresh action to allow an external entity to trigger mailbox
updates when changes occur instead of requiring the use of pollmailboxes.
<parameter name="Digit" required="true">
<para>The DTMF digit to play.</para>
</parameter>
+ <parameter name="Duration" required="false">
+ <para>The duration, in milliseconds, of the digit to be played.</para>
+ </parameter>
</syntax>
<description>
<para>Plays a dtmf digit on the specified channel.</para>
{
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;
+ unsigned int duration_ms = 0;
if (!(chan = ast_channel_get_by_name(channel))) {
astman_send_error(s, m, "Channel not found");
chan = ast_channel_unref(chan);
return 0;
}
+
+ if (!ast_strlen_zero(duration) && (sscanf(duration, "%30u", &duration_ms) != 1)) {
+ astman_send_error(s, m, "Could not convert Duration parameter");
+ chan = ast_channel_unref(chan);
+ return 0;
+ }
- ast_senddigit(chan, *digit, 0);
+ ast_senddigit(chan, *digit, duration_ms);
chan = ast_channel_unref(chan);