Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2094/src/java/net/sf/asterisk/fastagi
Modified Files:
AGIConnectionHandler.java
Log Message:
Added logging of missing mapping via VerboseCommand()
Index: AGIConnectionHandler.java
===================================================================
RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIConnectionHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -p -r1.8 -r1.9
--- AGIConnectionHandler.java 11 Mar 2005 20:15:15 -0000 1.8
+++ AGIConnectionHandler.java 12 Mar 2005 09:56:17 -0000 1.9
@@ -18,6 +18,7 @@ package net.sf.asterisk.fastagi;
import java.io.IOException;
+import net.sf.asterisk.fastagi.command.VerboseCommand;
import net.sf.asterisk.fastagi.impl.AGIChannelImpl;
import net.sf.asterisk.fastagi.impl.AGIReaderImpl;
import net.sf.asterisk.fastagi.impl.AGIWriterImpl;
@@ -38,12 +39,12 @@ import org.apache.commons.logging.LogFac
public class AGIConnectionHandler implements Runnable
{
private final Log logger = LogFactory.getLog(getClass());
-
+
/**
* The socket connection.
*/
private SocketConnectionFacade socket;
-
+
/**
* The strategy to use to determine which script to run.
*/
@@ -93,22 +94,28 @@ public class AGIConnectionHandler implem
script = mappingStrategy.determineScript(request);
threadName = Thread.currentThread().getName();
-
+
if (script != null)
{
- logger.info("Begin AGIScript " + script.getClass().getName() + " on " + threadName);
+ logger.info("Begin AGIScript " + script.getClass().getName()
+ + " on " + threadName);
script.service(request, channel);
- logger.info("End AGIScript " + script.getClass().getName() + " on " + threadName);
+ logger.info("End AGIScript " + script.getClass().getName()
+ + " on " + threadName);
}
else
{
- logger.error("Unable to determine which script to run for "
- + request.getRequestURL());
+ String error;
+
+ error = "No script configured for " + request.getRequestURL();
+ channel.sendCommand(new VerboseCommand(error, 1));
+ logger.error(error);
}
}
catch (AGIException e)
{
- logger.error("AGIException while handling request: " + e.getMessage());
+ logger.error("AGIException while handling request: "
+ + e.getMessage());
}
catch (Exception e)
{
|