title: Android VOIP SipException: Failed to create SipSession
body: <p>Im trying to run a VOIP call using built in SIP on android 3.1. I have physical tablet device (galaxy Tab 10.1).</p>
  
  <p>For testing purpose, I have created a project from <a href="http://developer.android.com/resources/samples/SipDemo/index.html" rel="noreferrer">SipDemo example</a> - it works fine! (meaning my credentials are working and my device/network is fine).</p>
  
  <p><strong>my Manifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="modera.com.doorcontroller" android:versionCode="1" android:versionName="1.0"&gt;
  
      &lt;application android:icon="@drawable/logoeditedsmall" android:label="@string/app_name" android:debuggable="true"&gt;
        &lt;activity android:name="MainActivity" android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
        &lt;/activity&gt;
  
        &lt;activity android:name="CallActivity"&gt;&lt;/activity&gt;
  
  &lt;/application&gt;
  
  &lt;uses-sdk android:minSdkVersion="11" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.USE_SIP" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  
  &lt;uses-feature android:name="android.hardware.sip.voip" android:required="true" /&gt;
  &lt;uses-feature android:name="android.hardware.wifi" android:required="true" /&gt;
  &lt;uses-feature android:name="android.hardware.microphone" android:required="true" /&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>my backend code:</strong></p>
  
  <pre><code>public void initializeManager() {
      if (manager == null) {
          manager = SipManager.newInstance(this);
      }
  
      if (me != null) {
          closeLocalProfile();
      }
  
      try {
          SipProfile.Builder builder = new SipProfile.Builder(username,
                  domain);
          builder.setPassword(password);
          builder.setOutboundProxy(proxy);
          me = builder.build();
  
          manager.open(me);
  
          manager.setRegistrationListener(me.getUriString(),
                  new SipRegistrationListener() {
  
                      @Override
                      public void onRegistering(String localProfileUri) {
                          Log.i("MY", "onRegistering");
  
                      }
  
                      @Override
                      public void onRegistrationDone(String localProfileUri,
                              long expiryTime) {
                          Log.i("MY", "onRegistrationDone");
  
                      }
  
                      @Override
                      public void onRegistrationFailed(
                              String localProfileUri, int errorCode,
                              String errorMessage) {
                          Log.i("MY", "onRegistrationFailed");
  
                      }
                  });
  
      } catch (ParseException pe) {
          Log.e("MY", pe.toString());
      } catch (SipException se) {
          Log.e("MY", se.toString());
      }
  }
  
  
  
  public void initiateCall() {
  
      try {
          SipAudioCall.Listener listener = new SipAudioCall.Listener() {
  
              @Override
              public void onCallEstablished(SipAudioCall call) {
                  call.startAudio();
                  call.setSpeakerMode(true);
                  call.toggleMute();
                  Log.i("MY", "oonCallEstablished");
              }
  
              @Override
              public void onCallEnded(SipAudioCall call) {
                  Log.i("MY", "onCallEnded");
              }
          };
  
          call = manager.makeAudioCall(me.getUriString(), sipAddress,
                  listener, 30);
  
      } catch (Exception e) {
          Log.e("MY", e.toString());
          if (me != null) {
              try {
                  manager.close(me.getUriString());
              } catch (Exception ee) {
                  Log.e("MY", ee.toString());
              }
          }
          if (call != null) {
              call.close();
          }
      }
  }
  </code></pre>
  
  <p>Running this code (at first I initalize, using initalizeManager and then I run initateCall) I receive an exception:</p>
  
  <pre><code>android.net.sip.SipException: Failed to create SipSession; network unavailable?
  </code></pre>
  
  <p>...and LogCat logs:</p>
  
  <pre><code>07-14 13:35:16.200: ERROR/SipService(364): openToMakeCalls()
  07-14 13:35:16.200: ERROR/SipService(364): javax.sip.SipException: only creator can access the profile
  07-14 13:35:16.200: ERROR/SipService(364):     at com.android.server.sip.SipService.createGroup(SipService.java:337)
  07-14 13:35:16.200: ERROR/SipService(364):     at com.android.server.sip.SipService.open(SipService.java:185)
  07-14 13:35:16.200: ERROR/SipService(364):     at android.net.sip.ISipService$Stub.onTransact(ISipService.java:58)
  07-14 13:35:16.200: ERROR/SipService(364):     at android.os.Binder.execTransact(Binder.java:320)
  07-14 13:35:16.200: ERROR/SipService(364):     at dalvik.system.NativeStart.run(Native Method)
  07-14 13:35:16.200: WARN/SipService(364): only creator can set listener on the profile
  07-14 13:35:16.230: WARN/SipService(364): only creator or radio can close this profile
  </code></pre>
  
  <p>Google hasn't given any results, because there just isnt enough data on Android 2.3+ SIP, so every suggestion you make helps me out a lot!</p>