You may need to modify slightly to get MAC rather than Trunk or Extension Number however a starting point:
Dynamic Channel Mapping SQL Query:
USE nice_admin
SELECT DISTINCT nvcSourcePoolName [Pool Name], nvcDeviceNumber [Extension]
FROM tblCLSCMSource, tblCLSCMSourcePool, tblCLSCMSourcePoolName
WHERE tblCLSCMSourcePool.iDeletionVersionID is NULL
and tblCLSCMSourcePool.iSourceID = tblCLSCMSource.iSourceID
and tblCLSCMSourcePool.iSourcePoolID = tblCLSCMSourcePoolName.iSourcePoolID
ORDER BY nvcSourcePoolName, nvcDeviceNumber
Static Extension Mapping:
use nice_Admin
SELECT DISTINCT tblSystemResource.vcResourceName[Logger Name],
tblSystemResource.nvcInternalId[LG Serial Num],
tblSystemResource.vcLocation[LG Machine Name],
tblCLSCMChannel.iChannelNumber[LG Channel],
tblCLSCMSource.nvcDeviceNumber[Extension]
--tblCLSCMStaticMapping.iChannelID,
--tblCLSCMStaticMapping.iSourceID,
--tblCLSCMSource.iSWitchID
FROM tblCLSCMStaticMapping,
tblCLSCMSource,
tblCLSCMChannel,
tblSystemResource
WHERE tblCLSCMStaticMapping.iDeletionVersionID is NULL
and tblCLSCMSource.iSourceID = tblCLSCMStaticMapping.iSourceID
and tblCLSCMChannel.iChannelID = tblCLSCMStaticMapping.iChannelID
and tblCLSCMChannel.nvcLoggerResourceID = tblSystemResource.iResourceID
ORDER BY tblCLSCMChannel.iChannelNumber