<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>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)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p style='margin:0in;margin-bottom:.0001pt'>Add all phones to an app user:<o:p></o:p></p><p style='margin:0in;margin-bottom:.0001pt'> <o:p></o:p></p><p style='margin:0in;margin-bottom:.0001pt'><sql>INSERT INTO ApplicationUserDeviceMap<o:p></o:p></p><p style='margin:0in;margin-bottom:.0001pt'>(fkdevice, fkApplicationUser,tkuserassociation)<o:p></o:p></p><p style='margin:0in;margin-bottom:.0001pt'>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%'<o:p></o:p></p><p style='margin:0in;margin-bottom:.0001pt'></sql><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b>From:</b> cisco-voip [mailto:cisco-voip-bounces@puck.nether.net] <b>On Behalf Of </b>Nick Barnett<br><b>Sent:</b> Tuesday, April 18, 2017 2:17 PM<br><b>To:</b> Cisco VoIP Group <cisco-voip@puck.nether.net><br><b>Subject:</b> [cisco-voip] Automating association devices and profiles to PG_User application user?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>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.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Are my worries substantiated by any fact? Does anyone else do this? Are there better ways to accomplish this task?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><div><p class=MsoNormal>Nick<o:p></o:p></p></div></div></div></body></html>