Log.debug("Adding AsteriskEventHandler");
    public void initAsteriskManager() {        // Only initialize things if the plugin is enabled        if(JiveGlobals.getBooleanProperty(Properties.ENABLED, false)) {            log.info("Initializing Asterisk Manager connection");            // Populate the manager configuration            ManagerConfig asteriskManagerConfig = new ManagerConfig();            asteriskManagerConfig.setServer(JiveGlobals.getProperty(Properties.SERVER));            asteriskManagerConfig.setUsername(JiveGlobals.getProperty(Properties.USERNAME));            asteriskManagerConfig.setPassword(JiveGlobals.getProperty(Properties.PASSWORD));            int port = JiveGlobals.getIntProperty(Properties.PORT, -1);            if (port > 0) {                asteriskManagerConfig.setPort(port);            }            int poolsize = JiveGlobals.getIntProperty(Properties.POOLSIZE, -1);            if (poolsize > 0) {                asteriskManagerConfig.setMaxPoolSize(poolsize);            }            // Check to see if the configuration is valid then            // Initialize the manager connection pool and create an eventhandler            if (isConfigValid(asteriskManagerConfig)) {                try {                    // This will release the connection back to the pool so can be reinitialized                    if (managerConnection != null) {                        managerConnection.logoff();                    }                    ManagerConnectionPoolFactory.init(asteriskManagerConfig);                    managerConnection = ManagerConnectionPoolFactory.getManagerConnectionPool()                            .getConnection();                    // Start handling events                    managerConnection.addEventHandler(new AsteriskEventHandler(this));                }                catch (Exception e) {                    Log.error("unable to obtain a manager connection --> " + e.getMessage(), e);                }            }            else {                Log.warn("AsteriskPlugin configuration is invalid, please see admin tool!!");            }        }    }