The telephone call

Hi all

I would like to make a phone call, can provide you some simple examples to achieve this, please?

To be more precise, I implemented PhoneListener interface according to my needs and now I need to run, for example, 4 phone calls, one after the other.

I did the following:

import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneListener;
import net.rim.device.api.system.Application;
import net.rim.device.api.ui.component.Dialog;
import net.rim.blackberry.api.invoke.PhoneArguments;
import net.rim.blackberry.api.invoke.Invoke;

class PhoneMain extends Application implements PhoneListener
{
    PhoneMain()
    {
        Phone.addPhoneListener(this);
    }

    public static void main(String[] args)
    {
        new PhoneMain().enterEventDispatcher();

        GlobalFlags.gCallInProcess = true;
        PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL, "1234567890");
        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);
        while(GlobalFlags.gCallInProcess) ;
        GlobalFlags.gCallInProcess = true;
        PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL, "1234567891");
        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);
        while(GlobalFlags.gCallInProcess) ;
        GlobalFlags.gCallInProcess = true;
        PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL, "1234567892");
        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);
        while(GlobalFlags.gCallInProcess) ;
        GlobalFlags.gCallInProcess = true;
        PhoneArguments phoneArgs = new PhoneArguments(PhoneArguments.ARG_CALL, "1234567893");
        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneArgs);
        while(GlobalFlags.gCallInProcess) ;
    }

    public void callAdded(int callId) {
    }
    public void callAnswered(int callId) {
        Dialog.alert("Call ID: " + String.valueOf(callId) + " answered!");
    }
    public void callConferenceCallEstablished(int callId) {
    }
    public void callConnected(int callId) {
        Dialog.alert("Call ID: " + String.valueOf(callId) + " connected!");
    }
    public void callDirectConnectConnected(int callId) {
    }
    public void callDirectConnectDisconnected(int callId) {
    }
    public void callDisconnected(int callId) {
        Dialog.alert("Call ID: " + String.valueOf(callId) + " disconnected!");
        GlobalFlags.gCallInProcess = false;
    }
    public void callEndedByUser(int callId) {
        Dialog.alert("Call ID: " + String.valueOf(callId) + " call ended!");
        GlobalFlags.gCallInProcess = false;
    }
    public void callFailed(int callId, int reason) {
    }
    public void callHeld(int callId) {
    }
    public void callIncoming(int callId) {
    }
    public void callInitiated(int callid) {
    }
    public void callRemoved(int callId) {
    }
    public void callResumed(int callId) {
    }
    public void callWaiting(int callid) {
    }
    public void conferenceCallDisconnected(int callId) {
    }

} 

class GlobalFlags
{
    public static boolean gCallInProcess = false;
}

It looks like PhoneListener correctly registered, but it does not call to 4 specified numbers.

What is the problem in my code? How can I get what I need?

Any help will be appreciated!

Thank you!

The code you write after that EnterEventDispatcher will not work. Because once EnterEventDispatcher is called it does not return.

Tags: BlackBerry Developers

