Failed to create SipSession; network unavailable

我只是一个虾纸丫 提交于 2019-11-26 23:37:42

问题


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?

来源:https://stackoverflow.com/questions/30241756/failed-to-create-sipsession-network-unavailable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!