I downloaded Android SIP Demo in Android Studio. I registered an account on getonsip.com, added it to my phone accounts and confirmed that it works by calling from getonsip.com and from one Android phone to another. All is good so far.
I slightly modified the Java code from the demo to complete 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();
Then I deployed it to my phone (Galaxy S4, Android 4.4.2 API 19). However, when I try to make it call:
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 on the Internet did not help me. I tried adding a 5 second delay before calling, rebooting the phone and changing the destination SIP address to enable sip:<address>@getonsip.com as well as sip:<address>@getonsip.com:5060 , but always the same thing same error message.
Does anyone know how to solve this?
java android sip opensips
EntangledLoops May 14 '15 at 15:53 2015-05-14 15:53
source share