- }
-
- /* set serial on bchannel message
- * also ref is given, so we send message with ref */
- if (message_type == MESSAGE_BCHANNEL) {
- int i = p_m_b_index;
- unsigned int portid = (mISDNloop.port<<8) + i+1+(i>=15);
- switch (param->bchannel.type) {
- case BCHANNEL_REQUEST:
- p_m_r_handle = portid;
- message_bchannel_to_remote(p_m_r_remote_id, p_m_r_ref, BCHANNEL_ASSIGN, portid, 0, 0, 0, 0, 0, 0, 1);
- chan_trace_header(p_m_mISDNport, this, "MESSAGE_BCHANNEL (to remote application)", DIRECTION_NONE);
- add_trace("type", NULL, "assign");
- add_trace("channel", NULL, "%d.%d", portid>>8, portid&0xff);
- end_trace();
- break;
- case BCHANNEL_RELEASE:
- p_m_r_handle = 0;
- message_bchannel_to_remote(p_m_r_remote_id, p_m_r_ref, BCHANNEL_REMOVE, portid, 0, 0, 0, 0, 0, 0, 1);
- chan_trace_header(p_m_mISDNport, this, "MESSAGE_BCHANNEL (to remote application)", DIRECTION_NONE);
- add_trace("type", NULL, "remove");
- add_trace("channel", NULL, "%d.%d", portid>>8, portid&0xff);
- end_trace();
- break;
+ /* FALL THROUGH: */
+ default:
+ if (message_type == MESSAGE_CONNECT)
+ new_state(PORT_STATE_CONNECT);
+ /* cannot just forward, because param is not of container "struct lcr_msg" */
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, message_type);
+ memcpy(&message->param, param, sizeof(message->param));
+ message_put(message);
+
+ if (message_type == MESSAGE_RELEASE) {
+ new_state(PORT_STATE_RELEASE);
+ delete this;
+ return;