05-26-2010 07:08 AM
http://supportforums.blackberry.com/t5/Java-Develo
I am following the same way as suggested above.
it works and confirms with all success message too.
But at the same time on the back ground to my application screen, it gives an error message with "cannot connect to *004#12341234#". this prevents the device make any calls until you find out this message and close the window.
i am using,
String strNumber = "*004#12341234#"; //USSD cmd to set call forwarding
PhoneArguments phoneArgs = new PhoneArguments (PhoneArguments.ARG_CALL, strNumber );
Invoke.invokeApplication( Invoke.APP_TYPE_PHONE, phoneArgs );
What am i doing wrong? Any suggessions or hints?!!!
09-01-2011 03:17 PM - edited 09-01-2011 03:18 PM
This should work to enable and disable call forwarding for you.
<code>
//Enable Call Forwarding
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE,new PhoneArguments(PhoneArguments.ARG_CALL,"**004*" + destination + "#");
//Clear call forwarding
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE,new PhoneArguments(PhoneArguments.ARG_CALL,"**004*"))
</code>
looks like you don't have enough stars on your number to invoke the call forwarding.
09-01-2011 05:30 PM
Here is an implmentation of a USSD Command Invoker that I've written and been using. It was designed to execute them in a managed fashion (not to many at once). It seems to work for the most part, maybe some tinkering is needed with the timeings etc. for your specific environment etc..
USSD Command Executor
public class USSDCommandExecutor {
private static Vector commands = new Vector();
public static void callUSSD(USSDCommand command, boolean enable){
USSDCommandExecutor.commands.addElement(new CommandToExecute(command, enable));
Application.getApplication().invokeLater(new Runnable(){
public void run() {
execute();
}
}, 100, false);
}
private static void execute(){
if(!commands.isEmpty()){
final CommandToExecute execute = (CommandToExecute)commands.elementAt(0);
commands.removeElementAt(0);
new Thread(new Runnable(){
public void run() {
try{
Invoke.invokeApplication(
Invoke.APP_TYPE_PHONE,
new PhoneArguments(
PhoneArguments.ARG_CALL,
execute.getCommand().getCommand(execute.isEnable() )
)
);
}catch(Throwable t){
//do something... maybe a callback or log even
}
}
}).start();
if(commands.isEmpty()){
Application.getApplication().invokeLater(new Runnable(){
public void run() {
execute();
}
}, 1000, false);
}
}
}
private static class CommandToExecute {
private USSDCommand command;
private boolean enable;
protected CommandToExecute(USSDCommand command, boolean enable){
this.command = command;
this.enable = enable;
}
public USSDCommand getCommand() {
return command;
}
public boolean isEnable() {
return enable;
}
}
}USSD Commands (Call Forwarding)public class CallForwarding extends USSDCommand {
private String ddi;
public CallForwarding(String callForward) {
super("##004#{0}#", "**004*");
this.ddi = callForward;
}
public String[] getData() {
return new String[]{this.ddi};
}
}USSD Commands (Call Waiting)public class CallWaiting extends USSDCommand {
public CallWaiting() {
super("*43#", "#43#");
}
public String[] getData() {
return new String[]{};
}
}
06-20-2012 07:45 AM
Hi andy_hollywood,
Thank you for your sample sources, but I don't understand how can I intercept incoming response call from server. Well, I need to create an app that hides response callback from server on USSD request call. And also I need hide Calling Screen, but after deep research I understand that it can't be done((.
Please can you tell me which direction to move, because I totaly lost![]()
06-20-2012 07:47 AM
Do you mean you want to fire a USSD and then prevent the Dialog showing up to the user, AND use the response from the server to do something else?
06-20-2012 08:03 AM
User make a USSD phone call like "*146*"+"00"+number+"#" and than carrier make response call to the user, then he picks it up and talking. So I need to hide callback from server from the user. So he just make ussd call and then automaticaly connected to destination opponent.
06-20-2012 08:10 AM
That is all very tough to do using the RIM SDK, in fact from my experience impossible by using hte functions available to you in the SDK.
Think you need to be looking a few levels lower in terms of technology for your devices in order to achieve something seamless.
06-20-2012 09:50 AM
Thank you for reply, I will try to dig lower.
11-25-2012 05:04 AM
hi, sorry to post my question in between......
In my case, is ther a setting to disable shown the raw message sent from server to BB via USSD ? In BB OS 6/7, USSD message sent by server is shown first (unformatted raw message), upon pressing OK, message gets formated and displays properly...
How can i disable the raw message apperaing as pop up text first ? any help will be greatly appreciated