Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Shraddha
Posts: 34
Registered: ‎07-25-2008
My Device: Not Specified

Problem injecting phonecall

i am trying to inject a call programatically through my blackberry application using the Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, new PhoneArguments(
            PhoneArguments.ARG_CALL, <phonenumber string here>);

 

This code works perfect for lower versions of BB OS that is less than 5.0. Above this version, the behaviour is kind of unpredictable.

5.0 onwards, the phoneApp throws a null pointer in some cases and sometimes it just hangs the phone.

 

I am not able to test this much on device for now. In simulators, 9550 simulator throws a null pointer in call Initiated method (the stack traces it to CallManager.phoneEventNotify API within the phone applcation.)

I suspect this null pointer translates to bigger issues on higher version of OS...

DOes anybody have any information about this behavior of the API? Any pointers of what could be the issue ?

 

I'll add more information to the post if needed.

 

THanks in advance

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem injecting phonecall

are you positive that this issue also occurs on a real device?
if it is only a simulator, check for a newer version or ignore the error.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
swap_chau
Posts: 179
Registered: ‎06-15-2011
My Device: Storm 9550
My Carrier: Vodaphone

Re: Problem injecting phonecall

Peter is right, I am using the same code to originate call, and it is working fine for torch, bold 9900, storm 9530, bold 9630. I checked on these devices.

Please use plain text.
Developer
Shraddha
Posts: 34
Registered: ‎07-25-2008
My Device: Not Specified

Re: Problem injecting phonecall

[ Edited ]

i initially felt it was only on simulator.. but on BB OS 6 onwards the phone application is getting stuck when i inject the phoencall, says something like... uncaught exception- Phone application (net_app_phone..something of that sort) is not responding.

 

So i suspect the simulator thing might be translating to this on the newer OS.

(Also, i didn't suspect the application logic much because we have no issues injecting the call using the same code on 4.5, 4.6, 4.7 and 5.0 devices or simulators... started from 9800)... i understand the APIs haven't changed.. but somehow feel that null pointer on simulator shouldn't be ignored to avoid issues on devices.. so any idea why that may be happening

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem injecting phonecall

and you don't do anything else with the call, for example in a phonelistener?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Shraddha
Posts: 34
Registered: ‎07-25-2008
My Device: Not Specified

Re: Problem injecting phonecall

This is what i am doing

- listen to phone call event

- look for a particular type of number

- end this call if numebr fits the criteria

<no issues upto this step>

- inject the call (different number) by invoking phoneapp

<on 9550 simulator when i get the pop-up to answer or disconnect the call i get nullpointer here>

- let this call proceed as usual... we dont need to do anything with this call.

 

 

 

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem injecting phonecall

the phonelistener runs in the context of the phone application.
if you block the listener, for example with a modal dialog, the phone application is also blocked and will be killed by the system after some time ("xxx is not responding")

to avoid this move the context to your own application via global events.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Shraddha
Posts: 34
Registered: ‎07-25-2008
My Device: Not Specified

Re: Problem injecting phonecall

Thanks Simon....
You may be right i'll try this out... it'll be a while before i can verify this though.
Also, this is when we invoke the phoneApplication and i presumed the background thread which is a phoneListener is still working.

Hmm.. so i either move the context to my application or may be relaunch the background phonelistener app too? will i need to re-register the phone listener ?
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem injecting phonecall

where you do the processing is not too important, just don't execute any blocking code in the phonelistener.
and be aware that, if you call UiApplication.getUiApplication there, for example, you get the phone app, not your own.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.