News:

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

Main Menu

Single-Stage Dialling Using SIP: Four OBi Example

Started by ianobi, November 22, 2012, 07:47:03 AM

Previous topic - Next topic

ianobi

This is a practical example of RonR's elegant design. Please feel free to point out typo's, mistakes and things which are not clear. Between us all we might bring some clarity to this subject.

This example looks at the settings for OBi 1. There are four OBi devices in this network. This list shows their public IP address, router, local IP address, spX to be used for SIP dialling / receiving with corresponding UserAgentPort and userid.

@bill.ddns.me.uk – ROUTER -192.168.1.10 OBI 1 sp2 5061 userid = bill1
                                      192.168.1.12 OBI 2 sp2 5071 userid = bill2
                                      192.168.1.13 PhonerLite 5064 userid = billp

@anne.ddns.co – ROUTER -192.168.1.10 OBI 3 sp1 5060 userid = anne1

@hank.ddns.co – ROUTER -192.168.1.10 OBI 4 sp2 5061 userid = hank1
               

Example OBi 1 dialling through its own trunks:

     18005551212  ->  Local PrimaryLine
**1 18005551212  ->  Local SP1 Service
**2 18005551212  ->  Local SP2 Service
**8 18005551212  ->  Local LINE Port
**9 200123456      ->  Local OBiTALK Service

Example OBi 1 dialling through OBi 3's trunks:

    3*18005551212  ->  OBi 3 PrimaryLine
3**1 18005551212  ->  OBi 3 SP1 Service
3**2 18005551212  ->  OBi 3 SP2 Service
3**8 18005551212  ->  OBi 3 LINE Port
3**9 200123456      ->  OBi 3 OBiTALK Service

Assume OBi 1 Primary Line is sp1.

Voice Services -> SP2 Service -> X_InboundCallRoute (SP2 must be configured for SIP) (OBi110):

{(Mtsc)>(<*1:>(Msp1)),(Mtsc)>(<**1:>(Msp1)):sp1},{(Mtsc)>(<*2:>(Msp2)),(Mtsc)>(<**2:>(Msp2)):sp2},
{(Mtsc)>(<*8:>(Mli)),(Mtsc)>(<**8:>(Mli)):li},{(Mtsc)>(<*9:>(Mpp)),(Mtsc)>(<**9:>(Mpp)):pp},
{(Mtsc)>**0:aa},{(Mtsc)>***:aa2},{(Mtsc)>(Mp2p):sp2},{(Mtsc)>(Msp1):sp1},{(Mtsc)>0:ph},{(Mtsc):},{ph}


User Settings -> User Defined DigitMaps -> User Defined Digit MapX
Label : tsc
DigitMap : (bill2|billp|anne1|hank1)

This is a list of trusted OBi and SIP client userid's that are allowed to use single-stage dialing on this OBi.  Any reserved characters (m, M, s, S, x, X) in userid's must be surrounded by single quotes.  If no other OBi's or SIP clients are allowed to use single-stage dialing on this OBi, the DigitMap may be left empty: ()


User Settings -> User Defined DigitMaps -> User Defined Digit MapX
Label : p2p
DigitMap : (<2*:>(@@.)<:@192.168.1.12:5071>|<3*:>(@@.)<:@anne.ddns.co:5060>|<4*:>(@@.)<:@hank.ddns.co:5061>)

(:sip_port may be omitted for 5060/SP1).

This is a list of destination OBi's through which calls from this OBi or its SIP clients can be initiated.  If you do not wish to initiate calls through other OBi's from this OBi or its SIP clients, the DigitMap may be left empty: ()


Change [1-9]x?*@@. to <P2P>(Mp2p) in the PHONE Port and Auto Attendant DigitMap's:

Physical Interfaces -> PHONE Port -> DigitMap:

(<P2P>(Mp2p)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|**1(Msp1)|**2(Msp2)|**8(Mli)|**9(Mpp)|(Mpli))

Voice Services -> Auto Attendant -> DigitMaP:

