156
156
<argument name="called" />
157
157
<argument name="calling" />
158
158
<argument name="progress" />
159
+ <argument name="mfprogress" />
160
+ <argument name="mfwink" />
159
161
<para>Send the specified DTMF strings <emphasis>after</emphasis> the called
160
162
party has answered, but before the call gets bridged. The
161
163
<replaceable>called</replaceable> DTMF string is sent to the called party, and the
162
164
<replaceable>calling</replaceable> DTMF string is sent to the calling party. Both arguments
163
165
can be used alone. If <replaceable>progress</replaceable> is specified, its DTMF is sent
164
166
to the called party immediately after receiving a <literal>PROGRESS</literal> message.</para>
165
167
<para>See <literal>SendDTMF</literal> for valid digits.</para>
168
+ <para>If <replaceable>mfprogress</replaceable> is specified, its MF is sent
169
+ to the called party immediately after receiving a <literal>PROGRESS</literal> message.
170
+ If <replaceable>mfwink</replaceable> is specified, its MF is sent
171
+ to the called party immediately after receiving a <literal>WINK</literal> message.</para>
172
+ <para>See <literal>SendMF</literal> for valid digits.</para>
173
+ </option>
174
+ <option name="E">
175
+ <para>Enable echoing of sent MF or SF digits back to caller (e.g. "hearpulsing").
176
+ Used in conjunction with the D option.</para>
166
177
</option>
167
178
<option name="e">
168
179
<para>Execute the <literal>h</literal> extension for peer after the call ends</para>
499
510
answered, if it has not already been answered. These two channels will then
500
511
be active in a bridged call. All other channels that were requested will then
501
512
be hung up.</para>
502
-
503
513
<para>Unless there is a timeout specified, the Dial application will wait
504
514
indefinitely until one of the called channels answers, the user hangs up, or
505
515
if all of the called channels are busy or unavailable. Dialplan execution will
512
522
If the <variable>OUTBOUND_GROUP_ONCE</variable> variable is set, all peer channels created by this
513
523
application will be put into that group (as in <literal>Set(GROUP()=...</literal>). Unlike <variable>OUTBOUND_GROUP</variable>,
514
524
however, the variable will be unset after use.</para>
515
-
516
525
<example title="Dial with 30 second timeout">
517
526
same => n,Dial(PJSIP/alice,30)
518
527
</example>
534
543
</example>
535
544
<example title="Dial with pre-dial subroutines">
536
545
[default]
537
-
538
546
exten => callee_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
539
547
same => n,Log(NOTICE, I'm called on channel ${CHANNEL} prior to it starting the dial attempt)
540
548
same => n,Return()
541
-
542
549
exten => called_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
543
550
same => n,Log(NOTICE, I'm called on outbound channel ${CHANNEL} prior to it being used to dial someone)
544
551
same => n,Return()
545
-
546
552
exten => _X.,1,NoOp()
547
553
same => n,Dial(PJSIP/alice,,b(default^called_channel^1(my_gosub_arg1^my_gosub_arg2))B(default^callee_channel^1(my_gosub_arg1^my_gosub_arg2)))
548
554
same => n,Hangup()
549
555
</example>
550
556
<example title="Dial with post-answer subroutine executed on outbound channel">
551
557
[my_gosub_routine]
552
-
553
558
exten => s,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
554
559
same => n,Playback(hello)
555
560
same => n,Return()
556
-
557
561
[default]
558
-
559
562
exten => _X.,1,NoOp()
560
563
same => n,Dial(PJSIP/alice,,U(my_gosub_routine^my_gosub_arg1^my_gosub_arg2))
561
564
same => n,Hangup()
@@ -717,6 +720,7 @@ enum {
717
720
#define OPT_PREDIAL_CALLER (1LLU << 42)
718
721
#define OPT_RING_WITH_EARLY_MEDIA (1LLU << 43)
719
722
#define OPT_HANGUPCAUSE (1LLU << 44)
723
+ #define OPT_HEARPULSING (1LLU << 45)
720
724
721
725
enum {
722
726
OPT_ARG_ANNOUNCE = 0 ,
@@ -752,6 +756,7 @@ AST_APP_OPTIONS(dial_exec_options, BEGIN_OPTIONS
752
756
AST_APP_OPTION ('c' , OPT_CANCEL_ELSEWHERE ),
753
757
AST_APP_OPTION ('d' , OPT_DTMF_EXIT ),
754
758
AST_APP_OPTION_ARG ('D' , OPT_SENDDTMF , OPT_ARG_SENDDTMF ),
759
+ AST_APP_OPTION ('E' , OPT_HEARPULSING ),
755
760
AST_APP_OPTION ('e' , OPT_PEER_H ),
756
761
AST_APP_OPTION_ARG ('f' , OPT_FORCECLID , OPT_ARG_FORCECLID ),
757
762
AST_APP_OPTION_ARG ('F' , OPT_CALLEE_GO_ON , OPT_ARG_CALLEE_GO_ON ),
@@ -1208,6 +1213,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
1208
1213
char * opt_args [],
1209
1214
struct privacy_args * pa ,
1210
1215
const struct cause_args * num_in , int * result , char * dtmf_progress ,
1216
+ char * mf_progress , char * mf_wink ,
1217
+ const int hearpulsing ,
1211
1218
const int ignore_cc ,
1212
1219
struct ast_party_id * forced_clid , struct ast_party_id * stored_clid ,
1213
1220
struct ast_bridge_config * config )
@@ -1227,7 +1234,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
1227
1234
int cc_frame_received = 0 ;
1228
1235
int num_ringing = 0 ;
1229
1236
int sent_ring = 0 ;
1230
- int sent_progress = 0 ;
1237
+ int sent_progress = 0 , sent_wink = 0 ;
1231
1238
struct timeval start = ast_tvnow ();
1232
1239
SCOPE_ENTER (3 , "%s\n" , ast_channel_name (in ));
1233
1240
@@ -1565,6 +1572,14 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
1565
1572
ast_channel_unlock (in );
1566
1573
sent_progress = 1 ;
1567
1574
1575
+ if (!ast_strlen_zero (mf_progress )) {
1576
+ ast_verb (3 ,
1577
+ "Sending MF '%s' to %s as result of "
1578
+ "receiving a PROGRESS message.\n" ,
1579
+ mf_progress , hearpulsing ? "parties" : "called party" );
1580
+ ast_mf_stream (c , (hearpulsing ? NULL : in ),
1581
+ (hearpulsing ? in : NULL ), mf_progress , 50 , 55 , 120 , 65 , 0 );
1582
+ }
1568
1583
if (!ast_strlen_zero (dtmf_progress )) {
1569
1584
ast_verb (3 ,
1570
1585
"Sending DTMF '%s' to the called party as result of "
@@ -1575,6 +1590,20 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
1575
1590
}
1576
1591
ast_channel_publish_dial (in , c , NULL , "PROGRESS" );
1577
1592
break ;
1593
+ case AST_CONTROL_WINK :
1594
+ ast_verb (3 , "%s winked, passing it to %s\n" , ast_channel_name (c ), ast_channel_name (in ));
1595
+ if (!sent_wink ) {
1596
+ sent_wink = 1 ;
1597
+ if (!ast_strlen_zero (mf_wink )) {
1598
+ ast_verb (3 ,
1599
+ "Sending MF '%s' to %s as result of "
1600
+ "receiving a WINK message.\n" ,
1601
+ mf_wink , (hearpulsing ? "parties" : "called party" ));
1602
+ ast_mf_stream (c , (hearpulsing ? NULL : in ),
1603
+ (hearpulsing ? in : NULL ), mf_wink , 50 , 55 , 120 , 65 , 0 );
1604
+ }
1605
+ }
1606
+ break ;
1578
1607
case AST_CONTROL_VIDUPDATE :
1579
1608
case AST_CONTROL_SRCUPDATE :
1580
1609
case AST_CONTROL_SRCCHANGE :
@@ -2132,9 +2161,7 @@ static int setup_privacy_args(struct privacy_args *pa,
2132
2161
/* the file doesn't exist yet. Let the caller submit his
2133
2162
vocal intro for posterity */
2134
2163
/* priv-recordintro script:
2135
-
2136
2164
"At the tone, please say your name:"
2137
-
2138
2165
*/
2139
2166
int silencethreshold = ast_dsp_get_threshold_from_settings (THRESHOLD_SILENCE );
2140
2167
ast_answer (chan );
@@ -2249,7 +2276,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
2249
2276
2250
2277
struct ast_bridge_config config = { { 0 , } };
2251
2278
struct timeval calldurationlimit = { 0 , };
2252
- char * dtmfcalled = NULL , * dtmfcalling = NULL , * dtmf_progress = NULL ;
2279
+ char * dtmfcalled = NULL , * dtmfcalling = NULL , * dtmf_progress = NULL ;
2280
+ char * mf_progress = NULL , * mf_wink = NULL ;
2253
2281
struct privacy_args pa = {
2254
2282
.sentringing = 0 ,
2255
2283
.privdb_val = 0 ,
@@ -2385,9 +2413,11 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
2385
2413
}
2386
2414
2387
2415
if (ast_test_flag64 (& opts , OPT_SENDDTMF ) && !ast_strlen_zero (opt_args [OPT_ARG_SENDDTMF ])) {
2388
- dtmf_progress = opt_args [OPT_ARG_SENDDTMF ];
2389
- dtmfcalled = strsep (& dtmf_progress , ":" );
2390
- dtmfcalling = strsep (& dtmf_progress , ":" );
2416
+ mf_wink = opt_args [OPT_ARG_SENDDTMF ];
2417
+ dtmfcalled = strsep (& mf_wink , ":" );
2418
+ dtmfcalling = strsep (& mf_wink , ":" );
2419
+ dtmf_progress = strsep (& mf_wink , ":" );
2420
+ mf_progress = strsep (& mf_wink , ":" );
2391
2421
}
2392
2422
2393
2423
if (ast_test_flag64 (& opts , OPT_DURATION_LIMIT ) && !ast_strlen_zero (opt_args [OPT_ARG_DURATION_LIMIT ])) {
@@ -2864,7 +2894,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
2864
2894
}
2865
2895
2866
2896
peer = wait_for_answer (chan , & out_chans , & to , peerflags , opt_args , & pa , & num , & result ,
2867
- dtmf_progress , ignore_cc , & forced_clid , & stored_clid , & config );
2897
+ dtmf_progress , mf_progress , mf_wink , (ast_test_flag64 (& opts , OPT_HEARPULSING ) ? 1 : 0 ),
2898
+ ignore_cc , & forced_clid , & stored_clid , & config );
2868
2899
2869
2900
if (!peer ) {
2870
2901
if (result ) {
@@ -3542,4 +3573,4 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Dialing Application",
3542
3573
.load = load_module ,
3543
3574
.unload = unload_module ,
3544
3575
.requires = "ccss" ,
3545
- );
3576
+ );
0 commit comments