cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
448
Views
0
Helpful
4
Replies

Currently Talking / Connected to a Phone

jwiesmann123
Level 1
Level 1

Hi all,

i maybe got an easy or a difficult question, but i do not know what to do anymore.

I just want to know if someone is talking with anybody else.

i do know, that i can catch any events by using a callobserver, but the events

CallCtlConnEstablishedEv

or

ConnCreatedEv

or similar are raised, if i reached a network, if the phone i want to call is ringing and so on ...

i just want to know, is there anything i can ask for (CTI or AXL), which easily tells me, that a phone is connected.

I do not care if it is an internal or external, outgoing or incoming call.

I just want to know if a guy is currently talking or not!

That cannot be to difficult....

thx a lot

1 Accepted Solution

Accepted Solutions

stephan.steiner
Spotlight
Spotlight

CallCtlConnEstablishedEv.ID is a safe bet, if you do check both direction of the call and who got you the message. You can also simply query the terminal, get the active connections and check their state, as well as the call as a whole.

If you want to create some kind of BLF, there's the devicestate server that gets you all devices in a certain state, and state changes. Based on those events, you could go further, following the JTAPI call hierarchy and states to determine the exact state of a call, who's talking, etc.

View solution in original post

4 Replies 4

stephan.steiner
Spotlight
Spotlight

CallCtlConnEstablishedEv.ID is a safe bet, if you do check both direction of the call and who got you the message. You can also simply query the terminal, get the active connections and check their state, as well as the call as a whole.

If you want to create some kind of BLF, there's the devicestate server that gets you all devices in a certain state, and state changes. Based on those events, you could go further, following the JTAPI call hierarchy and states to determine the exact state of a call, who's talking, etc.

Hi Stephan,

thank you for your reply, but what do you mean with BLF?

How can i use that?

I wrote a application, which catches every event from more than 100 phones with jtapi.

But to know when you are really connected, i do not figure out. I made an excel sheet with all actions / events, which are raised.

And tried to get that working, but as you can imagine, it is not working as expected.

For example, there is no "CallCtlConnEstablishedEv" when you have been called from a mobile phone ( or you have called a mobile phone .. i do not know exactly, but i know that "CallCtlConnEstablishedEv" is NOT always raised. BUT it is sometimes raised, if you just want to call anybody ( without knowing if the called person will pick up the phone ...)

What i need to know is how long a phonecall took ( like on the display of a ciscophone ).

So why there is not an event like "connectionEstablishedAndPhonePickedUp" :) for that what i need.

If you do know TAPI, there is a event called "LINECALLSTATE_CONNECTED", thats it. That is what i would like to have.

You may know a working way? Also would accept some java code :).

Joerg

Maybe it is hard to understand, what i mean, here i have an example.

I want to call a terminal from another terminal:

Following states are deliverd, if i read them at the CallCtlConnEstablishedEv.

Just RINGING:

=============

callControlConnection.getCallControl: 88

callControlConnectionState: 51

callControlConnection.getCall().getState(): 33

getCallControlCause100

getMetaCode129

getID206

Cause100

tcon (0) cT.getDeviceState()1

tcon (0) cT.getRegistrationState()1

tcon (0) cT.getState()1

tcon (0) getState67

tcon (0) getConnection[532/(P1-vde) GCID=(1,307446)->ACTIVE]->ESTABLISHED

tcon (0) getConnection.getState51

Now CONNECTED

==============

callControlConnection.getCallControl: 88

callControlConnectionState: 51

callControlConnection.getCall().getState(): 33

getCallControlCause100

getMetaCode129

getID206

Cause100

tcon (0) cT.getDeviceState()1

tcon (0) cT.getRegistrationState()1

tcon (0) cT.getState()1

tcon (0) getState67

tcon (0) getConnection[532/(P1-vde) GCID=(1,307446)->ACTIVE]->ESTABLISHED

tcon (0) getConnection.getState51

The states are exactly the same (just take a look at the ids)

(cT = CiscoTerminal, tcon = terminalConnection)

And i do want to know, where there is a difference between ringing and talking, without tracing all states and compare them etc.

I hope you can help me.

I got it now,

these two words of Stephan (both directions), did what i needed to understand.

Thanks a lot.

For anybody who cares about, this is the code i am using now:

public void callChangedEvent(CallEv[] arg0) {

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

try {

if (arg0[i].getID() == CallCtlConnEstablishedEv.ID ) {

CallControlConnection callControlConnection = (CallControlConnection) ((CallCtlConnEstablishedEv) arg0[i]).getConnection();

CallControlCall call = (CallControlCall) callControlConnection.getCall();

Connection[] conns = call.getConnections();

boolean connected = true;

for (int k=0;k

CiscoConnection ciscoConnection = (CiscoConnection)conns[k];

if (conns[k].getState() != Connection.CONNECTED ||

ciscoConnection.getCallControlState() != CallControlConnection.ESTABLISHED) connected = false;

}

if (connected) System.out.println("CONNECTED...");

}

} catch (Exception e) {

System.out.println("Catched exception: " + e);

}

}

}