trunks and inbound routes

oceanblues

Joined
Aug 31, 2010
Messages
13
Likes
0
Points
0
#1
Hi everyone, I have the following situation.

I founded a pbx with elastix 2.0.2 and audiocodes mp118 4fxs 4fxo in my office. My office is located in a plaza where a local pbx (alcatel oxe) is in use and an extension from alcatel oxe is drived to every office. In my office a? additionally use another PSTN line and both of the local extension and PSTN line is attached to my audiocodes.

I want to answer the incoming calls from the PSTN line with an IVR (I already got it running), and direct the calls coming from the local PBX to my elastix' extension on my desk. But, I cannot, no way, differentiate one call from the other. When I try to create an inbound route for the PSTN line I cannot handle the other line as a different trunk. When I link the inbound route to the IVR both lines are greeted with the IVR or both lines are directed to my desk phone.

Does anyone have an idea that can help me? Thanks.
 

gl1176

Joined
Oct 5, 2009
Messages
55
Likes
0
Points
0
#2
I have configured this on an Audiocodes gateway and it is not done by the way most people explain on how to configure these or any FXO gateway.

You need to configure individual trunks for each FXO using a host=ip_address_of_gateway and not one that registers. Then each trunk has the option username= set to the port name like this FXO-1 FXO-2 and make the settings change on the gateway. Then in outbound routes, you need to set each Trunk Sequence in order of reverse hunt of how the calls enter the gateway like FXO-2 FXO-1. Last, in the Inbound routes, you can set the DID number field to what you set in the gateway, so that when the call setup to asterisk, it routes it accordingly.

I will look for the config but it always best to setup a FXO gateway in this fashion so that it is flexable for changes, and makes troubleshooting a bad port very easy.
 

gl1176

Joined
Oct 5, 2009
Messages
55
Likes
0
Points
0
#3
Actually looked at the config and it's a bit more than what I previously posted.

I think I did forget to mention that you need to set the gateway with a static IP address first.

The setting on the trunk does not have to use username= but instead use an outbound dial prefix that each trunk will be set different like trunk1 has 1000, trunk2 has 2000 and so on. On the gateway you need to setup incoming digit manipulation tables so that the number dialed into the gateway will be answered, then strip the prefix and dial out the port setup in the gateway routing section.

Then for calls from the gateway, you set the DID in the Configuration > Protocol Configuration > Endpoint Settings > Automatic Dialing on the gateway so that it answers the call from the port, then sends it to asterisk with the correct DID that is set in the Inbound Routes on Freepbx.

Here is my config fo the gateway:



[BSP Params]

PCMLawSelect = 3
BaseUDPPort = 10000
VLANPREMIUMSERVICECLASSMEDIAPRIORITY = 5
VLANPREMIUMSERVICECLASSCONTROLPRIORITY = 3
PREMIUMSERVICECLASSCONTROLDIFFSERV = 26

[Analog Params]

FXSLoopCharacteristicsFilename = 'MP11x-02-1-FXS_16KHZ.dat'
CurrentDisconnectDuration = 200
TimeToSampleAnalogLineVoltage = 100

[ControlProtocols Params]


[MGCP Params]


[MEGACO Params]

EP_Num_0 = 0
EP_Num_1 = 1
EP_Num_2 = 0
EP_Num_3 = 0
EP_Num_4 = 0

[Voice Engine Params]

CallProgressTonesFilename = 'usa_tones_13.dat'
IdlePCMPattern = 85
InputGain = 6
FaxModemBypassCoderType = 1
CNGDetectorMode = 0
RFC2833TxPayloadType = 101
RFC2833RxPayloadType = 101
DTMFDetectorSensitivity = 1

[WEB Params]

LogoWidth = '145'

[SIP Params]

MAXDIGITS = 32
ISPROXYUSED = 1
ISWAITFORDIALTONE = 1
ISTWOSTAGEDIAL = 0
ENABLECURRENTDISCONNECT = 1
CHANNELSELECTMODE = 0
ALWAYSSENDTOPROXY = 1
ISFAXUSED = 1
SIPTRANSPORTTYPE = 0

