Android VOIP - Building an app for audio and video calls - android

I have to develop a mobile app with audio and video functionality. I browsed the web, I found out I need a SIP server. An SIP server does it works like Apache for web apps?
I also found this :
public SipProfile mSipProfile = null;
...
SipProfile.Builder builder = new SipProfile.Builder(username, domain);
builder.setPassword(password);
mSipProfile = builder.build();
But then at which point in my project I should tell that username = xxxx and domain = yyyy? Actually I cannot see the flow clearly it is starting from where and ending where..
Do you guys have a tutorial that I can follow?

A SIP server is the main component of an IP PBX, and mainly deals with the setup of all SIP calls in the network. A SIP server is also referred to as a SIP Proxy or a Registrar. Although the SIP server is the most important part of the SIP based phone system, it only handles call setup and call tear down. It does not actually transmit or receive any audio. This is done by the media server in RTP.
There are some widely used free & open source SIP servers like Asterisk, FreeSWITCH & penSIPS etc.
You can check here for list of SIP servers
You need to create SIP account or user on SIP server. Client will register to that SIP server using that SIP account with username & password.
Domain is basically SIP server's DNS hostname or IP address.
After registration to SIP server, client can make & receive audio or video calls.
Checkout here for SIP Demo app in android

Related

Connect Android SIP to OfficeSip server

