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:
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:
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.androidsip
I'm not sure.. but '@' and '/' are not allowed and SipProfile.Builder will make a URI, e.g. "[email protected](or ip)", with username and serverDomain parameters. Just try to set like this.. ("user1", "test.com"), ("user1", "126.96.36.199").
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.
In WalkieTalkieActivity.java I modified the code to be the following:
SipProfile.Builder builder = new SipProfile.Builder("test", "officesip.local");
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.