cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1101
Views
20
Helpful
38
Replies
Highlighted

How to get the ANI in a service ?

Hi !

I have to develop a service which displays the name of the caller during a call

To do this, I must have the ANI but I don't know how ?!

(My service is developed in Java - Servlet - )

Perhaps there is an "option" in the call manager to setup the variable ANI in the request to the service ?

If you have an idea ... thanks you in advance !

Thierry

38 REPLIES 38
Highlighted
Enthusiast

Re: How to get the ANI in a service ?

If you use the JTAPI interface, you can exploit the CiscoAddress (public interface CiscoAddress extends javax.telephony.Address,

CiscoObjectContainer). Within this is a method named "getAddressCallInfo(Terminal)". One of the fields returned is a field "External". This is an external address with a valid name. An address of this type is

created when ANI or callerID is available on the call.

Highlighted

Re: How to get the ANI in a service ?

Hi,

I have the version 1.3 of the Cisco JTAPI Implementation

but in the CiscoAddress interface, I have only these methods :

clearCallConnections()

getRegistrationState() deprecated

getState()

getType()

?

Thanks you in advance...

Highlighted
Beginner

Re: How to get the ANI in a service ?

hi thierry!

how do i have to use the getaddresscallinfo(terminal) method? i'm able to start a call between to phones (f.e. origterm/origaddress, destterm/destaddress). i think i have to implement this method to destaddress.getaddresscallinfo(destterm)? i'm not really sure how to get along...

could you give me a tip for the right direction?

thx jochen

Highlighted

Re: How to get the ANI in a service ?

Ok I found a solution !

Thks

Highlighted
Beginner

Re: How to get the ANI in a service ?

hi thierry!

i also want to use the jtapi-interface in a service for different things, but i don't know how to connect the ccm with the jtapi-interface to execute the jtapi-functions! can you give me a tip how to implement this in a service?

thanks in advance, jochen

Highlighted
Enthusiast

Re: How to get the ANI in a service ?

Configure a user on the CCM (which will be your application)

Associate a device (CTI/RP)

Assign a DN to the device

Route calls to the DN that meet your requirements

That is one method, dependent upon your needs there are more, can you be specific?

Highlighted
Enthusiast

Re: How to get the ANI in a service ?

One last thing I did not add, is that your application must register as the user, using the username/password that you set up. This is very important

Highlighted
Beginner

Re: How to get the ANI in a service ?

hi jashepard,

i have a little simple sample script:

public void getProvider () {

try {

JtapiPeer peer = JtapiPeerFactory.getJtapiPeer ( null );

System.out.println ("Got peer "+peer);

Provider provider = peer.getProvider("manihss-cm1;login=mani2;passwd=mani2");

System.out.println ("Got provider "+provider);

MyProviderObserver providerObserver = new MyProviderObserver ();

provider.addObserver(providerObserver);

while (outOfService ) {

Thread.sleep(500);

}

System.out.println ("Provider is now in service");

Address[] addresses = provider.getAddresses();

System.out.println ("Found "+ addresses.length +" addresses");

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

System.out.println(addresses[i]);

}

provider.shutdown();

} catch (Exception e){

}

}

but i always have problems with the addprovider function! i can establish a connection, get the provider object and so on, but i can't add to my provider an observer! can you give me a tip?

thx, jochen

Highlighted
Beginner

Re: How to get the ANI in a service ?

do i have to implement a own class for myproviderobserver?

Highlighted
Beginner

Re: How to get the ANI in a service ?

i use jtapi version 1.4 instead of 1.3! could this be a problem?

Highlighted
Beginner

Re: How to get the ANI in a service ?

ok, i just move like a snail, but i'm still moving :-)

i do need a class myproviderobserver! is it right, that the only thing this class does, is to listen to events and handle the eventlist?

it is quite hard to find a good documentation... :-(

could anyone recommend a good book (or ebook) or something else?

thx, jochen

Highlighted
Beginner

Re: How to get the ANI in a service ?

Hi

I am developing the code to caputre the run time status of an IP Phone. My code is almost similar to urs.

I am facing the problem to get the Xtn and the use associated with the phone.

Can you please throw some light on the same.

Thanks

-vk

Highlighted

Re: How to get the ANI in a service ?

Hi Guys,

Sorry for this long time ...

I found a solution for my problem ;-)

so I will give you my code (this is a prototype) :

this is my CallObserver :

import javax.telephony.*;

import javax.telephony.events.*;

import javax.telephony.callcontrol.*;

public class MyCallObserver implements CallObserver {

public void callChangedEvent(CallEv[] evlist)

{

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

{

if (evlist[i] instanceof ConnEv) {

String name = null;

Connection connection = null;

try

{

connection = ((ConnEv)evlist[i]).getConnection();

Address addr = connection.getAddress();

name = addr.getName();

}

catch (Exception excp)

{

// Handle Exceptions

}

String msg = "Connection to Address: " + name + " is ";

switch (evlist[i].getID())

{

case ConnAlertingEv.ID :

{

System.out.println(msg + "ALERTING");

CallEv call_event = (CallEv) evlist[i];

CallControlCall ccc = (CallControlCall) call_event.getCall();

Address ori_adresse = ccc.getCallingAddress();

System.out.println("The CALLER IS : " + ori_adresse.getName());

}

case ConnInProgressEv.ID :

{

System.out.println(msg + "INPROGRESS");

}

case ConnConnectedEv.ID :

{

System.out.println(msg + "CONNECTED");

}

case ConnDisconnectedEv.ID :

{

System.out.println(msg + "DISCONNECTED");

}

}

}

}

}

}

Now, I have to discover how to send info on the screen of the IP Phone ...

(push method)

Highlighted
Beginner

Re: How to get the ANI in a service ?

hi thierry, it's me again :-)

i have two more questions:

1) i got the caller id, but not with the getaddresscallinfo methode, but in the callobserver i print out the "name" when the state is "CONNECTED"! that's it! but how can i get the callerid to the phone? i think, i have to use a java url-connection and push it to an .asp file which invokes a database query and pushes the db-data to the phone? is this possible?

2) when i call the ip phone from external (f.e. with my handy) the calling number is displayed on the phone! is it possible to catch the displayed number with an http-get command?

thanks for your help!

jochen