How to get the phone # correspondent to disconnected call?

Hi all

My requirement is to get the call disconnected phone number, I set up PhoneListner and tried to get the number as

PC net.rim.blackberry.api.phone.PhoneCall = net.rim.blackberry.api.phone.Phone.getCall (callId);

But the pc is always returned null in the callDisconnected method.

Here is my code snippet: -.

public void callDisconnected (int callId)
{
Logger.SOP ("callId getPhoneNumber:" + callId);
Logger.Debug ("callDisconnected: [" + getPhoneNumber (callId) + "]");

}

public String getPhoneNumber (int callId) {}
PC net.rim.blackberry.api.phone.PhoneCall = net.rim.blackberry.api.phone.Phone.getCall (callId);
       
if(PC == null) {}
Returns a null value.
}
String phNumber = pc.getDisplayPhoneNumber ();
If (phNumber.indexOf(' ') > 0) {}
phNumber = phNumber.substring (phNumber.indexOf(' '));
phNumber = phNumber.trim ();
}
Return phNumber;
}

BlackBerry OS version is: 4.6.0.92 9000 Blackberry (Bold)

I ran this code on a simulator.

I had similar problems, but resolved them while recording the phone number in a hash inside the callConnected/callInitiated/callIncoming... you call it.

Hashtable phoneCallsHash = new Hashtable();
...
phoneCallsHash.put("" + aCallID, phone.getCall(aCallID).getDisplayPhoneNumber());

get it back later (in callDisconnected):

(String)phoneCallsHash.get("" + aCallID);

That should do it.

Tags: BlackBerry Developers