(<P2P>(Mp2p)|[1-9]|[1-9][0-9]|<00:$1>|0|**1(Msp1)|**2(Msp2)|**8(Mli)|**9(Mpp)|(Mpli))


Change {([1-9]x?*@@.):pp} to {(<P2P:>@@.):spx} in the PHONE Port and Auto Attendant OutboundCallRoute's:

Physical Interfaces -> PHONE Port -> OutboundCallRoute:

{(<P2P:>@@.):sp2},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},
{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}

Voice Services -> Auto Attendant -> OutboundCallRoute:

{(<P2P:>@@.):sp2},{0:ph},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},
{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}


SIP clients should be configured to make calls without SIP registration.  The SIP proxy should be the IP address or hostname of the OBi (with :5061 appended for SP2).  If SIP clients are located outside the OBi's LAN, ports 5060 and 5061 will need to be forwarded to the OBi in the router.


If you don't have a SIP provider and SP2 is unused, the following will enable SP2 for SIP:

Service Providers -> ITSP Profile B -> SIP -> ProxyServer : 127.0.0.1
Voice Services -> SP2 Service -> AuthUserName : (any userid)
Voice Services -> SP2 Service -> X_RegisterEnable : (unchecked)
Voice Services -> SP2 Service -> X_ServProvProfile : B

In this example Phonerlite (userid = billp) can dial through any trunk of OBi 1 via OBi 1's sp2_InboundCallRoute. PhonerLite is set to call without registration and its Proxy/Registrar is set to OBi 1's sp2 address - 192.168.1.10:5061. OBi 1 can call PhonerLite, or forward calls from InboundCallRoutes using format sp(billp@192.168.1.13:5064). Anyone else can call Phonerlite direct using the format billp@bill.ddns.me.uk:5064.

Each router will need to "port forward" the ports it uses for its UserAgentPorts to receive calls from outside its own local IP range.

CoalMinerRetired

Interesting, but I'm a few steps back in the learning curve/understanding process from experimenting with this just yet.

