News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Obi202/Zoiper for Android setup

Started by ats1080, May 10, 2016, 06:30:42 AM

Previous topic - Next topic

ats1080

(solved - see bottom of this post)

Hello,

I am using Google Voice set up on SP1 and I have some old android phones I want to use as wireless handsets in the house along with a wired land line phone plugged directly in to the Obi202.  I have been reading for 2 days now about various setups and trying everything possible, but have so far been unable to get incoming calls with Zoiper.  Outgoing calls were very easy to set up using this guide http://blog.obihai.com/2012/08/use-your-obi202-as-google-voice-gateway.html?m=1 but still no incoming calls.  I looked at sip2sip but I don't want the SIP port open to the internet, especially since I have no need for access outside my home network anyway.  Here is my current setup (from link above):

On the OBi202, set up the following parameters:
-          ITSP Profile B/General/SignalingProtocol = SIP (default)
-          ITSP Profile B/SIP/ProxyServer = 127.0.0.1    (a dummy non-empty value)
-          ITSP Profile B/SIP/X_SpoofCallerID = yes (or checked)
-          SP2/X_ServProvProfile = B
-          SP2/X_UserAgentPort = 5061 (default)
-          SP2/X_RegisterEnable = no (or unchecked)
-          SP2/AuthUserName = nexus
-          SP2/AuthPassword = (blank)
-          SP2/X_Proxy = yes (or checked)
-          SP2/X_InboundCallRoute = {nexus>:SP1}  
-          SP1/X_InboundCallRoute = {SP2(nexus@local_client)}

These are the setting I'm using in zoiper:
-          Host = 192.168.0.41:5061
-          Username = nexus
-          Password = (blank) - you can use a blank password by entering a single space
-          Authentication user = nexus
-          Outbound proxy = 192.168.0.41:5061
-          Subscribe for register = no


=============================================================


Correct settings:

The Following assumes Google Voice is set up on SP1 and SP2/ITSP B is free for use.  Change these settings according to your setup.

On the OBi202, set up the following parameters:
-          ITSP Profile B/General/SignalingProtocol = SIP (default)
-          ITSP Profile B/SIP/ProxyServer = 127.0.0.1    (a dummy non-empty value)
-          ITSP Profile B/SIP/X_SpoofCallerID = yes (or checked)
-          SP2/X_ServProvProfile = B
-          SP2/X_UserAgentPort = 5061 (default)
-          SP2/X_RegisterEnable = no (or unchecked)
-          SP2/AuthUserName = 2000
-          SP2/AuthPassword = (blank)
-          SP2/X_Proxy = yes (or checked)
-          SP2/X_InboundCallRoute = {2000>:SP1}  
-          SP1/X_InboundCallRoute = {ph1,ph2,sp2(2000@ip.addr.of.phone:(local SIP Port below)),sp2(2000@ip.addr.of.phone:(local SIP Port below)} Ex. {ph1,ph2,sp2(2000@192.168.0.30:20124),sp2(2000@192.168.0.35:20123)}

On each phone with Zoiper set up the following parameters:
-          Accounts settings/Host = ip.addr.of.obi202:(port of your SPx) Ex. 192.168.0.41:5061
-          Accounts settings/Username = 2000
-          Accounts settings/Password = (blank) - you can use a blank password by entering a single space
-          Accounts settings/Authentication user = 2000
-          Accounts settings/Outbound proxy = ip.addr.of.obi202:(port of your ITSP) Ex. 192.168.0.41:5061
-          Accounts settings/Subscribe for register = no
-          Connectivity settings/Listening Ports/Local Sip Port/Random Port = off
-          Connectivity settings/Listening Ports/Local Sip Port/Port = any unused port Ex. 20123

ianobi

The problem may be the use of "Reserved Characters" in the username.
Reserved Characters are m, M, s, S, x, X

Try replacing nexus with a number such as 384521 in all fields where it occurs in the OBi and the Zoiper.

If that solves the problem, then you can try any other alphanumeric combinations not using reserved characters or, if you really want to use nexus, then there is a rather messy way around the problem using single inverted commas in just the right places.

ats1080

Thanks for the reply.  I initially mimicked the article I posted using 1001 as the username and was unsuccessful with that as well which is when I switched to a alpha username.  I will try again quick to double check.

ats1080

Well...I have no idea why it decided to work now, but it does?  ???  Maybe in my frustration of testing I was not leaving enough time to let services fully restart?  I did use 2000 as the username this time instead of 1001, but I don't see how that could have mattered.  Maybe I'll try switching back to 1001 sometime but right now I don't want to break it lol.

Another question...Can I have multiple softphones set up using username 2000 that all ring at the same time, or can you only have 1 softphone per username?

ianobi

I'm glad to see it's working   :)

