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

Main Menu

InboundCallRoute Explained

Started by azrobert, March 06, 2014, 11:37:54 AM

Previous topic - Next topic


I helped a newbie with a setup and he asked for an explanation of how the InboundCallRoute worked. I thought answering the question in a separate thread might help others.

This is the route he asked about:

The above rules are use to make calls from an Android phone using CSipSimple softphone. The first rule uses Sip2Sip service to make single stage calls by bridging an inbound call out SP1. The second uses Callcentric to make calls via the AA.

Rules are processed left to right.
When a rule matches a call, it is immediately routed to the destination.
Each rule has 2 tests and the format is:

You can optionally have only 1 test like this:
{test1:dest}  or  {>test2:dest}

If you have 2 tests, both tests must be true to get a match on a rule.
If a test is enclosed in parentheses it is a DigitMap.
If it is not enclosed it is a LITERAL.

Rule {123:dest} is testing for literal "123"
Rule {(1xx):dest} is testing for literal "1" followed by 2 digits
Rule {1xx:dest} is testing for literal "1" followed by 2 alpha "x"

If a test is in this format (Maaa) it uses the DigitMap of a trunk.
Rule {(Msp1):dest} uses SP1 DigitMap for the test.

The tests have different meanings depending if it's a normal inbound call or an inbound call initiated by a softphone/ATA meant to be bridged.

Normal Inbound Call:
Test1 is the CallerID of the inbound call.
Test2 is your UserID of the service provider.


Callcentric sends the extension number as CallerID when a sub-account calls the main account.
101 is the extension number.
17771234567 is your Callcentric UserID.
If both these match the call is routed to the Auto Attendant.

Inbound Call meant to be bridged:
Test1 is your UserID
Test2 is the outbound phone number.


pvpham is your Sip2Sip UserID.
(Msp1) is using SP1 DigitMap to match on the dialed number.
If both tests are true the call is bridged out SP1.

If both rules fail to match, the call is routed to the Phone Port.


Great writeup. Can this be made into a sticky?


Bookmark showing examples of X_InboundCallRoute:

Since we don't have access create our own stickies, the above mentioned forum sub heading can be used as a community sticky. We won't need to ask the moderators to post anything of interest in that thread. I have already included azrobert's excellent explanation in that bookmark. Anyone can post there and build up that bookmark. Try to copy examples that offer a short explanation.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.


I had a mental lapse and called this an explanation of an OutboundCallRoute. I fixed my error.



Thanks. It helps me to understand a little better. Those codes now look less intimidating.


What is this programming language ?

Is the operator ">" is a logic AND gate ?

What is the OR gate operator ?


QuoteWhat is this programming language ?
I think it's OBihai own language.

QuoteIs the operator ">" is a logic AND gate ?
No. It's a separator between test1 and test2.
It's always AND.
To specify only test2 do:

QuoteWhat is the OR gate operator ?
There isn't any.
To do an OR function do:

The vertical bar is the OR operator within a test.


Now my home phone won't work.

I had made a change in the  X_InboundCallRoute: to a new set to see if the Obi change the way I think it should if my understanding of the syntax is correct. I returned   X_InboundCallRoute: back to its beginning before the change. Now the home phone won't dial. I still can answer the inbound call though.

I also still can make call from my cell phone.

Before the change, when I hit the TALK on my home phone handset, the phone starts with the burst of short tone then the long tone. Now it just the long tone. What I did wrong.



The X_inboundCallRoute should only affect inbound calls.

Outbound calls use the Phone Port DigitMap and OutboundCallRoute.
Also the ITSP A DigitMap is used, but since the Cell can still make calls the DigitMap should be OK.

Did you accidentally change any of the above. Check the ITSP A DigitMap and see if it's the same as what you changed it to.

Is the Phone Port DigitMap and OutboundCallRoute set to default?
If not please post them.


