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

Java Development

Reply
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Call Initiated event generated twice !!!!

hi all,

 

in my app, i've registered a phone listener
on outgoing call, callInitiated event is generated twice..very strange !!
while on incoming call, callIncoming event is generated once..which is proper

here i've put the code of my phoneListener class

 

package com.spec.bb.callreminder.controller;

 

import net.rim.blackberry.api.phone.Phone;

import net.rim.blackberry.api.phone.PhoneCall;

import net.rim.blackberry.api.phone.phonelogs.PhoneCallLogID;

import net.rim.blackberry.api.phone.AbstractPhoneListener;

 

import net.rim.device.api.ui.component.Dialog;

import net.rim.device.api.ui.Ui;

import net.rim.device.api.ui.UiApplication;

import net.rim.device.api.ui.Manager;

import net.rim.device.api.ui.UiEngine;

import net.rim.device.api.system.Bitmap;

 

public class AddPhoneListener extends AbstractPhoneListener {

 

static public void registerOnStartup(){

AddPhoneListener phone_handler = new AddPhoneListener();

Phone.addPhoneListener(phone_handler);

}

 

public AddPhoneListener() {}

 

private void checkCall(String ehandler, int callid){

System.out.println("------------------------------>Status:::" + ehandler );

PhoneCall callInfo = Phone.getCall(callid);

 

//ONLY FOR INCOMING/OUTGOING CALL

if(ehandler.equals("callIncoming") || ehandler.equals("callInitiated")){

if ( callInfo != null ) {

System.out.println("------------------------------>Calling:::" + callInfo.getDisplayPhoneNumber());

}

}

}

 

//IMPLEMENTED LISTENER METHODS

 

// A call has been added to a conference call

public void callAdded(int callId) { }

 

// User answered a call

public void callAnswered(int callId) { }

 

// Conference call established

public void callConferenceCallEstablished(int callId) { }

 

// Network indicates a connected event

public void callConnected(int callId) { }

 

// Direct-connect call connected

public void callDirectConnectConnected(int callId) { }

 

// Direct-connect call disconnected

public void callDirectConnectDisconnected(int callId) { }

 

// Call disconnected

public void callDisconnected(int callId) { }

 

// User ended call

public void callEndedByUser(int callId) { }

 

// Call has been placed on "hold"

public void callHeld(int callId) { }

 

// New call has arrived

public void callIncoming(int callId) { checkCall("callIncoming", callId); }

 

// Outbound call initiated by the handheld

public void callInitiated(int callid) { checkCall("callInitiated", callid); }

 

// Call removed from a conference call

public void callRemoved(int callId) { }

 

// Call taken off of "hold"

public void callResumed(int callId) { }

 

// Call is waiting

public void callWaiting(int callid) { }

 

// Conference call has been terminated

// (all members disconnected)

public void conferenceCallDisconnected(int callId) { }

 

// Call failed

public void callFailed(int callId, int reason) { }

 

}

 

any Idea/suggestions??? 

 

 

 

 

Jeet Bhatt, India
BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Call Initiated event generated twice !!!!

What BlackBerry model and handheld software version are you testing on?  You can find this under Options, About on the BlackBerry.  Are you testing using a real BlackBerry device or are you using the BlackBerry Simulator?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Call Initiated event generated twice !!!!

I M USING JDE 4.5 SIMULATORS
Jeet Bhatt, India
BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Call Initiated event generated twice !!!!

What BlackBerry model are you simulating?  What is the full, 4 digit handheld software version?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Call Initiated event generated twice !!!!

simulator of BB 8830, 8300, 8100
Jeet Bhatt, India
BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Call Initiated event generated twice !!!!

That is the BlackBerry model, not handheld software version.  The BlackBerry handheld software version will look something like 4.5.0.55.

 

I tried this using the BlackBerry 8300 Simulator included with the BlackBerry JDE and was not able to reproduce it.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
myraddin
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Call Initiated event generated twice !!!!

[ Edited ]

I can confirm the 'error'.

 

EV_CALL_INITIATED(1) gets triggered twice.

 

I am testing on 8110 simulator (v 2.9.0.52)

BB JDE 4.5.0.7 

 

I even tried it on the device 8110 v4.3.0.93 (platform 2.6.0.53) and it has shown very similar results.

 

 

Message Edited by myraddin on 10-22-2008 01:05 PM


"Listen carefully, I shall say this only once"
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Call Initiated event generated twice !!!!

yes man,

 

i m facing the same...cant find actual cause

Jeet Bhatt, India
BlackBerry Development Advisor
MSohm
Posts: 14,752
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Call Initiated event generated twice !!!!

I still wasn't able to reproduce this when using the same BlackBerry Simulator.  Is there any series of events that needs to occur to trigger this?  I tested after a fresh launch of the BlackBerry Simulator.  I see call initiated, call connected and then call disconnected being called.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: Call Initiated event generated twice !!!!

hello mark

 

it seems very strange behaviour..not all time it generated twice..i also could not recognize the exact senario..so right now i kept watch on my app behaviour..if i can trap something, i'll let u inform

Jeet Bhatt, India