|
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 ]
|