News:

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

Main Menu

Forking inbound calls to FreePBX

Started by DimaT, February 07, 2016, 07:24:52 PM

Previous topic - Next topic

DimaT

I have Obi 110,  SP1 configured to to be connected to LD provider (DID Logic) - all incoming ring phone line, outgoing  local area, 911, 1-800/877 ->local line, LD ->DID Logic.
Recently I set up FreePBX, and started to wonder if I could fork all incoming (ph line and (maybe) SP1 to FreePBX. In the other words, home phone would ring in addition to what ever extension on FreePBX I set up.
I can probably register SP2 to connect as a trunk to FreePBX, could you pls help me with settings to fork incoming calls?

azrobert

Asterisk

Setup an outbound trunk without registration for the OBi110:
Outbound CallerID: 8005551212
Peer Details:
type=peer
username=OBi110
host=192.168.1.110       (IP Addr of OBi110)
port=5061                        (Port# of SP2)
canreinvite=no
insecure=invite,port
qualify=yes

Setup an outbound route for above trunk
Setup an inbound route for 900 (See OBi110 Line inbound route)

OBi110
Service Providers -> ITSP Profile A  General-> DigitMap:
(1xxxxxxxxxx|011xx.)

Physical Interfaces -> Line Port -> DigitMap:
(911|xxxxxxx|18(00|88|77|66|55|44)xxxxxxx)

Setup a dummy SP2 definition like this:
Service Providers -> ITSP Profile B -> SIP -> ProxyServer: 127.0.0.1
Service Providers -> ITSP Profile B -> SIP -> X_SpoofCallerID: Checked
Voice Services -> SP2 Service -> AuthUserName: OBi110
Voice Services -> SP2 Service -> X_RegisterEnable: (unchecked)
Voice Services -> SP2 Service -> X_ServProvProfile: B
Voice Services -> SP2 Service -> MaxSessions: 4
Voice Services -> SP2 Service -> X_InboundCallRoute:
{8005551212>0:ph},{8004441212>(Mli):li},{8005551212>(Msp1):sp1},{ph}

Fork inbound calls to Asterisk:
Physical Interfaces ->Line Port -> InboundCallRoute:
ph,sp2(900@192.168.1.100:5060)  (Asterisk IP address and port)

Voice Services -> SP1 Service -> X_InboundCallRoute:
ph,sp2(900@192.168.1.100:5060)  (Asterisk IP address and port)

Use the Asterisk trunk CallerID in the SP2 X_InboundCallRoute
Line and SP1 inbound calls will be forked to Asterisk
Setup an Asterisk inbound route for 900
911, 7 digit and tollfree will be routed to Line
11 digit and international will be routed to SP1

DimaT

Thank you for the respond and all your help.
I did set up OBi in the way you, the only difference - ITSP profile B -SIP and Voice Services SP2 I changed ports to 6051 (if I use default 5060 on my PBX server it almost immediately become unresponsive due to hacker attacks), Voice services-SP2-SIp Credentials I used AuthUserName and AuthPassword - since PBX is hosted as VPS, the rest is exactly as you described.
I was not very clear about incoming route "900", this I created trunk as described here:
https://www.obitalk.com/forum/index.php?topic=1157.0 , section 3 - Creating FXO port.
Trunk settings are:

username=OBITRUNK1
secret=XXXXXXXXX
host=dynamic
type=friend
port=6051
context=from-trunk
qualify=yes
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw

caller ID - 8005551212, name OBITRUNK1

Inbound route-
Description Obi110in,
DID number 8005551212
CID prefix - L1-
Destination - ring group 600

I did not setup outbound route for the trunk (?Do I need one since I am not going to call out via OBI yet).

So far: trunk appear to be register, however when I call any extension on PBX my home phone rings, any incoming to my home phone via land line is not being forked to PBX.

What did I do wrong?


azrobert

#3
I'm not an Asterisk expert and I know I my setup is different than other examples on this forum. I'm not going to spend any time trying to understand the setup in the link you provided. I didn't provide any code for calling an extension on the PBX. If you want to call an extension, register SP2 as an extension on the PBX and then route the extension number to SP2.

Here is an explanation of my code:
To route an inbound call to Asterisk send it like this: number@PBX_IP:port
When you route a call like this, Asterisk will consider it an anonymous SIP call and reject it. You can configure Asterisk to accept anonymous SIP calls under SIP Settings, which is not recommended or define a trunk with the OBi110's IP address (as in my example). Now Asterisk will recognize the call is coming from a known IP address and accept it. The trunk doesn't register to the OBi110 and you shouldn't provide a Register String. Fixing the anonymous SIP call problem is the only function for the trunk, unless you want to route outbound calls to the OBi110.

In my example I'm forking the call like this:
ph,sp2(900@192.168.1.100:5060)  

If 900 is defined as an extension, you don't need an inbound route and the call will ring the extension.

If it's not defined as an extension, define an inbound route for DID Number 900 and route the call to a ring group or however you want to handle it.

You don't need an outbound route if you are not routing outbound calls to the OBi110.