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: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor
Accepted Solution

making a call in a different way

Normally when placing a call I do it like this:

 

PhoneArguments pa =

new PhoneArguments(PhoneArguments.ARG_CALL, newNumber);

Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pa);

What I wonder is if it is possible to first invoke the phone and then send dtmf-tones instead?

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: making a call in a different way

Yes, you can invoke the phone application to make a phone call and then inject DTMF tones into the call.  After invoking the phone application to dial a number use the Phone.getActiveCall() method to obtain an instance of PhoneCall, then use it to call the sendDTMFTone(s) methods.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: making a call in a different way

Must be doing something wrong.  ph is always null;

 

 

     boolean result;

     Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, null);
      try
        {
         Thread.sleep(waitTime);  
        }catch(Exception e33)
        {
        comm.HandleAlert(settings.Debug, "PlaceCall, sleep failed:  " + e33, 0);  
        }
       
        PhoneCall ph = Phone.getActiveCall();
        if(ph==null)
         {
          comm.HandleAlert(settings.Debug, "PlaceCall2  ph == null",0);
          return;
         }

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: making a call in a different way

Passing in null will only launch the phone application.  It won't dial out/create an outbound call.

 

You'll need to specify a number when invoking the phone application to dial out.  Once the call has been made you can inject DTMF tones into the call.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: making a call in a different way

Ah!

 

That I do already. My original question was not clear enough. The problem I have with placing a call the "ordinary" way is that it really does not give any feedback whatsoever.

 

            PhoneArguments pa = new PhoneArguments(PhoneArguments.ARG_CALL, Number,false);
            Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pa);

 

So I wondered if I could establish a connection and then inject DTMF tones.

 

The problem I am trying to circumvent is that I get "Call Failed" with description "General Error" now and then when making a call the ordinary way so I would like to do the call in steps that can be monitored, like 1. get a line, 2 get contact. 3. dial a number

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: making a call in a different way

The PhoneListener is the closest you'll get to that.  Your application can be alerted if the call was answered, failed, busy, etc...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 553
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: making a call in a different way

OK,

 

thats what I got already. "General Error".  Get the "Call Failed", "General Error" now and then. DOes not seem possible to intercept that and try again, the message displays on screen. Thats why I was looking for an alternate way.

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