my new task is to implement Voice/Video chat native application in Android. I browsed net for the same and it was written that using Android "SIP" API we can do it. I gone through the documents about SIP.In Implementing using SIP we required SIP address for each user which will be provided by different SIP providers. I also checked the SipDemo sample app provided in samples.
Problem is my app will be used by many Users and they can chat with any others.
So, how can we generate SIP address for each user dynamically and establish communication session ?
or each there any other way of doing this ?
Please Help
If you want to test your android app you can generate a free sip account from AntiSip.
and for generating sip account dynamically you have to configure sip on your server with the help of Asterisk:
Two VoIP software can contact each other directly by using direct SIP URI like username#IP:port.
This can work fine on local networks where the UA (sip user agent) has fix address. Otherwise you will need to use a SIP server (This is the main role of a SIP registrar server: to keep a track of the user locations). There are plenty open source software for this like the above mentioned Asterisk but you can also find a lot of services offering free calls (free from softphone to softphone; they charge only if you wish to make outbound calls to landline or mobile numbers).
Related
I am building an application using HTML5 with PHP restful service. This app will be converted to APK and IPA using Cordova/Phonegap. I need to implement SIP call (click to call) feature.
I have set up Kamailio SIP server. The SIP address will be pre-registered and allocated to my users.
To address (SIP address) will be embedded on the hyperlink, clicking on that should initiate SIP call between the two SIP address (Caller and Callee). I have only the audio call feature in my application.
I don't need SIP client (we don't have dial feature). Can I make SIP calls without a SIP client? Any help would be appreciated.
Thanks.
Can I make SIP calls without a SIP client?
By definition, no. A SIP client talks to a SIP server. This is not significantly different from an HTTP client talking to an HTTP server, or an SMTP client talking to an SMTP server, or an IMAP client talking to an IMAP server, or an SSH client talking to an SSH server, etc.
On Android, if the user has configured a SIP client, and if the SIP client supports something like the sip: scheme, you might be able to initiate a phone call to another SIP endpoint, though my guess is that this would require a custom Cordova plugin. I cannot speak as to what might be possible on iOS. I also do not know if there is a HTML5/JavaScript SIP client that you could integrate, though I would be somewhat surprised if there was one.
Quoting You "To address (SIP address) will be embedded on the hyperlink, clicking on that should initiate SIP call between the two SIP address (Caller and Callee). ".
You app has a link, clicking which will initiate a call. So app is working as a client so you do not need a separate client. Only thing you need to do is handle the SIP request with SDP media to lower layer (TCP/IP).
Please comment if i did not answer/understood your question properly.
If you mean without a sip client standalone application then the answer is yes, because most of click2call services work exactly in this way (e.g.: https://clic2call.demo.sociale.it/webrtc ).
But on the other hand you should consider that in that case the sip client is more than half based on the WebRTC browser implementation, and by now Cordova and Phonegap don't provide that functionality, not even with external plugin.
The good news is that Chrome supports WebRTC on Android and all desktop enviroments.
I just dont Understand
From the text of Android Website.
It said,
"Android provides an API that supports the Session Initiation Protocol
(SIP). This lets you add SIP-based internet telephony features to your
applications"
Which then I questioned myself, can we use this SIP API in
the Ad-Hoc connection of two Android devices connected each other?
What about,
"Each participant in the application's communication session must have
a SIP account. There are many different SIP providers that offer SIP
accounts."
an Account? What is that for? I assumed the account is
for handling the data translated from and to (client-server) communication.
But what about if I used for the Ad-Hoc TWo android communication, that Has no Internet connectivity? I mean, Can I used SIP Api for this? Or i should use something else...?
This mean Android now have build-in SIP stack API.
So if you want to build SIP applications like SIP softphone, then you can use Android API for SIP without using a thirtparty SIP stack.
Many applications build with SIP for example: PJSIP, CSipSimple, Linphone ...
After have SIP application (SIP client) you must have account to login and make call with another SIP clients.
SIP is an application layer protocol, means it works on transport layer, TCP/UDP/IP/SCTP...
You can make sip client using SIP API such as voip client and make a call with two android devices without server, just direct ip call, after set up ad-hoc network.
Thanks.
I have searched for way to make real-time voice (calls) between two peers but only found how to record voices and send them or sending photos and text. but what I want is for the two peers to be able to call each other. So is it possible that using WiFi P2P manager on android would allow me to create a real-time conversation between the two peers? Does android have that feature?
Wifi p2p is now called as Wifi Direct you can connect with WifiDirect to transfer files between two or more devices you can find the WifiDirect demo project on android developer site
And if you want to work with SIP you must have a valid sip account some site allows free sip account one of them is can be Found here after having a valid sip account you can start calling over wifi and you can download one more open source project sipdroid from Here
Am sure #Ibrahim wants to be able to connect the two android users without a dependency on internet. Using the internet is the 'old' style. Meanwhile do check this library :
https://github.com/fyhertz/libstreaming
There is so much resources here that we are learning from in building connectivity for users here in Africa at large without the need for internet.
Has anyone made a small basic application using SIP for android? I have tried using CSipSimple app, with SIP account on antisip.com and sip2sip.com but none of them register properly, and it gives a timeout error.
I also tried those accounts with the SipDemo given with Android, and also in Linphone app. Linphone works fine with a SIP account on Linphone itself, but no other SIP accounts works.
If you want to try it out with CSipSimple, Add Account > OSTN
Account name: OSTN
Username:<yourusername>
Password:<yourpassword>
Server: ostel.co
(Register first #ostel.co)
Or you can download SipWise CE and setup your own local Sip Service Provider - you will not face errors like timeout (as long as you are not far from your wi-fi coverage)
Do I need a PBX or SIP server to allow two devices to communicate via SIP?
Lets assume one device (Android or IOS) knows the IP address of another. Couldn't that device send the INVITE directly to the other and get a conversation started, without the need for a SIP server? Or am I oversimplifying and the SIP server does something magical that I'm missing?
Thanks,
Mike
What you are describing is peer-to-peer SIP which does not require any servers in the middle. So yes it is possible.
As per SIP standard there is no restriction of SIP server to be use.
Server is use because we do not have to remember location (IP Port) of all SIP users.
When user register with server, Server take care of location of user.
(Server provide so many other features but to make this description easy ignoring all)
But in your case as you know IP address of another user no need of server.
Just make sure a SIP stack you are using is allow you to send INVITE without REGISTER. Because some stack restrict client to send INVITE without successfully register.