158158 <argument name="progress" />
159159 <argument name="mfprogress" />
160160 <argument name="mfwink" />
161+ <argument name="sfprogress" />
162+ <argument name="sfwink" />
161163 <para>Send the specified DTMF strings <emphasis>after</emphasis> the called
162164 party has answered, but before the call gets bridged. The
163165 <replaceable>called</replaceable> DTMF string is sent to the called party, and the
170172 If <replaceable>mfwink</replaceable> is specified, its MF is sent
171173 to the called party immediately after receiving a <literal>WINK</literal> message.</para>
172174 <para>See <literal>SendMF</literal> for valid digits.</para>
175+ <para>If <replaceable>sfprogress</replaceable> is specified, its SF is sent
176+ to the called party immediately after receiving a <literal>PROGRESS</literal> message.
177+ If <replaceable>sfwink</replaceable> is specified, its SF is sent
178+ to the called party immediately after receiving a <literal>WINK</literal> message.</para>
179+ <para>See <literal>SendSF</literal> for valid digits.</para>
173180 </option>
174181 <option name="E">
175182 <para>Enable echoing of sent MF or SF digits back to caller (e.g. "hearpulsing").
@@ -1214,6 +1221,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
12141221 struct privacy_args * pa ,
12151222 const struct cause_args * num_in , int * result , char * dtmf_progress ,
12161223 char * mf_progress , char * mf_wink ,
1224+ char * sf_progress , char * sf_wink ,
12171225 const int hearpulsing ,
12181226 const int ignore_cc ,
12191227 struct ast_party_id * forced_clid , struct ast_party_id * stored_clid ,
@@ -1580,6 +1588,14 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
15801588 ast_mf_stream (c , (hearpulsing ? NULL : in ),
15811589 (hearpulsing ? in : NULL ), mf_progress , 50 , 55 , 120 , 65 , 0 );
15821590 }
1591+ if (!ast_strlen_zero (sf_progress )) {
1592+ ast_verb (3 ,
1593+ "Sending SF '%s' to %s as result of "
1594+ "receiving a PROGRESS message.\n" ,
1595+ sf_progress , (hearpulsing ? "parties" : "called party" ));
1596+ ast_sf_stream (c , (hearpulsing ? NULL : in ),
1597+ (hearpulsing ? in : NULL ), sf_progress , 0 , 0 );
1598+ }
15831599 if (!ast_strlen_zero (dtmf_progress )) {
15841600 ast_verb (3 ,
15851601 "Sending DTMF '%s' to the called party as result of "
@@ -1602,7 +1618,16 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
16021618 ast_mf_stream (c , (hearpulsing ? NULL : in ),
16031619 (hearpulsing ? in : NULL ), mf_wink , 50 , 55 , 120 , 65 , 0 );
16041620 }
1621+ if (!ast_strlen_zero (sf_wink )) {
1622+ ast_verb (3 ,
1623+ "Sending SF '%s' to %s as result of "
1624+ "receiving a WINK message.\n" ,
1625+ sf_wink , (hearpulsing ? "parties" : "called party" ));
1626+ ast_sf_stream (c , (hearpulsing ? NULL : in ),
1627+ (hearpulsing ? in : NULL ), sf_wink , 0 , 0 );
1628+ }
16051629 }
1630+ ast_indicate (in , AST_CONTROL_WINK );
16061631 break ;
16071632 case AST_CONTROL_VIDUPDATE :
16081633 case AST_CONTROL_SRCUPDATE :
@@ -2278,6 +2303,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
22782303 struct timeval calldurationlimit = { 0 , };
22792304 char * dtmfcalled = NULL , * dtmfcalling = NULL , * dtmf_progress = NULL ;
22802305 char * mf_progress = NULL , * mf_wink = NULL ;
2306+ char * sf_progress = NULL , * sf_wink = NULL ;
22812307 struct privacy_args pa = {
22822308 .sentringing = 0 ,
22832309 .privdb_val = 0 ,
@@ -2413,11 +2439,13 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
24132439 }
24142440
24152441 if (ast_test_flag64 (& opts , OPT_SENDDTMF ) && !ast_strlen_zero (opt_args [OPT_ARG_SENDDTMF ])) {
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 , ":" );
2442+ sf_wink = opt_args [OPT_ARG_SENDDTMF ];
2443+ dtmfcalled = strsep (& sf_wink , ":" );
2444+ dtmfcalling = strsep (& sf_wink , ":" );
2445+ dtmf_progress = strsep (& sf_wink , ":" );
2446+ mf_progress = strsep (& sf_wink , ":" );
2447+ mf_wink = strsep (& sf_wink , ":" );
2448+ sf_progress = strsep (& sf_wink , ":" );
24212449 }
24222450
24232451 if (ast_test_flag64 (& opts , OPT_DURATION_LIMIT ) && !ast_strlen_zero (opt_args [OPT_ARG_DURATION_LIMIT ])) {
@@ -2894,7 +2922,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
28942922 }
28952923
28962924 peer = wait_for_answer (chan , & out_chans , & to , peerflags , opt_args , & pa , & num , & result ,
2897- dtmf_progress , mf_progress , mf_wink , (ast_test_flag64 (& opts , OPT_HEARPULSING ) ? 1 : 0 ),
2925+ dtmf_progress , mf_progress , mf_wink , sf_progress , sf_wink ,
2926+ (ast_test_flag64 (& opts , OPT_HEARPULSING ) ? 1 : 0 ),
28982927 ignore_cc , & forced_clid , & stored_clid , & config );
28992928
29002929 if (!peer ) {
0 commit comments