-#else
-void Pdss1::message_isdn(unsigned long prim, unsigned long dinfo, void *data)
-{
- int new_l3id;
- int timer_hex=0;
-
- switch (prim)
- {
- case CC_TIMEOUT | INDICATION:
- if (p_m_d_ntmode)
- {
- int headerlen = (p_m_d_ntmode)?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
- timer_hex = *((int *)(((char *)data)+headerlen));
- }
- if (timer_hex==0x312 && p_m_d_ntmode)
- {
- l1l2l3_trace_header(p_m_mISDNport, this, L3_TIMEOUT_IND, DIRECTION_IN);
- add_trace("timer", NULL, "%x", timer_hex);
- end_trace();
- t312_timeout_ind(prim, dinfo, data);
- }
- break;
-
- case CC_SETUP | INDICATION:
- if (p_state != PORT_STATE_IDLE)
- break;
- setup_ind(prim, dinfo, data);
- break;
-
- case CC_SETUP | CONFIRM:
- if (p_m_d_ntmode)
- {
- l1l2l3_trace_header(p_m_mISDNport, this, L3_NEW_CR_IND, DIRECTION_IN);
- add_trace("callref", "old", "0x%x", p_m_d_l3id);
- /* nt-library now gives us a new id via CC_SETUP_CONFIRM */
- if ((p_m_d_l3id&0xff00) != 0xff00)
- PERROR(" strange setup-procid 0x%x\n", p_m_d_l3id);
- p_m_d_l3id = *((int *)(((u_char *)data)+ mISDNUSER_HEAD_SIZE));
- add_trace("callref", "new", "0x%x", p_m_d_l3id);
- end_trace();
- }
- break;
-
- case CC_INFORMATION | INDICATION:
- information_ind(prim, dinfo, data);
- break;
-
- case CC_SETUP_ACKNOWLEDGE | INDICATION:
- if (p_state != PORT_STATE_OUT_SETUP)
- {
- PERROR("Pdss1(%s) received setup_acknowledge, but we are not in outgoing setup state, IGNORING.\n", p_name);
- break;
- }
- setup_acknowledge_ind(prim, dinfo, data);
- break;
-
- case CC_PROCEEDING | INDICATION:
- if (p_state != PORT_STATE_OUT_SETUP
- && p_state != PORT_STATE_OUT_OVERLAP)
- {
- PERROR("Pdss1(%s) received proceeding, but we are not in outgoing setup OR overlap state, IGNORING.\n", p_name);
- break;
- }
- proceeding_ind(prim, dinfo, data);
- break;
-
- case CC_ALERTING | INDICATION:
- if (p_state != PORT_STATE_OUT_SETUP
- && p_state != PORT_STATE_OUT_OVERLAP
- && p_state != PORT_STATE_OUT_PROCEEDING)
- {
- PERROR("Pdss1(%s) received alerting, but we are not in outgoing setup OR overlap OR proceeding state, IGNORING.\n", p_name);
- break;
- }
- alerting_ind(prim, dinfo, data);
- break;
-
- case CC_CONNECT | INDICATION:
- if (p_state != PORT_STATE_OUT_SETUP
- && p_state != PORT_STATE_OUT_OVERLAP
- && p_state != PORT_STATE_OUT_PROCEEDING
- && p_state != PORT_STATE_OUT_ALERTING)
- {
- PERROR("Pdss1(%s) received alerting, but we are not in outgoing setup OR overlap OR proceeding OR ALERTING state, IGNORING.\n", p_name);
- break;
- }
- connect_ind(prim, dinfo, data);
- if (p_m_d_notify_pending)
- {
- /* send pending notify message during connect */
- message_notify(ACTIVE_EPOINT(p_epointlist), p_m_d_notify_pending->type, &p_m_d_notify_pending->param);
- message_free(p_m_d_notify_pending);
- p_m_d_notify_pending = NULL;
- }
- break;
-
- case CC_CONNECT_ACKNOWLEDGE | INDICATION:
- case CC_CONNECT | CONFIRM:
- if (p_state == PORT_STATE_CONNECT_WAITING)
- new_state(PORT_STATE_CONNECT);
- if (p_m_d_notify_pending)
- {
- /* send pending notify message during connect-ack */
- message_notify(ACTIVE_EPOINT(p_epointlist), p_m_d_notify_pending->type, &p_m_d_notify_pending->param);
- message_free(p_m_d_notify_pending);
- p_m_d_notify_pending = NULL;
- }
- break;
-
- case CC_DISCONNECT | INDICATION:
- disconnect_ind(prim, dinfo, data);
- break;
-
- case CC_RELEASE | CONFIRM:
- case CC_RELEASE | INDICATION:
- release_ind(prim, dinfo, data);
- break;
-
- case CC_RELEASE_COMPLETE | INDICATION:
- release_complete_ind(prim, dinfo, data);
- break;
-
- case CC_RELEASE_COMPLETE | CONFIRM:
- break;
-
- case CC_NOTIFY | INDICATION:
- notify_ind(prim, dinfo, data);
- break;
-
- case CC_HOLD | INDICATION:
- hold_ind(prim, dinfo, data);
- break;
-
- case CC_RETRIEVE | INDICATION:
- retrieve_ind(prim, dinfo, data);
- break;
-
- case CC_SUSPEND | INDICATION:
- suspend_ind(prim, dinfo, data);
- break;
-
- case CC_RESUME | INDICATION:
- resume_ind(prim, dinfo, data);
- break;
-
- case CC_FACILITY | INDICATION:
- facility_ind(prim, dinfo, data);
- break;
-
- case CC_RELEASE_CR | INDICATION:
- l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_CR_IND, DIRECTION_IN);
- add_trace("callref", NULL, "0x%x", p_m_d_l3id);
- end_trace();
- if (p_m_d_ntmode)
- {
- if ((p_m_d_l3id&0xff00) == 0xff00)
- p_m_mISDNport->procids[p_m_d_l3id&0xff] = 0;
- }
- p_m_d_l3id = 0;
- p_m_d_ces = -1;
- p_m_delete = 1;
-//#warning remove me
-//PDEBUG(DEBUG_LOG, "JOLLY release cr %d\n", p_serial);
- /* sending release to endpoint in case we still have an endpoint
- * this is because we don't get any response if a release_complete is received (or a release in release state)
- */
- while(p_epointlist)
- {
- struct lcr_msg *message;
- message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
- message->param.disconnectinfo.cause = (p_m_d_collect_cause!=CAUSE_NOUSER)?p_m_d_collect_cause:CAUSE_UNSPECIFIED;
- message->param.disconnectinfo.location = (p_m_d_collect_cause!=CAUSE_NOUSER)?p_m_d_collect_location:LOCATION_PRIVATE_LOCAL;
- message_put(message);
- /* remove epoint */
- free_epointlist(p_epointlist);
-
- new_state(PORT_STATE_RELEASE);
- }
- break;
-
- case CC_NEW_CR | INDICATION:
- l1l2l3_trace_header(p_m_mISDNport, this, L3_NEW_CR_IND, DIRECTION_IN);
- if (p_m_d_l3id)
- add_trace("callref", "old", "0x%x", p_m_d_l3id);
- if (p_m_d_ntmode)
- {
- new_l3id = *((int *)(((u_char *)data+mISDNUSER_HEAD_SIZE)));
- if (((new_l3id&0xff00)!=0xff00) && ((p_m_d_l3id&0xff00)==0xff00))
- p_m_mISDNport->procids[p_m_d_l3id&0xff] = 0;
- } else
- {
- new_l3id = dinfo;
- }
- p_m_d_l3id = new_l3id;
- add_trace("callref", "new", "0x%x", p_m_d_l3id);
- end_trace();
- break;
-
- default:
- l1l2l3_trace_header(p_m_mISDNport, this, L3_UNKNOWN, DIRECTION_IN);
- add_trace("unhandled", "prim", "0x%x", prim);
- end_trace();
- }
-}
-#endif