summaryrefslogtreecommitdiffstats
path: root/dss1.cpp
diff options
context:
space:
mode:
authorSuper User2008-07-26 17:42:16 +0200
committerSuper User2008-07-26 17:42:16 +0200
commitff4d197d5ecb2cb29a55f78b260ab387e3afc80d (patch)
tree3db42ea3a70133f12c8208bdc58f2c4c00ad8a3e /dss1.cpp
parentmany fixes on HDLC issues (diff)
downloadlcr-ff4d197d5ecb2cb29a55f78b260ab387e3afc80d.tar.gz
lcr-ff4d197d5ecb2cb29a55f78b260ab387e3afc80d.tar.xz
lcr-ff4d197d5ecb2cb29a55f78b260ab387e3afc80d.zip
now LCR features real HDLC bchannel mode.
-> if initial caller uses pure data mode (or video), the bchannels for this call are handled in HDLC mode. (hardware/software briding is still applicable.) modified: apppbx.cpp modified: chan_lcr.c modified: dss1.cpp modified: dss1.h modified: lcradmin.c modified: lcrsocket.h modified: mISDN.cpp modified: mISDN.h modified: message.h modified: socket_server.c
Diffstat (limited to 'dss1.cpp')
-rw-r--r--dss1.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/dss1.cpp b/dss1.cpp
index 06bb203..fea2e29 100644
--- a/dss1.cpp
+++ b/dss1.cpp
@@ -23,7 +23,7 @@ extern unsigned int mt_assign_pid;
/*
* constructor
*/
-Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive) : PmISDN(type, mISDNport, portname, settings, channel, exclusive)
+Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, channel, exclusive, mode)
{
p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
p_m_d_ntmode = mISDNport->ntmode;
@@ -669,6 +669,15 @@ void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
break;
}
+ /* set bchannel mode */
+ if (p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED
+ || p_capainfo.bearer_capa==INFO_BC_DATARESTRICTED
+ || p_capainfo.bearer_capa==INFO_BC_VIDEO)
+ p_capainfo.source_mode = B_MODE_HDLC;
+ else
+ p_capainfo.source_mode = B_MODE_TRANSPARENT;
+ p_m_b_mode = p_capainfo.source_mode;
+
/* hunt channel */
ret = channel = hunt_bchannel(channel, exclusive);
if (ret < 0)
@@ -1535,6 +1544,7 @@ void Pdss1::resume_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
if (ret < 0)
goto no_channel;
+// mode (if hdlc parked) to be done. never mind, this is almost never requested
/* open channel */
ret = seize_bchannel(channel, 1);
if (ret < 0)
@@ -2892,18 +2902,18 @@ int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
switch(cmd)
{
case MT_SETUP:
- /* creating port object */
+ /* creating port object, transparent until setup with hdlc */
SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
- if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0)))
+ if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
FATAL("Cannot create Port instance.\n");
pdss1->message_isdn(cmd, pid, l3m);
break;
case MT_RESUME:
- /* creating port object */
+ /* creating port object, transparent until setup with hdlc */
SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
- if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0)))
+ if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
FATAL("Cannot create Port instance.\n");
pdss1->message_isdn(cmd, pid, l3m);
break;