[cisco-voip] querying AD or CM user information in CCX

Tanner Ezell tanner.ezell at gmail.com
Sat Jan 16 02:57:41 EST 2010


So, I was bored.. and decided I'd write a java soap/axl class that retrieves
the userid based on the extension provided.

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.

After loading the jar file, you'll have to restart the CCX Engine via the
Control Center.

After everything is all done and loaded, in your script you'll use it as
such

String username;

Set username = {

UCMGetUserByExtension user = new UCMGetUserByExtension();
return user.getExt(CCMServer, CCMAdminUser, CCMAdminUserPassword,
Extension);
}

Now, assuming they are in the system, you'll get an actual End User name.

Returns:
 end user id on success
 -1 if no end user id is found
 -2 for unknown host
 -3 general exception error
 -4 general error (probably only get this if you specify the wrong server)

As demonstrated above, the UCMGetUserByExtension class has the single
method, 'getExt' which takes 4 parameters,

CCMServer - the address to UCM
CCMAdminUser - an admin user, though it could just be an AXL user
CCMAdminUserPassword - password for the specified user
Extension - the extension we want to find.

Known caveat:

This will not work if someone calls on their agent extension. Only non-agent
extensions will yield a result.
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".

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.

The following SQL is sent to the server:

SELECT userid FROM enduser WHERE pkid = (
    SELECT fkenduser FROM endusernumplanmap WHERE tkdnusage = 1 AND
fknumplan = (
        SELECT pkid FROM numplan WHERE dnorpattern = '<extension here>' AND
fkroutepartition IS NOT NULL))

If someone knows a better query to run let me know and ill update it.

Also, this was built and tested against UCCX 7 with a Premium license
(you'll need premium to run custom java classes).

Cheers,
Tanner Ezell
On Fri, Jan 15, 2010 at 10:29 AM, Eric Pedersen <eric.pedersen at sait.ca>wrote:

>  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.
>
>
>
> The appliance Callmanager is nice from a maintenance perspective, but not
> having native SQL access is frustrating.
>
>
>
> *From:* Scott Voll [mailto:svoll.voip at gmail.com]
> *Sent:* January 15, 2010 08:46
> *To:* Eric Pedersen
> *Cc:* cisco-voip at puck.nether.net
> *Subject:* Re: [cisco-voip] querying AD or CM user information in CCX
>
>
>
> Eric--
>
>
>
> What are you going to do with it once you have it?  are you putting it into
> a ticket system?
>
>
>
> 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???
>
>
>
> It's something I'm planning on doing here........ Just haven't had time
> yet.
>
>
>
> Scott
>
> On Thu, Jan 14, 2010 at 4:43 PM, Eric Pedersen <eric.pedersen at sait.ca>
> wrote:
>
> 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?
>
>
>
>  We are AD integrated so I could do an LDAP query but it looks like I would
> need some custom Java code for that.
>
>
>
> It’s CCX 7.0 and CM 7.1.
>
>
>
>
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>


-- 
Regards,
Tanner Ezell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20100115/87079288/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UCMGetUserByExtension.jar
Type: application/java-archive
Size: 3576 bytes
Desc: not available
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20100115/87079288/attachment.bin>


More information about the cisco-voip mailing list