简体   繁体   中英

Android Sip: How to make audio call without using SIP address (I want to use real phone number instead)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM