Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jul 2001 16:16:05 +0300
From:      Juha-Matti Liukkonen <jml@cubical.fi>
To:        hm@hcs.de, freebsd-isdn@freebsd.org
Subject:   i4b busy hour fixes
Message-ID:  <3B407415.939BDD47@cubical.fi>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------C9C01A403B9EAF10BA31F4FB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

we have been using i4b (0.96 based) system in a rather traffic intensive
application (dozens of calls per minute, both incoming and outgoing, for
extensive periods of time), and came up with a couple of bugs in isdnd.

Problem 1 is that the config entry hangup flag is zeroed only at
CONNECT_ACTIVE_IND in msghdl.c. If any (other) call is disconnected
after EV_MDO and before CONNECT_ACTIVE_IND, the cleanup routine will
disconnect the in-progress dialout as well, if its hangup flag is
nonzero (which it is likely to be) after the previous incarnation of the
cfg entry. Patch-1 fixes this by clearing the hangup flag as soon as a
cfg entry is reserved for the call.

Problem 2 is that doing a local hangup (eg. by writing "H" to the
dialout device) to a call which is already disconnected results in isdnd
moving the cfg entry to an illegal state, from which there is no
recovery. This is tricky because there is no way to synchronize local
hangup with the remote end (ie. the callee can always hang up at an
inconvenient time)! Hence, patch-2 alters fsm.c's EV_DRQ state table
such that the local hangup request is processed or ignored in most
states, even for disconnected calls.

Both of the above problems seem to remain in -current, so I thought to
push the patches out there.

A third semi-generic modification we are using is the capability to
launch answerprog for dialled out connections as well as incoming ones.
I can provide this patch as well if there is more general interest.

Cheers,
	- Juha

--
Juha-Matti Liukkonen, Cubical Solutions Ltd
Phone: +358(0)405280142
Email: jml@cubical.fi
--------------C9C01A403B9EAF10BA31F4FB
Content-Type: text/plain; charset=us-ascii;
 name="i4b-096-patch-2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="i4b-096-patch-2"

--- i4b-orig/isdnd/fsm.c	Sun Aug 20 11:08:51 2000
+++ i4b/isdnd/fsm.c	Mon Jul  2 15:43:37 2001
@@ -368,7 +368,7 @@
 
 /* local requests */
 /* EV_TIMO  */{{F_ill, ST_ILL},		{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_TIMO,ST_IDLE},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},        {F_ill, ST_ILL}},
-/* EV_DRQ   */{{F_ill, ST_ILL},		{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_DRQ, ST_WAITDISCI},	{F_NcNa,ST_WAITDISCI},	{F_ill, ST_ILL},	{F_ill, ST_ILL},        {F_ill, ST_ILL}},
+/* EV_DRQ   */{{F_NcNa, ST_IDLE},		{F_DRQ, ST_WAITDISCI},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_DRQ, ST_WAITDISCI},	{F_NcNa,ST_WAITDISCI},	{F_NcNa, ST_DOWN},	{F_ill, ST_ILL},        {F_ill, ST_ILL}},
 /* EV_CBRQ  */{{F_NcNa,ST_ACB_WAITDIAL},{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},       {F_NcNa,ST_ACB_WAITDIAL},{F_NcNa, ST_ACB_DIAL}, {F_NcNa,ST_ACB_DIALFAIL},{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},        {F_ill, ST_ILL}},
 /* EV_ALRT  */{{F_ALRT,ST_ALERT},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},	{F_ill, ST_ILL},        {F_ill, ST_ILL}},
 

--------------C9C01A403B9EAF10BA31F4FB
Content-Type: text/plain; charset=us-ascii;
 name="i4b-096-patch-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="i4b-096-patch-1"

--- i4b-orig/isdnd/msghdl.c	Thu Sep 21 14:29:51 2000
+++ i4b/isdnd/msghdl.c	Mon Jul  2 15:43:01 2001
@@ -143,6 +143,7 @@
 			log(LL_CHD, "%05d %s ignoring: incoming call from %s to %s",
 				mp->header.cdid, cep->name, SRC, DST);
 			sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
+			cep->cdid = CDID_UNUSED;
 			break;
 
 		case REACT_ANSWER:
@@ -764,6 +765,7 @@
 	incr_free_channels(cep->isdncontrollerused);
 	
 	cep->connect_time = 0;			
+	cep->cdid = CDID_UNUSED;
 
 	next_state(cep, EV_MDI);
 }
@@ -816,6 +818,7 @@
 	
 	cep->charge = 0;
 	cep->last_charge = 0;
+	cep->hangup = 0;
 
 	next_state(cep, EV_MDO);	
 }
@@ -868,6 +871,7 @@
 	
 	cep->charge = 0;
 	cep->last_charge = 0;
+	cep->hangup = 0;
 
 	next_state(cep, EV_MDO);	
 }

--------------C9C01A403B9EAF10BA31F4FB--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B407415.939BDD47>