Connect new phone line to one of the available FXO ports on the gateway.
(Can use network cable, one pair crimped to RJ11 Jack)
create a SIP trunk on Elastix (freepbx) server. with following details.
Trunk Name: (phoneline number)
Outbound CID: (leave empty)
CID option: Allow any CID
Dialed number manipulation rules:
(don’t make prefix changes here. leave default values)
Trunk Name: (unique number to identify the trunk)
Secret=(password for the trunk)
host=(ip address of the pstn gateway)
Leave everything else default.
then click submit. apply.
Open PSTN then go to Accounts–User account.
fill the following info to connect to Elastix
channel: (number of the FXO port, to which the phone line is connected)
SIP user ID: (Trunk Name -as per Elastix trunk)
Authenticate ID: (trunk name)
Authentication Password: (password of the trunk)
SIP account: (Select account from available)
In PSTN Go to settings–channel settings– calling to voip
Add following info for the section”unconditional call forward to following.”
userID: (channel number:phone number)
SIP Server: ch1-8:(ip of the elastix server)
(ie., use the following sip server for channel 1 to 8)
SIP Destination port: ch1-8:5060
(ie., use the following sip port for channel 1 to 8)
Leave everything else as default.
in PSTN got to FXO lines — Dialing
change values in port scheduling schema as we need.
Round-robin and/or flexible: rr:1-8 (round robin for all ports)
if we want to seperate the ports we can use something like below. rr:1-2;rr:3;rr:4;rr:5;rr:6;rr:7-8 where 1-2 and 7-8 are port groups and others and individual lines.)
Prefix to specify port: 99
(default value is 99, note this for using in elastix-outbound route) save. reboot.
On elastix server. Inbound routes. Add incoming route.
DID Number: (phone number of the line)
music on hold: (default or specify)
leave default values for other stuff.
select extension or IVR.
(in my case i selected IVR)
if using IVR make sure that the IVR settings is mapped to an extension.
step 6.1: IVR Settings.
Change Name: (IVR name)
Announcement: (IVR audio file)
Direct dial options: All extentions
Time out message: none
Invalid message: none
repeat Loops: 2
Then map dialpad keys to extensions.
eg: 0 == extensions == ((100) Operator) (untick return to ivr)
On elastix server. outbound routes. add route.
Route Name: (route name)
Route CID: (blank)
Route Password: (blank)
music on hold: (select from available)
time group: —permanant route—
route position: (change postion of the route related to other routes
routes are checked from up to down)
PIN set: None
Dial Pattern that will use this route:
This section is the important one.
there is 4 options to send a call to this route.
01. Append, 02. Prefix, 03. match pattern, 04. called ID
Append is used to direct a call to a specific port in PSTN.
We noted before that the prefix for PSTN is 99.
Which means if I put 996 on the prepend part of the route,
the call will be directed to the 6th port of the PSTN.
Prefix is used when dialing the number. When i have more than 1 phone lines and I want to dial through a specific one, I will need to tell that
to the Elastix server. Prefix is used for this.
we should use different prefix for different routes.
When server receives a call, prefix is checked and when matched to an outbound route, the call is forwarded through that route.
Before forwarding the route prefix is removed, and the pstn prefix (eg:996) is prepended to the call.
when PSTN recieves the call it will know that the call is specific to a port. (in our case port 6).
PSTN then removes the prefix and forward the call to that port.
Dial pattern example.
996 + 8 + XXXXXXXXXX / Caller ID
in this example:
prepend = 996
prefix = 8
match pattern = XXXXXXXXXX
this is the pattern of the phone number.
where X = match any digit 0-9, Z = Match any number 1-9, N= 2-9
We can also add numbers to the pattern,(eg: 05471xxxxx)
caller ID = (not specified)
we can specify a caller ID, When we want a specific extension to use this route. To do that just type in the extension number here.
Trunk sequence for matched routes:
we can specify which trunk to use when a call is matched to the above conditions. we can specify more than one trunk. in such a case an available line is used when other lines are busy.
select trunk from drop-down menu.