From 30a6a1642bb7d4d17e587bc73c8e87805c62c6d8 Mon Sep 17 00:00:00 2001 From: Super User Date: Mon, 12 May 2008 11:39:44 +0200 Subject: [PATCH] fixed multiplexing bug DL reports tei modified: dss1.cpp modified: mISDN.cpp --- dss1.cpp | 16 ++++++++++++---- mISDN.cpp | 5 +++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dss1.cpp b/dss1.cpp index 90cd3c5..384ac2f 100644 --- a/dss1.cpp +++ b/dss1.cpp @@ -4058,11 +4058,19 @@ int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi { pdss1 = (class Pdss1 *)port; /* check out correct stack and id */ - if (pdss1->p_m_mISDNport == mISDNport - && (pdss1->p_m_d_l3id & MISDN_PID_CRVAL_MASK) == (pid & MISDN_PID_CRVAL_MASK)) + if (pdss1->p_m_mISDNport == mISDNport) { - /* found port, the message belongs to */ - break; + if (pdss1->p_m_d_l3id & MISDN_PID_CR_FLAG) + { + /* local callref, so match value only */ + if ((pdss1->p_m_d_l3id & MISDN_PID_CRVAL_MASK) == (pid & MISDN_PID_CRVAL_MASK)) + break; // found + } else + { + /* remote callref, ref + channel id */ + if (pdss1->p_m_d_l3id == pid) + break; // found + } } } port = port->next; diff --git a/mISDN.cpp b/mISDN.cpp index 41b2122..188eb37 100644 --- a/mISDN.cpp +++ b/mISDN.cpp @@ -2365,6 +2365,7 @@ int mISDN_handler(void) case MT_L2ESTABLISH: l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_IND, DIRECTION_IN); + add_trace("tei", NULL, "%d", l3m->pid); end_trace(); if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127) { @@ -2379,6 +2380,7 @@ int mISDN_handler(void) case MT_L2RELEASE: l1l2l3_trace_header(mISDNport, NULL, L2_RELEASE_IND, DIRECTION_IN); + add_trace("tei", NULL, "%d", l3m->pid); end_trace(); if ((!mISDNport->ntmode || mISDNport->ptp) && l3m->pid < 127) { @@ -2418,6 +2420,7 @@ int mISDN_handler(void) PDEBUG(DEBUG_ISDN, "the L2 establish timer expired, we try to establish the link portnum=%d.\n", mISDNport->portnum); mISDNport->ml3->to_layer3(mISDNport->ml3, MT_L2ESTABLISH, 0, NULL); l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT); + add_trace("tei", NULL, "%d", 0); end_trace(); time(&mISDNport->l2establish); return(1); @@ -2557,6 +2560,7 @@ int mISDN_handler(void) mISDN_write(mISDNdevice, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC); } l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT); + add_trace("tei", NULL, "%d", 0); end_trace(); time(&mISDNport->l2establish); return(1); @@ -3338,6 +3342,7 @@ struct mISDNport *mISDNport_open(int port, int ptp, int force_nt, int l2hold, st { mISDNport->ml3->to_layer3(mISDNport->ml3, MT_L2ESTABLISH, 0, NULL); l1l2l3_trace_header(mISDNport, NULL, L2_ESTABLISH_REQ, DIRECTION_OUT); + add_trace("tei", NULL, "%d", 0); end_trace(); time(&mISDNport->l2establish); } -- 2.13.6