projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle MT_L2IDLE
[lcr.git]
/
dss1.cpp
diff --git
a/dss1.cpp
b/dss1.cpp
index
c80a672
..
eabb0cd
100644
(file)
--- a/
dss1.cpp
+++ b/
dss1.cpp
@@
-16,7
+16,9
@@
extern "C" {
}
#include <mISDN/q931.h>
extern "C" {
}
#include <mISDN/q931.h>
+#ifdef OLD_MT_ASSIGN
extern unsigned int mt_assign_pid;
extern unsigned int mt_assign_pid;
+#endif
#include "ie.cpp"
#include "ie.cpp"
@@
-2011,10
+2013,18
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
/* creating l3id */
l1l2l3_trace_header(p_m_mISDNport, this, L3_NEW_L3ID_REQ, DIRECTION_OUT);
/* creating l3id */
l1l2l3_trace_header(p_m_mISDNport, this, L3_NEW_L3ID_REQ, DIRECTION_OUT);
+#ifdef OLD_MT_ASSIGN
/* see MT_ASSIGN notes at do_layer3() */
mt_assign_pid = 0;
ret = p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_ASSIGN, 0, NULL);
/* see MT_ASSIGN notes at do_layer3() */
mt_assign_pid = 0;
ret = p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_ASSIGN, 0, NULL);
- if (mt_assign_pid == 0 || ret < 0) {
+ if (mt_assign_pid == 0 || ret < 0)
+ p_m_d_l3id = mt_assign_pid;
+ mt_assign_pid = ~0;
+#else
+ p_m_d_l3id = request_new_pid(p_m_mISDNport->ml3);
+ if (p_m_d_l3id == MISDN_PID_NONE)
+#endif
+ {
struct lcr_msg *message;
add_trace("callref", NULL, "no free id");
struct lcr_msg *message;
add_trace("callref", NULL, "no free id");
@@
-2027,8
+2037,10
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
trigger_work(&p_m_d_delete);
return;
}
trigger_work(&p_m_d_delete);
return;
}
+#ifdef OLD_MT_ASSIGN
p_m_d_l3id = mt_assign_pid;
mt_assign_pid = ~0;
p_m_d_l3id = mt_assign_pid;
mt_assign_pid = ~0;
+#endif
add_trace("callref", "new", "0x%x", p_m_d_l3id);
end_trace();
add_trace("callref", "new", "0x%x", p_m_d_l3id);
end_trace();
@@
-2036,7
+2048,7
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_REQ, DIRECTION_OUT);
/* channel information */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_REQ, DIRECTION_OUT);
/* channel information */
- if (
channel >= 0) /* it should
*/
+ if (
p_m_d_ntmode || channel != CHANNEL_ANY) /* only omit channel id in te-mode/any channel
*/
enc_ie_channel_id(l3m, exclusive, channel);
/* caller information */
plan = 1;
enc_ie_channel_id(l3m, exclusive, channel);
/* caller information */
plan = 1;
@@
-2897,7
+2909,7
@@
int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
port = port_first;
while(port) {
/* are we ISDN ? */
port = port_first;
while(port) {
/* are we ISDN ? */
- if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_
mISDN_
DSS1) {
+ if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1) {
pdss1 = (class Pdss1 *)port;
/* check out correct stack and id */
if (pdss1->p_m_mISDNport == mISDNport) {
pdss1 = (class Pdss1 *)port;
/* check out correct stack and id */
if (pdss1->p_m_mISDNport == mISDNport) {
@@
-2987,6
+2999,11
@@
int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
// facility als broadcast
break;
// facility als broadcast
break;
+ case MT_L2IDLE:
+ // L2 became idle - we could sent a MT_L2RELEASE if we are the L2 master
+ PDEBUG(DEBUG_ISDN, "Got L2 idle\n");
+ break;
+
default:
PERROR("unhandled message: cmd(0x%x) pid(0x%x)\n", cmd, pid);
port = port_first;
default:
PERROR("unhandled message: cmd(0x%x) pid(0x%x)\n", cmd, pid);
port = port_first;