]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
sig_analog: Allow three-way flash to time out to silence.
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 10 Jul 2023 18:53:43 +0000 (18:53 +0000)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 4 Aug 2023 14:31:18 +0000 (14:31 +0000)
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.

channels/chan_dahdi.c
channels/chan_dahdi.h
channels/sig_analog.c
channels/sig_analog.h
configs/samples/chan_dahdi.conf.sample

index aa881c8d28356f2a4942962336d654a31beea5bb..a048bce48fafae0e199bf10f712fee9a0a4fc559 100644 (file)
@@ -12898,6 +12898,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
                tmp->usedistinctiveringdetection = usedistinctiveringdetection;
                tmp->callwaitingcallerid = conf->chan.callwaitingcallerid;
                tmp->threewaycalling = conf->chan.threewaycalling;
+               tmp->threewaysilenthold = conf->chan.threewaysilenthold;
                tmp->adsi = conf->chan.adsi;
                tmp->use_smdi = conf->chan.use_smdi;
                tmp->permhidecallerid = conf->chan.hidecallerid;
@@ -18245,6 +18246,8 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
                                confp->chan.cid_start = CID_START_RING;
                } else if (!strcasecmp(v->name, "threewaycalling")) {
                        confp->chan.threewaycalling = ast_true(v->value);
+               } else if (!strcasecmp(v->name, "threewaysilenthold")) {
+                       confp->chan.threewaysilenthold = ast_true(v->value);
                } else if (!strcasecmp(v->name, "cancallforward")) {
                        confp->chan.cancallforward = ast_true(v->value);
                } else if (!strcasecmp(v->name, "relaxdtmf")) {
index ed351bf53f6e2eb27ffba617994fe741efca7aee..de65e5ef88fe1b977c6588e11555cc6cb0425307 100644 (file)
@@ -351,6 +351,11 @@ struct dahdi_pvt {
         * \note Set from the "threewaycalling" value read in from chan_dahdi.conf
         */
        unsigned int threewaycalling:1;
+       /*!
+        * \brief TRUE if a three way dial tone should time out to silence
+        * \note Set from the "threewaysilenthold" value read in from chan_dahdi.conf
+        */
+       unsigned int threewaysilenthold:1;
        /*!
         * \brief TRUE if call transfer is enabled
         * \note For FXS ports (either direct analog or over T1/E1):
index ebc6c63c295cb8adc203d1da29cdd122384d6ae1..816735effb8776299577844e480ff09bbaabbef6 100644 (file)
@@ -2166,8 +2166,9 @@ static void *__analog_ss_thread(void *data)
                /* Read the first digit */
                timeout = analog_get_firstdigit_timeout(p);
                /* If starting a threeway call, never timeout on the first digit so someone
-                  can use flash-hook as a "hold" feature */
-               if (p->subs[ANALOG_SUB_THREEWAY].owner) {
+                * can use flash-hook as a "hold" feature...
+                * ...Unless three-way dial tone should time out to silence, in which case the default suffices. */
+               if (!p->threewaysilenthold && p->subs[ANALOG_SUB_THREEWAY].owner) {
                        timeout = INT_MAX;
                }
                while (len < AST_MAX_EXTENSION-1) {
@@ -2249,7 +2250,11 @@ static void *__analog_ss_thread(void *data)
                                }
                        } else if (res == 0) {
                                ast_debug(1, "not enough digits (and no ambiguous match)...\n");
-                               res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION);
+                               if (p->threewaysilenthold) {
+                                       ast_debug(1, "Nothing dialed at three-way dial tone, timed out to silent hold\n");
+                               } else {
+                                       res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION);
+                               }
                                analog_wait_event(p);
                                ast_hangup(chan);
                                goto quit;
index 624ab5804d3f92b83a0e18cb95e72b0489b0b34b..673767933fd323a82c6bc371bdf108d9346737b2 100644 (file)
@@ -300,6 +300,7 @@ struct analog_pvt {
        unsigned int permhidecallerid:1;                /*!< Whether to hide our outgoing caller ID or not */
        unsigned int pulse:1;
        unsigned int threewaycalling:1;
+       unsigned int threewaysilenthold:1;              /*!< Whether to time out a three-way dial tone to silence */
        unsigned int transfer:1;
        unsigned int transfertobusy:1;                  /*!< allow flash-transfers to busy channels */
        unsigned int use_callerid:1;                    /*!< Whether or not to use caller id on this channel */
index 9a2a7996da31725cdc2c63c0a2c9c2db61e5649a..26b3ffe28a4393d5ac6bca05c1b9f9a5279b4bb3 100644 (file)
@@ -759,6 +759,14 @@ callwaitingcallerid=yes
 ;
 threewaycalling=yes
 ;
+; By default, the three-way dial tone never times out, allowing it to be
+; used as a primitive "hold" mechanism. However, if you'd prefer
+; to have the dial tone time out to silence, you can use this option
+; to time out after the normal first digit timeout to silence.
+; Default is 'no'.
+;
+;threewaysilenthold=no
+;
 ; For FXS ports (either direct analog or over T1/E1):
 ;   Support flash-hook call transfer (requires three way calling)
 ;   Also enables call parking (overrides the 'canpark' parameter)