So, I was bored.. and decided I'd write a java soap/axl class that retrieves the userid based on the extension provided.<div><br></div><div>Attached is the JAR File, UCMGetUserByExtension. You'll need to load this under Document Management, default, classpath. Make sure it is marked as Selected under System --> Custom File Configuration.</div>
<div><br></div><div>After loading the jar file, you'll have to restart the CCX Engine via the Control Center.</div><div><br></div><div>After everything is all done and loaded, in your script you'll use it as such </div>
<div><br></div><div>String username;</div><div><br></div><div>Set username = {</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">UCMGetUserByExtension user = new UCMGetUserByExtension();<br>
return user.getExt(CCMServer, CCMAdminUser, CCMAdminUserPassword, Extension);<br>}<br><br></blockquote><div><div class="gmail_quote">Now, assuming they are in the system, you'll get an actual End User name. </div><div class="gmail_quote">
<br></div><div class="gmail_quote">Returns:</div><div class="gmail_quote"> end user id on success</div><div class="gmail_quote"> -1 if no end user id is found</div><div class="gmail_quote"> -2 for unknown host</div><div class="gmail_quote">
-3 general exception error</div><div class="gmail_quote"> -4 general error (probably only get this if you specify the wrong server)</div><div class="gmail_quote"><br></div><div class="gmail_quote">As demonstrated above, the UCMGetUserByExtension class has the single method, 'getExt' which takes 4 parameters, </div>
<div class="gmail_quote"><br></div><div class="gmail_quote">CCMServer - the address to UCM</div><div class="gmail_quote">CCMAdminUser - an admin user, though it could just be an AXL user</div><div class="gmail_quote">CCMAdminUserPassword - password for the specified user</div>
<div class="gmail_quote">Extension - the extension we want to find.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Known caveat:</div><div class="gmail_quote"><br></div><div class="gmail_quote">This will not work if someone calls on their agent extension. Only non-agent extensions will yield a result.</div>
<div class="gmail_quote">This only returns the end user id, in order for it to work, a device/profile with the number must be associated to the end user otherwise you'll get "-1".</div><div class="gmail_quote">
<br></div><div class="gmail_quote">As I type this email I had a thought, this may return -1 if you have a device with multiple extensions. (I tested this on my lab server, which is pretty sparse). If that's the case, let me know.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">The following SQL is sent to the server:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">SELECT userid FROM enduser WHERE pkid = (</div>
<div class="gmail_quote"> SELECT fkenduser FROM endusernumplanmap WHERE tkdnusage = 1 AND fknumplan = (</div><div class="gmail_quote"> SELECT pkid FROM numplan WHERE dnorpattern = '<extension here>' AND fkroutepartition IS NOT NULL))</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">If someone knows a better query to run let me know and ill update it.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Also, this was built and tested against UCCX 7 with a Premium license (you'll need premium to run custom java classes).</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Tanner Ezell</div><div class="gmail_quote"><span class="Apple-tab-span" style="white-space:pre">                        </span></div></div><div class="gmail_quote">
On Fri, Jan 15, 2010 at 10:29 AM, Eric Pedersen <span dir="ltr"><<a href="mailto:eric.pedersen@sait.ca" target="_blank">eric.pedersen@sait.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">We have an old version of HEAT but the customer DB is not well
maintained. Until it is upgraded and improved, it would be better to
query the data in Callmanager or active directory. I did some AXL
programming with .NET but it has been a long time since I wrote any Java
code. Maybe when I have some time I will look at writing some code to do
an LDAP query of AD since that is probably easier than AXL.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">The appliance Callmanager is nice from a maintenance
perspective, but not having native SQL access is frustrating.</span></p>
<p class="MsoNormal"><a name="12635f7e60d1eaf3_1263363186adb902__MailEndCompose"><span style="font-size:11.0pt;color:#1F497D"> </span></a></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Scott Voll
[mailto:<a href="mailto:svoll.voip@gmail.com" target="_blank">svoll.voip@gmail.com</a>] <br>
<b>Sent:</b> January 15, 2010 08:46<br>
<b>To:</b> Eric Pedersen<br>
<b>Cc:</b> <a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<b>Subject:</b> Re: [cisco-voip] querying AD or CM user information in CCX</span></p>
</div><div><div></div><div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Eric--</p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">What are you going to do with it once you have it? are
you putting it into a ticket system?</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">if so, you could grab the ANI and have it open a ticket and
put the ANI in, and then your ticket system could do the matching???</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">It's something I'm planning on doing here........ Just
haven't had time yet.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Scott</p>
<div>
<p class="MsoNormal">On Thu, Jan 14, 2010 at 4:43 PM, Eric Pedersen <<a href="mailto:eric.pedersen@sait.ca" target="_blank">eric.pedersen@sait.ca</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-CA">We are using CCX for our internal helpdesk and most of the people
that call have user accounts in CM. Is there a way in CCX to fetch user
information based on the ANI? It’s CM 7.1 so I can’t do a SQL
query. Am I missing something obvious?</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA"> We are AD integrated so I could do an LDAP query but it looks
like I would need some custom Java code for that.</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA">It’s CCX 7.0 and CM 7.1.</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div></div></div>
</div>
<br>_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Tanner Ezell<br>
</div>