I notice you have ddns.co listings for the three routers. Assuming this is something like the U.S. dyndns.org thing, can you replace the hardcoded IP address/es (...list of destination OBi's through which calls from this OBi or its SIP clients can be initiated) with the DynDns names?

ianobi

I invented the ddns names, dyndds.org would work fine. In my list  destinations OBi 3 and OBi 4 do have URI formats, only OBi 2 has an IP address because it is local to OBi 1 and these are OBi 1's settings:

User Settings -> User Defined DigitMaps -> User Defined Digit MapX
Label : p2p
DigitMap : (<2*:>(@@.)<:@192.168.1.12:5071>|<3*:>(@@.)<:@anne.ddns.co:5060>|<4*:>(@@.)<:@hank.ddns.co:5061>)

I will have a go at describing a call stage by stage soon to better illustrate how it works.

ianobi

#3
An example call: Bill (OBi 1) is in the UK, Anne (OBi 3) is in the USA. Bill wants to make a call to USA number 12345678912 via Anne's GV service, which is on her OBi sp1.

Bill dials 3**1 12345678912. This is matched in DigitMap Mp2p by the rule <3*:>(@@.)<:@ anne.ddns.co:5060>. This rule deletes 3*, (@@.) accepts the number 12345678912, then @anne.ddns.co:5060 is added. So the number is now *1 12345678912@anne.ddns.co:5060. Then the OBi 1 PHONE Port -> DigitMap rule <P2P>(Mp2p) prepends P2P to the number. The number is now P2P *1 12345678912@anne.ddns.co:5060 (spaces shown for clarification).

Now that number is passed through the OBi 1 PHONE Port -> OutboundCallRoute and is matched by the rule {(<P2P:>@@.):sp2}. This rule removes the P2P, @@. accepts the whole number and it is sent out to sp2. Therefore the number sent to sp2 is *1 12345678912@anne.ddns.co:5060.

Now we move to OBi 3. The OBi 3 sp1 InboundCallRoute is the same as for OBi 1 sp2 InboundCallRoute shown above. OBi 3 tsc DigitMap has to contain the other users' userids, so it is Mtsc : (bill1|bill2|billp|hank1).

Arriving at OBi 3, the router removes the @anne.ddns.co and directs the call to sp1 because it sees port 5060. SIP protocol means the message contains the userid "bill1" from the OBi 1.

The call is accepted by sp1 InboundCallRoute as "bill1" is in Mtsc by the first part of this rule: {(Mtsc)>(<*1:>(Msp1)),(Mtsc)>(<**1:>(Msp1)):sp1}. It removes the *1 and sends 12345678912 to GV on sp1.

So Bill in UK gets his free call to USA number 12345678912  :D

I think I may have to go and lie down for a while...


Clinic802

so suppose the local phone company in a distant land has blocked some VOIP ports, namely 5060 etc.
would the OBi-100 at that location be able to communicate with the USA based OBi202?
.
If not, what work-around is possible?
.
thx

ianobi

This is "peer to peer" calling. I'm assuming that's why RonR chose p2p as the name for that DigitMap. This means that any port number should work, so long as both Obi devices know what it is and that port is not used for anything else.

If distant OBi 2 used UserAgentPort 1234, then calling OBi 1 would need this:

User Settings -> User Defined DigitMaps -> User Defined Digit MapX
Label : p2p
DigitMap : (<2*:>(@@.)<:@someone.ddns.co:1234>)

QBZappy

#6
Although different, there are enough similarities between Linksys PAP2 Dial Plan design and the OBi syntax. This site (Netphone Directory) might be useful in explaining the different parts of a dial plan. If an explanation like this could be found in the OBi Admin manual, it would avoid a lot of grief.

Linksys PAP2 Dial Plan Basics
http://www.netphonedirectory.com/pap2_dialplan.htm
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

Ostracus

I think the dial plan splitting up is one of the things that confuses people.

CoalMinerRetired

Is the syntax discussed here (http://www.obitalk.com/forum/index.php?topic=4658.msg30461#msg30461) a possible mechanism to pass a username and a password in this scheme?

Of course, only do this on your local LAN, not across the public internet.

ianobi

Yes, I'm sure it would work. I will do some testing tomorrow when I have more time. Being able to spoof Caller ID without password would still be useful to this setup. All the routing tricks are done in the InboundCallRoutes using Caller IDs, no passwords required.

Clinic802

Quote from: ianobi on November 22, 2012, 07:47:03 AM
QuoteThis example looks at the settings for OBi 1. There are four OBi devices in this network. This list shows their public IP address, router, local IP address, spX to be used for SIP dialling / receiving with corresponding UserAgentPort and userid.

@bill.ddns.me.uk – ROUTER -192.168.1.10 OBI 1 sp2 5061 userid = bill1
                                      192.168.1.12 OBI 2 sp2 5071 userid = bill2
                                      192.168.1.13 PhonerLite 5064 userid = billp

I don't understand the "userid", is this from the SIP credentials or another source?


QuoteAssume OBi 1 Primary Line is sp1.

Voice Services -> SP2 Service -> X_InboundCallRoute (SP2 must be configured for SIP) (OBi110):

{(Mtsc)>(<*1:>(Msp1)),(Mtsc)>(<**1:>(Msp1)):sp1},{(Mtsc)>(<*2:>(Msp2)),(Mtsc)>(<**2:>(Msp2)):sp2},
{(Mtsc)>(<*8:>(Mli)),(Mtsc)>(<**8:>(Mli)):li},{(Mtsc)>(<*9:>(Mpp)),(Mtsc)>(<**9:>(Mpp)):pp},
{(Mtsc)>**0:aa},{(Mtsc)>***:aa2},{(Mtsc)>(Mp2p):sp2},{(Mtsc)>(Msp1):sp1},{(Mtsc)>0:ph},{(Mtsc):},{ph}

Are these settings for the OBi202 / OBi 1 or for the OBI110 / OBi 2 - 3 - 4?


QuoteUser Settings -> User Defined DigitMaps -> User Defined Digit MapX
Label : p2p
DigitMap : (<2*:>(@@.)<:@192.168.1.12:5071>|<3*:>(@@.)<:@anne.ddns.co:5060>|<4*:>(@@.)<:@hank.ddns.co:5061>)

Is it possible to use different DigitMap's so as to enable "Single-Stage Dialing Through Any OBi Trunk" and also "Single-Stage Dialling using SIP in another DigitMap"?   http://www.obitalk.com/forum/index.php?topic=1103.0


QuoteOBi202

Voice Services -> OBiTALK Service -> InboundCallRoute : {(Mcot)>111:ph1},{(Mcot)>222:ph2},...

Would this be a practical method of choosing which phone port to dial out from on the OBi202 from the OBi110's?   http://www.obitalk.com/forum/index.php?topic=3186.0


Thanks in advance for helping.
I would like to setup the OBi202 in the USA & then have OBi110's in Canada, England & Middle-Far East, either GV is not available or port 5060 is blocked.
SP1 would be GV & SP2 either Callcentric, Anveo.
Its something to do on the weekends as a hobby instead of watching re-runs.

ianobi

Clinic802,

I'm happy to help in what should be an interesting project. I would like to think that you see it as a hobby, not just a way to get free business telecoms. We are mostly amateurs here helping each other.

I think that your first attempt should be using "Single-Stage Dialling Through Any OBi Trunk" as it is less complex and more reliable so long as the OBiTALK network carries on working. Port 5060 is not required for that set up as OBihai uses port 10000 for the OBiTALK network signalling and as users we can use any ports we wish at the local ends. Many of us change the UserAgentPort from 5060 on sp1 to other values to avoid SIP scanners etc. "Single-Stage Dialling Through Any OBi Trunk Using SIP" may be less reliable as it depends on peer to peer direct communications, which can be less reliable.

To answer your questions:

userid = AuthUserName in SPX. This is CallerID and shows as "From" or "Peer Number" in the receiving OBi Call History. It is used in the tsc DigitMap in the receiving OBi to decide if the call is from a "Trusted Caller".

All the settings shown are from the point of view of the OBi110 owned by Bill. This is the OBi110 that makes the example call from the UK to the USA later in my posts.

Mixing "Single-Stage Dialling Through Any OBi Trunk" and "Single-Stage Dialling Through Any OBi Trunk Using SIP" could be possible in your scheme, but with limitations. The problem concerns the changes needed in the Phone Port DigitMap and the PhonePort OutboundCallRoute. You could set the OBi202 to use one scheme using Phone1 and the other scheme using Phone2. Then USA using Phone1 could make and receive calls with Canada and England. USA using Phone2 could make and receive calls with Middle – Far East. In effect it would be two separate schemes with no way for Canada and England to make and receive calls to Middle – Far East. (Except of course any OBi can call any other OBi as a normal phone call).

An OBi110 dialling into the OBi202 and out on one of the OBi202's trunks, would not use any of the OBi202's phone ports. The InboundCallRoute would send a call out on the trunk direct or after being processed by the relevant MspX.

Warning! This hobby will consume a great deal of time. Testing will take time and willing people at both ends. DigitMaps will need to be designed to suit each different country. I'm happy to talk general principles, but you will have a lot of work to do sorting the details  :)


Clinic802

thank you.
The "warning"  should include not for the faint hearted also.
.
I have to read a little more to educate myself on the construction of the digitmaps, if you could direct me to some material, that would be appreciated.

ianobi

This gives an overall idea of how call routing works in the OBi:

http://www.obitalk.com/forum/index.php?topic=513.msg3001#msg3001

I recommend not reading the replies after the first post until you are more experienced with the subject. If you use the search option on this forum subject "digit map" by user "RonR" you can find a lot of good information.

Usually here if you have a go and produce a DigitMap that does not quite work as planned, then someone will have a look and help out.

It would be interesting if you could post your progress here. Others can learn form the good bits and the mistakes  :)