You can do a simple SQL insert. This is a base Query I have used to add all hard phones to an app user, that aren’t already associated to the user (for apps like phoneview)
Add all phones to an app user: <sql>INSERT INTO ApplicationUserDeviceMap (fkdevice, fkApplicationUser,tkuserassociation) SELECT device.pkid, 'be93a493-3b9b-d0f4-d360-fafb54babb70', '1' from device where Device.pkid NOT IN (SELECT fkDevice FROM ApplicationUserDeviceMap AS MAP WHERE MAP.fkApplicationUser = 'be93a493-3b9b-d0f4-d360-fafb54babb70') and tkclass = '1' and name like 'SEP%' </sql> From: cisco-voip [mailto:[email protected]] On Behalf Of Nick Barnett Sent: Tuesday, April 18, 2017 2:17 PM To: Cisco VoIP Group <[email protected]> Subject: [cisco-voip] Automating association devices and profiles to PG_User application user? We have automation that builds devices, EM_Profiles, DNs, and just about everything else... except for the manual add of the controlled devices to the pg user application user for UCCE. We also use Nice for recording and there is a nice app user that needs these associations as well. I have figured out how to do this by using a getAppUser AXL call, parsing the returned data, inserting my NEW device/profile where appropriate (into a new tag) and then submitting the information back as an updateAppUser. I think this this the only method we have available to automating this portion. It kind of worries me to do it this way because I can see how the database may see it as disassociating all devices from the PG User and then re-associating all devices. Depending on processor utilization etc, I can also see where they may be a short period of time where the PG user has no associated devices. Are my worries substantiated by any fact? Does anyone else do this? Are there better ways to accomplish this task? Thanks, Nick
_______________________________________________ cisco-voip mailing list [email protected] https://puck.nether.net/mailman/listinfo/cisco-voip
