July 23, 2021, 11:45:26 pm *
Welcome, Guest. Please login or register.
News:
 
   Forum Home   Search Login Register OBiTALK  
Pages: [1] 2
  Print  
Author Topic: routing all calls thru asterisk 11.2 using Obi202 and obi110 with pstn  (Read 30289 times)
cssobi
Newbie
*
Posts: 13


« on: November 29, 2013, 05:18:38 am »

Need help on routing all calls thru asterisk 11.2 using Obi202 and obi110 with pstn.

What are the basics that need to be setup to get the following working?

We have the following hardware/software and are located in the USA
Obi110 static ip 192.168.1.25 with connected telco line (pstn)
Obi202 static ip 192.168.1.23 [actually 3 obi202 but listing one to get basics working]
asterisk [11.2] static ip 192.168.1.3

we want all calls that originate from either obi or pstn to go through asterisk first with one possible exception 911.
for example with 4 requirements:
requirement 1) if user dials other obi phone extensions that it first is sent to asterisk and then asterisk calls the corresponding extension
requirement 2) if user wants to make outside call using the pstn that it first is sent to asterisk and then asterisk sends it to  [or back to]  obi110 pstn to make the call
requirement 3)  on incoming obi110 pstn calls they are routed to asterisk which decides which extensions to ring or perhaps AA
requirement 4) on all phones if  7 to 11 digits are dialed to route to asterisk first and then to obi110 pstn
without selecting any prefix codes such as **8 or **3, etc. International calls can required those codes.

we are not interested at this time to do anything with obitalk nor google voice.
We are familiar with asterisk sip.conf and extension.conf.

It appears we need to know what to setup on the obi's side in
service providers->
voice services-> [including trunk groups]

can someone spell out especially the obi sides to do the above?

Thanx

css
« Last Edit: November 29, 2013, 05:20:46 am by cssobi » Logged
Usetheforceobiwan
Full Member
***
Posts: 162


« Reply #1 on: November 29, 2013, 06:18:24 am »

This would be a good start:  http://tech.iprock.com/?p=3279
Logged
cssobi
Newbie
*
Posts: 13


« Reply #2 on: November 29, 2013, 07:10:03 am »

saw that before ... and revisited ... it is overwhelming with things such as gv and obitalk
which are not in our needs.

seems what we are trying to accomplish should not be that unusual


Logged
drgeoff
Hero Member & Beta Tester
*****
Posts: 5401


« Reply #3 on: November 29, 2013, 10:38:53 am »

I'm somewhat reluctant to respond on this as I won't be able to give precise step by step instructions.  My experience with Asterisk/FreePBX is limited and not doing what you are seeking.  However, some guidelines.

1.  Don't try to get it all working in one shot.  Build it up bit by bit, testing each bit as you go along.

2.  Use fixed IP addresses for the OBis and the PBX.

3.  Configuring the OBis should be relatively straightforward.  There are 3 aspects:

3.1  If you want 911 calls to not go through the Asterisk then you need another Service Provider for that.  So you need to configure 2 Service Providers and 2 Voice Services.  (SP1 for Asterisk and SP2 for the VoIP SP you are using for 911.)

3.2 You need to think about numbering so that you can craft dial plans which route outgoing calls 2 ways on the OBis and 2 (or more?) ways on Asterisk.  The OBis need to recognise 911 calls and send them to SP2 while all others go to Asterisk on SP1.  Asterisk needs to differentiate calls to other extensions (OBis) from calls to external numbers.

3.3  As far as Asterisk is concerned the OBis (except 110) are extensions and are configured on Asterisk in the normal way with extension number and 'secret'.  Configure the OBis with the same number and secret (Voice services/SP1/SIP credentials) to register with Asterisk.  Use the IP address of your Asterisk box for the field at Service providers/ITSP Profile A/SIP/proxy Server.

With the above, you should be able to make calls between the OBis and make 911 calls.

Next task would be to the PSTN line (in and out) operational.  This is where I'm getting out of my depth as I have no first hand experience with that.  Sad  Have a good read of http://www.obitalk.com/forum/index.php?topic=57.0 and http://www.obitalk.com/forum/index.php?topic=1157.0 .
« Last Edit: November 29, 2013, 01:38:15 pm by drgeoff » Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #4 on: November 29, 2013, 03:47:46 pm »