My phone control box failed( It's a Uniden with two hand set). It happened coincidentally the same time when I made change to the OBi and reboot. That made me thinking that I did something wrong. I replaced it with the spare and everything is OK now.


I would like inbound call to ring 2nd cell phone and 2nd cell phone to make direct call.

I change the X_InboundCallRout: to {pvpham|userid2>(Msp1):sp1},{101|102>17771234567:aa},{ph}
userid2 is Sip2Sip account of 2nd cell phone.
102 is extension of Callcentric for cell phone 2

is the above code correct ?

on cell phone 2:

Register Callcentric
Register Sip2Sip
Set filter rule for Sip2Sip

What-else do I need to do ?



Your config looks good.

m, M, s, S, x, X  are reserved characters. If you have any of these in your UserID they must be in quotees like this:


If that's not the case then do the same routine as the 1st account.
Check Sip2Sip call history and everything I said to check on the cell


Quote from: azrobert on March 09, 2014, 09:38:01 PM
m, M, s, S, x, X  are reserved characters. If you have any of these in your UserID they must be in quotees like this:


I gave you false information. This only applies when the test is a DigitMap  (enclosed in parentheses) like this:

Ignore what I told you.


I run into a set back when adding a second cell phone into the scheme:

For some reason, the CSipSimple apt that I installed in my second cell phone does not have the Filter function in its setting. I guess that because the operating system for my second cell phone is old ( Android 2.3.5, Gingerbread) that make the CSipSimple adapted itself to the old version. I can not set the filter rule for the Sip2Sip

Is there any way that I can put a filter ( Suffix with @myIP:port) somewhere in the OBi code ? instead of on the  cellphone side


I setup CSipSimple on an older version than 2.3.5. and it had filters.
Filters are the last option under settings.
Are you scrolling down far enough?

Filters must be on the cell.


Try This:

In CSipsimple select Accounts
Select Add Account.
Choose BASIC Wizard
Account name = anything
User = userid2
Server =
Password = anything

Press and hold on the account name.
When a new screen appears, select "Choose Wizard".
Select Expert Wizard
Select your account again by tapping name.
Select Registration URI and blank it out, then ok.
SAVE. is your OBi IP address and port.
Use the CSipSimple dialer to make calls.


I can make call from cell #2 using both Native and CSipSimple dialer using Sip2Sip account . However I do not know if it works to my intention which is to be able to make call thru GV or phone plan at my choosing. It always work because cell phone #2 has a phone plan. Sip2Sip account history does not show anything. I do not know how to verify that the call I made is thru the phone plan or thru OBi>GV

Also when call made to GV(sp1) cell phone #2 won't ring.

Here what I did:
SP2 :
X_InboundCallRout: {pvpham|userID2>(Msp1):sp1},{101|102>17771234567:aa},{ph}

pvpham is Sip2Sip account of 1st cell phone ( no phone plan)
userid2 is Sip2Sip account of 2nd cell phone( has phone plan with PagePlus)
101 is extension of Callcentric for cell phone 1
102 is extension of Callcentric for cell phone 2

CsipSimple: add account with Callcentric  for 102, add account with Sip2Sip per your instruction for userID2

X InboundCallRout: {ph,sp2(17771234567101|;ui=$1)}


Did you setup cell#2 with my Reply#15 instructions?
Do you have a data plan on cell#2 or do you have a plan for only calling?
If you have a data plan on cell#2, when you are out of the house do you want to use the data plan to make calls using the OBi100?

My reply#15 instructions do not use Sip2Sip and will only work on your local WiFi network.
If you want to use your data plan on Cell#2, you must use the previous instructions with the filter.


Check the OBi100's call history to make sure Cell minutes are not used.
Log directly into the OBi100 using the Web interface.
Go to Status -> Call History

SP1 X InboundCallRoute: {ph,sp2(;ui=$1) ,sp2(;ui=$1)}


Hi.  I've been using an OBi 110 with Google Voice for a couple of years with just a basic config.  However, now that Google is ending XMPP support, I have started to look at doing more with the OBi.  I currently have it configured with Google Voice on sp1 and Callcentric on sp2.

My question concerns making changes to X_InboundCallRoute on the sp2 voice service.  Currently this is configured as follows:

{(x.1nnnnnnnnnn):aa},{>17771234567:ph} ----> where 1nnnnnnnnnn is my mobile number.  (This is how I found it when I went to modify the config for the first time.)

I read azrobert's posts on how to configure the inbound call routing so that my Callcentric sub-account can access the OBi's auto attendant.   I changed my X_InboundCallRoute to this:


As instructed, I submitted the change and rebooted the OBi.  It worked the first time I tried it, but then the OBi automatically reset X_InboundCallRoute back to {(x.1nnnnnnnnnn):aa},{>17771234567:ph} after a few minutes.  I tried this again several times with the same result.  Finally, I made the change, submitted, rebooted and waited for about a minute without attempting a call.  Sure enough, the config had reset itself again.

Has anyone else experienced this?  Am I missing something?  Forgive me for being a noob.  I have a background in networking from years ago, but sip and voip are new to me.  Any help would be appreciated.  Thanks.