fixed the occasional no audio issue, still need deeper investigation .. echotraining...
[asterisk/asterisk.git] / channels / misdn / isdn_lib.c
index 447fbab..13838ff 100644 (file)
@@ -1138,7 +1138,7 @@ struct misdn_stack* stack_init( int midev, int port, int ptp )
                if (!stack->nt) {
                        /*assume L1 is up, we'll get DEACTIVATES soon, for non
                         * up L1s*/
-                       stack->l1link=1;
+                       stack->l1link=0;
                }
 
                misdn_lib_get_short_status(stack);
@@ -2037,7 +2037,8 @@ int handle_bchan(msg_t *msg)
                                
                                int i=cb_event( EVENT_BCHAN_DATA, bc, glob_mgr->user_data);
                                if (i<0) {
-                                       clean_up_bc(bc);
+                                       cb_log(2,stack->port,"cb_event returned <0\n");
+                                       /*clean_up_bc(bc);*/
                                }
                        }
                }
@@ -2342,12 +2343,13 @@ int handle_mgmt(msg_t *msg)
                case SSTATUS_L2_ESTABLISHED:
                        cb_log(1, stack->port, "MGMT: SSTATUS: L2_ESTABLISH \n");
                        stack->l2link=1;
+                       if ( !stack->ptp && !stack->nt )
+                               stack->l1link=2;
                        break;
                        
                case SSTATUS_L2_RELEASED:
                        cb_log(1, stack->port, "MGMT: SSTATUS: L2_RELEASED \n");
                        stack->l2link=0;
-                       stack->l1link=2;
                        break;
                }