I realize that my e-mails on this thread are being dropped because my From address is different from what I registered with.  My two cents on this topic is that the Asterisk Manager provides a great interface for keeping track of many lines.  I've got code in PHP using phpagi-manager that shows how to detect an anaswered line and a hungup line as the event happens.  I think AGI would be a much better method to use, but if it doesn't meet your needs (or, like me, you can't figure out how to do what you want), then try the Manager interface.
<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Nicholas Blasgen</b> &lt;<a href="mailto:squidy@gmail.com">squidy@gmail.com</a>&gt;<br>Date: Jul 23, 2007 9:27 PM
<br>Subject: Re: [asterisk-dev] AGI and DeadAGI<br>To: Asterisk Developers Mailing List &lt;<a href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>&gt;<br><br></span>I&#39;ll be interested in the reply you get. Personally I&#39;ve been using
<br>the manager to detect hangups and then execute whatever code I need. I<br>set the callerid in the agi to provide the manager any state<br>information I need. Not great but it works.<br><br>/Nick<br>Sent from my iPhone