Failed to create SipSession; network unavailable
Asked Answered
S

0

6

I've loaded the Android SIP Demo into Android Studio. I registered an account on getonsip.com, added it to my phone accounts, and verified it works by calling the phone from the getonsip.com webapp and also from one Android phone to another. All good so far.

I modified the Java code from the demo slightly to accommodate the getonsip settings:

  SipProfile.Builder builder = new SipProfile.Builder(username, domain);
  builder.setOutboundProxy(proxy);
  builder.setPassword(password);
  builder.setAuthUserName(auth);
  builder.setAutoRegistration(true);
  builder.setPort(5060);
  builder.setProtocol("UDP");
  sipProfile = builder.build();

I then deployed it to my phone (Galaxy S4, Android 4.4.2 API 19). However, when I try to place a call to myself like this:

  sipCall = sipManager.makeAudioCall(sipProfile.getUriString(), sipAddress, listener, 30);

I always get the same error:

05-14 11:43:13.476    5061-5080/android.SipDemo W/System.err﹕ android.net.sip.SipException: Failed to create SipSession; network unavailable?

Other posts on StackOverflow and around the internet have not helped me. I've tried adding a 5 second delay before calling, rebooting the phone, and changing the target SIP address to include sip:<address>@getonsip.com and also sip:<address>@getonsip.com:5060, but always the same error message.

Does anybody know how to resolve this?

Secant answered 14/5, 2015 at 15:53 Comment(7)
I have the same problem ,Exception .while making a call .. Did you find any thing useful for that my friend ?!Incumbent
Reboot really helped me.Odom
I switched to using my own native SIP stack and ignoring the provided Android interface. Sadly, this isn't a solution to the problem, but rather a complicated work around.Secant
@Secant what did you use ? can you please share with use ?Verona
@Verona I built pjsip for Android with some custom changes for the product I was working on.Secant
i need your step to build pjsip @Secant can you pelase give me that.Verona
@Verona trac.pjsip.org/repos/wiki/Getting-Started/AndroidSecant

© 2022 - 2024 — McMap. All rights reserved.