finally { close(phoneManager); }
        public void run() {            PhoneManager phoneManager = null;            try {                phoneManager = getPhoneManager();                String device = getDevice(event.getChannel1());                PhoneUser phoneUser = phoneManager.getByDevice(device);                if (phoneUser != null) {                    CallSession callSession = getCallSessionFactory().getCallSession(event.getUniqueId1(), phoneUser.getUsername());                    callSession.setChannel(event.getChannel1());                    callSession.setLinkedChannel(event.getChannel2());                    Log.debug("Asterisk-IM LinkTask: Initialized call session " + callSession);                }                // Now setup this up for the second user                device = getDevice(event.getChannel2());                phoneUser = phoneManager.getByDevice(device);                if (phoneUser != null) {                    CallSession callSession = getCallSessionFactory().getCallSession(event.getUniqueId2(), phoneUser.getUsername());                    callSession.setChannel(event.getChannel2());                    callSession.setLinkedChannel(event.getChannel1());                    Log.debug("Asterisk-IM LinkTask: Initialized call session " + callSession);                }            }            catch (Exception e) {                Log.error(e.getMessage(), e);            }            finally {                close(phoneManager);            }        }