Replaced polling loop for LCR and chan_lcr with select based event loop. Now LCR and chan_lcr will not use any CPU until there is work to do.
Fix lot of warnings
changed long to int (64 bit system's compatibilty)
only for backup, still in coding state - no compile!!!