Merged revisions 132826 via svnmerge from
authorChristian Richter <christian.richter@beronet.com>
Wed, 23 Jul 2008 12:07:15 +0000 (12:07 +0000)
committerChristian Richter <christian.richter@beronet.com>
Wed, 23 Jul 2008 12:07:15 +0000 (12:07 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r132826 | crichter | 2008-07-23 13:37:50 +0200 (Mi, 23 Jul 2008) | 1 line

another Fix because of r119585, this commit has broken high frequented BRI Ports, there was a possibility that a channel, that was marked as in_use would be reused later, the corresponding port could got stuck then. So it is recommended to upgrade for chan_misdn users.
........

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

channels/misdn/isdn_lib.c

index df963ee..5c5f124 100644 (file)
@@ -2637,6 +2637,19 @@ static int handle_frm(msg_t *msg)
                        misdn_make_dummy(&dummybc, stack->port, MISDN_ID_GLOBAL, stack->nt, 0);
                        bc=&dummybc;
                }
+
+               if (!bc && (frm->prim==(CC_SETUP|INDICATION)) ) {
+                       make_dummy(&dummybc, stack->port, MISDN_ID_GLOBAL, stack->nt, 0);
+                       dummybc.port=stack->port;
+                       dummybc.l3_id=frm->dinfo;
+                       bc=&dummybc;
+
+                       misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+
+                       free_msg(msg);
+                       return 1;
+               }
+
     
 handle_frm_bc:
                if (bc ) {
@@ -3121,7 +3134,7 @@ static int test_inuse(struct misdn_bchannel *bc)
        struct timeval now;
        gettimeofday(&now, NULL);
        if (!bc->in_use) {
-               if ( bc->last_used.tv_sec == now.tv_sec ) {
+               if (misdn_lib_port_is_pri(bc->port) && bc->last_used.tv_sec == now.tv_sec ) {
                        cb_log(2,bc->port, "channel with stid:%x for one second still in use! (n:%d lu:%d)\n", bc->b_stid, (int) now.tv_sec, (int) bc->last_used.tv_sec);
                        return 1;
                }