Skip to content

Commit e1a1ae9

Browse files
sig_analog: Allow three-way flash to time out to silence.
sig_analog allows users to flash and use the three-way dial tone as a primitive hold function, simply by never timing it out. Some systems allow this dial tone to time out to silence, so the user is not annoyed by a persistent dial tone. This option allows the dial tone to time out normally to silence. ASTERISK-30004 #close Resolves: #205 UserNote: The threewaysilenthold option now allows the three-way dial tone to time out to silence, rather than continuing forever.
1 parent f335da6 commit e1a1ae9

5 files changed

Lines changed: 25 additions & 3 deletions

File tree

channels/chan_dahdi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12898,6 +12898,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
1289812898
tmp->usedistinctiveringdetection = usedistinctiveringdetection;
1289912899
tmp->callwaitingcallerid = conf->chan.callwaitingcallerid;
1290012900
tmp->threewaycalling = conf->chan.threewaycalling;
12901+
tmp->threewaysilenthold = conf->chan.threewaysilenthold;
1290112902
tmp->adsi = conf->chan.adsi;
1290212903
tmp->use_smdi = conf->chan.use_smdi;
1290312904
tmp->permhidecallerid = conf->chan.hidecallerid;
@@ -18245,6 +18246,8 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
1824518246
confp->chan.cid_start = CID_START_RING;
1824618247
} else if (!strcasecmp(v->name, "threewaycalling")) {
1824718248
confp->chan.threewaycalling = ast_true(v->value);
18249+
} else if (!strcasecmp(v->name, "threewaysilenthold")) {
18250+
confp->chan.threewaysilenthold = ast_true(v->value);
1824818251
} else if (!strcasecmp(v->name, "cancallforward")) {
1824918252
confp->chan.cancallforward = ast_true(v->value);
1825018253
} else if (!strcasecmp(v->name, "relaxdtmf")) {

channels/chan_dahdi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ struct dahdi_pvt {
351351
* \note Set from the "threewaycalling" value read in from chan_dahdi.conf
352352
*/
353353
unsigned int threewaycalling:1;
354+
/*!
355+
* \brief TRUE if a three way dial tone should time out to silence
356+
* \note Set from the "threewaysilenthold" value read in from chan_dahdi.conf
357+
*/
358+
unsigned int threewaysilenthold:1;
354359
/*!
355360
* \brief TRUE if call transfer is enabled
356361
* \note For FXS ports (either direct analog or over T1/E1):

channels/sig_analog.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,8 +2166,9 @@ static void *__analog_ss_thread(void *data)
21662166
/* Read the first digit */
21672167
timeout = analog_get_firstdigit_timeout(p);
21682168
/* If starting a threeway call, never timeout on the first digit so someone
2169-
can use flash-hook as a "hold" feature */
2170-
if (p->subs[ANALOG_SUB_THREEWAY].owner) {
2169+
* can use flash-hook as a "hold" feature...
2170+
* ...Unless three-way dial tone should time out to silence, in which case the default suffices. */
2171+
if (!p->threewaysilenthold && p->subs[ANALOG_SUB_THREEWAY].owner) {
21712172
timeout = INT_MAX;
21722173
}
21732174
while (len < AST_MAX_EXTENSION-1) {
@@ -2249,7 +2250,11 @@ static void *__analog_ss_thread(void *data)
22492250
}
22502251
} else if (res == 0) {
22512252
ast_debug(1, "not enough digits (and no ambiguous match)...\n");
2252-
res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION);
2253+
if (p->threewaysilenthold) {
2254+
ast_debug(1, "Nothing dialed at three-way dial tone, timed out to silent hold\n");
2255+
} else {
2256+
res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION);
2257+
}
22532258
analog_wait_event(p);
22542259
ast_hangup(chan);
22552260
goto quit;

channels/sig_analog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ struct analog_pvt {
300300
unsigned int permhidecallerid:1; /*!< Whether to hide our outgoing caller ID or not */
301301
unsigned int pulse:1;
302302
unsigned int threewaycalling:1;
303+
unsigned int threewaysilenthold:1; /*!< Whether to time out a three-way dial tone to silence */
303304
unsigned int transfer:1;
304305
unsigned int transfertobusy:1; /*!< allow flash-transfers to busy channels */
305306
unsigned int use_callerid:1; /*!< Whether or not to use caller id on this channel */

configs/samples/chan_dahdi.conf.sample

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,14 @@ callwaitingcallerid=yes
759759
;
760760
threewaycalling=yes
761761
;
762+
; By default, the three-way dial tone never times out, allowing it to be
763+
; used as a primitive "hold" mechanism. However, if you'd prefer
764+
; to have the dial tone time out to silence, you can use this option
765+
; to time out after the normal first digit timeout to silence.
766+
; Default is 'no'.
767+
;
768+
;threewaysilenthold=no
769+
;
762770
; For FXS ports (either direct analog or over T1/E1):
763771
; Support flash-hook call transfer (requires three way calling)
764772
; Also enables call parking (overrides the 'canpark' parameter)

0 commit comments

Comments
 (0)