[IPsec Params]


[SNMP Params]


;
; *** TABLE DspTemplates ***
; This table contains hidden elements and will not be exposed.
; This table exists on board and will be saved during restarts
;

;
; *** TABLE PREFIX ***
;
;

[ PREFIX ]
FORMAT PREFIX_Index = PREFIX_DestinationPrefix, PREFIX_DestAddress, PREFIX_SourcePrefix, PREFIX_ProfileId, PREFIX_MeteringCode, PREFIX_DestPort, PREFIX_SrcIPGroupID, PREFIX_DestHostPrefix, PREFIX_DestIPGroupID, PREFIX_SrcHostPrefix, PREFIX_TransportType, PREFIX_SrcTrunkGroupID;
PREFIX 0 = *, 192.168.10.2, *, 0, 255, 5060, -1, , -1, , 0, -1;

[ \PREFIX ]

;
; *** TABLE CoderName ***
;
;

[ CoderName ]
FORMAT CoderName_Index = CoderName_Type, CoderName_PacketInterval, CoderName_rate, CoderName_PayloadType, CoderName_Sce;
CoderName 0 = g711Ulaw64k, 20, 0, 255, 0;
CoderName 1 = t38fax, 255, 255, 255, 255;

[ \CoderName ]

;
; *** TABLE TrunkGroup ***
;
;

[ TrunkGroup ]
FORMAT TrunkGroup_Index = TrunkGroup_TrunkGroupNum, TrunkGroup_FirstTrunkId, TrunkGroup_FirstBChannel, TrunkGroup_LastBChannel, TrunkGroup_FirstPhoneNumber, TrunkGroup_ProfileId, TrunkGroup_LastTrunkId, TrunkGroup_Module;
TrunkGroup 0 = 1, 255, 1, 1, 5557277216, 0, 255, 255;
TrunkGroup 1 = 2, 255, 2, 2, 5557273356, 0, 255, 255;
TrunkGroup 2 = 3, 255, 3, 3, 5555988732, 0, 255, 255;
TrunkGroup 3 = 4, 255, 4, 4, 5557279184, 0, 255, 255;

[ \TrunkGroup ]

;
; *** TABLE NumberMapIp2Tel ***
;
;Configuration > Protocol Configuration > Manipulation Tables > Dest Number IP -> Tel

[ NumberMapIp2Tel ]
FORMAT NumberMapIp2Tel_Index = NumberMapIp2Tel_DestinationPrefix, NumberMapIp2Tel_SourcePrefix, NumberMapIp2Tel_SourceAddress, NumberMapIp2Tel_NumberType, NumberMapIp2Tel_NumberPlan, NumberMapIp2Tel_RemoveFromLeft, NumberMapIp2Tel_RemoveFromRight, NumberMapIp2Tel_LeaveFromRight, NumberMapIp2Tel_Prefix2Add, NumberMapIp2Tel_Suffix2Add, NumberMapIp2Tel_IsPresentationRestricted, NumberMapIp2Tel_SrcTrunkGroupID, NumberMapIp2Tel_SrcIPGroupID;
NumberMapIp2Tel 1 = 1000*, *, *, 255, 255, 4, 0, 255, , , 255, -1, -1;
NumberMapIp2Tel 2 = 2000*, *, *, 255, 255, 4, 0, 255, , , 255, -1, -1;
NumberMapIp2Tel 3 = 3000*, *, *, 255, 255, 4, 0, 255, , , 255, -1, -1;
NumberMapIp2Tel 4 = 4000*, *, *, 255, 255, 4, 0, 255, , , 255, -1, -1;

[ \NumberMapIp2Tel ]

;
; *** TABLE PstnPrefix ***
;
;Configuration > Protocol Configuration > Routing Tables > IP To Hunt Group Routing Table