Similar Questions

  • Definition of authorization of the phone call is denied

    Hello developers,

    I need to change the permission of the telephone call to the value.deny but when im, in doing so, it gives me an errorr

    "You can't change the permission for this add-on.

    I added the following code snippet, I know the resaon for the same thing. and how I can fix it so that I can refuse the call.

    ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance(); ApplicationPermissions original = apm.getApplicationPermissions();
    
    // Set up and attach a reason provider
     DemoReasonProvider drp = new DemoReasonProvider();
            apm.addReasonProvider(ApplicationDescriptor.currentApplicationDescriptor(), drp);
    
    if(original.getPermission(ApplicationPermissions.PERMISSION_PHONE) == ApplicationPermissions.VALUE_DENY )
            {
                // All of the necessary permissions are currently available
                return;
            }
    
       ApplicationPermissions permRequest = new ApplicationPermissions();
    
            permRequest.addPermission(ApplicationPermissions.PERMISSION_PHONE);
            //permRequest.addPermission(ApplicationPermissions.PERMISSION_DEVICE_SETTINGS);
            //permRequest.addPermission(ApplicationPermissions.PERMISSION_EMAIL);
            //permRequest.addPermission(ApplicationPermissions.PERMISSION_INTERNET);
            //permRequest.addPermission(ApplicationPermissions.PERMISSION_DISPLAY_LOCKED);
            boolean acceptance = ApplicationPermissionsManager.getInstance().invokePermissionsRequest(permRequest);
    
            if(acceptance)
            {
                // User has accepted all of the permissions
                return;
            }
            else
            {
               -- do nothing
            }
    

    Thank you

    sujithRavindran

    Thank you all, I got the answer

    Abstract USNG phone earpiece

  • Hello, I bought a phone to the Panama. They sold me as unlocked. I live in the Brazil. He ran once the telephone network. and is now unsigned. I can't make calls.

    Hello, I bought a phone to the Panama. They sold me as unlocked. I live in the Brazil. He ran once the telephone network. and is now unsigned. I can't make calls.

    Take it back to the store where you bought it.

  • In input/out live telephone calls have "broken" sound only after updating to iOS 9.3 update on 6, please help...

    All entry/out live telephone calls have 'broken' sound only & unable to play the music on my phone after update to iOS 9.3 update on 6, please help...

    Hi there dmaclatchy,

    It sounds slipped you can not use the app phone on your phone, because the sound is uneven or inaudible and something is happening with your music do not let play. I want to quit all applications running on the phone:

    Force an app to close the iOS

    1. press the Home button twice quickly. You will see small glimpses of your applications recently used.
    2. slide to the left to find the application you want to close.
    3. push upward on the overview of the application to close.

    When you have done that reboot the device and test again the question:

    iOS: switch off and on (restart) and reset

    If the problem persists, save your device in iTunes, then restore it like new and verify that it works.

    How to clear your iOS device and then set up as a new device or restore from backups

    If this is the case, restore your backup either check it still works and just reinstalled software or circumvent the problem in the backup file itself. Let us know how it goes! Thank you for using communities of Apple Support.

  • Phone calls to the Microsoft call centre.

    Hello

    I'm sick to death of receiving your call center phone calls telling me there is a problem with my computer, when this 'thing' has yet been turned on and still less currently in use .

    Also sick of these people not understand English and even less be able to speak.  If this problem is not resolved I 'LL go further.

    They are criminal con-men who are nothing to do with Microsoft.

    Fake phone calls to technical support

    It is a common scam. Do not let them give any info, do not give access to your PC, not give them all the money and do not go to all the websites that they suggest. One moment.

    Please see:

    http://www.microsoft.com/en-gb/security/online-privacy/msname.aspx .

    Microsoft does ever not requested for telephone calls of support or security.

    (such persons may use names other than Microsoft as well)

  • Fax HP Photosmart C410 connects to the telephone line at home instead of the dedicated fax number

    I have a Photosmart C410a.  The machine must be connected to the dedicated fax line, and number of this line was introduced in the fax header.  However, when tested using the FaxBack Service, fax back called the conduct of the House instead of connected to the fax line.  The machine is connected directly to the wall and there is no dispatcher, etc., with the home phone.  The telephone number doesn't have to all be typed them into the C410a.  Any thoughts you may have on what might be happening would be greatly appreciated.

    Best,

    Scott

    RESOLVED: The problem has been an error with the FaxBack service - my camera was working normally.  The best way to test your machine is either send/receive a fax with a friend or with HP customer support.

  • Is it possible to be alerted in a telephone call on dial upward?

    Original title: 'internet connection '.

    even if it means interrupting my connection, can somebody pleeeease tell me if it is possible to be alerted of an incoming phone call when the telephone line, I use for my dial-up access a basic service only (no call waiting, calling I.D. etc.). If yes what should I do to get there. There must be a solution-i have tried for days to get a response and with the "unprecedented" speed of my dial-up connection, I'm losing my patience! However, I have the internet service and a home phone that is nothing other than a busy signal 89% of the time. looking forward to a response... that works.

    Not without subscribing to call waiting as far as I KNOW. Contact your telephone company & know for sure. ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Citing a telephone call, a sign more is automatically added!

    Hello

    Im trying to invoke a telephone call by using this code:

    PhoneArguments call = new PhoneArguments(PhoneArguments.ARG_CALL, phoneNumber);
                    Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
    

    The phone number is the local telephone number 11 numbers (8xxxxxxxxxx).

    The system adds a prefix "+" to my number and the call will fail.

    How to tell the system not to put this '+' sign and use the number as it is.

    Thank you.

    You must disable smart dialing like this:

    Call of PhoneArguments = new PhoneArguments (phone number, PhoneArguments.ARG_CALL, false);

    Chris

  • I know where the last call from my iphone stolen?

    I know where the last call from my iphone stolen?

    Not anyone here, not Apple. You can check with your operator if they used your SIM card, and you may have to get the police involved for the information about the location. If it was not your SIM card, you would not be able to.

  • My iPhone can connect to the computer via Wifi instead of cable? Because I figured that my head of the telephone cable i have problem if the computer cannot detect my folder after plugging in the cable.

    My iPhone can connect to the computer via Wifi instead of cable? Because I figured that my head of the telephone cable i have problem if the computer cannot detect my folder after plugging in the cable.

    Sync your iPhone, iPad or iPod touch with iTunes using a WiFi - Apple...

  • is there a way to tell if the person calling me is really using an iPhone.

    A person calls me a phone which, said, is an iPhone, yet when I text, my outgoing text does not appear in blue, what he does with everyone who has an iPhone.   In addition, I get the text of the message undeliverable.  So my questions are: 1) is there a way for me to verify that the person calling is the use of an iPhone, and 2) if indeed it is an iPhone, why the text would not delivered?  Even if the person was using a droid, the text should go.

    There is no way to determine what type of phone a person uses when they call you. As iMessage versus SMS is, if the person who uses an iPhone does not choose to have iMessage activated, so you would not get the opportunity to send a message as an iMessage, he would send as a normal SMS. If the message is not delivered, it could be for any number of reasons, connection problems, the lack of a SMS plan on one of the devices, etc. Can send you a SMS? If so, can answer you?

  • I need help to restore my visual voicemail that has been erased when I got the application called "which app»

    I got the application called "which app ' via the app store two weeks ago and since my visual voicemail has disappeared. In talking with an associate at the apple store, they told me that that app turns your voicemail and sends it to their server, so you cannot retrieve all messages left on your phone.  I reached out to my carrier and despite my deposit, delivery number reset my voicemail and other efforts, I'm still not able to retrieve all messages default.

    Has anyone else had this experience or know a solution?

    http://www.whoapp.co/#/support

  • waiting for AT & T, the activation call wifi

    I try to activate AT & T wifi calling all in overseas and got everything and he gave me the message about the wifi calls must be activated in a few minutes, but its been over an hour and it still shows as the wifi calls are not enabled. I tried to activate several times but each time he asks only if I want to change my 911 location.

    Has anyone else managed to activate AT & T wifi calling while in another country?

    My guess would be that it is likley a limitation of the you are connected to the local network. Composing the WiFi only works outside the AT & home network of T if the local carrier you are roaming on allows it.

    If you use only wifi now, it won't work until you are connected to an AT & T network. To initialize the service on your device, you must be connected to AT & T home network or roaming cell phone partner.  You cannot configure the feature only a wifi connection.

    Once you put in place, you can call only foreign wifi, but to put in place, you need a cellular connection to AT & T to set up your device and the phone number for wifi calling with AT & T.

  • Do not disturb the appellants of only blocks feature at the first call, but if they call back, my iphone6 rings. Is there a way to fix this?

    Do not disturb feature prevents the ring on the first call of the appellant, but if they call immediately, my iphone6 rings. Is there a way to fix this?

    Turn your repeated setting OFF calls.

  • Various questions about the Skype call abroad.

    Hi all!

    I'm recently cheated by my phone company, so I plan on starting to call Skype to landlines and mobile phones. I've always used Skype from one computer to another, so I really have no idea how the Skype call would work from a computer to a phone. Phone of the receiver must be connected to one internet line in orden to receive the call?

    Even more stupid question: How does all this work?

    I live overseas and it is thought only to be able to call my family in my country of origin, which is both fixed lines and some mobile phones.

    Should I create a new number (or number will have for me), or will I use my Skype ID for calls? And how can they call me?

    Thanks in advance for your patience

    / S

    You can call any phone Skype if you have a subscription or credit.

    https://support.Skype.com/en/FAQ/FA34608/call-phones-from-Skype

    If they would be able to call from a phone, then you need a Skype number.

    https://support.Skype.com/en/FAQ/FA331/what-is-a-Skype-number

Maybe you are looking for

  • ICloud sign in

    I bought an iphone 6s and there a different apple of my previous phone ID.  However, my new phone wants to connect me to my icloud with my previous apple ID account.  How can I change that on my new phone?

  • Qosmio G40-12 s is not booting

    Recently my Qosmio G40 had a blue screen and poured out the physical memory, it took so long, I remember he stopped at 75%, then I restarted the laptop and came with the Qosmio logo, I spent my finger, certified, shows hdd1 unlocked and hdd2 unlocked

  • care about vista Dell Inspiron 1545

    What are the specs?

  • HP Pavilion p6110f Desktop PC graphics card

    Hello I have a HP Pavilion p6110f Desktop PC, what is the best graphic card for this computer for gaming? Thank you

  • scanner Kodak i40 64-bit of Windows 7 will not work

    Will not install drivers that work with windows 7 64 bit. Kodak has said that it should work, as possible. Said to contact Microsoft.