Re: get Calling number from redirected call

Jörg Wiesmann <[email protected]> Thu, 20 Jul 2006 23:39:11 -0600
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <LISTSERV%[email protected]>
You can get the number by catching the events and get the call.
if you got a listener, the callChangeEvent will be raised.
There you can get the calls and figure out what number called you or you did=

call ...

public final void callChangedEvent(CallEv[] events) {
   for (int i =3D 0; i < events.length; i++) {
   [...]
      // CISCO EXAMPLE:
      Address myCalledAddress =3D (
(CiscoCall)(events[i]).getCall()).getCalledAddress();
      Address myCallingAddress =3D (
(CiscoCall)(events[i]).getCall()).getCallingAddress();

... }

watch out that the getCall is not null ..

how to set the listener: ( if you did not do so allready )

public void initialize(Address observedAddress, Terminal observedTerminal) {=

  if (observedAddress !=3D null) {
 try {
   // adding the address ( thats our telnumber )
  observedAddress.addCallObserver(this);
  observedTerminal.addCallObserver(this);
  // Now add observer on Address and Terminal
  observedAddress.addObserver(this);
  observedTerminal.addObserver(this);
 } catch (ResourceUnavailableException e) {
     // do something
        } catch (MethodNotSupportedException e) {
     // do something
        }
   }
}

Hope it helps

Greetz J=F6rg Wiesmann

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".