[ PstnPrefix ]
FORMAT PstnPrefix_Index = PstnPrefix_DestPrefix, PstnPrefix_TrunkGroupId, PstnPrefix_SourcePrefix, PstnPrefix_SourceAddress, PstnPrefix_ProfileId, PstnPrefix_SrcIPGroupID, PstnPrefix_DestHostPrefix, PstnPrefix_SrcHostPrefix;
PstnPrefix 0 = 1000*, 1, *, 192.168.10.2, 0, -1, , ;
PstnPrefix 1 = 2000*, 2, *, 192.168.10.2, 0, -1, , ;
PstnPrefix 2 = 3000*, 3, *, 192.168.10.2, 0, -1, , ;
PstnPrefix 3 = 4000*, 4, *, 192.168.10.2, 0, -1, , ;

[ \PstnPrefix ]

;
; *** TABLE ProxyIp ***
;
;

[ ProxyIp ]
FORMAT ProxyIp_Index = ProxyIp_IpAddress, ProxyIp_TransportType, ProxyIp_ProxySetId;
ProxyIp 0 = 192.168.10.2, 0, 0;

[ \ProxyIp ]

;
; *** TABLE TxDtmfOption ***
;
;

[ TxDtmfOption ]
FORMAT TxDtmfOption_Index = TxDtmfOption_Type;
TxDtmfOption 0 = 4;

[ \TxDtmfOption ]

;
; *** TABLE TrunkGroupSettings ***
;
;

[ TrunkGroupSettings ]
FORMAT TrunkGroupSettings_Index = TrunkGroupSettings_TrunkGroupId, TrunkGroupSettings_ChannelSelectMode, TrunkGroupSettings_RegistrationMode, TrunkGroupSettings_GatewayName, TrunkGroupSettings_ContactUser, TrunkGroupSettings_ServingIPGroup;
TrunkGroupSettings 0 = 1, 2, 4, , , -1;
TrunkGroupSettings 1 = 2, 2, 4, , , -1;
TrunkGroupSettings 2 = 3, 2, 4, , , -1;
TrunkGroupSettings 3 = 4, 2, 4, , , -1;

[ \TrunkGroupSettings ]

;
; *** TABLE TelProfile ***
;
;

[ TelProfile ]
FORMAT TelProfile_Index = TelProfile_ProfileName, TelProfile_TelPreference, TelProfile_CodersGroupID, TelProfile_IsFaxUsed, TelProfile_JitterBufMinDelay, TelProfile_JitterBufOptFactor, TelProfile_IPDiffServ, TelProfile_SigIPDiffServ, TelProfile_DtmfVolume, TelProfile_InputGain, TelProfile_VoiceVolume, TelProfile_EnableReversePolarity, TelProfile_EnableCurrentDisconnect, TelProfile_EnableDigitDelivery, TelProfile_EnableEC, TelProfile_MWIAnalog, TelProfile_MWIDisplay, TelProfile_FlashHookPeriod, TelProfile_EnableEarlyMedia, TelProfile_ProgressIndicator2IP, TelProfile_TimeForReorderTone, TelProfile_EnableDIDWink, TelProfile_IsTwoStageDial, TelProfile_DisconnectOnBusyTone, TelProfile_EnableVoiceMailDelay, TelProfile_DialPlanIndex;
TelProfile 1 = , 1, 0, 1, 10, 10, 46, 26, -11, 6, 0, 0, 1, 0, 1, 0, 0, 700, 0, -1, 255, 0, 0, 1, 1, -1;

[ \TelProfile ]

;
; *** TABLE IpProfile ***
;
;

