Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

CUCM 8.x SQL Syntax - MoH Dependency

 

Has anyone posted the syntax of a SQL query that returns the devices associated to an MoH audio file (Network or User)?

 

Thanks,

 

Beau

Everyone's tags (2)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Bronze

try thisrun sql select name

try this

run sql select name,userholdmohaudiosourceid,networkholdmohaudiosourceid from device

 

this lists all devices and the associated moh id.

You can get fancy and also

You can get fancy and also display the names:

run sql select device.name, usersource.name as usersource, networksource.name as networksource from device left join mohaudiosource as usersource on device.userholdmohaudiosourceid=usersource.sourceid left join mohaudiosource as networksource on device.networkholdmohaudiosourceid=networksource.sourceid

 

Also don't forget to check the lines as they take precedence over device:

run sql select np.dnorpattern as extension,partition.name as partition, usersource.name as UserSource,networksource.name as NetworkSource from numplan as np left join routepartition as partition on np.fkroutepartition=partition.pkid left join mohaudiosource as usersource on np.userholdmohaudiosourceid=usersource.sourceid left join mohaudiosource as networksource on np.networkholdmohaudiosourceid=networksource.sourceid

3 REPLIES
Bronze

try thisrun sql select name

try this

run sql select name,userholdmohaudiosourceid,networkholdmohaudiosourceid from device

 

this lists all devices and the associated moh id.

You can get fancy and also

You can get fancy and also display the names:

run sql select device.name, usersource.name as usersource, networksource.name as networksource from device left join mohaudiosource as usersource on device.userholdmohaudiosourceid=usersource.sourceid left join mohaudiosource as networksource on device.networkholdmohaudiosourceid=networksource.sourceid

 

Also don't forget to check the lines as they take precedence over device:

run sql select np.dnorpattern as extension,partition.name as partition, usersource.name as UserSource,networksource.name as NetworkSource from numplan as np left join routepartition as partition on np.fkroutepartition=partition.pkid left join mohaudiosource as usersource on np.userholdmohaudiosourceid=usersource.sourceid left join mohaudiosource as networksource on np.networkholdmohaudiosourceid=networksource.sourceid

New Member

 Thank you both. Mark - it

 

Thank you both.

 

Mark - it works as expected pulling devices with user & network hold file names.

Brian - this too works to pull the pattern's associated MoH file name.

 

I've used them both and verified the syntax.

217
Views
0
Helpful
3
Replies
CreatePlease login to create content