The username could be any random number. Use something obscure for extra security.

QuoteAnother question...Can I have multiple softphones set up using username 2000 that all ring at the same time, or can you only have 1 softphone per username?

I really don't know! The usual answer is that you can "fork" an incoming call to four devices. The OBi202 ph and ph2 count as devices. I don't have an OBi202 so I can't test how your setup would work.

My preferred method of using android phones as "extra OBi handsets" is described here:
http://www.obitalk.com/forum/index.php?topic=6561.msg41523#msg41523

It does require using an android softphone that can have accounts that do not require registration, I use CSipSimple. In the method described in that post you can fork incoming calls to up to four devices. Devices that are not the OBi Phone Port need an individual ip address / port.


ats1080

Quote from: ianobi on May 10, 2016, 10:14:53 AM
QuoteAnother question...Can I have multiple softphones set up using username 2000 that all ring at the same time, or can you only have 1 softphone per username?

I really don't know! The usual answer is that you can "fork" an incoming call to four devices. The OBi202 ph and ph2 count as devices. I don't have an OBi202 so I can't test how your setup would work.

I'll let you know later today!  I'm not really sure what you mean by "fork"ing ;D the number.  I read over your post and didn't really understand it.  Were you trying to say I would need to set up SP3/ITSP C and SP4/ITSP D to get more phones working?  I need to set up freepbx again and break some stuff to learn VoIP again.  Back in college I did a project with freepbx with trunks to everyone else and a handful of IP phones but VoIP is apparently not like riding a bicycle because I forgot almost all of it lol.

ianobi

The "forking" is done on inbound calls. In most cases something like this:

Voice Services > SP1 Service > X_InboundCallRoute:
{ph,sp1(2001@192.168.1.10:20123),sp2(2002@192.168.1.11:20124),sp2(2003@192.168.1.12:20125)}

Means: ring the phone attached to the OBi and also use sp1 to ring 2001, sp2 to ring 2002 and 2003. The first to answer wins the race and all other devices will stop ringing.

In your case the incoming calls are being sent to "local_client". I don't know, but maybe something like this would work:

SP1/X_InboundCallRoute = {SP2(2001@local_client),SP2(2002@local_client),SP2(2003@local_client)}

Also change this:
Voice Services -> SP2 Service -> MaxSessions : 4
This allows sp2 to cope with up to four simultaneous calls.

Let us know if you get around to trying it.

ats1080

Quote from: ianobi on May 10, 2016, 11:04:02 AM
The "forking" is done on inbound calls. In most cases something like this:

Voice Services > SP1 Service > X_InboundCallRoute:
{ph,sp1(2001@192.168.1.10:20123),sp2(2002@192.168.1.11:20124),sp2(2003@192.168.1.12:20125)}

Means: ring the phone attached to the OBi and also use sp1 to ring 2001, sp2 to ring 2002 and 2003. The first to answer wins the race and all other devices will stop ringing.

Ah, that makes a lot more sense.  One question for you...where are the other usernames coming from?  2001, 2002, 2003?  In the config for ITSP I can only see 1 box for username per ITSP, unless you can seperate by comma?

I'm not exactly sure what "local_client" is supposed to be, but it works.  Maybe someone else can chime in on that?

I actually saw the MaxSessions change suggested in another thread so I did have that already set up.

ianobi

QuoteOne question for you...where are the other usernames coming from?  2001, 2002, 2003?  In the config for ITSP I can only see 1 box for username per ITSP, unless you can seperate by comma?

Each SPx is equivalent to a "voip device". Voice Services -> SPx Service -> AuthUserName is its CallerID and so it can only have one. This is useful for routing calls to it. Each ITSP does not have to be directly linked with each SPx. In fact several SPx's can share an ITSP. We have to be a bit careful with terminology!

In my example 2001, 2002, 2003 are the usernames (CallerID) of each of the non-OBi devices and can be used to direct calls to them.

CallerIDs can also be used to filter calls arriving at an OBI device. For example, only accepting calls with certain CallerIDs.

In this example:
Voice Services > SP1 Service > X_InboundCallRoute:
{ph,sp1(2001@192.168.1.10:20123),sp2(2002@192.168.1.11:20124),sp2(2003@192.168.1.12:20125)}

2001 etc are only needed to give the correct format, the call will be sent to the ip address / port regardless and if the call is acceptable to the device then it will ring. It may need the correct CallerID from the OBI (its SPx AuthUserName).

The problem with this:
SP1/X_InboundCallRoute = {SP2(2001@local_client),SP2(2002@local_client),SP2(2003@local_client)}

Is that I can't see how the "local_client" can send an incoming call to more than one device. It may be that that's its limit.