[ IpProfile ]
FORMAT IpProfile_Index = IpProfile_ProfileName, IpProfile_IpPreference, IpProfile_CodersGroupID, IpProfile_IsFaxUsed, IpProfile_JitterBufMinDelay, IpProfile_JitterBufOptFactor, IpProfile_IPDiffServ, IpProfile_SigIPDiffServ, IpProfile_SCE, IpProfile_RTPRedundancyDepth, IpProfile_RemoteBaseUDPPort, IpProfile_CNGmode, IpProfile_VxxTransportType, IpProfile_NSEMode, IpProfile_IsDTMFUsed, IpProfile_PlayRBTone2IP, IpProfile_EnableEarlyMedia, IpProfile_ProgressIndicator2IP, IpProfile_EnableEchoCanceller, IpProfile_CopyDest2RedirectNumber, IpProfile_MediaSecurityBehaviour, IpProfile_CallLimit, IpProfile_DisconnectOnBrokenConnection, IpProfile_FirstTxDtmfOption, IpProfile_SecondTxDtmfOption, IpProfile_RxDTMFOption, IpProfile_EnableHold, IpProfile_InputGain, IpProfile_VoiceVolume, IpProfile_AddIEInSetup, IpProfile_SBCExtensionCodersGroupID, IpProfile_MediaIPVersionPreference, IpProfile_TranscodingMode;
IpProfile 1 = , 1, 0, 1, 10, 10, 46, 26, 0, 0, 0, 0, 2, 0, 0, 0, 0, -1, 1, 0, 0, -1, 1, 0, 0, 1, 1, 6, 0, , -1, 0, 0;

[ \IpProfile ]

;
; *** TABLE EnableCallerId ***
;
;

[ EnableCallerId ]
FORMAT EnableCallerId_Index = EnableCallerId_IsEnabled;
EnableCallerId 0 = 1;
EnableCallerId 1 = 1;
EnableCallerId 2 = 1;
EnableCallerId 3 = 1;

[ \EnableCallerId ]

;
; *** TABLE TargetOfChannel ***
;
;Configuration > Protocol Configuration > Endpoint Settings > Automatic Dialing

[ TargetOfChannel ]
FORMAT TargetOfChannel_Index = TargetOfChannel_Destination, TargetOfChannel_Type;
TargetOfChannel 0 = 5557277216, 1;
TargetOfChannel 1 = 5557273356, 1;
TargetOfChannel 2 = 5557279184, 1;
TargetOfChannel 3 = 5555988732, 1;

[ \TargetOfChannel ]

;
; *** TABLE CallWaitingPerPort ***
;
;

[ CallWaitingPerPort ]
FORMAT CallWaitingPerPort_Index = CallWaitingPerPort_IsEnabled;
CallWaitingPerPort 0 = 0;
CallWaitingPerPort 1 = 0;
CallWaitingPerPort 2 = 0;
CallWaitingPerPort 3 = 0;

[ \CallWaitingPerPort ]

;
; *** TABLE ProxySet ***
;
;

[ ProxySet ]
FORMAT ProxySet_Index = ProxySet_EnableProxyKeepAlive, ProxySet_ProxyKeepAliveTime, ProxySet_ProxyLoadBalancingMethod, ProxySet_IsProxyHotSwap, ProxySet_SRD;
ProxySet 0 = 0, 60, 0, 0, 0;

[ \ProxySet ]
 

oceanblues

Joined
Aug 31, 2010
Messages
13
Likes
0
Points
0
#4
First of all thank you for the effort to help. I tried what you mentioned and it greatly works. One thing ? want to mention is I found out that I used the same extension as my local pbx in elastix, which caused me some errors. After that little change many things got through. I also tried to apply your recomendations and tattaaa... :) everything is okay now. Thank you for your help.
 

netpasya

Joined
Feb 7, 2011
Messages
6
Likes
0
Points
0
#5
Can you please post what you have in the "PEER Details" and "USER Details" of the trunk settings?
 

gl1176

Joined
Oct 5, 2009
Messages
55
Likes
0
Points
0
#6
All you need is peer details if you use type=friend. So here is what one trunk of each of the lines has in the peer details:

type=friend
host=10.102.2.8
context=from-trunk
disallow=all
allow=ulaw
dtmfmode=rfc2833
qualify=yes
canreinvite=no
insecure=very
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top