Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:56:38+00:00 2026-05-31T15:56:38+00:00

I am developing a SIP application for incoming and outgoing calls and i want

  • 0

I am developing a SIP application for incoming and outgoing calls and i want to show AlertDialog on incoming call. For that i had put two buttons with dialog Accept and Reject. on pressing either one of this buttons application is crashes.

here is the code of my class and manifest files.

code for incomingCallReciever

public class IncomingCallReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
    Intent nextpage = new Intent(context, IncomingCallPage.class);
    nextpage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(nextpage);
    mContext = context;

}

public void acceptCall() {
    incomingCall.sendDtmf(9);
    try {
        incomingCall.sendDtmf(9);
        incomingCall.answerCall(200);
        wtActivity.gototimer("i");
    } catch (SipException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    wtActivity.gototimer("i");
}

public void rejectCaLL() {
    try {
        incomingCall.endCall();
    } catch (SipException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

}

//this code will open a new screen which is (incomingCallpage.class)
code for incomingCallpage

public class IncomingCallPage extends Activity {
    IncomingCallReceiver incomingCallReceiver;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Toast.makeText(IncomingCallPage.this, "Incoming call Page", 5000)
            .show();
    new AlertDialog.Builder(this)
            .setTitle("Incoming Call")
            .setMessage("From:242424")
            .setIcon(R.drawable.phone)
            .setPositiveButton("Accept",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {

                            **incomingCallReceiver.acceptCall();**
                        }
                    })
            .setNegativeButton("Reject",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {
                            **incomingCallReceiver.rejectCaLL();**
                        }
                    }).show();
}

}

//i have registered the reciever in manifest.xml file.

<uses-sdk android:minSdkVersion="9" />

<uses-feature
    android:name="android.hardware.sip.voip"
    android:required="true" />

<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<uses-feature
    android:name="android.hardware.wifi"
    android:required="true" />
<uses-feature
    android:name="android.hardware.microphone"
    android:required="true" />

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

<application
    android:debuggable="true"
    android:icon="@drawable/logo_linphone_57x57"
    android:label="SIP Dialer" >
    <activity
        android:name=".WalkieTalkieActivity"
        android:configChanges="orientation|keyboardHidden" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".SipSettings"
        android:label="set_preferences" />
    <activity
        android:name=".dialer"
        android:label="@string/app_name" />
    <activity
        android:name=".timer"
        android:label="@string/app_name" />
    <activity
        android:name=".d1"
        android:label="@string/app_name" />
    <activity
        android:name=".IncomingCallPage"
        android:label="@string/app_name" />

    **<receiver
        android:name=".IncomingCallReceiver"
        android:enabled="true"
        android:label="Call Receiver" >
        <intent-filter>
            <action android:name="android.SipDemo.INCOMING_CALL" />
        </intent-filter>
    </receiver>**
</application>

while running this code the error is :03-19 06:54:00.137: E/AndroidRuntime(1699):at com.example.android.sip.IncomingCallPage$1.onClick(IncomingCallPage.java:30)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:56:39+00:00Added an answer on May 31, 2026 at 3:56 pm

    did you created instance?

    incomingCallReceiver=new IncomingCallReceiver();
    

    or change you method to static

    public static void acceptCall() 
    

    //and call this in your IncomingCallPage

    IncomingCallReceiver.acceptCall()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application that will make SIP calls using the SIP APIs.
Developing an application for Android, i want to record data that will be usefull
i am developing one application which is based on SIP. And i want to
I'm developping a SIP application, and when i want to call someone(with its identifier
I want to add VoIP functionality to my application, without developing required VoIP/SIP libraries
I'm devlopping a SIP application and whant to launch the normal incoming call interface
i am developing a one SIP application to simply make and receive a call.
i am developing application which send and receive data between two computers but there
Developing a network application, I have a Connection class that manages sending and receiving
I'm working on developing a SIP application in Java and wondering what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.