Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
772b5903
Commit
772b5903
authored
5 years ago
by
lvl
Browse files
Options
Downloads
Patches
Plain Diff
app_senddtmf: Add receive mode to AMI Action PlayDTMF
ASTERISK-28614 Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664
parent
b3de3ce0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/app_senddtmf.c
+12
-1
12 additions, 1 deletion
apps/app_senddtmf.c
with
12 additions
and
1 deletion
apps/app_senddtmf.c
+
12
−
1
View file @
772b5903
...
@@ -80,6 +80,9 @@
...
@@ -80,6 +80,9 @@
<parameter name="Duration" required="false">
<parameter name="Duration" required="false">
<para>The duration, in milliseconds, of the digit to be played.</para>
<para>The duration, in milliseconds, of the digit to be played.</para>
</parameter>
</parameter>
<parameter name="Receive" required="false">
<para>Emulate receiving DTMF on this channel instead of sending it out.</para>
</parameter>
</syntax>
</syntax>
<description>
<description>
<para>Plays a dtmf digit on the specified channel.</para>
<para>Plays a dtmf digit on the specified channel.</para>
...
@@ -147,6 +150,7 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
...
@@ -147,6 +150,7 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
const
char
*
channel
=
astman_get_header
(
m
,
"Channel"
);
const
char
*
channel
=
astman_get_header
(
m
,
"Channel"
);
const
char
*
digit
=
astman_get_header
(
m
,
"Digit"
);
const
char
*
digit
=
astman_get_header
(
m
,
"Digit"
);
const
char
*
duration
=
astman_get_header
(
m
,
"Duration"
);
const
char
*
duration
=
astman_get_header
(
m
,
"Duration"
);
const
char
*
receive_s
=
astman_get_header
(
m
,
"Receive"
);
struct
ast_channel
*
chan
;
struct
ast_channel
*
chan
;
unsigned
int
duration_ms
=
0
;
unsigned
int
duration_ms
=
0
;
...
@@ -167,7 +171,14 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
...
@@ -167,7 +171,14 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
return
0
;
return
0
;
}
}
ast_senddigit_external
(
chan
,
*
digit
,
duration_ms
);
if
(
ast_true
(
receive_s
))
{
struct
ast_frame
f
=
{
AST_FRAME_DTMF
,
};
f
.
len
=
duration_ms
;
f
.
subclass
.
integer
=
*
digit
;
ast_queue_frame
(
chan
,
&
f
);
}
else
{
ast_senddigit_external
(
chan
,
*
digit
,
duration_ms
);
}
chan
=
ast_channel_unref
(
chan
);
chan
=
ast_channel_unref
(
chan
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment