I am using Android sip from android.net.sip package. I have a SIP credential which make call to phone number. below is sample piece of SIP call in android
SipProfile.Builder builder = null;
builder = new SipProfile.Builder("+16674442153" +
"", "");
builder.setPassword("");
SipProfile outgoing = builder.build();
sipManager. makeAudioCall(sipProfile.getUriString(), outgoing.getUriString(), listener, 30);
In this makeAudiocall function of SipManager is accepting only a sipaddress and whenever i enter a phone number its throw a exception
java.text.ParseException: Invalid URL: sip:+16674442153@
so is there is another way or library which helps me to make a phone number call using SIP in android.
This depends on your SIP Provider. If your SIP Provider allows SIP calls to normal phone numbers they should have documented how the SIP URI should look like.
For some providers the following scheme works:
phonenumber@sipproviderserver.com
But this is not a programming problem but a provider problem. The provider must allow you to connect from SIP to the Phone network. How the SIP endpoint have to be configured and if this can happen automagically depends, again, on the provider.