title: SIP registration fails - TIME OUT - ALL PERMISSIONS included in the manifest BUT the RECEIVE DATA FROM INTERNET PERMISSION not included in the APP
body: <p>I am trying to register with my SIP account.  I doudt it's a programming issue because I rewrote the SIP programme twice from scratch and took inspiration from different sources. AND!! I look over the permission actually in the APP in the setting option of my android phone and the permission "RECEIVE DATA FROM INTERNET" is NOT THERE!! even if I use the permission android.permission.INTERNET in my manifest file.  I don't get it!! Further more, I am using a firebase DATABASE over the internet with this APP and I can read and write into it.  How is this possible??</p>
  
  <p>MORE SPECIFIC DESCRIPTION OF THE PROBLEM : The APP call the onRegistering then calls the onRegistrationFailed with error : SIP ERROR MSG : localProfileUri=sip:rafael.hogue@sip2sip.info   errorCode=time out!!  errorMessage=registration timed out</p>
  
  <p>using this source code:</p>
  
  <pre><code>private Builder builder = null;
  private void log_and_register()
  {
      try
      {
          c.DEBUG().ftrace("VOIP Supported: " + SipManager.isVoipSupported(c.ma()));
          c.DEBUG().ftrace("SIP API Supported: " + SipManager.isApiSupported(c.ma()));
  
          mSipManager = SipManager.newInstance(c.ma());
          builder = new Builder(c.config().getSIP_UserName(), c.config().getSIP_Domain());
          builder.setPassword(c.config().getSIP_Password());
          //builder.setProtocol("UDP"); //"TCP");
          //builder.setPort(5060);   //5080  5070
          builder.setAutoRegistration(true);
          mSipProfile = builder.build();
      }
      catch (ParseException pe)
      {
          c.DEBUG().ftrace("incapable of parsing domain name, username or password!");
          c.DEBUG().ASSERT(0 == 1);
      }
      try
      {
          Intent intent = new Intent();
          intent.setAction("android.SipDemo.INCOMING_CALL");
          PendingIntent pendingIntent = PendingIntent.getBroadcast(c.ma(), 0, intent, Intent.FILL_IN_DATA);
          mSipManager.open(mSipProfile, pendingIntent, null);
      }
      catch (SipException se)
      {
          c.DEBUG().ftrace("WALKIE TALKIE NOT WORKING - Sip Exception!!");
          c.DEBUG().ASSERT(0 == 1);
      }
      if (ContextCompat.checkSelfPermission(c.ma(), Manifest.permission.USE_SIP) == PackageManager.PERMISSION_GRANTED)
          c.DEBUG().ftrace("GRANTED!!!");
      else
          ActivityCompat.requestPermissions(c.ma(), new String[]{Manifest.permission.USE_SIP}, 1);
      try
      {
          if (mSipManager.isRegistered(mSipProfile.getUriString()))
          {
              c.DEBUG().ftrace("already registered !!" + mSipManager.isRegistered(mSipProfile.getUriString()));
              return;
          }
      }
      catch (Exception e)
      {
          c.DEBUG().ftrace("NO!!");
      }
      try
      {
          //mSipManager.register(mSipProfile, 30, new SipRegistrationListener(){
          //mSipManager.register(mSipProfile, 30000, new SipRegistrationListener(){
          c.DEBUG().ftrace("THIS IS THE TRACE BEFORE REGISTATION : " + mSipProfile.getUriString());
          mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener()
          {
              public void onRegistering(String localProfileUri)
              {
                  c.DEBUG().ftrace("Registering with SIP Server...");
              }
              // next version has it!!
              public void onRegistrationTimeout()
              {
              }
              public void onRegistrationDone(String localProfileUri, long expiryTime)
              {
                  c.DEBUG().ftrace("SIP Ready");
              }
              public void onRegistrationFailed(String localProfileUri, int errorCode, String errorMessage)
              {
                  // -9 signifie qu'il y a un appel en cours
                  c.DEBUG().ftrace("CANNOT REGISTER domain=" + c.config().getSIP_Domain() + " / username=" + c.config().getSIP_UserName());
                  c.DEBUG().ftrace("SIP ERROR MSG : localProfileUri=" + localProfileUri + "   errorCode=" + errCode(errorCode) + "  errorMessage=" + errorMessage);
              }
          });
      }
      catch (Exception e)
      {
          c.DEBUG().ftrace("Cannot initialise wakie talkie!");
          c.DEBUG().ASSERT(0 == 1);
      }
      // https:github.com/aosp-mirror/platform_development/commit/a025796211f15c2796f8ea3208c066801aa250b6
  }
  </code></pre>
  
  <p>I include those permission:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" /&gt;
  &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
  
  &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
  &lt;uses-permission android:name="android.permission.USE_SIP" /&gt;
  &lt;uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.MODIFY_PHONE_STATE" tools:ignore="ProtectedPermissions" /&gt;
  
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.REBOOT" tools:ignore="ProtectedPermissions" /&gt;
  &lt;uses-permission android:name="android.permission.STATUS_BAR" tools:ignore="ProtectedPermissions" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&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;
  </code></pre>
  
  <p>Below there is a reference to my first problem that I try solving with the Audio Streaming solution that has work well on a local WIFI network BUT it doesn't see my mobile IP.  I don't want to have only local WIFI walki talki (and phone)so the previous solution doen't work for me!!</p>
  
  <p>reference: <a href="https://stackoverflow.com/questions/53347751/sip-registration-failure-tried-3-diff-account">sip registration failure - tried 3 diff. account</a> </p>