Summary:ASTERISK-03902: [patch] Send DTMF to calling party
Reporter:lancey (lancey)Labels:
Date Opened:2005-04-08 17:04:24Date Closed:2008-01-15 15:31:20.000-0600
Versions:Frequency of
Environment:Attachments:( 0) app_dial_d_2.diff.txt
( 1) app_dial_d.diff.txt
( 2) app_dial_i.diff
Description:app_dial's D() option sends DTMF to the *called* party upon successfull connect. In some situations we need the calling party to receive some DTMF too (e.g. ABCD progress tones). I suggest such option be incorporated into app_dial, as it might be useful.


It's trivial to make the D() option send the DTMF to the calling party. All we need is modify the call to ast_dtmf_stream on line 1259 of app_dial.c - swap "chan" and "peer".
I can make a patch which adds new option to app_dial to send DTMF to the calling party. All I need to know is some suggestion on which letter to use (I see "d" is used in latest CVS :)), as well as your general approval.
Comments:By: Tilghman Lesher (tilghman) 2005-04-08 17:27:38

Sounds fine.  Just pick a letter which isn't used in CVS-HEAD.

By: lancey (lancey) 2005-04-08 18:12:47

app_dial_i.diff is a patch which implements an I() option which sends the given DTMF string to the *calling* party.

By: Brian West (bkw918) 2005-04-08 20:19:14

how about patch the D() option to accept D(12345) for outbound.. and D(-12345) inbound or something like that?  App dial has too many flags now... or

D(12345:called) (default if you don't specify)

I think the L option does something like this.


By: lancey (lancey) 2005-04-08 20:22:45

bkw918: what if we need to play one DTMF to the called party, and another DTMF to the calling party on the *same* call?

I do also think the dial cmd has too many options, so i suggest something like that:
which plays:
DTMF string "called" to the called party, and
DTMF string "caller" to the calling party,
with ":caller" being optional, in order to be compatible with the older format.

I can also create a patch.

edited on: 04-08-05 20:24

By: Clod Patry (junky) 2005-04-08 20:23:07

D(12345:caller) could be nice yeah.

By: Brian West (bkw918) 2005-04-08 20:28:30



ya ya that works.


By: lancey (lancey) 2005-04-08 22:02:46

app_dial_d.diff.txt is the latest patch, it modifies the D option to accept a second DTMF string which gets sent to the calling party. Both strings could be used alone.

D(2)   -> sends '2' to the called party
D(:B)  -> sends 'B' to the calling party
D(2:B) -> does both of the above two ;)

edited on: 04-08-05 22:03

By: Mark Spencer (markster) 2005-04-09 13:58:50

Need disclaimer status on the patch and check formatting please, toher than that looks good :)

By: lancey (lancey) 2005-04-09 16:19:51

I know about the disclaimer, but i don't have a fax here, so I will send it on Monday.

About the formatting - what should I check, didn't get your point?

By: Clod Patry (junky) 2005-04-09 18:33:34

+ if (!ast_strlen_zero(dtmfcalling)) {
+                               if (option_verbose > 2)
+                                        ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n",dtmfcalling);
+ res = ast_dtmf_stream(chan,peer,dtmfcalling,250);

the right syntax is:
if ( foobar)
instruction here;
instruction there;


if ( foobar) {
} else {

See the tabulations after an if.
At the end of your patches, you did not respect these standards.
If you could submit a new revision of your patch, that would be appreciated.

By: lancey (lancey) 2005-04-09 21:35:48

-> app_dial_d_2.diff.txt

Tell me if this one looks better.

By: lancey (lancey) 2005-04-10 14:05:06

Disclaimer is on file at Digium.

By: Mark Spencer (markster) 2005-04-10 21:55:07

Added to CVS with mods, thanks!

By: Russell Bryant (russell) 2005-04-15 02:53:54

not included in 1.0 since it is a new feature

By: Digium Subversion (svnbot) 2008-01-15 15:31:20.000-0600

Repository: asterisk
Revision: 5445

U   trunk/apps/app_dial.c

r5445 | markster | 2008-01-15 15:31:19 -0600 (Tue, 15 Jan 2008) | 2 lines

Add calling party DTMF (bug ASTERISK-3902)