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

Native Development

Reply
Developer
Posts: 68
Registered: ‎03-12-2013
My Device: BB Z10
My Carrier: Rogers
Accepted Solution

Invoking the phone to dial a number

I am trying to dial a telephone number from my application running on my BB Z10. I have been able to launch the phone application and bring it to focus but it does not dial the number. I have tried the following to dial 9999 as the number:

 

navigator_invoke_invocation_create(&iRequest);

navigator_invoke_invocation_set_id(iRequest, "1");

navigator_invoke_invocation_set_action(iRequest, "bb.action.DIAL");

navigator_invoke_invocation_set_type(iRequest, "application/vnd.blackberry.phone.startcall");

string data = "{\"number\" : \"9999\"}";

navigator_invoke_invocation_set_data(iRequest, data.c_str(), data.length());

navigator_invoke_invocation_send(iRequest);

navigator_invoke_invocation_destroy(iRequest);

 

I have also tried sending as URI instead of data:

 

navigator_invoke_invocation_create(&iRequest);

navigator_invoke_invocation_set_id(iRequest, "1");

navigator_invoke_invocation_set_action(iRequest, "bb.action.DIAL");

navigator_invoke_invocation_set_type(iRequest, "application/vnd.blackberry.phone.startcall");

navigator_invoke_invocation_set_uri(iRequest, "data://local?number=9999");

navigator_invoke_invocation_send(iRequest);

navigator_invoke_invocation_destroy(iRequest);

 

In both cases the phone appears but does not dial.

Highlighted
Developer
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10
My Carrier: Rogers

Re: Invoking the phone to dial a number

Well, not sure if this would help you or not, if you insist on using Invocation and stuff..

 

There's always this:

https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html

 

And the Cascades API sample "Call a pizza" uses it even though it's Cascades, I'm sure you could use it in C++...

Developer
Posts: 217
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Invoking the phone to dial a number

You could do this.

 

Phone phone;
phone.initiateCellularCall(number);

 Using the Phone class.

 

https://developer.blackberry.com/cascades/reference/bb__system__phone__phone.html