summaryrefslogtreecommitdiffstats
path: root/bchannel.c
diff options
context:
space:
mode:
authorAndreas Eversberg2010-01-24 19:41:32 +0100
committerAndreas Eversberg2010-01-24 19:41:32 +0100
commit8fb861ef9ece9f4bd68ef79a77625ec23c27aef1 (patch)
treeea055ed2a47d381bfd1978105442ff9144a7007c /bchannel.c
parentAdded queue buffer for chan_lcr sending faxes without interruption. (diff)
downloadlcr-8fb861ef9ece9f4bd68ef79a77625ec23c27aef1.tar.gz
lcr-8fb861ef9ece9f4bd68ef79a77625ec23c27aef1.tar.xz
lcr-8fb861ef9ece9f4bd68ef79a77625ec23c27aef1.zip
- Fixed HLC (higher layer capability) modification to LCR routing.
- Fixed chan_lcr fax queue buffer. Added LCR_TRANSFERCAPABILITY environment. -> use options "n:t:q250" for sending/receiving faxes with asterisk and chan_lcr. modified: README modified: action.cpp modified: bchannel.c modified: chan_lcr.c modified: route.c modified: route.h
Diffstat (limited to 'bchannel.c')
-rw-r--r--bchannel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bchannel.c b/bchannel.c
index 51423a1..b6107b6 100644
--- a/bchannel.c
+++ b/bchannel.c
@@ -449,9 +449,9 @@ void bchannel_transmit(struct bchannel *bchannel, unsigned char *data, int len)
bchannel->test = (bchannel->test + len) & 7;
#endif
if (bchannel->nodsp_queue) {
- space = (bchannel->nodsp_queue_out - bchannel->nodsp_queue_in) & (QUEUE_BUFFER_SIZE - 1);
+ space = (bchannel->nodsp_queue_out - bchannel->nodsp_queue_in - 1) & (QUEUE_BUFFER_SIZE - 1);
if (len > space) {
- CERROR(bchannel->call, NULL, "Queue buffer overflow.\n");
+ CERROR(bchannel->call, NULL, "Queue buffer overflow, space is %d, len is %d.\n", space, len);
return;
}
p = buff + MISDN_HEADER_LEN;
@@ -485,6 +485,11 @@ static void bchannel_send_queue(struct bchannel *bchannel)
len = (bchannel->nodsp_queue_in - bchannel->nodsp_queue_out) & (QUEUE_BUFFER_SIZE - 1);
if (len == 0)
return; /* mISDN driver received all load */
+#if 0
+ printf("%4d:(%s|%s)\n", bchannel->nodsp_queue_out,
+ "----------------------------------------------------------------"+64-len/(8192/64),
+ " "+len/(8192/64));
+#endif
if (len > 1024)
len = 1024;
frm->prim = PH_DATA_REQ;