Anton wrote:
I can go to IRC when needed. Just tell me when.

Regards,

Here's a patch.  Apply it to your asterisk source tree.

Anton.

On Monday 10 November 2008 21:09, Matthew Fredrickson wrote:
Anton wrote:
Hi Matthew,

One of the ss7 bugs I've discovered on quick tests, and
it's critical to normal functionality:

short description: ss7 does not release channels on the
other side channel reset/failure.
Crap, yes.  I don't know why I still haven't fixed
that... keep forgetting.  Most of the time it's not a
problem, because if we receive an individual reset (RSC
message) we *do* actually drop the call.  It's only on
group resets that I still haven't added the code to drop
it.  If you're on AIM, MSN, or anything like that and can
get in contact with me, I would like to fix this (should
be just about 5 minutes of coding and a retest from your
test scenario).

Matthew Fredrickson
Digium, Inc.

It means, when there are some amount of calls going
through the system, and remote switch just going down
abnormally (and than may restore), libss7 asterisk
would not release the channels, which was in use.

used: asterisk 1.6.0.1
libss7 1.0.2
dahdi-linux 2.0.0
dahdi-tools 2.0.0

To reproduce the error:

1st box asterisk libss7

2nd box asterisk chan_ss7 (1.4.21.1)

(though I think 2nd box version or switchtype does not
matter at all, considering the symptoms)

Making 5 looped calls, which after 5 calls end up with
Echo() app. to test our voice. Than just stopping box2
(chan_ss7) side by "stop now" - and we'll see that on
box1 core show channels will have all calls in progress
not released. This call wll remain unreleased even when
calling party hangup, so making channels stuck forever.
This is despite, that libss7 acknowledged the other
side by sending reset ask:

[Nov  9 22:11:02] DEBUG[10593]: chan_dahdi.c:9494
ss7_linkset: Got Reset for CICs 1 to 15: Acknowledging
[Nov  9 22:11:02] DEBUG[10593]: chan_dahdi.c:9494
ss7_linkset: Got Reset for CICs 17 to 31: Acknowledging

*CLI> dahdi show channels group 1
   Chan Extension  Context         Language   MOH
Interpret        Blocked    State 1            incoming
                  default                         In
Service 2            incoming                   default
In Service 3 incoming default In Service 4 3772059 incoming default In Service 5 incoming default In Service 6 incoming default In Service 7 incoming default In Service 8 incoming default In Service 9 incoming default In Service 10 3772059 incoming default In Service 11 incoming default In Service 12 incoming default In Service 13 incoming default In Service 14 incoming default In Service 15 incoming default In Service 17 incoming default R In Service 18 incoming default In Service 19 incoming default In Service 20 incoming default In Service 21 incoming default In Service 22 incoming default In Service 23 3772059 incoming default In Service 24 incoming default In Service 25 incoming default In Service 26 incoming default In Service 27 3772059 incoming default In Service 28 incoming default In Service 29 3772059 incoming default In Service 30 incoming default In Service 31 incoming default In Service *CLI>

while other side is:

*CLI> core show channels
Channel Location State Application(Data) 0 active channels
0 active calls
*CLI> ss7 linestat
Linkset: east1
CIC   1 Idle
CIC   2 Idle
CIC   3 Idle
CIC   4 Idle
CIC   5 Idle
CIC   6 Idle
CIC   7 Idle
CIC   8 Idle
CIC   9 Idle
CIC  10 Idle
CIC  11 Idle
CIC  12 Idle
CIC  13 Idle
CIC  14 Idle
CIC  15 Idle
CIC  17 Idle
CIC  18 Idle
CIC  19 Idle
CIC  20 Idle
CIC  21 Idle
CIC  22 Idle
CIC  23 Idle
CIC  24 Idle
CIC  25 Idle
CIC  26 Idle
CIC  27 Idle
CIC  28 Idle
CIC  29 Idle
CIC  30 Idle
CIC  31 Idle
*CLI>

and we've asknowledged the reset:

[Nov  9 22:11:02] DEBUG[10593]: chan_dahdi.c:9494
ss7_linkset: Got Reset for CICs 1 to 15: Acknowledging
[Nov  9 22:11:02] DEBUG[10593]: chan_dahdi.c:9494
ss7_linkset: Got Reset for CICs 17 to 31:

There is probably missing channel release on ss7
channel reset and asterisk itself.

Index: channels/chan_dahdi.c
===================================================================
--- channels/chan_dahdi.c       (revision 156159)
+++ channels/chan_dahdi.c       (working copy)
@@ -9422,6 +9422,20 @@
        
 }
 
+static inline void ss7_hangup_cics(struct dahdi_ss7 *linkset, int startcic, 
int endcic, unsigned int dpc)
+{
+       int i;
+
+       for (i = 0; i < linkset->numchans; i++) {
+               if (linkset->pvts[i] && (linkset->pvts[i]->dpc == dpc && 
((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic)))) {
+                       ast_mutex_lock(&linkset->pvts[i]->lock);
+                       if (linkset->pvts[i]->owner)
+                               linkset->pvts[i]->owner->_softhangup |= 
AST_SOFTHANGUP_DEV;
+                       ast_mutex_unlock(&linkset->pvts[i]->lock);
+               }
+       }
+}
+
 static inline void ss7_block_cics(struct dahdi_ss7 *linkset, int startcic, int 
endcic, unsigned int dpc, unsigned char state[], int block)
 {
        int i;
@@ -9816,6 +9830,7 @@
                                p = linkset->pvts[chanpos];
                                isup_gra(ss7, e->grs.startcic, e->grs.endcic, 
e->grs.opc);
                                ss7_block_cics(linkset, e->grs.startcic, 
e->grs.endcic, e->grs.opc, NULL, 0);
+                               ss7_hangup_cics(linkset, e->grs.startcic, 
e->grs.endcic, e->grs.opc);
                                break;
                        case ISUP_EVENT_CQM:
                                ast_debug(1, "Got Circuit group query message 
from CICs %d to %d\n", e->cqm.startcic, e->cqm.endcic);
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-ss7 mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-ss7

Reply via email to