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
New Developer
Posts: 126
Registered: ‎06-09-2010
My Device: 9000
My Carrier: T Mobile
Accepted Solution

Get the number of an incoming call

Hi all,

As the Gold 10.2 SDK is released, they described in the changed log that:

 

ll.png

 

But in the SDK, I cannot find any property or function to get the number of icoming call. 

Do you have any suggestion or solution?

Thanks,

 

 

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Get the number of an incoming call

also failed to find something on this in documentation

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 169
Registered: ‎03-25-2011
My Device: Playbook, Z10 L.E.
My Carrier: Vodafone NL

Re: Get the number of an incoming call

I can't find either.

 

All that goodness, new APIs, out on the wild ... untammed, unused.

Cheers!
New Developer
Posts: 20
Registered: ‎07-21-2013
My Device: Q10
My Carrier: VZW

Re: Get the number of an incoming call

This has actually been working for me since the 10.2 beta1 release. The docs are here:

 

https://developer.blackberry.com/native/reference/cascades/bb__system__phone__phone.html?f=phone#fun...

Developer
Posts: 16,999
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Get the number of an incoming call


sunetos wrote:

This has actually been working for me since the 10.2 beta1 release. The docs are here:

 

https://developer.blackberry.com/native/reference/cascades/bb__system__phone__phone.html?f=phone#fun...


and where do you read the number? callUpdated gives you a Call object, but i don't see a number attribute on it.

----------------------------------------------------------
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
New Developer
Posts: 126
Registered: ‎06-09-2010
My Device: 9000
My Carrier: T Mobile

Re: Get the number of an incoming call

I knew the callUpdated() but how can you get the number of incoming call, which method or property?
New Developer
Posts: 20
Registered: ‎07-21-2013
My Device: Q10
My Carrier: VZW

Re: Get the number of an incoming call

From the docs on that same page, after a callUpdated or lineUpdated signal, the phone's "lines()" are populated. My code does something like this:

m_phone = new Phone(this);
bool res = QObject::connect(m_phone, SIGNAL(callUpdated(const bb::system::phone::Call&)), this, SLOT(onCallUpdated(const bb::system::phone::Call&)));

...

void ApplicationUI::onCallUpdated(const bb::system::phone::Call &call)
{
	CallType::Type callType = call.callType();
	CallState::Type callState = call.callState();

	if (callType != CallType::Outgoing) return;
	qDebug() << "Phone number:" << m_phone->activeLine().address();
}

 

New Developer
Posts: 126
Registered: ‎06-09-2010
My Device: 9000
My Carrier: T Mobile

Re: Get the number of an incoming call

I returns your own phone number not the number of the incoming call

New Developer
Posts: 20
Registered: ‎07-21-2013
My Device: Q10
My Carrier: VZW

Re: Get the number of an incoming call

Ack, you're right. I apologize for the misinformation. I tried this (and many variations) and it does not work despite the documentation saying it should:

 

void ApplicationUI::onCallUpdated(const bb::system::phone::Call &call)
{
	CallType::Type callType = call.callType();
	CallState::Type callState = call.callState();

	//if (callType != CallType::Outgoing) return;

	qDebug() << "gvbb call updated id: " << call.callId() << " type: " << callType << " state: " << callState;

	//if (callState == CallState::Connecting) {
	//if (callState == CallState::Incoming) {
	if (true) {
		bb::system::InvokeRequest request;
		request.setAction("bb.action.OPEN");
		request.setMimeType("application/vnd.blackberry.calllog.id");
		request.setData(QByteArray::number(call.callId()));
		//request.setData(QString(call.callId()).toUtf8());

		const InvokeTargetReply *reply = m_invokeMgr->invoke(request);
		if (reply) {
			QObject::connect(reply, SIGNAL(finished()), this, SLOT(processInvokeReply()));
			qDebug() << "reply finished? : " << reply->isFinished();
		} else {
			qWarning() << "Invoke Failed! Reply object is empty.";
		}
	}
}

void ApplicationUI::processInvokeReply()
{
	// Get the reply from the sender object
	bb::system::InvokeReply *reply = qobject_cast<bb::system::InvokeReply*>(sender());
	qDebug() << "invoke reply:" << reply->objectName() << " | " << reply->dynamicPropertyNames();
	reply->dumpObjectInfo();
	reply->dumpObjectTree();
}

 

New Developer
Posts: 126
Registered: ‎06-09-2010
My Device: 9000
My Carrier: T Mobile

Re: Get the number of an incoming call

Who is responsible for the Document for the new SDK? Can you please explain this?