app_mf: Add full tech-agnostic MF support

Adds tech-agnostic support for MF signaling by adding
MF sender and receiver applications as well as Dial
integration.

ASTERISK-29496-mf #do-not-close

Change-Id: I61962b359b8ec4cfd05df877ddf9f5b8f71927a4
This commit is contained in:
Naveen Albert
2021-09-22 00:18:08 +00:00
committed by George Joseph
parent e3ff42aee6
commit 50716bb3e4
7 changed files with 590 additions and 146 deletions

View File

@@ -941,6 +941,39 @@ void ast_replace_sigchld(void);
*/
void ast_unreplace_sigchld(void);
/*!
* \brief Send a string of MF digits to a channel
*
* \param chan The channel that will receive the MF digits.
* \param peer (optional) Peer channel that will be autoserviced while the
* primary channel is receiving MF
* \param chan2 A second channel that will simultaneously receive MF digits.
* This option may only be used if is_external is 0.
* \param digits This is a string of characters representing the MF digits
* to be sent to the channel. Valid characters are
* "0123456789*#abcdABCD". Note: You can pass arguments 'f' or
* 'F', if you want to Flash the channel (if supported by the
* channel), or 'w' or 'W' to add a wink (if supported by the
* channel).
* \param between This is the number of milliseconds to wait in between each
* MF digit. If zero milliseconds is specified, then the
* default value of 50 will be used.
* \param duration This is the duration that each numeric MF digit should have.
* Default value is 55.
* \param durationkp This is the duration that each KP digit should have. Default
* is 120.
* \param durationst This is the duration that each ST, STP, ST2P, or ST3P digit
* should have. Default is 65.
* \param is_external 1 if called by a thread that is not the channel's media
* handler thread, 0 if called by the channel's media handler
* thread.
*
* \retval 0 on success.
* \retval -1 on failure or a channel hung up.
*/
int ast_mf_stream(struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *chan2, const char *digits,
int between, unsigned int duration, unsigned int durationkp, unsigned int durationst, int is_external);
/*!
* \brief Send a string of DTMF digits to a channel
*

View File

@@ -2242,6 +2242,30 @@ int ast_sendtext_data(struct ast_channel *chan, struct ast_msg_data *msg);
*/
int ast_recvchar(struct ast_channel *chan, int timeout);
/*!
* \brief End sending an MF digit to a channel.
* \param chan channel to act upon
* \return Returns 0 on success, -1 on failure
*/
int ast_senddigit_mf_end(struct ast_channel *chan);
/*!
* \brief Send an MF digit to a channel.
*
* \param chan channel to act upon
* \param digit the MF digit to send, encoded in ASCII
* \param duration the duration of a numeric digit ending in ms
* \param duration the duration of a KP digit ending in ms
* \param duration the duration of a ST, STP, ST2P, or ST3P digit ending in ms
* \param is_external 1 if called by a thread that is not the channel's media
* handler thread, 0 if called by the channel's media handler
* thread.
*
* \return 0 on success, -1 on failure
*/
int ast_senddigit_mf(struct ast_channel *chan, char digit, unsigned int duration,
unsigned int durationkp, unsigned int durationst, int is_external);
/*!
* \brief Send a DTMF digit to a channel.
*
@@ -2269,6 +2293,14 @@ int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration);
*/
int ast_senddigit_external(struct ast_channel *chan, char digit, unsigned int duration);
/*!
* \brief Send an MF digit to a channel.
* \param chan channel to act upon
* \param digit the MF digit to send, encoded in ASCII
* \return 0 on success, -1 on failure
*/
int ast_senddigit_mf_begin(struct ast_channel *chan, char digit);
/*!
* \brief Send a DTMF digit to a channel.
* \param chan channel to act upon