]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add discriminator for when ring pulse alert signal is used to preface MWI spills
authorDoug Bailey <dbailey@digium.com>
Sat, 17 Jan 2009 18:26:44 +0000 (18:26 +0000)
committerDoug Bailey <dbailey@digium.com>
Sat, 17 Jan 2009 18:26:44 +0000 (18:26 +0000)
This prevents the situation when MWI messages are added to caller ID spills causing the channel to be hung up

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169153 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c
configs/chan_dahdi.conf.sample

index 53df3f79279577d29fdd6930fdac57446829453e..23386364eb3c927582766d623e30a46ce30b274c 100644 (file)
@@ -634,6 +634,7 @@ static struct dahdi_pvt {
        unsigned int transfertobusy:1;                  /*!< allow flash-transfers to busy channels */
        unsigned int mwimonitor_neon:1;                 /*!< monitor this FXO port for neon type MWI indication from other end */
        unsigned int mwimonitor_fsk:1;                  /*!< monitor this FXO port for fsk MWI indication from other end */
+       unsigned int mwimonitor_rpas:1;                 /*!< monitor this FXO port for rpas precursor to fsk MWI indication */
        unsigned int mwimonitoractive:1;                /*!< an MWI monitor thread is currently active */
        unsigned int mwisendactive:1;                   /*!< a MWI message sending thread is active */
        /* Channel state or unavilability flags */
@@ -7507,12 +7508,18 @@ static void *ss_thread(void *data)
                if (flags & CID_MSGWAITING) {
                        ast_log(LOG_NOTICE, "MWI: Channel %d message waiting!\n", p->channel);
                        notify_message(p->mailbox, 1);
-                       ast_hangup(chan);
+                       /* If generated using Ring Pulse Alert, then ring has been answered as a call and needs to be hungup */
+                       if (p->mwimonitor_rpas) {
+                               ast_hangup(chan);
+                       }
                        return NULL;
                } else if (flags & CID_NOMSGWAITING) {
                        ast_log(LOG_NOTICE, "MWI: Channel %d no message waiting!\n", p->channel);
                        notify_message(p->mailbox, 0);
-                       ast_hangup(chan);
+                       /* If generated using Ring Pulse Alert, then ring has been answered as a call and needs to be hungup */
+                       if (p->mwimonitor_rpas) {
+                               ast_hangup(chan);
+                       }
                        return NULL;
                }
 
@@ -8849,6 +8856,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
                if (chan_sig & __DAHDI_SIG_FXS) {
                        tmp->mwimonitor_fsk = conf->chan.mwimonitor_fsk;
                        tmp->mwimonitor_neon = conf->chan.mwimonitor_neon;
+                       tmp->mwimonitor_rpas = conf->chan.mwimonitor_rpas;
                }
                tmp->sig = chan_sig;
                tmp->outsigmod = conf->chan.outsigmod;
@@ -14103,16 +14111,22 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
                } else if (!strcasecmp(v->name, "transfertobusy")) {
                        confp->chan.transfertobusy = ast_true(v->value);
                } else if (!strcasecmp(v->name, "mwimonitor")) {
-                       if (!strcasecmp(v->value, "neon")) {
+                       confp->chan.mwimonitor_neon = 0;
+                       confp->chan.mwimonitor_fsk  = 0;
+                       confp->chan.mwimonitor_rpas = 0;
+                       if (strcasestr(v->value, "fsk")) {
+                               confp->chan.mwimonitor_fsk = 1;
+                       }
+                       if (strcasestr(v->value, "rpas")) {
+                               confp->chan.mwimonitor_rpas = 1;
+                       }
+                       if (strcasestr(v->value, "neon")) {
                                confp->chan.mwimonitor_neon = 1;
-                               confp->chan.mwimonitor_fsk = 0;
-                       } else {
-                               confp->chan.mwimonitor_neon = 0;
-                               if (!strcasecmp(v->value, "fsk"))
-                                       confp->chan.mwimonitor_fsk = 1;
-                               else 
-                                       confp->chan.mwimonitor_fsk = ast_true(v->value) ? 1 : 0;
                        }
+                       /* If set to true or yes, assume that simple fsk is desired */
+                       if (ast_true(v->value)) {
+                               confp->chan.mwimonitor_fsk = 1;
+                       } 
                } else if (!strcasecmp(v->name, "cid_rxgain")) {
                        if (sscanf(v->value, "%f", &confp->chan.cid_rxgain) != 1) {
                                ast_log(LOG_WARNING, "Invalid cid_rxgain: %s at line %d.\n", v->value, v->lineno);
index 85087c504b4b15041c204ac3a7f8aad7d06c9dcc..ce2a3054e7ed44dce2d6ffa36e55679c1bcb5ce4 100644 (file)
@@ -369,12 +369,20 @@ usecallerid=yes
 ;waitfordialtone=yes
 ;
 ; The following option enables receiving MWI on FXO lines.  The default
-; value is no.  When this is enabled, and MWI notification indicates on or off,
-; the script specified by the mwimonitornotify option is executed.  Also, an
-; internal Asterisk MWI event will be generated so that any other part of
-; Asterisk that cares about MWI state changes will get notified, just as if
-; the state change came from app_voicemail. The energy level that must be seen
-; before starting the MWI detection process can be set with 'mwilevel'.
+; value is no.
+;      The mwimonitor can take the following values
+;              no - No mwimonitoring occurs. (default)
+;              yes - The same as specifying fsk
+;              fsk - the FXO line is monitored for MWI FSK spills
+;              fsk,rpas - the FXO line is monitored for MWI FSK spills preceded
+;                      by a ring pulse alert signal.
+;              neon - The fxo line is monitored for the presence of NEON pulses
+;                      indicating MWI.   
+; When detected, an internal Asterisk MWI event is generated so that any other
+; part of Asterisk that cares about MWI state changes is notified, just as if
+; the state change came from app_voicemail.
+; For FSK MWI Spills, the energy level that must be seen before starting the
+; MWI detection process can be set with 'mwilevel'.
 ;
 ;mwimonitor=no
 ;mwilevel=512