cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
285
Views
4
Helpful
2
Replies

SQL query Mac Address and Line 1/Primary line (4.1.3)

mdury
Level 1
Level 1

Is there any way to have an sql query where i can capture the Primary line/DN/Line 1 along with the mac , description etc. HEre is waht i use so far

select NumPlan.DNOrPattern as DirectoryNumber, Device.Name as DeviceName, Device.Description as UserDeviceProfileName, Device.LoginUserid as UserId, DeviceNumPlanMap.Display as DisplayIntCallerID,DeviceNumPlanMap.Label as LineTextLabel,

TypeModel.Name AS PhoneType,DeviceNumPlanMap.E164Mask as ExtPhoneMask, NumPlan.CFADestination as CallFWDALL, NumPlan.CFNADestination as CallFWDNoAnswer, NumPlan.CFBDestination as CallFWDBusy, devicepool.Name as DevPoolName

from numplan, devicenumplanmap, devicepool, device ,TypeModel

where DeviceNumPlanMap.fknumplan = numplan.pkid

and DeviceNumPlanMap.fkdevice = device.pkid

and device.fkdevicepool = devicepool.pkid

and device.tkmodel = typemodel.enum

and numplan.tkPatternUsage = 2

order by numplan.DnOrPattern

thanks

2 Replies 2

ckatene
Level 3
Level 3

you're getting there. you will also need to reference devicenumplanmap.numplanindex so that you get the details of only the first line

... and devicenumplanmap.numplanindex = 1 ...

Thanks, I;ll try those parameters