Re: get Calling number from redirected call
Jörg Wiesmann <[email protected]> Fri, 21 Jul 2006 10:49:11 +0200
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <[email protected]> |
Hi,
You have to do it your own, there is just a little help like this:
if (events[i].getID() =3D=3D CallCtlTermConnHeldEv.ID) {
CallCtlTermConnHeldEv connHeldEv =3D
(CallCtlTermConnHeldEv)events[i];
connHeldEv.getCalledAddress()
connHeldEv.getCallingAddress()
}
you now have to store your numbers and the terminal as key.
If you now get called by a terminal, which has a "holdnumber", you may
display it
and delete afterwards.
But thats just a workaround .. maybe there is another way, to get the
number ..
for example, you could get the terminal of the calling partner and
iterate over the
connections ..
like this: ( not tested .... )
for (int a=3D0;a<tc.length;a++) {
CallControlCall ccCall =3D
(CallControlCall)tc[a].getConnection().getCall();
if (ccCall.getState() =3D=3D CallControlCall.ACTI=
VE) {
ccCall.getCalledAddress();
ccCall.getCallingAddress();
}
}
but as i said, i never tested that ...
If it works then let me know :)
greetz J=F6rg Wiesmann
Milan Matys wrote:
> Thanks for this information, but I have this done.But I learned somethi=
ng
> new from your example. I have problem with showing Caller number, when =
is
> call redirected. For example to your company came outside call from tel=
.
> number 111. Secretary (tel. Number 222) take this call and redirect it =
to
> someone else (tel. Number 333). I' want to show on display of this tele=
phone
> (333) a number of call incoming from outside (111). But I'm able only t=
o
> show number of secretary phone (222).
> Is in jtapi any event or something which can show me that call was redi=
rect?
>
>
> Have a nice day
>
> Milan Matys
>
> -----Original Message-----
> From: Discussion list for Java Telephony API
> [mailto:[email protected]] On Behalf Of J=F6rg Wiesmann
> Sent: Friday, July 21, 2006 7:39 AM
> To: [email protected]
> Subject: Re: [JTAPI] get Calling number from redirected call
>
> 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 yo=
u 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 observedTermin=
al) {
> 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".
>
> =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".
>
>
>
=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 bo=
dy
of the message "signoff JTAPI-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".