cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Detecting when a call is an inbound call or outbound call.

102
Views
0
Helpful
0
Comments
This document was generated from CDN thread

Created by: Dan Nelson on 22-12-2008 09:52:20 PM
Hello,

I am very new to JTAPI and the phone world, but I am slowley moving forward with what I am trying to accomplish in building a Caller ID application with jtapi.

I was wondering if I should be detecting if a call is inbound or outbound in a different manner.

Right now I am doing this:

Outbound call:
1. Catch META_CALL_STARTING event.
2. Catch CallActiveEvt
3. Check to see if CallActiveEvt.getCause() == Ev.CAUSE_NEW_CALL

Inbound call:
1. Catch META_CALL_STARTING event.
2. Catch CallActiveEvt
3. Check to see if CallActiveEvt.getCause() == Ev.CAUSE_NORMAL

The only difference is the result of the Event.getCause() function.

Anyone have a better solution to this, or this it?

Thanks for any feedback.

-Dan

Subject: Re: Detecting when a call is an inbound call or outbound call.
Replied by: Mohan Potluri on 22-12-2008 10:31:06 PM
Another option:
If it is an outbound call, you should see CallCtlConnDialingEv and for
inbound calls you should see CallCtlConnOfferedEv and
CallCtlConnAlertingEv.

Subject: Re: Detecting when a call is an inbound call or outbound call.
Replied by: Dan Nelson on 22-12-2008 11:06:28 PM
Thanks for the response Mohan.

The only issue I have with catching the "CallCtlConnDialingEv" event is that this event doesn't get fired until a I receive a META_CALL_PROGRESS event.

I really want to determine if this is an inbound call or outbound call within the "META_CALL_STARTING" event.

-Dan

Subject: Re: Detecting when a call is an inbound call or outbound call.
Replied by: Stephan Steiner on 05-01-2009 10:45:30 AM
What exactly is the end goal of your application? I've written my own caller list application which works without the meta events entirely - and the only situation where I can see where you'd want to start really early in the call is for outbound calls (where I start with ConnCreatedEv) ..
and I determine if a call is incoming or outgoing by looking at the CiscoCall object:

public boolean isIncomingCall(CiscoCall call)
{
Address called = call.getCurrentCalledAddress();
Terminal term = call.getCallingTerminal();
if (!term.equals(this.term) && isMyLine(called))
return true;
else
return false;
}
public boolean isMyLine(Address adr)
{
if (adr == null)
return false;
boolean retval = false;
for (Address a : term.getAddresses())
{
if (a.equals(adr))
retval = true;
}
return retval;
}

Basically I'm looking at the calling number and check if it's a line that belongs to the terminal that got the event (I have an instance of my own terminal class per terminal I monitor).
CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards