Showing posts from 2015

Bulk deletion of CTL/ITL files

So I created a forking version that will do all the phones you would like in a single command.  Granted this uses tcl (non-threaded) and expect to call the fork.

set phoneIPList {}
set user "User"
set pass "Password"
foreach phoneIP [split $phoneIPList] {
      set pid [fork]
        exit -onexit {
                exec kill [pid]
        switch $pid {
                -1 {
                        puts "Fork attempt #$i failed."
                0 {
                        foreach command [split $commandList] {
                                        if {$command == "ERASE"} {
                                                after 5000
                                        if { [catch { exec curl -i --user $user\:$pass \
                                        -0 --data-urlencode XML@$command\.xml \
                                        $phoneIP\/CGI/Execute } msg] } {
                                                puts $msg
                default {

You will need 4 XML files named, SETTINGS.xml, CTL.xml, UNLOCK.xml , and ERASE.xml with the Key presses as follows:

        <ExecuteItem Priority='0' URL='Init:Services'/>
        <ExecuteItem Priority='0' URL='Key:Settings'/>

This is the SETTINGS.xml as an example you can figure out the rest though.  This has been used in production and the only caveat is some 79xx's need different softkeys as well as a reset from CUCM even though the CTL deletion normally resets the phone.

32 lines of code and a few XML files.  This should be good enough for most peoples needs.