Re: Re: [JTAPI] Incoming Telephone Number
Jörg Wiesmann <[email protected]> Tue, 13 Jun 2006 14:07:54 +0200
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <[email protected]> |
J=F6rg Wiesmann wrote:
> Hi Pavel,
>
> if you reach the "if loop",
> if (call !=3D null && call instanceof CallControlCall) {
>
> does your debugger step into or over it?
> Why dont you cast the call?
> What happends if you print out the following lines;
> - ((CallControlCall) call).getCalledAddress();
> - ((CallControlCall) call).getCallingTerminal();
> - ((CallControlCall) call).getCallingAddress();
>
>
> or if you switch the event to:
>
> // in that for loop, see first mail / answer
> // do not forget, to loop the events after getting a callChangedEvent
>
> if (events[i].getID() =3D=3D CallCtlConnEstablishedEv.ID) {
> System.out.println("called address:" + ((CallCtlConnEstablishedEv)
> events[i]).getCalledAddress() );
> System.out.println("calling address:" + ((CallCtlConnEstablishedEv)
> events[i]).getCallingAddress() );
> System.out.println("calling terminal:" + ((CallCtlConnEstablishedEv)
> events[i]).getCallingTerminal() );
> }
>
> did you implement the following classes: AddressObserver,
> TerminalObserver, CallControlCallObserver
> ?
>
> you may give us some more debug / outprintlines, to get closer to your
> problem...
>
> greetz J=F6rg Wiesmann
>
>
> pvseznam wrote:
>> Hi J=F6rg,
>>
>> Thanks for your reply.
>>
>> I have tried to add "observedAddress.addCallObserver(this);
>> observedTerminal.addCallObserver(this); "
>> and "callChangedEvent" function as you suggested. But the result
>> was:
>> CalledAddress=3DCallBridge TU
>> MyCallingAddress =3D null
>> when incoming call was coming.
>>
>> Recently I added all possible core package observers and listeners -
>> I only haven't casted calls to (CallControlCall) as you do. And I
>> stoped at proper places in debugger and went though structures but I
>> have not found the incoming number anywhere. Always the
>> callingAddress and callingTerminal are null.
>>
>> Thanks a lot for any help and suggestion,
>> Pavel
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------ P=F9vodn=ED zpr=E1va ------------
>> Od: J=F6rg Wiesmann <[email protected]>
>> P=F8edm=ECt: Re: [JTAPI] Incoming Telephone Number
>> Datum: 12.6.2006 23:17:14
>> ---------------------------------------------
>> Hi Pavel,
>>
>> the first try looks quite good, the only thing i see is, that the
>> call
>> maybe is null.
>> If you are saying you allready get some events, you may want to try
>> this:
>>
>>
>> first of all, your class has to implement some other classes:
>> like this: public class YOURCLASS implements AddressObserver,
>> TerminalObserver, CallControlCallObserver
>>
>> if you have done so, you have to add the observer to every "phone"
>> (address and terminal).
>> You can do it like that: (you do not need all of them, as i remember
>> :) )
>>
>> observedAddress.addCallObserver(this);
>> observedTerminal.addCallObserver(this);
>> observedAddress.addObserver(this);
>> observedTerminal.addObserver(this);
>>
>> if you have done so, you should have the following function
>> implemented:
>> public final void callChangedEvent(CallEv[] events)
>>
>> there i do get the numbers like this:
>>
>> //
>> public final void callChangedEvent(CallEv[] events) {
>> for (int i =3D 0; i < events.length; i++) {
>> Call call =3D events[i].getCall();
>> try {
>> if (call !=3D null && call instanceof CallControlCall) {
>> Address myCalledAddress =3D ((CallControlCall)
>> call).getCalledAddress();
>> Address myCallingAddress =3D ((CallControlCall)
>> call).getCallingAddress();
>> System.out.println (myCalledAddress.getName());
>> System.out.println (myCallingAddress.getName());
>> } else {
>> if (call=3D=3Dnull) System.out.println ("call is null
>> .. ");
>> } catch (Exception e) {
>> //someting went wrong :(
>> e.printStackTrace();
>> }
>> }
>>
>> if it does not help you, just write down, what exactly is going
>> wrong.
>> greetz J=F6rg Wiesmann
>>
>>
>> Pavel Vesely schrieb:
>>
>>> Hi All,
>>>
>>> I would like to get a telephone number of incoming calls. I am
>>>
>> able to make
>>
>>> a call and I am getting events - it means the instalation should
>>>
>> be OK.
>>
>>> I am using GJTAPI with TAPI 3.0 Provider. And I have an optiPoint
>>>
>> 500 /
>>
>>> HiPath 3000 / CallBridge TU TAPI. If I use directly the TAPI with
>>>
>> C++
>>
>>> everything is fine but with JAVA I don't get the telephone number.
>>>
>>
>>
>>> Please, could you help me?
>>>
>>> Thanks a lot,
>>> Pavel
>>>
>>> I am using two ideas that I have found on this forum but no
>>>
>> success:
>>
>>> if (ev instanceof TermConnRingingEv) {
>>> // first try
>>> String A_number;
>>> String B_number;
>>> CallControlCall call =3D (CallControlCall)ev.getCall();
>>> if(call instanceof CallControlCall) {
>>> Address myCalledAddress =3D
>>> ((CallControlCall)call).getCalledAddress();
>>> Address myCallingAddress =3D
>>> ((CallControlCall)call).getCallingAddress();
>>> A_number=3DmyCallingAddress.getName();
>>> B_number=3DmyCalledAddress.getName();
>>> System.out.println("\n\nA=3D"+A_number+" B=3D"+B_number);
>>> }
>>>
>>> // second try
>>> TerminalConnection tc =3D ((TermConnEv)ev).getTerminalConnection();
>>>
>>
>>
>>> try {
>>> Call c =3D ev.getCall();
>>> Connection m_connections[] =3D c.getConnections();
>>> TerminalConnection termCons[] =3D
>>> m_connections[0].getTerminalConnections();
>>> TerminalConnection termCon =3D termCons[0];
>>> Terminal t =3D termCon.getTerminal();
>>> Address a[] =3D t.getAddresses();
>>> String incoming =3D a[0].getName();
>>> System.out.println("address is "+incoming);
>>> System.out.println("terminal is "+t.getName());
>>> System.out.println("the phone is ringing");
>>> } catch (Exception excp) {
>>> excp.printStackTrace();
>>> }
>>> }
>>>
>>> =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 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".