Similar Questions

  • How to get the phone and messages back in my dock apps? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    How can I get the phone and messages apps in my dock? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?

    Try

    Settings > general > reset > reset home screen presentation.

    Note: All other applications will be organised by alphabetical order.

  • How to get the phone for example number zero. 0612345678

    Dear Adobe Flex Builder Professional,

    I have a problem with getting the phone for example number zero. 0612345678

    If I get the phone number following as input:

    0612345678

    I'll get the phone number in output:

    612345678

    The application was written in Adobe Flex Builder 3.

    The code in the MXML file is:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Canvas xmlns:mx = "http://www.adobe.com/2006/mxml"
    creationComplete = "init ()" "
    horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >

    < mx:Metadata >
    [Event (name = "customerSaveEvent", type = "events. CustomerEvent")]
    [Event (name = "customerCancelEvent" type = "flash.events.Event")]
    < / mx:Metadata >

    < mx:Script >
    <! [CDATA]
    Import util.ComboBoxUtil;
    Import mx.controls.Alert;
    How to import events. CustomerEvent;
    Import mx.collections.ArrayCollection;
    Import mx.core.Application;
    Import valueObject.Customer;
    Import mx.validators.Validator;
    Import mx.validators.PhoneNumberValidator;

    private var phoneCheck:PhoneNumberValidator;

    [Bindable]
    public var selectedCustomer:Customer;

    private function init (): void {}
    this.cretePhoneValidator ();
    if(this.selectedCustomer == null) {}
    this.clearForm (null);
    }
    }

    private function cretePhoneValidator (): void {}
    phoneCheck = new PhoneNumberValidator();
    phoneCheck.source = phone number;
    phoneCheck.property = 'text ';
    }

    private function validateForm (): void {}
    var validatorList:Array = new Array (emailCheck, phoneCheck);
    Validator.validateAll (validatorList);
    }

    private function cancelClickHandler (): void {}
    var cancelManageCustomerObj:Event = new Event ("customerCancelEvent");
    dispatchEvent (cancelManageCustomerObj);
    }

    private function saveCustomer (): void {}
    validateForm();

    var c:Customer = null;
    var selCust:Customer = Application.application.selectedCustomer;

    If (selCust! = null) {}
    c = selCust;
    } else {}
    c = new Customer();
    }
    c.setLastName (lastName.text);
    c.setFirstName (firstName.text);
    c.setStreet (street.text);
    c.setPostal (postal.text);
    c.setCity (city.text);
    c.setEmail (email.text);
    c.setPhoneNumber (new Number (phoneNumber.text));
    c.setMailing (mailing.selectedItem.data);
    c.setComment (comment.text);
    var changed: client = Application.application.customerService.createOrUpdate (c);

    var customerEventObj:CustomerEvent = new CustomerEvent ("customerSaveEvent", modified);
    dispatchEvent (customerEventObj);

    this.clearForm (selCust);
    }

    private void clearForm(selCust:Customer):void {}
    if(selCust == null) {}
    this.lastName.text = "";
    this.firstName.text = "";
    This.Street.Text = "";
    This.postal.Text = "";
    This.City.Text = "";
    this.phoneNumber.text = "";
    This.email.Text = "";
    this.mailing.selectedIndex = 0;
    This.Comment.Text = "";
    }
    focusManager.setFocus (lastName);
    }
    []] >
    < / mx:Script >

    <!-mx:EmailValidator id = "emailCheck" source = "{email}" = "text" property
    trigger = '{save}' triggerEvent = ' click on ' /-->

    < mx:Form id = "manageCustomerForm" >
    < mx:FormItem label = "Achternaam:" >
    < mx:TextInput id = text = "{selectedCustomer.getLastName ("lastName")}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Voorletters:" >
    < mx:TextInput id = text = "{selectedCustomer.getFirstName ("firstName")}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Straat:" >
    < mx:TextInput id = text = "{selectedCustomer.getStreet () ' street'}" / >
    < / mx:FormItem >
    < mx:FormItem label = "zip code:" >
    < mx:TextInput id = text = "{selectedCustomer.getPostal ('post')}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Stad:" >
    < mx:TextInput id = "City" text = "{selectedCustomer.getCity ()}" / >
    < / mx:FormItem >
    < mx:FormItem label = "number:" >
    < mx:TextInput id = text = "{selectedCustomer.getPhoneNumber ('Phone number')}" / >
    < / mx:FormItem >
    < mx:FormItem label = "e-mail:" >
    < mx:TextInput id = "email" text = "{selectedCustomer.getEmail ()}" / >
    < / mx:FormItem >
    < mx:FormItem label = "" unstable: ">"
    < mx:TextArea id = "comment" text = "{selectedCustomer.getComment ()}" "
    width = "447" height = "144" / >
    < / mx:FormItem >
    < mx:FormItem label = "send:" >
    < mx:ComboBox id = dataProvider = "{Application.application.comboBoxUtil.yesNo"mailing"} '"
    selectedIndex = "{ComboBoxUtil.getIndex (selectedCustomer.getMailing ())}" / >
    < / mx:FormItem >
    < mx:HBox id = "manageButtonBox" >
    < mx:Button id = "Save" label = "Opslaan" click = "saveCustomer ()" / > "
    < mx:Button id = "resetButton" label = "Wis" click = "clearForm (null)" / > "
    < mx:Button id = "cancelButton" label = "Annuleer" click = "cancelClickHandler ()" / > "

    < / mx:HBox >
    < / mx:Form >
    < / mx:Canvas >

    The code in the SQL file is:

    create the customer table)
    ID integer not null primary key autoincrement,.
    lastName varchar (50),
    firstName varchar (50),
    Street varchar (50),
    City varchar (50),
    postal varchar (10),
    Telephone INT number (10),
    Email varchar (50),
    sending Boolean default false,
    Comment by varchar (255)
    );

    create table (treatment)
    ID integer not null primary key autoincrement,.
    Date Date,.
    treatment varchar (255),
    whole customerId not null,
    constraint fk_customer foreign key (customerId) references customer (id)
    );

    create table (user)
    ID integer not null primary key autoincrement,.
    loginName varchar (50) not null,
    lastName varchar (50) not null,
    firstName varchar (50) not null,
    password varchar (50) not null,
    Active Boolean true not null default,
    accessright varchar (10) not null
    );

    create table (of the order of the day
    ID integer not null primary key autoincrement,.
    whole userId not null,
    Date Date,.
    time integer,
    full minute,
    Description varchar (50),
    constraint fk_user foreign key (userId) references user (id)
    );

    create table (license)
    ID integer not null primary key autoincrement,.
    key varchar (50),
    Val varchar (50)
    );

    I hope someone can help me with this problem.

    Hi Buxsnl,

    I think that I already gave the answer in my previous post. But think that you have not implemented it.

    The threshold of the code is not necessary...

    m:System.NET.SocketAddress.ToString (), c.setPhoneNumber (new Number (phoneNumber.text));

    Instead you can replace it with the below a...

    c.setPhoneNumber (phoneNumber.text);

    and the function setPhoneNumber() in your client class must be less to:

    public void setPhoneNumber(phoneNumber:String):void

    {

    //

    }

    Can send you the code to your client class... ??

    Thank you

    Jean Claude

  • How to get the phone's public IP address?

    I need to recover the public phone IP address, how do I do this?

    Did search you the Forums before posting?

    https://supportforums.BlackBerry.com/T5/native-development/get-IP-address-of-WiFi/m-p/2460215#M26157

    https://supportforums.BlackBerry.com/T5/native-development/how-to-get-WiFi-IP-address-in-BlackBerry-...

    https://supportforums.BlackBerry.com/T5/native-development/getting-the-IP-address-of-the-device/m-p/...

    http://doc.Qt.IO/Qt-4.8/qnetworkinterface.html

  • How to get the phone in ongoing call screen

    It is a follow-up on the menu of the phone not shown thread.

    I checked with the KB and found an interesting topic: How - to upgrade a screen on the main event Thread

    My original question (as can be seen in the thread has already been mentioned) was to know how to draw something on the screen of the phone.

    Example:

    (1) a user accepts a call.

    (2) my application implements PhoneListener and in callConnected() just draws a picture on the top of the phone application

    (3) all the features of the phone (menu of the phone for example) are preserved.

    The article mentioned shows that it is possible to draw something on a screen.

    How can I get an instance of the phone screen?

    Here is my proposal (but it does not work):

    public void callConnected(int arg0){ UiApplication.getUiApplication().invokeLater(new Runnable()        {
    
                public void run()            {                Screen screenName = UiApplication.getUiApplication().getActiveScreen();                //Perform screen changes here.                Graphics g = screenName.getGraphics();                g.setColor(0xFF8080);                g.fillRect(10, 10, 100, 100);                //Calling invalidate() on your screen forces the paint                 //method to be called.                 screenName.invalidate();            }        }); }
    

    How to make the getUiApplication() to pick up the phone?

    Do you ever feel like you're talking to yourself ?

    That's what I had:

    //Calling invalidate() on your screen forces the paint                 //method to be called.                 screenName.updateDisplay();                //screenName.doPaint();                //screenName.invalidate();
    

    Why the work of updateDisplay doPaint (as well as his brothers and sisters invalidate()) does not work?

    But, alas, my efforts have been in vain.

    The 'red square' disappears when something is painted on them -ruins it a bit.

    So, I guess, my quest continues.

    Someone has an idea how draw a persistent image on the VoiceApp and always to enable all the features of VoiceApp (menu, for example)?

  • How to get the phone to ring several times before the voicemail picks up

    Is there a setting to let the phone ring several times before the voicemail picks up

    This option will be controlled by your wireless operator. Contact them to determine whether it is possible to change the response time of voicemail.

  • Get the phone number of incoming calls

    Greetings!

    Yes! I read a lot about these subject through this forum, but no solution so far.

    We are trying to retrieve the number of incoming phone currently but ((callId) Phone.getCall or Phone.getActiveCall) are return null, so I'm not able to recover the number, getDisplayPhoneNumber().

    Implementation of the PhoneListener or the AbstractePhoneListener extension the result is the same, as expected.

    Our first objective is Blackberry 8900 v4.6.1.250 (Platform 4.2.0.113), so far without success.

    Does work for sorting?

    Thanks in advance!

    I use this method with success in all kinds of OS versions.

    I would say to start own thread, it may need to wait a little time, but generally a callincoming should already have a call in progress.

    4.6 on the returned string may contain invalid characters (such as '?'), look for these.

  • iPhone Sync with PCI trying to sync my iphone to my computer via i-tunes soft ware.  It does give me an option for the phone device. How can I get the phone icon in the menu bar?

    I am trying to sync my iphone to my computer via i-tunes soft ware.  It does give me an option for the phone device. How can I get the phone icon in the menu bar?

    Mac or Windows?

  • How can I get the phone number to speak to someone at Adobe to change my account?

    How can I get the phone number to speak to someone at Adobe from my account?

    phone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • How to get the podcast of the website on the phone

    I was told to put that feed into the PODCASTING app on your iOS device.

    The site in question is https://randirhodes.com/how-to-get-the-podcast/

    I paid for a premium podcast, now how o I get this podcast to appear on my iphone 6 s more in the podcast app?

    Podcasts > select my Podcasts > press the '+' > Add Podcast > paste the URL that you got on the site.

  • How to get the ID of the Tweet with Twitter API ME V 1.9?

    Hello.. '

    I'm doing the request through the integration of twitter...

    Now I am facing a problem which I don't know how retweet...
    And all I have to retweet corresponds to the id of the tweet itself.

    Anyone know how to get the tweet id?

    Kind regards

    Eric

    if (m.verifyCredential()) {
        Tweet t = new Tweet("Hi!!! This is my first tweet via Twitter API ME. \o/");
        TweetER ter = TweetER.getInstance(m);
        t = ter.post(t);        //Now, check this instance of "t" what properties it is having, I guess it should have tweet ID also.
    }
    
  • How to get the number and the name of the contacts selector

    Hi all

    I got the Contact Picker work but I have no idea how to get the selected telephone number and the name.

    There are attributes that I can put like contactId.value () to retrieve or there is another way?

    Thanks in advance.

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
                                }
                            }
                        ]
    
                    }
    
                    Label {
                        id: result
                        text: "You chose contact: "
                    }
    

    Hello

    You can get the contact name and phone number as this,

    ImageButton{
                        defaultImageSource: "asset:///images/bluebutton.png"
                        onClicked: {
                            contactPicker.open();
                        }
                        attachedObjects: [
                            ContactPicker {
                                id: contactPicker
                                onContactSelected: {
                                    result.text = "You chose contact: " + contactId;
    // call a cpp method to get the details
    
    app.getDetails(contactId); } } ] } Label { id: result text: "You chose contact: " }
    

    the CPP code:

    void ContactDetails(ContactId id)
    {
    Contact contact_info = m_contactService->contactDetails(id);
    
        QString firstName = contact_info.firstName();
        QString lastname = contact_info.lastName();
            QList phoneno_list = contact_info.phoneNumbers();
    
        QStringList no_s;
    
        foreach(ContactAttribute attr, phoneno_list)
        {
            no_s << attr.value();
        }
    }
    

    You can get details like this.

    Kind regards

    Naresh Kodumuri.

  • Get the phone number of the address book on the menu, click

    My app (which has no UI) adds a new menu item to the contacts Blackberry address book... Now, if you click on this menu I would get the phone number to contact selected...

    I did it with the addition of the menu item... But how can I get the phone number of the address book when you click on the menu?

    using code i below contacts called from another application have also recovered the phone number...

    BlackBerryContactList contacts = (BlackBerryContactList) PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
    

    But how can I get in my current scenario?

    Oops... How did I miss the best way to get the coordinates of the context of the run method (of the added menu) parameter.

  • How to get the event when we change our simcard in BB device

    Hi all

    Please, someone tell how to get the event or any listener method that can automatically called when we change our SIM card device.

    Thanks in advance,

    TEJ

    Hi Tej,

    I came across some post, which may be useful for you

    http://supportforums.BlackBerry.com/T5/Java-development/is-there-a-way-to-get-the-mobile-or-phone-nu...

    http://supportforums.BlackBerry.com/T5/Java-development/is-SIM-ID-really-exist/m-p/54407#M5954

  • How to get the time of the device

    Hello

    I'm developing an application in which I send location of the device in lat, long for every 10 minutes.  I want to send some time also with lat, long. This time must be peripheral situation updates for every 10 minutes.  Can someone tell me how do I do this?

    It is not obvious to your OP exactly what you ask.

    Ask you in a certain way a consistent recording time no matter what time zone are you in?

    Or are you just asking how to get the date and time?

    If it's the last QDateTime is one of the ways to get the date and time...

    http://developer.BlackBerry.com/native/reference/Cascades/QDateTime.html

    If you ask for the first answer more complex, you will probably need to check the time against an external clock (say GMT) and then re-reading use the contact information you have saved to determine what the weather was (including a calculation of DST) at this point in this particular time zone.

    Relying on the phone to change accurately that it is time that you move in time zones will not give accurate results.

Maybe you are looking for