]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_dahdi: Add inband_on_setup_ack compatibility option.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 3 Jul 2014 21:38:30 +0000 (21:38 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 3 Jul 2014 21:38:30 +0000 (21:38 +0000)
The new inband_on_setup_ack option causes Asterisk to assume inband audio
may be present when a SETUP_ACKNOWLEDGE message is received.

Q.931 Section 5.1.3 says that in scenarios with overlap dialing, when a
dialtone is sent from the network side, progress indicator 8 "Inband info
now available" MAY be sent to the CPE if no digits were received with the
SETUP.  It is thus implied that the ie is mandatory if digits came with
the SETUP and dialtone is needed.  This option should be enabled, when the
network sends dialtone and you want to hear it, but the network doesn't
send the progress indicator when needed.

NOTE: For Q.SIG setups this option should be enabled when outgoing overlap
dialing is also enabled because Q.SIG does not send the progress indicator
with the SETUP ACK.

The commit -r413714 (AST-1338) which causes this issue was dealing with a
SIP-to-ISDN interoperability issue.

This commit is a merge of the two patches indicated below.

ASTERISK-23897 #close
Reported by: Pavel Troller
Patches:
      pri-4.diff (license #6302) patch uploaded by Pavel Troller
      jira_asterisk_23897_v11.patch (license #5621) patch uploaded by rmudgett

Review: https://reviewboard.asterisk.org/r/3633/

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

UPGRADE.txt
channels/chan_dahdi.c
channels/sig_pri.c
channels/sig_pri.h
configs/chan_dahdi.conf.sample

index 9c56d2189c82a910b9e07d328c007a475091682b..fbdb31b2ade7524964bf50c2c7683f0b4467e11f 100644 (file)
 ===
 ===========================================================
 
+from 1.8.28.2 to 1.8.29.0:
+* Added the inband_on_setup_ack compatibility option to chan_dahdi.conf to
+  deal with switches that don't send an inband progress indication in the
+  SETUP ACKNOWLEDGE message.
+
 from 1.8.28.0 to 1.8.28.1:
 * Added http.conf session_inactivity timer option to close HTTP connections
   that aren't doing anything.
index c198935c15106a4b3d043c7af92f991aff55f56c..c0c4300b6cf1cc2ace4294b30d9c593a06671d87 100644 (file)
@@ -1366,6 +1366,7 @@ static struct dahdi_chan_conf dahdi_chan_conf_default(void)
                        .localdialplan = PRI_NATIONAL_ISDN + 1,
                        .nodetype = PRI_CPE,
                        .qsigchannelmapping = DAHDI_CHAN_MAPPING_PHYSICAL,
+                       .inband_on_setup_ack = 1,
                        .inband_on_proceeding = 1,
 
 #if defined(HAVE_PRI_CCSS)
@@ -12709,6 +12710,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
                                                        pris[span].pri.layer1_ignored = 0;
                                                }
                                                pris[span].pri.append_msn_to_user_tag = conf->pri.pri.append_msn_to_user_tag;
+                                               pris[span].pri.inband_on_setup_ack = conf->pri.pri.inband_on_setup_ack;
                                                pris[span].pri.inband_on_proceeding = conf->pri.pri.inband_on_proceeding;
                                                ast_copy_string(pris[span].pri.initial_user_tag, conf->chan.cid_tag, sizeof(pris[span].pri.initial_user_tag));
                                                ast_copy_string(pris[span].pri.msn_list, conf->pri.pri.msn_list, sizeof(pris[span].pri.msn_list));
@@ -17818,6 +17820,8 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
 #endif /* defined(HAVE_PRI_MWI) */
                        } else if (!strcasecmp(v->name, "append_msn_to_cid_tag")) {
                                confp->pri.pri.append_msn_to_user_tag = ast_true(v->value);
+                       } else if (!strcasecmp(v->name, "inband_on_setup_ack")) {
+                               confp->pri.pri.inband_on_setup_ack = ast_true(v->value);
                        } else if (!strcasecmp(v->name, "inband_on_proceeding")) {
                                confp->pri.pri.inband_on_proceeding = ast_true(v->value);
                        } else if (!strcasecmp(v->name, "layer1_presence")) {
index f493c5cdd4ce235067f592612ccea1c9a26b4680..284259ef0d63ba54f5727b0500a043cac154268d 100644 (file)
@@ -1469,6 +1469,9 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
 #if defined(HAVE_PRI_CALL_WAITING)
                new_chan->is_call_waiting = old_chan->is_call_waiting;
 #endif /* defined(HAVE_PRI_CALL_WAITING) */
+#if defined(HAVE_PRI_SETUP_ACK_INBAND)
+               new_chan->no_dialed_digits = old_chan->no_dialed_digits;
+#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */
 
 #if defined(HAVE_PRI_AOC_EVENTS)
                old_chan->aoc_s_request_invoke_id_valid = 0;
@@ -1484,6 +1487,9 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
 #if defined(HAVE_PRI_CALL_WAITING)
                old_chan->is_call_waiting = 0;
 #endif /* defined(HAVE_PRI_CALL_WAITING) */
+#if defined(HAVE_PRI_SETUP_ACK_INBAND)
+               old_chan->no_dialed_digits = 0;
+#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */
 
                /* More stuff to transfer to the new channel. */
                new_chan->call_level = old_chan->call_level;
@@ -6316,8 +6322,19 @@ static void *pri_dchannel(void *vpri)
                                         * We explicitly DO NOT want to check PRI_PROG_CALL_NOT_E2E_ISDN
                                         * because it will mess up ISDN to SIP interoperability for
                                         * the ALERTING message.
+                                        *
+                                        * Q.931 Section 5.1.3 says that in scenarios with overlap
+                                        * dialing where no called digits are received and the tone
+                                        * option requires dialtone, the switch MAY send an inband
+                                        * progress indication ie to indicate dialtone presence in
+                                        * the SETUP ACKNOWLEDGE.  Therefore, if we did not send any
+                                        * digits with the SETUP then we must assume that dialtone
+                                        * is present and open the voice path.  Fortunately when
+                                        * interoperating with SIP, we should be sending digits.
                                         */
-                                       && (e->setup_ack.progressmask & PRI_PROG_INBAND_AVAILABLE)
+                                       && ((e->setup_ack.progressmask & PRI_PROG_INBAND_AVAILABLE)
+                                               || pri->inband_on_setup_ack
+                                               || pri->pvts[chanpos]->no_dialed_digits)
 #endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */
                                        ) {
                                        /*
@@ -6869,7 +6886,12 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
        if (!keypad || !ast_strlen_zero(c + p->stripmsd + dp_strip))
 #endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
        {
-               pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, s ? 1 : 0);
+               char *called = c + p->stripmsd + dp_strip;
+
+               pri_sr_set_called(sr, called, pridialplan, s ? 1 : 0);
+#if defined(HAVE_PRI_SETUP_ACK_INBAND)
+               p->no_dialed_digits = !called[0];
+#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */
        }
 
 #if defined(HAVE_PRI_SUBADDR)
index f9ccf443667cde9bc39a3f5991c8009017042482..269295b39b217d1d311d291c4ab517bed6071380 100644 (file)
@@ -286,6 +286,10 @@ struct sig_pri_chan {
        /*! \brief TRUE if this is a call waiting call */
        unsigned int is_call_waiting:1;
 #endif /* defined(HAVE_PRI_CALL_WAITING) */
+#if defined(HAVE_PRI_SETUP_ACK_INBAND)
+       /*! TRUE if outgoing SETUP had no called digits */
+       unsigned int no_dialed_digits:1;
+#endif /* defined(HAVE_PRI_SETUP_ACK_INBAND) */
 
        struct ast_channel *owner;
 
@@ -393,6 +397,8 @@ struct sig_pri_span {
         * appended to the initial_user_tag[].
         */
        unsigned int append_msn_to_user_tag:1;
+       /*! TRUE if a SETUP ACK message needs to open the audio path. */
+       unsigned int inband_on_setup_ack:1;
        /*! TRUE if a PROCEEDING message needs to unsquelch the received audio. */
        unsigned int inband_on_proceeding:1;
        int dialplan;                                                   /*!< Dialing plan */
index a5ad6c6154b35e58d328f3b21a8ca3b251b4ccd9..96a4beb968011057dbc6e97e4141e5c951276208 100644 (file)
 ;
 ;resetinterval = 3600
 ;
+; Assume inband audio may be present when a SETUP ACK message is received.
+; Q.931 Section 5.1.3 says that in scenarios with overlap dialing, when a
+; dialtone is sent from the network side, progress indicator 8 "Inband info
+; now available" MAY be sent to the CPE if no digits were received with
+; the SETUP.  It is thus implied that the ie is mandatory if digits came
+; with the SETUP and dialtone is needed.
+; This option should be enabled, when the network sends dialtone and you
+; want to hear it, but the network doesn't send the progress indicator when
+; needed.
+;
+; NOTE: For Q.SIG setups this option should be enabled when outgoing overlap
+; dialing is also enabled because Q.SIG does not send the progress indicator
+; with the SETUP ACK.
+; Default yes in current release branches for backward compatibility.
+;
+;inband_on_setup_ack=yes
+;
 ; Assume inband audio may be present when a PROCEEDING message is received.
 ; Q.931 Section 5.1.2 says the network cannot assume that the CPE side has
 ; attached to the B channel at this time without explicitly sending the