cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2161
Views
0
Helpful
7
Replies

SQL Update Device Descriptions with Owner User ID?

hellohova
Level 1
Level 1

I'm looking to clean up our phone devices by updating device descriptions on phones to include the Owner User ID and Perhaps First and Last Name to the already existing device descriptions.

Is this possible via SQL?

7 Replies 7

dstaudt
Cisco Employee
Cisco Employee

I got something like this working on my CUCM 12.5 system with this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/12.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:executeSQLUpdate sequence="?">
         <sql>UPDATE device
              SET description=
                 (SELECT enduser.firstname||" "||enduser.lastname||" ("||enduser.userid||")" FROM enduser WHERE device.fkenduser=enduser.pkid)
         	  WHERE device.tkmodel NOT IN (134,645) AND device.fkenduser IS NOT NULL
       	</sql>
      </ns:executeSQLUpdate>
   </soapenv:Body>
</soapenv:Envelope>

Models 134/645 are Remote Destination/Universal Device Template....everything else with a fkenduser value seemed to be an 'actual' device.
Note, the CUCM CLI would not accept the double-pipe symbol ( || ) for concatenating strings, so I resorted to using AXL to make the request.  If you're going that way, you may just want to use regular AXL requests to accomplish your task, e.g. <listPhone>, <getUser>, <updatePhone>, etc.

Live2 Bicycle
Level 3
Level 3

I needed to update / append / concatenate which carrier serviced every directly number in my 3 CUCM clusters. I used the below CLI run sql command to append / concatenate the carrier id to the description field that already contained the cost center for the user the directory number belonged to.

run sql update numplan set description= CONCAT('CBTS:', description) where dnorpattern='9999999999' == Appends carrier and Colon to beginning of Description Field

The Line Description started off with only the cost center number like this -- 101522
Now the Line Description looks like this -- CBTS:101522

If I ever need to change the carrier then I can use the below query to change the carrier in the description field
run sql update numplan set description= REPLACE(description,'CBTS:','CBTS-Teams:') where dnorpattern='9999999999' == Updates carrier in Description Field

Yes it's usually possible to update device descriptions including Owner User ID and First/Last Name through SQL commands especially if your phone system supports best projectors  it. However the exact SQL commands and procedures can vary depending on the phone system or software you're using. I recommend consulting your system's documentation or reaching out to their support for specific guidance on how to achieve this.

To update device descriptions on phones to include the Owner User ID and perhaps the First and Last Name, follow these steps:

  1. Access the Phone Device Settings: Log in to the phone system's administration portal or control for panel. The exact steps to access device settings may vary depending on your phone system (e.g., VoIP provider or on-premises PBX).

  2. Locate the Device: Find the specific phone device you want to update in the list of connected devices. This list is typically found in the administration portal.

  3. Edit Device Description: Once you've located the device, there should be an option to edit or configure its settings. Look for a field labeled "Device Description" or similar.

Fredricksonj725
Level 1
Level 1

Yes, updating device descriptions on phones using SQL is possible. You can achieve this by running SQL queries to modify the relevant fields in your database. However, the exact best SQL query would depend on the structure of your database and the specific details you want to include in the device descriptions.

"Great initiative! Adding Owner User ID and First/Last Name to device descriptions is a smart way to streamline and organize. If you need any assistance or have specific steps in mind, feel free to share. Happy to help with the cleanup process!

lrapks165
Level 1
Level 1

Yes, it's possible to update device descriptions on phones to include Owner User ID, First Name, and Last Name using SQL, but it depends on the specific database schema and setup you have for storing device information. Moreover, you can use Vsco Lightroom Presets to enhance your photography editing skills.