Subject: Allow FXO channels to send out calls even before someone calls in through them
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Bug: http://issues.asterisk.org/view.php?id=14577
Last-Update: 2009-12-19

This rxisoffhook does not work. Before 1.6.0 it was wrapped in a #ifdef
DAHDI_CHECK_HOOKSTATE (or rather: ZAP_CHECK_HOOKSTATE). In 1.6 it is 
accidentally enabled by default.

On DAHDI (the kernel) this field is not properly initialized at startup. 
And thus it will only work after an incoming ring.

--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10685,12 +10685,16 @@ static inline int available(struct dahdi
 				/* When "onhook" that means no battery on the line, and thus
 				  it is out of service..., if it's on a TDM card... If it's a channel
 				  bank, there is no telling... */
+#ifdef DAHDI_CHECK_HOOKSTATE
 				if (par.rxbits > -1)
 					return 1;
 				if (par.rxisoffhook)
 					return 1;
 				else
 					return 0;
+#else
+				return 1;
+#endif
 			} else if (par.rxisoffhook) {
 				ast_debug(1, "Channel %d off hook, can't use\n", p->channel);
 				/* Not available when the other end is off hook */
