Script to Auto Associate and Disassociate IP Phones CM User

Version 1
    This document was generated from CDN thread

    Created by: Deepak Gupta on 30-08-2011 11:19:45 AM
    Hi There
     
    Is there a script that someone can share that allows us to automatically associate a bunch of IP Phones to a CUCM Application user and also allows to deassociate them?
     
    Input to the Script = List of IP Phone MAC addresses
    Associate/Disassociate Buttons
     
    Regards
    Deepak

    Subject: RE: Script to Auto Associate and Disassociate IP Phones CM User
    Replied by: Florian Kroessbacher on 30-08-2011 02:58:10 PM
    Hy Deepak,

    all the phones which should be associated with the appuser had to be within this update request.
    All phone not in the request will be deassociated by the callmanger. You could trace this behaviour
    on the RTMT in the Axl Log. If you put it to debug Level you can see what is done ob the cucm on
    sql level if u to some request.

    cheers Floh

    Subject: RE: Script to Auto Associate and Disassociate IP Phones CM User
    Replied by: David Staudt on 30-08-2011 01:24:24 PM
    The HTTP request to AXL would use the <updateAppUser> request:
     
    POST https://10.88.131.141:8443/axl/ HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "CUCMB ver=8.0 updateAppUser"
    User-Agent: Jakarta Commons-HttpClient/3.1
    Content-Length: 449
    Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjbyExMjM=
    Host: 10.88.131.141:8443
     
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.0">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:updateAppUser sequence="1">
             <userid>testAppUser</userid>
             <associatedDevices>
                <!--Zero or more repetitions:-->
                <device>SEP123456789012</device>
             </associatedDevices>
          </ns:updateAppUser>
       </soapenv:Body>
    </soapenv:Envelope>
     
    Note that the <associatedDevices> list must be complete - i.e. the entire list of devices for the user will be replaced by this list.

    Subject: RE: Script to Auto Associate and Disassociate IP Phones CM User
    Replied by: Deepak Gupta on 30-08-2011 02:46:00 PM
    Hi David

    Thanks much for the quick response.

    Kindly excuse my ignorance. You wrote:
    Note that the <associatedDevices> list must be complete - i.e. the entire list of devices for the user will be replaced by this list.

    There are currently 1700 phones associated with the AppUser - if I want to remove 5 phones from the device association then do I have to send over just those 5 phones in the above request or do I have to send a list of all 1695 phones?

    Regards
    Deepak

    Subject: RE: Script to Auto Associate and Disassociate IP Phones CM User
    Replied by: Deepak Gupta on 30-08-2011 03:09:15 PM
    Thanks for the clarification Florian
    Thanks David for the example.

    I will give it a shot and revert if there are further questions.

    Cheers!
    DG