summaryrefslogtreecommitdiff
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-07-03 22:22:36 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-07-03 22:22:36 +0000
commit3bd495a688199c2db5ebc397210f06191aa59581 (patch)
tree915c129ba5f811995be43faf15e6ff951b24c3be /channels/sig_pri.c
parent9b10813a2b2aa0edc5005aa9dc61c303a9ec6766 (diff)
chan_dahdi: Add inband_on_setup_ack compatibility option.
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/ ........ Merged revisions 417956 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 417957 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 417958 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 4c1f170f1..bcfebb053 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -1650,6 +1650,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;
@@ -1665,6 +1668,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;
@@ -7518,8 +7524,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) */
) {
/*
@@ -8149,7 +8166,12 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rd
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)