in the manifest you need the following
<uses-permission
android:name="android.permission.PROCESS_OUTGOING_CALLS" />

and you need to add a receiver as well
 <receiver android:name=".OutgoingNumber">
                        <intent-filter android:priority="1">
                        <action
android:name="android.intent.action.NEW_OUTGOING_CALL"></action>
                        </intent-filter>
                </receiver>

then my receiver calls is something like this


import java.util.Iterator;
import java.util.Set;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;

public class OutgoingNumber extends BroadcastReceiver
{

        @Override
        public void onReceive(Context context, Intent intent)
        {
                Log.d("OutGoingNum", "Action is " + intent.getAction());

                if(intent.getAction().equalsIgnoreCase
(Intent.ACTION_NEW_OUTGOING_CALL))
                {
                        String phonenbr = 
intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
                        Log.d("OutGoingNum", "phonenbr is " + phonenbr);

                        if(phonenbr.equals("666"))
                        {
                                String data1  = this.getResultData();
                                Log.d("OutGoingNum", "data1=" + data1);

                                this.setResultData("999");
                                String data2  = this.getResultData();
                                Log.d("OutGoingNum", "data12=" + data2);
                        }
                }
        }
}


as to what is displayed on the call screen it changes between the
emulator and the actual phone.  The emulator looks liek it is dialing
the original number but te call log shows you called the other number
but on a G1 it shows the new number you are dialing and this is also
in the call log.

That is why i need to find out how to change the call log to fix the
number that gets recorded. I would love to change the number shown to
the user as well but i am not sure if that is possible.

Chris







On Apr 12, 7:29 pm, TAKEphONE <shimo...@gmail.com> wrote:
> Hi,
>
> Can you post the code you're using to change the dialed number ?
>
> When you change it - what do you see in the "current call" screen ?
>
> On Apr 12, 8:49 am, Seer <gilligan.ch...@gmail.com> wrote:
>
> > well i can change the outgoing number now but i still have not worked
> > out a way to update the call log to use the original number or a way
> > to display the original number as the number been called or a modified
> > one install of the one actually been used. I am using something like a
> > calling card and don't want all the other numbers you need to put in
> > front of a dialed number in the call log etc or on the screen as i
> > still want to display the persons contact details and maybe mention a
> > calling card is been used.
>
> > Chris
>
> > On Apr 12, 10:38 am, Seer <gilligan.ch...@gmail.com> wrote:
>
> > > Hi,
> > > I have been using a receiver listening to NEW_OUTGOING_CALL and i can
> > > capture the outgoing call broadcast but every time i manipulate the
> > > intent that is broadcast it is ignored.
>
> > > What is the best way to change the outgoing call number.  ideally i
> > > would like to record the call as going to the original number , dial a
> > > completely different number and if possible change the number shown
> > > the the user to something else to show it is using a different number
> > > but still show the number they are trying to dial as well.
>
> > > Can anyone help me or point me in the right direction with this?
>
> > > Chris
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to