0

hi am working on android sip api i have a problem with creating profile. i have tested 2 methodes : 1)

try {

        SipProfile.Builder builder = new SipProfile.Builder("sip:165@40.134.279.145");
        builder.setPassword("******");
        builder.setPort(5060);           
        me = builder.build();

        manager.open(me);

    } catch (ParseException pe) {
        Log.d("error", "connexion error");
    } 

   catch (SipException se) {
        Log.d("profile", "error");
    }

2)

try {

        SipProfile.Builder builder = new SipProfile.Builder(username,domaine);
        builder.setPassword("******");
        builder.setPort(5060);           
        me = builder.build();

        manager.open(me);

    } catch (ParseException pe) {
        Log.d("error", "connexion error");
    } 

   catch (SipException se) {
        Log.d("profile", "error");
    }

==> with the first methode i get a NullPointer exception in Open(me) // me is the variable of the profile

==> with the seconde one i have a parseException however the user name and the domaine are good and tested with a softphone Draytek.

notes : am testing on a device with 4.0 android version and i added permissions to manifest.

Java D
  • 436
  • 1
  • 8
  • 18
Kolombo90
  • 51
  • 1
  • 8

1 Answers1

1

Please provide full stack traces of the exception you're catching. Also, have you tried integrating the port into the URI, I.E. "sip:165@40.134.279.145:5060"?

Valid SIP URIs are discussed here.

Community
  • 1
  • 1
Vaiden
  • 15,728
  • 7
  • 61
  • 91