Perhaps you would like to consider my alternative method posted earlier. It has been used in various forms by myself, azrobert and RonR and works very reliably. The method you are using was intended to connect one ip phone to the OBi202 by registering it to an SPx.

Anyhow, getting late in my part of the world. I'll be back tomorrow. Keep posting, it's always good to see someone trying new things  :)





ats1080

I spent another hour or so on this tonight...  But, I finally figured out why my configs from before were not working.  Apparently the local_client is some sort of variable that stores the IP and Port of the client.  What I did NOT know was that Zoiper has a setting for listening ports and by default it is set to Random.  So...After I found that setting I changed it to 20123 on one phone and 20124 on the other phone (just using your ports as a suggestion...doesn't really matter) and now it rings on both phones at the same time.  I updated my original post to reflect these changes.

ianobi

Interesting. You seem to have designed a hybrid between the original Obihai config using the OBi202 as a proxy for the ip phone to register with and the suggested config in my link, which details how to use softphone accounts which must operate without registering, but can connect with any OBi device.

Zoiper needs to register to work and you have achieved that with your config. For OBi202 owners that does present some new opportunities to use different softphones.

Just when you think you've seen it all ...    :)

ats1080

Haha, glad I could bring up something new.  Hopefully it is helpful to someone.  As far as I can tell you can have unlimited (restricted to number of ports available: 65535 - 20 or so already used) devices on one ITSP setup.  All you need to do is add more ",sp2(2000@ip.addr.of.phone:(local SIP Port below)" to the end of the inbound route.  I currently have 4 smartphones using username 2000 on ITSP B and they all ring on an inbound call and can call out flawlessly.  I have not tried simultaneous calls yet, not sure if that would work or not.

ianobi

Assuming that your sp1 InboundCallRoute includes ph1 & ph2, then you appear to have exceeded four terminals. Four used to be the maximum, I wonder if a firmware update has changed that or maybe it's just your unique setup that makes it work.

You might like to have a look at security issues - search for "scanners" on this forum. Like myself and others, you are using "single-stage" or "through dialling" here:
SP2/X_InboundCallRoute = {2000>:SP1}

A scanner who finds the correct ip address / port (your example 192.168.0.41:5061) might well try a CallerID of 2000 and then have access to your SP1 service. You might wish to change the 2000 to something really odd - say ten alphanumeric characters, but not the "Reserved Characters" mentioned earlier. Also I would change the port away from 5061, which is very common in SIP. Change SP2/X_UserAgentPort to something above 30000. That would require changing in the two places you have used it in the Zoiper config also.

Might sound a bit paranoid, but scanners really are looking all the time. Of course Google is free unless you have funds in your account for international calling, but even so ...

ats1080

Quote from: ianobi on May 11, 2016, 05:25:56 AM
Assuming that your sp1 InboundCallRoute includes ph1 & ph2, then you appear to have exceeded four terminals. Four used to be the maximum, I wonder if a firmware update has changed that or maybe it's just your unique setup that makes it work.

I'm not sure.  Now that I look back I only had 3 smartphones hooked up, so I'm still over the 4 terminals. My inbound config is this: {ph1,ph2,sp2(2000@192.168.0.30:20124),sp2(2000@192.168.0.35:20123),sp2(2000@192.168.0.33:20125)}

Quote from: ianobi on May 11, 2016, 05:25:56 AM
You might like to have a look at security issues - search for "scanners" on this forum. Like myself and others, you are using "single-stage" or "through dialling" here:
SP2/X_InboundCallRoute = {2000>:SP1}

A scanner who finds the correct ip address / port (your example 192.168.0.41:5061) might well try a CallerID of 2000 and then have access to your SP1 service. You might wish to change the 2000 to something really odd - say ten alphanumeric characters, but not the "Reserved Characters" mentioned earlier. Also I would change the port away from 5061, which is very common in SIP. Change SP2/X_UserAgentPort to something above 30000. That would require changing in the two places you have used it in the Zoiper config also.

Might sound a bit paranoid, but scanners really are looking all the time. Of course Google is free unless you have funds in your account for international calling, but even so ...


As far as security, I'm fairly certain I don't need to worry about it (correct me if I'm wrong).  I have my Obi behind my router/firewall (not using the Obi as a router, just a host on my LAN) and no ports are being forwarded to it so unless there's something I'm missing (some connection that goes back to Obi that can be exploited?) running a port scan will not pick anything up unless they are already inside my network, which means I have more problems than someone making free calls through my Obi  :o

ianobi

Yes, you should be secure. Your sp1 is GV, which uses XMPP and does not suffer from SIP scanners. Your sp2 does use SIP, but should only be exposed to devices within your own router subnet, so again you should be ok there.

I'm a belt and braces man. Stay secure - never let your defences / trousers / pants fall down    :)