I'm an Asterisk novice.
I hope this give you a guide on how to accomplish your requirements.
I did not test any of this.

I would 1st setup naming convention for OBi extensions something like:
101 - PH1 on OBi110
201 - PH1 on OBi202#1
202 - PH2 on OBi202#1

Setup a trunk for each OBi:
type=peer
username=robert1
host=192.168.1.101 (OBi110 IP addr)
port=5060

type=peer
username=robert2
host=192.168.1.102 (OBi202#1 IP addr)
port=5060

OBi110

Register SP1 as an Asterisk extension.

ITSP A DigitMap
(1?xxxxxxxxxx|xxxxxxx|201|202|011xx.)

ITSP A -> SIP
X_SpoofCallerID: Enabled (checked)
This is needed to pass CallerID to Asterisk.

Phone PortOutboundCallRoute:
{911:li},{(Msp1):sp1},(include defaults if you want)
This will route 911 to line and 7,10 or 11 digit numbers to Asterisk.
Extension numbers will also be routed to Asterisk.

Line InboundCallRoute:
{sp1(999@192.168.1.100:5060}  (Asterisk IP address)
This will route any Line inbound calls to Asterisk.

SP1 service X_InboundCallRoute
{robert1>(Msp1):li},{robert1>101:ph}
This will route 7 10 or 11 digit numbers from Asterisk to Line.
101 from Asterisk will be routed to the phone port.

OBi202

Register SP1 as an Asterisk extension.

ITSP A DigitMap
(911|1?xxxxxxxxxx|xxxxxxx|101|201|202|011xx.)

Phone PortOutboundCallRoute:
{(Msp1):sp1},(include defaults if you want)

SP1 service X_InboundCallRoute
{robert2>201:ph1}.{robert2>202:ph2}

« Last Edit: November 30, 2013, 11:31:05 am by azrobert » Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #5 on: November 29, 2013, 04:49:35 pm »

Here is another method to route inbound calls to extensions.

Define a dummy extension on Asterisk for each OBi extension.
In the Asterisk extension definition change the Dial parms to:
SIP/101@192.168.1.101:5060
SIP/201@192.168.1.102:5060
SIP/202@192.168.1.102:5060


Obi110
SP1 service X_InboundCallRoute
{robert1>(Msp1):li},{>101:ph}

Obi202
SP1 service X_InboundCallRoute
{>201:ph1},{>202:ph2}

I removed the peer number test in the inbound route because I'm not sure what it would be.
I think it will be the UserName you used for the SP1 extension, so it could be different names depending on which OBi originated the call.
You can see the peer number in the OBI Call History. You can then add it to the X_InboundCallRoute if you want more security.

I made changes to my 1st post. I forgot the extension numbers in the DigitMap.
Logged
drgeoff
Hero Member & Beta Tester
*****
Posts: 5401


« Reply #6 on: November 30, 2013, 02:40:26 am »

........
Setup a trunk for each OBi:
.........
Register SP1 as an Asterisk extension.
.........
I'm puzzled by that as I would have set the OBis as Asterisk extensions.  However, I did use the word "would" in the previous sentence to make it clear it isn't something I have done and I cannot say with certainty that it works.  Therefore I'm not going to say that setting a trunk for each OBi is incorrect or won't work.
Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #7 on: November 30, 2013, 08:14:38 am »

I have a setup like this and it DOES work.
I'm sure there are other ways to do this.
I can see why my posts can be confusing, so here is an explanation.

In my 1st post you define an extension and a trunk in Asterisk for each OBi.
The extension is used to send outbound calls to Asterisk with a destination of the OBi110 Line Port or OBi Phone Ports.
The Trunk is used to send the above calls back to an OBi.
I used SP1 on the OBi's for both the extension and the trunk. You could use another SPx for the Asterisk trunk. The trunk is not defined on the OBi except for the inbound route and is not registered.

I'm an Asterisk novice and don't know how to send an outbound phone number to the OBi110 destined to the Line Port using only an extension. That is the reason for the Asterisk trunk.

You could use an Asterisk extension to route calls back to the OBi destined for a Phone Port. If you did it this way I think you would need an extension for each OBi Phone Port. The OBi would route the call based on which extension received the call. Doing my way using a trunk you route the call based on the extension number (101,201....).

In my 2nd post you define a dummy extension (not defined on the OBi) for each Obi Phone port. You could use the existing Asterisk extensions from my 1st post, but would need to define a dummy for the 2nd Phone Port on the OBi202s. The call comes in the same as using a trunk and OBi routes the call based on the extension number.

Edit:
I forgot about international calls. The DigitMaps have been updated.
« Last Edit: November 30, 2013, 03:06:17 pm by azrobert » Logged
cssobi
Newbie
*
Posts: 13


« Reply #8 on: November 30, 2013, 11:49:05 am »

>I have a setup like this and it DOES work.

Is it in asterisk?
if so what were entries for sip.conf and extensions.conf


Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #9 on: November 30, 2013, 02:43:41 pm »

I'm running PBX in a Flash with FreePBX version 2.9.0.12 and Asterisk version 1.8.13.0. I'm not familiar with any conf files nor do I use them.

There is nothing special you have to define with this setup. You define an extension and a trunk for each OBi. Define an outbound route for the OBi110 trunk that includes phone numbers, 911 and extension number 101. Define an outbound route for the OBi202 trunk which includes extension numbers 201 and 202.

For OBi110 inbound Line calls forwarded to Asterisk use an inbound route to send the call to an extension as described in my second post.
« Last Edit: November 30, 2013, 03:08:01 pm by azrobert » Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #10 on: November 30, 2013, 03:51:54 pm »

Judging by your question I assume you have an Asterisk setup without FreePBX and you're probably not familiar with FreePBX.

I looked at a sample sip.conf and extensions.conf. It looks like sip.conf is the equivalent of FreePBX's trunk and extension definitions and extensions.conf is the equivalent of the inbound and outbound routes.

Here is my trunk definition:
type=peer
username=robert1
host=192.168.1.101
port=5060
fromuser=robert1
canreinvite=no
insecure=invite,port
qualify=yes
nat=yes

I took the default settings for my extension definitions except for Password and Dial.

I have no idea how this translates to sip.conf.

It looks like the Dial function is in extensions.conf.

Logged
cssobi
Newbie
*
Posts: 13


« Reply #11 on: November 30, 2013, 04:13:47 pm »

Robert,

when I enter a 11 digit number I see it go to asterisk (CLI) but then it rings busy


css
Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #12 on: November 30, 2013, 04:45:07 pm »

Make the following change.
Obi110
SP1 service X_InboundCallRoute
{robert1>(Msp1):li},{>101:ph},{ph}

This will ring the OBi110 phone port.
This will indicate you're call is getting to the OBi110, but something is not matching.

We are going out for dinner, so I'm signing off for the night.
« Last Edit: November 30, 2013, 04:47:47 pm by azrobert » Logged
cssobi
Newbie
*
Posts: 13


« Reply #13 on: December 02, 2013, 10:57:08 am »

thanks for your input,
I was able to get the fundamentals working [will be trying with 3 Obi202s soon]....
the reason I was getting a busy was because of an extra parenthesis in extensions.conf ...

on your post with adding a trunk for obi202 i.e. the one with robert2
I haven't added that ... when might that be useful or needed?
Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #14 on: December 02, 2013, 02:10:22 pm »

I'm not thinking clearly and making things more difficult than it has to be. I have 2 OBi110s and I call the extension on the other OBi110 by passing the extension number out the Asterisk trunk, therefore I need a trunk on Asterisk for each OBi110. I can use the other OBi110's SPx trunks the same way. I had to do it this way because all my OBi110 SPx trunks are used for Service Providers and I can't use them for Asterisk extensions. I use a Voice Gateway to send commands to Asterisk. Anybody out there that thinks I'm crazy to use Asterisk this way, I DON'T. I setup Asterisk as a learning experience and normally have it powered off.

Anyway, it doesn't make sense for you to do it this way since you have the SPx trunks for Asterisk extensions. Here is my revised suggestion for your setup:
 
Asterisk

Setup a trunk for the OBi110:
type=peer
username=robert1
host=192.168.1.101 (OBi110 IP addr)
port=5060

Setup Extensions 101, 201 and 202


OBi110

Register SP1 as Asterisk extension 101.

ITSP A DigitMap:
(1xxxxxxxxxx|xxxxxxx|011xx.)

ITSP A -> SIP
X_SpoofCallerID: Enabled (checked)
This is needed to pass CallerID to Asterisk for inbound calls on Line.

Phone Port DigitMap:
((Msp1)|201|202|911)

Phone PortOutboundCallRoute:
{911:li},{((Msp1)|201|202):sp1}

Line InboundCallRoute:
{sp1(999@192.168.1.100:5060}  (Asterisk IP address)

SP1 service X_InboundCallRoute:
{robert1>((Msp1)|911):li},{ph}

OBi202

Register SP1 as Asterisk extension 201.
Register SP2 as Asterisk extension 202.

ITSP A DigitMap:
(911|1xxxxxxxxxx|xxxxxxx|011xx.)

Phone Port1 DigitMap:
((Msp1)|101|202)

Phone Port1 OutboundCallRoute:
{((Msp1)|101|202):sp1}

SP1 service X_InboundCallRoute:
ph1

ITSP B DigitMap:
(911|1xxxxxxxxxx|xxxxxxx|011xx.)

Phone Port2 DigitMap:
((Msp2)|101|201)

Phone Port2 OutboundCallRoute:
{((Msp2)|101|201):sp2}

SP2 service X_InboundCallRoute:
ph2


Edit:
You should include the default rules for the Phone Port DigitMaps and OutboundCallRoutes.
« Last Edit: December 02, 2013, 03:21:40 pm by azrobert » Logged
cssobi
Newbie
*
Posts: 13


« Reply #15 on: December 10, 2013, 07:00:29 am »

>Line InboundCallRoute:
>{sp1(999@192.168.1.100:5060}  (Asterisk IP address)

the routing of '999' to asterisk ip address port 5060 to asterisk [11.2] gets to asterisk however about 1/4 of the times it is rejected because an incorrect [asterisk] context is set. Right now I expect the context to be unauthenicated which it appears to be about 3/4 of the incoming OBI110:LI calls but about 1/4 calls asterisk rejects it because it lands under another context name (LocalSets). 

Anybody have clue why this is so?

Logged
cssobi
Newbie
*
Posts: 13


« Reply #16 on: January 04, 2014, 09:20:20 am »

>the routing of '999' to asterisk ip address port 5060 to asterisk [11.2] gets to asterisk >however about 1/4 of the times it is rejected because an incorrect [asterisk] context is set. >Right now I expect the context to be unauthenicated which it appears to be about 3/4 of the >incoming OBI110:LI calls but about 1/4 calls asterisk rejects it because it lands under >another context name (LocalSets). 

I think this is caused by having sp1 doing both obi internal calls and routing of incoming all through same port ....

so I have attempted to make robert1 trunk go through sp2 and port 5061 but now obi110 doesn't see incoming pstn calls nor send them to asterisk ... Can someone tell me which specific adjustments I need to make so incoming pstn stuff goes through sp2 and the robert1 trunk?

Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4148


« Reply #17 on: January 04, 2014, 12:08:48 pm »

On the OBi110:

SP2 must be defined as a SIP trunk to send/receive to/from Asterisk.
If SP2 is not defined, setup a dummy SIP definition like this:

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

AND

ITSP B DigitMap:
(1xxxxxxxxxx|xxxxxxx|011xx.)

ITSP B -> SIP
X_SpoofCallerID: Enabled (checked)

SP2 service X_InboundCallRoute:
{robert1>((Msp2)|911):li},{ph}
Logged
cssobi
Newbie
*
Posts: 13


« Reply #18 on: January 04, 2014, 05:01:02 pm »

made those mods still nothing on incoming pstn to obi110
Logged
cssobi
Newbie
*
Posts: 13


« Reply #19 on: January 07, 2014, 04:57:42 pm »

i have reverted back to only using sp1

while the incoming call on pstn is routed to asterisk: about half the time the caller id
is wrong and makes the incoming pstn call looks like its coming internally from the obi110 and the other half of the time its correct from the pstn.

spent a lot of time on this ... anybody got an answer to resolving this issue?


Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Advertisement
Advertisement