OBiTALK Community

General Support => Installation and Set-Up (Devices) => Topic started by: NewY on February 01, 2013, 12:26:59 AM

Title: Automatic switch between trunks when one becomes unavailable
Post by: NewY on February 01, 2013, 12:26:59 AM
hi, I use one Obi110 and one Linksys PAP2. My provider is callwithus. My obi110 SP1 is google and SP2 is callwithus. I use google to make domestic calls and use callwithus to make international calls. However, Callwithus' registration is not stable on Obi110 but is very stable on Linksys PAP2. So I hook PAP2's phone line to Obi110's line port as a backup. 

My questions is how to set up on Obi110 so that when i make international call with SP2 and SP2 fails to register with Callwithus, it automatically switches to PSTN port (here it is PAP2)?

My thinking is to set up outbound call route configuration. But each rule seems independent. Or I need to work on TrunkGroup?

Please help. Thanks.

Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 01:07:15 AM
I understand somebody posted similar questions here athttp://www.obitalk.com/forum/index.php?topic=2390.msg15480#msg15480.

However, my need is not to switch all calls to the primary line, but only international calls.

Thanks.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 01:21:05 AM
To make it clearer: I want to keep sp1 as my primary line, while have the ability to automatically switch between sp2 and PSTN. How to set up? Thanks.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 06:28:07 AM
NewY,

I'm starting with some assumptions: I'm guessing that sp1 (GV) is your PrimaryLine and you dial **2 to get to Callwithus on OBi sp2 and **8 to get Callwithus via the OBi Line Port and the PAP2. What you would like to do is dial **2 and if Callwithus is failed on sp2, have the call automatically forward to the OBi Line Port.

Trunk Groups are the only way to create a "step-over failed/busy route" facility in an OBi. Please be aware that the OBi sometimes takes a few minutes to realise that it has lost registration with a Service Provider.

Something like this may work for you:

Physical Interfaces -> PHONE Port -> PrimaryLine: SP1 Service
Voice Service -> Auto Attendant -> PrimaryLine: SP1 Service

Physical Interfaces > Phone Port > DigitMap:
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|**1(Msp1)|**2(Mtg1)|**8(Mli)|**9(Mpp)|(Mpli))

Physical Interfaces > Phone Port > OutboundCallRoute
{([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Mtg1)):tg1},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}

Voice Services > Gateways and Trunk Groups > Trunk Group1
TrunkList > sp2,li
DigitMap > ((Msp2)|(Mli))

There are other ways of arranging the trunk group, say by using **6 to access the trunk group, which would leave you free to choose sp2 via **2 when you wanted to. Any of my assumptions at the start of this post might be wrong, so let me know if you want to modify my suggestion.

Always with Trunk Groups, be very careful where 911 is being routed.

Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: Ostracus on February 01, 2013, 06:41:46 AM
Quote from: ianobi on February 01, 2013, 06:28:07 AM
Trunk Groups are the only way to create a "step-over failed/busy route" facility in an OBi. Please be aware that the OBi sometimes takes a few minutes to realise that it has lost registration with a Service Provider.

Doesn't apply to the Obi100/110, but does X_NoRegNoCall shorten that process?
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 06:42:36 AM
xibai,

I think my reply to NewY does what you want: Keep sp1 as PrimaryLine, use sp2 for calls starting with **2, when sp2 fails or is busy divert those calls to PSTN.

Let me know if that's not ok for you.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 06:57:38 AM
Ostracus,

The truth is I don't know! The only Obihai info seems to be:

QuoteAdded SP parameter X_NoRegNoCall, if enabled, do not allow incoming or outgoing calls on that SP service.

Seems more like a user enable/disable setting rather than an automatic test for registration. I don't have an OBi202 to test that function.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 09:14:12 AM
hi, ianobi,

No wonder you are marked as "hero member." Your help is greatly appreciated! I mixed my two accounts. NewY and Xibai are one person. So double thanks to you.

Your approach does make sense. However, I got a message "the number you dialed is rejected" when I intentionally make sp2 "register failed" to test the switch. Apparently, it did not automatically switch to LINE, which is I tested good.

Following is my configuration. Please have a look if you have time:

I call china (86) frequently so

General -> DigitMap>ITSP A
(<**2>[86]x.|*xx|1xxxxxxxxxx|<1607>[2-9]xxxxxx|<1>[2-9]xxxxxxxxx|011xx.|xx.|(Mipd)|[^*]@@.)