I am developing an Android SIP client. I'd like to test it against OfficeSip server. So I have set up the officeSip server locally and I can connect to it via officeSIP messenger (the client).
The messenger requires this data to login:
List item
addr: username#server_domain
username: username
password: password
protocol: protocol
server address: server address
However, when trying to do the same in Android, its SipProfile.Builder has a bit different parameters. Of note are the following:
public SipProfile.Builder (String username, String serverDomain)
public SipProfile.Builder setOutboundProxy (String outboundProxy)
There doesn't seem to be a server address available.
I have tried the following for serverDomain parameter:
user#server_domain/server_ip
server_domain/server_ip
server_domain#server_ip
many other combinations
However, I'm either getting connection error (when # is used) or registration failed event (when / is used with server IP after the /). Error codes are -4 (When some error occurs on the device, possibly due to a bug) first, immediately followed by -9 (The client is in a transaction and cannot initiate a new one)
How can I connect to OfficeSIP using Android SIP client?
Edit:
I managed to establish communication with CSipSimpleClient which uses a custom SIP stack. It only required server name (equal to server's domain), username and password.
I'm not sure.. but '#' and '/' are not allowed and SipProfile.Builder will make a URI, e.g. "username#serverDomain(or ip)", with username and serverDomain parameters.
Just try to set like this.. ("user1", "test.com"), ("user1", "1.1.1.1").
API description says "the SIP server domain; if the network address is different from the domain, use setOutboundProxy(String) to set server address" about serverDomain.
Turns out, Android SIP stack is quite immature and finnicky.
Ultimately I was able to connect by specifying both server hostname and server proxy.
Also, if server domain differs from computer name server is running on, you WILL have issues connecting. Domain must match either IP address or computer name, but they must match in order to connect via Android SIP client.
I have successfully connected to OfficeSIP with the android SIP API.
Download the SipDemo here
In WalkieTalkieActivity.java I modified the code to be the following:
SipProfile.Builder builder = new SipProfile.Builder("test", "officesip.local");
builder.setPassword("test");
builder.setOutboundProxy("192.168.10.191");
builder.setAutoRegistration(true);
me = builder.build();
In OfficeSIP test is the user with a password also test. The outbound proxy is the IP of the computer or server hosting OfficeSIP and officesip.local is the SIP domain name, which can be found in OfficeSIP under ther settings tab.
To test this I made a second account on OfficeSIP and logged into that account using Sipdroid. From there I called the SipDemo app running on a second phone and it worked.

Http Client for cloud-to-device

Hello I write application for Android with push notification, I read documentation and there client is only for server with XMPP protocol, http://developer.android.com/google/gcm/client.html. I write application such will get data from server(time to start alarm) and it is not nessecary to do feedback. Do you have examples of HTTP client for cloud-to-device?
The client code in the link you posted works for both XMPP connection server and HTTP connection server. The only difference is that for HTTP server you can't use the GoogleCloudMessaging.send method (called by the onClick method), because that method sends a message from device to cloud.
The handling of the registration to GCM and incoming cloud to device messages is the same for both server implementations.
Our Http application server (cloud to device) is just an api call to an end point. This api call can be done in many ways, One is https://github.com/mseshachalam/GCMMessage-MultiCURL

Freeswitch can't connect to external sip profile on server

I am using port 5060 set on internal profile while the external has 5080.I have created extensions on the server.
I want user to connect sip server using the external profile defined in external.xml i.e
ext_no#XX.YY.ZZ.PP:5080.It says
2013-12-06 05:48:28.740200 [WARNING] sofia_reg.c:2454 Can't find user [ext_no#XX.YY.ZZ.PP] You must define a domain called 'XX.YY.ZZ.PP' in your directory and
add a user with the id="ext_no" attribute and you must configure your
device to use the proper domain in it's authentication credentials.
While it can successfully connect using internal sip profile by just changing the port no,i.e with sip URI:
ext_no#XX.YY.ZZ.PP:5060 and says:
[WARNING] sofia_reg.c:1432 SIP auth challenge (REGISTER) on sofia
profile 'internal' for [ext_no#XX.YY.ZZ.PP] from ip 1.23.169.192
I am on FusionPBX
Please guide.Thanks
Note:i have a valid ext_no and sip uri.Just did not disclose it for security.
To those who voted to close:
This is related to Voip which requires the sip connection to be established between mobile device and server.
The external SIP profile is anonymous and doesn't handle registrations. You would likely want to make a copy of the internal profile say internal-5070 as an example and set the port to 5070. Set the new internal-5070 sip profile with the external sip and rtp IP to use the external IP address. Open up iptables on the local server for SIP port 5070 TCP/UDP and then register the SIP phone to 5070.

detect mobile phone by web server

I would like to know what field within the http packet which was sent by client browser to WEB server can i look to detect whether the request was made from mobile device or from a PC.
My web server is open source which uses C programming language and runs a TCP socket and listens on HTTP port.
Can anyone please let me know.
You need to see for HTTP header called "User-Agent". The value of this will help you determine where the request was made from.
For further details you can check this answer: Auto detect mobile browser (via user-agent?)

Can I connect with WebSocket in an Android app?

I have an Android app and I want to send a text from the Android application to the webpage using HTML5 WebSocket.
Is this possible and if so how?
I'm aware of 2 libs for Android supporting WebSockets from native apps
http://code.google.com/p/weberknecht
https://github.com/tavendo/AutobahnAndroid
Autobahn supports RFC6455 (the final WS spec), integrates well with UI and service apps and support RPC and PubSub over WebSockets.
Disclaimer: I am the author of Autobahn.
A simple google search for 'android websockets' turned up this. He is referring to a GitHub project called websocket-android-phonegap.
Answer is Yes, it is possible to send a text from app to a web page.
WebSocket works on the very principle of server and client over TCP/IP. Just a wrapper created over the TCP/IP layer and built a new data format which is defined by IETF. Details of the data format is available at -
[https://www.rfc-editor.org/rfc/rfc6455][1]
Server accepts websocket connection if requested in correct format. Client here is the web application in which javascript objects are defined solely for this purpose in HTML5.
Easy to use APIs:
Client side programming of the websockets are very easy with new APIs and objects defined.
APIs(events) available for the developer: onopen, onclose, onmessage. All these functions should be defined by the developers java script file.
onopen: The function is called when the server accepts the connections succesfully
onclose: The function is called when the socket connection is closed
onmessage: The function is called when the data is received from the server.
send : the function is not event based but should be triggered when the client has the information to share with the server.

Categories

Resources