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

Unity Connection extension in use

                   hi, we have Connection v 8.62a, fully populated , working fine. Only issue is we need to create a user with a particular extension yet the system reports extension is in use. We cannot find the extension anywhere, users, call handlers, pdl's - none have that extension in use, we only have the single partition  - any advice appreciated, TIA....Jag

Everyone's tags (3)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

Unity Connection extension in use

that's not how you delete a user - thats a direct table delete of an extension number (which could be a primary or an alternate extension for a user or it may not be).  Blowing away (or trying - I suspect the FK constraint on that row will cause it to fail) a row in a table with delete commands like that is an amazingly bad idea and should never be done unless there is no other choice available.

in general direct table edits in a database as large and complex as Connection is never a good idea.  A user has data strung out over 30 tables - trying to just blow one of them away is not going to work and if it did it would damage your database.

Always use stored procedures for adding/deleting data in Connection - there is a huge number of interdependencies on tables (FK constraints on most) and a lot of the business logic is in the stored procedures.

In this case you can find the owner (user) of the extension you're looking for by doing a "select parent_subscriberobjectid from vw_DTMFAccessId where dtfaccessid='1234'"

armed with the owner objectid you can call the stored procedure to safely remove that user like this:

"execute procedure csp_userdelete (pObjectId='58b18eb6-6af3-4bfb-a2d7-c822e323635a')"

and you can even get fancy and pass in a replacement user - this is handy since if the user you are trying to delete is referenced _anywhere_ in the database the delete will not be allowed (more of those FK constraints).  So you can replace a user's references and point them to another (i.e. like the operator user or the like).  this is done by passing in the "pReplacementUserObjectId" parameter.

As a rule if you're going to be doing direct database editing you should get yourself CUDLI (the database explorer and editor for Connection): http://www.ciscounitytools.com/Applications/CxN/CUDLI/CUDLI.html

it has a complete data dictionary, a query builder, table/view explorer and help for finding and constructing stored procedures - if you want to do it right, it's good to use the tools the database developers provided for such things.

Cisco Employee

Unity Connection extension in use

Thanks for the detailed post Jeff.

I agree that this should not be used as a direct approach to delete the user and should be tried as the last resort. If we are deleting a user from the database or anything else for that matter, we need to check the dependencies and delete only the required entry/association.

As mentioned above, we may not even need to delete the user from the CLI beucase "the extension could be added as an Alternate extension and would not show  with the user directly". Simply removing the entry from the alternate extensions (from GUI) would allow us to add the extension to another user and the database.

6 REPLIES
Cisco Employee

Unity Connection extension in use

Hi,

You can query the database with the following query.

run cuc dbquery unitydirdb select * from tbl_DtmfAccessId where DtmfaccessId = 'extension_number'

HTH,

Jagpreet Singh Barmi

New Member

Unity Connection extension in use

SSA Jagpreet Singh,

thanks, will check that command - what if it finds the user in the DB (which i'm sure it will) - what is command to delete it from there ?...Regards, Jag

Cisco Employee

Unity Connection extension in use

SSA,

You can delete the user using the following command.

run cuc dbquery unitydirdb delete from tbl_DtmfAccessId WHERE DtmfAccessId ='extension_number'

As the extension could be added as an Alternate extension, it may not show with the user directly, but would show up in its alternate extension.

HTH,

Jagpreet Singh Barmi

Cisco Employee

Unity Connection extension in use

that's not how you delete a user - thats a direct table delete of an extension number (which could be a primary or an alternate extension for a user or it may not be).  Blowing away (or trying - I suspect the FK constraint on that row will cause it to fail) a row in a table with delete commands like that is an amazingly bad idea and should never be done unless there is no other choice available.

in general direct table edits in a database as large and complex as Connection is never a good idea.  A user has data strung out over 30 tables - trying to just blow one of them away is not going to work and if it did it would damage your database.

Always use stored procedures for adding/deleting data in Connection - there is a huge number of interdependencies on tables (FK constraints on most) and a lot of the business logic is in the stored procedures.

In this case you can find the owner (user) of the extension you're looking for by doing a "select parent_subscriberobjectid from vw_DTMFAccessId where dtfaccessid='1234'"

armed with the owner objectid you can call the stored procedure to safely remove that user like this:

"execute procedure csp_userdelete (pObjectId='58b18eb6-6af3-4bfb-a2d7-c822e323635a')"

and you can even get fancy and pass in a replacement user - this is handy since if the user you are trying to delete is referenced _anywhere_ in the database the delete will not be allowed (more of those FK constraints).  So you can replace a user's references and point them to another (i.e. like the operator user or the like).  this is done by passing in the "pReplacementUserObjectId" parameter.

As a rule if you're going to be doing direct database editing you should get yourself CUDLI (the database explorer and editor for Connection): http://www.ciscounitytools.com/Applications/CxN/CUDLI/CUDLI.html

it has a complete data dictionary, a query builder, table/view explorer and help for finding and constructing stored procedures - if you want to do it right, it's good to use the tools the database developers provided for such things.

Cisco Employee

Unity Connection extension in use

Thanks for the detailed post Jeff.

I agree that this should not be used as a direct approach to delete the user and should be tried as the last resort. If we are deleting a user from the database or anything else for that matter, we need to check the dependencies and delete only the required entry/association.

As mentioned above, we may not even need to delete the user from the CLI beucase "the extension could be added as an Alternate extension and would not show  with the user directly". Simply removing the entry from the alternate extensions (from GUI) would allow us to add the extension to another user and the database.

New Member

Unity Connection extension in use

Thanks for your input guys. I ran a user data dump that included alternate extensions and found the user with the alternate extension configured. I have deleted that and now can create the user with that extension....regards, Jaginder

734
Views
0
Helpful
6
Replies
CreatePlease login to create content