Cisco Support Community
Community Member

JTAPI Get Agent Extension from Agent ID

Dear all,

Please pardon me if have asked this question in the worng place. I'm new to this forums and not familer with the way around.

I wish to build an application using JTAPI connected to UCCX which will provide an CRM integration which will facilitate making calls from agent phones to customer numbers.

I have working code {Attached bellow, which has been refernced} with Agent Extensions but I have faced an issue while integrating with the CRM.

The CRM can only supply the Agent ID not the Agent Extension. My code works using the agent Extension.

I tried but I was not able to find comeup with a soulution which will present the agent extension when the Agent ID is passed.

Please help me to find a way to get the Agent extension using the Agent ID.

Thank you in advance.

--Current code which uses agent extension--

import javax.telephony.*;



public class MakeCall {

public MakeCall(String[] args) throws Exception {

String hostname = args[0];

String login = args[1];

String passwd = args[2];

String src = args[3];

String dst = args[4];

/* start up JTAPI */

JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);

/* connect to the provider */

String providerString = hostname;

providerString += ";login=" + login;

providerString += ";passwd=" + passwd;

Provider provider = peer.getProvider(providerString);

/* wait for it to come into service */

final Condition inService = new Condition();

provider.addObserver(new ProviderObserver() {

public void providerChangedEvent(ProvEv[] eventList) {

if (eventList == null)


for (int i = 0; i < eventList.length; ++i) {

if (eventList[i] instanceof ProvInServiceEv) {







/* get an object for the calling terminal */

Address srcAddr = provider.getAddress(src);

srcAddr.addCallObserver(new CallObserver() {

public void callChangedEvent(CallEv[] eventList) {



/* and make the call */

Call call = provider.createCall();

call.connect(srcAddr.getTerminals()[0], srcAddr, dst);


public static void main(String[] args) {

try {

new MakeCall(args);

} catch (Exception e) {


} finally {





Everyone's tags (5)

JTAPI Get Agent Extension from Agent ID

Hi Sudeera,

I am not good at coding :-), but looking into your requirement, you want to know "Agent extension using the Agent ID".

If you access the UCCX Admin->Subsystems->RmCm->Resoures page, click on any resource you will see the Resource ID and the IPCC Extension.

Hope it helps.


Please rate helpful posts by clicking on the stars below the right answer !!

Community Member

JTAPI Get Agent Extension from Agent ID

Dear anchoudh,

Thank you for your suggestion,

I belive the method illustrated is for getting list of extensions.

What I require is to programiatically get the Agent extension, by passing Agent Id as the input parameter.

Your words are much appriciated.

Thank you again.

Community Member

JTAPI Get Agent Extension from Agent ID

CreatePlease to create content