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
Highlighted
Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Killing a call and placing another one instead

I have an application that, among other things, kills a call the user does and calls another number.

Works fine most of the time. A little to often I get "Call Failed" on the second call. And for no apparent reason. I had an issue with placing the new call instantly after killing the first call that resulted in that the secon call got killed too. A bit weird.  The first call is killed in "CallInitiated". I tried to use the Listener hooks on "CallEnded" to determine when I could place the second call. Does not work since the call is killed before it is connected. Tried to check with Phone.getactiveCall if it was null. Did not work either.

 

So I had to opt for fixed wait before placing the second call. It seems to work with a wait of 100 ms.

 

It does not matter if I use 100 ms or 750 ms, I still get to many failures and there seem to be no

regularity to it. It seems that I have to check if the call gets placed OK but the making of the call

seems to give no return code

 

        PhoneArguments pa = new PhoneArguments(PhoneArguments.ARG_CALL, Number);

        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pa);

 

Most of the time (Maybe every time) I get the three tones Di, Di, Da. Failure rate is around 25% but I can get 10 good calls in a row, and 3-4 bad calls in a row. I  can log my debugging and I have lots of debug statements but its nothing there.

 

Environment   OS 5.0,  Blackberry Bold

 

 

Any ideas anyone?

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: Killing a call and placing another one instead

Additional information

 

In those cases where I get "Call Failed" the ever present message "Call Forwarding - Conditional" has not been flashed on the screen.

 

I can think of possible scenarios:

 

1. I am not in contact with my mobile operator

2. Some kind of conflict between receiving the message and placing my call

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: Killing a call and placing another one instead

[ Edited ]

Additional info.

 

Diagnosing the intermittent error it shows "General Error" every time it happens. and it happens in about 20% of the tries.

 

Putting a 3 seconds sleep between killing the call and starting a new one seems to result in a significant improvement. I do not hink that is accepable. Is there some way to find out if the

phone is ready to take an outbound call?

 

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-