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: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
Accepted Solution

Incoming/Outgoing call phone number, Phone log listener?

Yes. There is a object phone exists, there is a signal onCallUpdated. But how to retrieve phone number?

 

Another question - in BBOS has been PhoneLogListener object. I can't find alternative in new BB10. How to access to the Phone Log?

Developer
Posts: 16,584
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Incoming/Outgoing call phone number, Phone log listener?

the phone number is linked in the line object, you could get it by using sender() on the event i think (to get the phone object and query that).

i don't think phonelogs are available as an api yet, but i would not mind to be proved wrong :smileyhappy:
----------------------------------------------------------
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
Developer
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Incoming/Outgoing call phone number, Phone log listener?

Developer
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Incoming/Outgoing call phone number, Phone log listener?

Can you provide example?

 

void TestPhone::onCallUpdated(const bb::system::phone::Call &call) {
	m_CallState = 0;
    CallState::Type state = call.callState();

    if(state ==  CallState::Incoming )
    {
    	m_CallState = 1;
    }
    emit callStateChanged();
}

 

Developer
Posts: 16,584
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Incoming/Outgoing call phone number, Phone log listener?

you can access the sender of a signal by calling sender(), in your case that would be the Phone class i guess.
----------------------------------------------------------
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
Developer
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Incoming/Outgoing call phone number, Phone log listener?

Thanks! Found it!!!

 

Works! :smileyhappy:

Developer
Posts: 1,533
Registered: ‎07-14-2008
My Device: Z10

Re: Incoming/Outgoing call phone number, Phone log listener?

Does is give you the caller phone number or just the line number of your own phone?


Contributor
Posts: 17
Registered: ‎09-05-2012
My Device: 9780 Bold

Re: Incoming/Outgoing call phone number, Phone log listener?

Hello, with the phone object, i can only get my own number with:

Phone phone;
phone.activeLine().description();

 What did you do to get the caller number or the number called?

Thanks

Developer
Posts: 652
Registered: ‎02-03-2010
My Device: Z10 LE

Re: Incoming/Outgoing call phone number, Phone log listener?


AlexXF wrote:

Thanks! Found it!!!

 

Works! :smileyhappy:


Would you mind sharing the code to get the phone number of the person who called....haven't figured out how to that yet.  Thanks.


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
New Member
Posts: 4
Registered: ‎04-01-2013
My Device: blackberry z10

Re: Incoming/Outgoing call phone number, Phone log listener?

Alex, do you ses the number you calcul or your own number?