PhonePort: DigitMap
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|**1(Msp1)|**2(Mtg2)|**8(Mli)|**9(Mpp)|(Mpli))

PhonePort:OutboundCallRoute
{([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Mtg2)):tg2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}

GateWays & TrunkGrps
TrunkGroup2
TrunkList: sp2,li,sp1
DigitMap: ((Msp2)|(Mli)|(Msp1))

I setup a trunkgroup 2, which includes three channels. My intention is that since both sp2 and Line actually use same callwithus. If callwithus's service down, it will switch to google to make international calls, even though google is a bit expensive.

Let me know where I did wrong. Again, thanks.

Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 09:44:01 AM
QuoteHowever, I got a message "the number you dialed is rejected" when I intentionally make sp2 "register failed" to test the switch.

This seems to indicate that something went out to a service provider. Please look in Status > Call History on your OBi web page to see what you dialled and where the number routed to. I'm assuming that normally you can dial Callwith us via **2 or **8 when all is working normally.

This rule <**2>[86]x. should be written as <**2>86x. Using [86] means 8 or 6. The rule probably worked ok as the numbers started with an 8 anyhow.


QuoteTrunkGroup2
TrunkList: sp2,li,sp1
DigitMap: ((Msp2)|(Mli)|(Msp1))
There is a problem here. The first part should work ok. If sp2 is failed then calls should go to line. However, if Callwithus service is down, that will not make the OBi Line Port fail. So long as the OBi110 sees the voltage around 50v from the PAP2's Phone Port, it will assume all is ok.

Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 10:10:27 AM
ianobi,

Thanks for your prompt response.

1. here is what I got from Call Status when the call was rejected:

Call 1                    Terminal 1                    Terminal 2
Terminal ID             PHONE 1                      Announcement 1
State                    Connected                    Connected
Peer Number           **21(plus my home number)
Direction                Outbound                      Inbound

2. thanks for correcting the digitmap.

3. I will delete sp1 in trunk group 2. You are right. Thanks.

so what could be wrong with the automatic switch?
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 10:24:17 AM
We really need to see Status > Call History after a call has failed. This can only be seen in your OBi web page. Dial ***1 to get the ip address, put that in your browser. To log in the User Name and password will be "admin".

Call History cannot be seen in the OBi Expert Configuration pages.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: hwittenb on February 01, 2013, 10:26:11 AM
xibai,

Although it looks to me like the Trunk approach should work, CallWithUs does not require registration to make an outgoing call.  You can have the SP2 setup to not register and still make calls with CallWithUs over SP2.  The OBi will show an SP2 status of Registration Not Required.  If you do not have incoming calls from a DID with CallWithUs I would try that setting (X_RegisterEnable unchecked). 

Maybe the problem has only to do with the Registration sip sequence failing.  It doesn't make sense that you could make calls with a PAP2 and not the OBi when both are behind the same router unless it has something to do with the sip Registration itself.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 10:31:48 AM
hwittenb,

Thanks for the useful info. I agree the best approach is to fix the problem with callwithus in the OBi.

Looks like it is going to be difficult to make sp2 "fail" in these circumstances.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 10:44:35 AM
thanks you guys,

Here is what I got from the web:

Terminal ID        Phone1                                         SP2
Peer Number      **21(plus ten digits local number)     the ten digits local number
Direction            Outbound                                     Outbound
                                                                          End call (407 proxy authentication required)

to hwittenb, the reason I can not make call through sp2 is because I Intentionally make the registration by putting a wrong password so that I can test the autonomic switch from sp2 to LINE. But hwittenb helps me since I can disable the registration so that incoming calls only routes to PAP2 then to Obi11o LINE to avoid conflict.

By the way, <**2>86x. is better put under the SP1 or phone port? Putting into phone port may be more logoic?
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 10:53:44 AM
As you can see your call went to callwithus on sp2 and then failed due to wrong password. I cannot see a way to make the OBi110 see this route as failed, maybe hwittenb can suggest a way forward.

<**2>86x. is in the correct place. By putting it in your PrimaryLine DigitMap you achieve automatic routing of calls to sp2.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 10:59:45 AM
Thanks,ianobi.

I misunderstood hwittenb's last post. It happened quite frequently that callwithus fails with Obi110 while stable with PAP2. it is weird. Also I have incoming call from other callwithus internal numbers.

So anyway to make obi110 knows when sp2 fails and then automatically switch to LINe?
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 11:15:20 AM
I cannot see a way to make the OBi110 see this route as failed, as registration of the OBi110 is not required, it does not know if anything has failed.

