summaryrefslogtreecommitdiffstats
path: root/sys/i4b/capi
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2001-10-21 08:51:54 +0000
committerhm <hm@FreeBSD.org>2001-10-21 08:51:54 +0000
commit03b61a1a00862269701919e39e2697ced7263f5f (patch)
treebd1ed72d2eecfa7bea4351953e69536f93031689 /sys/i4b/capi
parentc6710f54b00521bc8ff02511a7c8e78d577d5286 (diff)
downloadFreeBSD-src-03b61a1a00862269701919e39e2697ced7263f5f.zip
FreeBSD-src-03b61a1a00862269701919e39e2697ced7263f5f.tar.gz
It seems that I slipped a nasty bug into the CAPI support. The message
lengths for CONNECT_REQ and CONNECT_IND are incorrect, which causes dialouts to fail after certain error situations (an invalid -- not wrong! -- number has been dialed). Since these messages are tagged as too short, the device reads trailing garbage as the B protocol parameters; this is OK as long as the garbage consists of zero bytes, which it usually does, except after the said error. Another change we have taken into use is to send an explicit Q.850 "normal call clearing" code when a call is ignored using PRI equipment (specifically AVM T1); the CAPI pseudo-code for ignore, 1, translates into something at least Ericsson exchanges interpret oddly (message "this area is not reachable from your number"). NCCLR makes the exchange give a busy signal, which is the behaviour at least we prefer (conceivably, the ignore code could be made a sysctl variable). The attached patch corrects the message length issue. It also includes a somewhat unpretty solution for the PRI ignore code (if device's number of channels equals 30, assume PRI and send NCCLR, otherwise send CAPI ignore). Tested using AVM B1 PCI and T1 PCI. Submitted by: Juha-Matti Liukkonen <jml@cubical.fi> Reviewed by: hm MFC after: 1 month
Diffstat (limited to 'sys/i4b/capi')
-rw-r--r--sys/i4b/capi/capi_msgs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/i4b/capi/capi_msgs.c b/sys/i4b/capi/capi_msgs.c
index a2ce023..5c1698f 100644
--- a/sys/i4b/capi/capi_msgs.c
+++ b/sys/i4b/capi/capi_msgs.c
@@ -195,7 +195,7 @@ void capi_connect_req(capi_softc_t *sc, call_desc_t *cd)
int slen = strlen(cd->src_telno);
int dlen = strlen(cd->dst_telno);
- m = i4b_Dgetmbuf(8 + 18 + slen + dlen);
+ m = i4b_Dgetmbuf(8 + 27 + slen + dlen);
if (!m) {
printf("capi%d: can't get mbuf for connect_req\n", sc->sc_unit);
return;
@@ -566,7 +566,7 @@ void capi_connect_resp(capi_softc_t *sc, call_desc_t *cd)
u_int32_t PLCI;
int dlen = strlen(cd->dst_telno);
- m = i4b_Dgetmbuf(8 + 11 + dlen);
+ m = i4b_Dgetmbuf(8 + 21 + dlen);
if (!m) {
printf("capi%d: can't get mbuf for connect_resp\n", sc->sc_unit);
return;
@@ -600,7 +600,12 @@ void capi_connect_resp(capi_softc_t *sc, call_desc_t *cd)
case SETUP_RESP_DNTCRE:
sc->sc_bchan[cd->channelid].state = B_FREE;
ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_FREE;
- msg = capimsg_setu16(msg, 1); /* Ignore */
+ if (sc->sc_nbch == 30) {
+ /* With PRI, we can't really ignore calls -- normal clearing */
+ msg = capimsg_setu16(msg, (0x3480|CAUSE_Q850_NCCLR));
+ } else {
+ msg = capimsg_setu16(msg, 1); /* Ignore */
+ }
break;
default:
@@ -733,7 +738,7 @@ void capi_data_b3_conf(capi_softc_t *sc, struct mbuf *m_in)
void capi_data_b3_ind(capi_softc_t *sc, struct mbuf *m_in)
{
- struct mbuf *m = i4b_Dgetmbuf(8 + 14);
+ struct mbuf *m = i4b_Dgetmbuf(8 + 6);
u_int8_t *msg = mtod(m_in, u_int8_t*);
u_int16_t applid, msgid;
u_int32_t NCCI;
OpenPOWER on IntegriCloud