]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Drop SS7 call if not connected yet when INCOMPLETE/BUSY/CONGESTION.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 5 Mar 2012 22:22:21 +0000 (22:22 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 5 Mar 2012 22:22:21 +0000 (22:22 +0000)
SS7 is a trunk protocol and should clear a failed call as soon as
possible.

* Made SS7 hangup a call immediately if it has not connected yet for
INCOMPLETE/BUSY/CONGESTION causes.  Otherwise, play an appropriate inband
tone.

(closes issue ASTERISK-19372)
Reported by: Igor Nikolaev

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

channels/sig_ss7.c

index 5763eeb076be9562413cdf023e0d61a07eb9bf38..0f9febcd8cddb90c7423b0028260c86d3f4c42cc 100644 (file)
@@ -1661,6 +1661,12 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
 
        switch (condition) {
        case AST_CONTROL_BUSY:
+               if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
+                       chan->hangupcause = AST_CAUSE_USER_BUSY;
+                       chan->_softhangup |= AST_SOFTHANGUP_DEV;
+                       res = 0;
+                       break;
+               }
                res = sig_ss7_play_tone(p, SIG_SS7_TONE_BUSY);
                break;
        case AST_CONTROL_RINGING:
@@ -1719,15 +1725,23 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
                res = 0;
                break;
        case AST_CONTROL_INCOMPLETE:
-               /* If the channel is connected, wait for additional input */
-               if (p->call_level == SIG_SS7_CALL_LEVEL_CONNECT) {
+               if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
+                       chan->hangupcause = AST_CAUSE_INVALID_NUMBER_FORMAT;
+                       chan->_softhangup |= AST_SOFTHANGUP_DEV;
                        res = 0;
                        break;
                }
-               chan->hangupcause = AST_CAUSE_INVALID_NUMBER_FORMAT;
+               /* Wait for DTMF digits to complete the dialed number. */
+               res = 0;
                break;
        case AST_CONTROL_CONGESTION:
-               chan->hangupcause = AST_CAUSE_CONGESTION;
+               if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
+                       chan->hangupcause = AST_CAUSE_CONGESTION;
+                       chan->_softhangup |= AST_SOFTHANGUP_DEV;
+                       res = 0;
+                       break;
+               }
+               res = sig_ss7_play_tone(p, SIG_SS7_TONE_CONGESTION);
                break;
        case AST_CONTROL_HOLD:
                ast_moh_start(chan, data, p->mohinterpret);