Try to compare settings with the PAP2 and OBi110 to see why OBi110 is less reliable.

If you want to give up on the callwithus via OBi sp2, you could change <**2>86x. to <**8>86x. so making all calls starting with 86 go to the OBi110 Line Port and PAP2 callwithus. This would free up sp2 for another service provider if needed.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 11:25:52 AM
Thanks, ianobi. You help a lot.

Now I just wonder what is the purpose of trunkgroup if it did not serve automatic switch.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: QBZappy on February 01, 2013, 11:27:49 AM
I think a variation of this set up might work.

Re: e911 Backup/Failover
http://www.obitalk.com/forum/index.php?topic=1832.msg11830#msg11830
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 11:35:06 AM
xiabi,

I agree, you really do not need a trunk group in this situation. Your original setup is ok for what you need. Use <**2>86x. or <**8>86x. depending on where you want to send "86" calls.


QBZappy,

The problem here is the OBi simply will never know that sp2 has failed, so it cannot "failover" to another trunk.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: hwittenb on February 01, 2013, 11:37:29 AM
If you have occasional calls from CallWithUs then you do need to have the account registered because that is how CallWithUs knows where to send the call. 

With both adapters behind the same router setup to register to the same CallWithUs account perhaps if the registration requests are going on occasionally at more or less the exact same time there is some contention problem that gets your router confused when the sip packets come back from CallWithUs.

I would setup the OBi to register and set the PAP2 not to register (on the PAP2 set Register: No) so you don't have them both registering at the same time.  Sometimes providers will allow multiple registrations but usually they do not.  When they do not it is usually the last adapter to register that is current registration.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 12:04:39 PM
it looks to me the e911 setting QBZappy mentioned provide a solution. But it is more complicated then my situation. E911 requires dial different numbers with different service providers while here only same number to be dialed.

The "roll over" or "fail over" is what I mean by automatic switch.

ianobi, in my situation, the obi did not konw SP2 fails probably because I put in a wrong password. In reality, it fails due to unknown reason which can be only fixed by restart the router and obi together. It shows "retrying..."

In view of e911, what should i adjust with my obi? Having a PAP2 as backup always better.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 12:14:14 PM
hwittenb, that is probably right for some situations. But I am not sure it is the case here. Callwithus shows both obi and pap2 registration is in good status.

Before I use pap2 with obi. After using obi, i removed pap2. However, obi sometimes fails with callwithus. That is way I am thinking about  hooking pap2 to obi LINE as a backup.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 01, 2013, 12:20:03 PM
QuoteThe "roll over" or "fail over" is what I mean by automatic switch.
Yes, I did understand what you meant.

In my opinion, no "fail over" will work unless your OBi110 can tell that sp2 has failed. I still cannot see how your OBi110 can tell that callwithus has failed. So long as it does not know that callwithus has failed, then it will continue to try to send calls to sp2.

To prove the trunk group works, you could simply uncheck:
Voice Services > SP2 Service > Enable
This will show how it would work if you could make the OBi110 see that callwithus had failed.

I have to log out for today. Please have a read through all the ideas in this thread and try anything that seems sensible. I will be back tomorrow for an update  :)
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 12:29:21 PM
Thanks a lot, ianobi. Obi is really fun to work on even though you can not get whatever you want.

Have a great day!
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 01, 2013, 12:56:17 PM
ianobi, I test the trunkgroup as you said. It works with problem. It automatically switch to LINE when I disable SP2.

I went through the post "e911 backup." It looks like a successful setup. The only thing is that it is more complicated than mine. I need to figure out what is need or not in my situation.

Thanks.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: ianobi on February 02, 2013, 02:17:51 AM
QuoteI test the trunkgroup as you said. It works with problem. It automatically switch to LINE when I disable SP2.

I hope that you meant to say "It works with no problem."  :)

It does prove that the trunk group setup works exactly as you want. The problem that you have is getting the OBi110 to think that sp2 is in a "failed" condition when callwithus backs off. I do not have an answer for that problem.

It is well worth reading "e911 backup." We can all learn a lot from that post, as is often the case with any post involving RonR.
Title: Re: Automatic switch between trunks when one becomes unavailable
Post by: xibai on February 03, 2013, 12:52:11 PM
Ianobi,

It is "without problem". Thanks for all you help. My final configuration is setting up the trunkgroup2 with SP2 going first. But keep SP2 unregistered. PAP2 goes to line.

Thanks for all your help and have a nice weekend.