fixed bchannel create
authorSuper User <root@isdn.jolly.ten>
Mon, 16 Jun 2008 20:13:39 +0000 (22:13 +0200)
committerSuper User <root@isdn.jolly.ten>
Mon, 16 Jun 2008 20:13:39 +0000 (22:13 +0200)
modified:   chan_lcr.c

chan_lcr.c

index 5fd0390..ab5886c 100644 (file)
@@ -1114,9 +1114,10 @@ int receive_message(int message_type, unsigned int ref, union parameter *param)
                                        CDEBUG(call, call->ast, "Join bchannel, because call is already bridged.\n");
                                        bchannel_join(bchannel, call->bridge_id);
                                }
+                               /* create only, if call exists, othewhise it bchannel is freed below... */
+                               if (bchannel_create(bchannel, ((call->transparent)?1:0) + ((call->hdlc)?2:0)))
+                                       bchannel_activate(bchannel, 1);
                        }
-                       if (bchannel_create(bchannel, ((call->transparent)?1:0) + ((call->hdlc)?2:0)))
-                               bchannel_activate(bchannel, 1);
                        /* acknowledge */
                        newparam.bchannel.type = BCHANNEL_ASSIGN_ACK;
                        newparam.bchannel.handle = param->bchannel.handle;