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
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B
Accepted Solution

initiateCellularCall doesnt work on work side

Hi,

I have following code for initiating call

phone.initiateCellularCall(number);

 

this works fine on the personal side but doesnt work on the work side

 

let me know what could be the fix or do I have to use any alternative API ?

 

thanks

Please use plain text.
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B

Re: initiateCellularCall doesnt work on work side

Hi,

 

I tried with Invocation framework using following code

 

#include <bb/PpsObject>

void MyClass::makeCall(const QString& phNumber) {
     InvokeRequest request;

    request.setMimeType("application/vnd.blackberry.phone.startcall");
    request.setAction("bb.action.DIAL");
   
    QVariantMap map;
    map.insert("number", phNumber);
    QByteArray requestData = PpsObject::encode(map,NULL);
    request.setData(requestData);

    // Start the invocation
    InvokeManager *m_invokeManager = new InvokeManager(this);
    const InvokeTargetReply *reply = m_invokeManager->invoke(request);
    if (!reply) {
            qDebug() << "EclUtils::makeCall-error";
        }
  
}

 

but this code give compilation error 'PpsObject' has not been declared, though the PpsObject  in included and the 'encode' is a static function as per the documentation.

 

Any pointer on above compilation error please ?

 

just for trying this approach I replaced the PpsObject code line with below one

 

QByteArray requestData(phNumber.toAscii());//PpsObject::encode(map,NULL);

 

but that doesnt help, with this change the call loag application gets invoked on personal side ( BUT NO CALL INITIATION)

 

And on work side it doesnt even invoke the call log application

 

let me know any solution to this

 

Thanks

Lauvot

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: initiateCellularCall doesnt work on work side

[ Edited ]

Hi,
I think adding namespace should resolve the compilation error:

QByteArray requestData = bb::PpsObject::encode(map, NULL);

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B

Re: initiateCellularCall doesnt work on work side

Hi,

I tried

using namespace bb::PpsObject

 

and

using namespace bb::ppsobject

 

but it gives error

 

error: 'PpsObject' is not a namespace-name

 

 

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: initiateCellularCall doesnt work on work side

PpsObject is a class name.

Try:
using namespace bb;

Or use a fully-qualified form in message above which doesn't require using namespace.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B

Re: initiateCellularCall doesnt work on work side

Thanks

the bb::smileytongue:psObject::encode() works for the compilation error

 

Thanks a lot!!!

Please use plain text.
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B

Re: initiateCellularCall doesnt work on work side

so the below code works and I am able to make call on the personal side

#include <bb/PpsObject>

void MyClass::makeCall(const QString& phNumber) {
InvokeRequest request;

request.setMimeType("application/vnd.blackberry.phone.startcall");
request.setAction("bb.action.DIAL");

QVariantMap map;
map.insert("number", phNumber);
QByteArray requestData = bb::smileytongue:psObject::encode(map,NULL);
request.setData(requestData);

// Start the invocation
InvokeManager *m_invokeManager = new InvokeManager(this);
const InvokeTargetReply *reply = m_invokeManager->invoke(request);
if (!reply) {
qDebug() << "EclUtils::makeCall-error";
}

}

 

but it doesnt work on the work side

 

and in general any reference link which describes what all the different stuff we should consider while writing code so it shhould work on personal and work side

 

I am kind of clue less on the code works on the personal side but same doesnt on work side

 

thanks

Please use plain text.
Contributor
lauvot
Posts: 23
Registered: ‎01-01-2013
My Device: BlackBerry Dev Alpha B

Re: initiateCellularCall doesnt work on work side

even after specifying following permission in the bar-descriptor.xml its NOT working

<permission>access_phone</permission>

 

any help on how to fix this ?

Please use plain text.