hi i am trying to make a sip call using android api the code is below. the setRegistration Listener method is throwing an nullpointer for my sipprofile but the profile prints fine so am at a bit of a loss as to why its throwing the error. am very new to android this is my first project so any help would be great thanks.
public void MakeACall(String a){ try { String ad="calling "+a;//a is peer address res1.setText(ad);//res1 is textview String b=sp("name","getonsip.com","pass").getUriString();//local profile res1.setText(b); System.out.println(b);//prints the sip profile fine SipProfile mSipProfile = sp("name","getonsip.com","pass"); SipManager mSipManager =SipManager.newInstance(MainActivity.this); mSipManager.setRegistrationListener(b,//nullpointer error is thrown here<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< new SipRegistrationListener() { public void onRegistering(String localProfileUri) { res1.setText("Registering with SIP Server..."); } public void onRegistrationDone(String localProfileUri, long expiryTime) { res1.setText("Ready"); } public void onRegistrationFailed(String localProfileUri, int errorCode, String errorMessage) { res1.setText("Registration failed. Please check settings."); } }); SipAudioCall.Listener whatWasThat = new SipAudioCall.Listener() { @Override public void onCallEstablished(SipAudioCall call) { call.startAudio(); call.setSpeakerMode(true); call.toggleMute(); res1.setText("calling"); } @Override public void onCallEnded(SipAudioCall call) { res1.setText("ended"); } }; mSipManager.makeAudioCall(sp("name","getonsip.com","pass").getUriString(), sp("other","getonsip.com","pass").getUriString(), whatWasThat, 30); } catch (java.text.ParseException e) { System.out.println("error with profile string thing"); e.printStackTrace(); } catch (SipException e) { // TODO Auto-generated catch block e.printStackTrace(); } }//end makecall()