Below is the freeswitch.xml from the setup I had for this. (I feel like I had a gateway called "phones" and the directory entries pointed to that, but it's not in here, and I can't test right now). I *think* you should be able to install a clean install of FreeSwitch and just replace the freeswitch.xml in the conf folder with this one (I did a lot of ripping out of mods on mine as well, but you shouldn't need that)
There are a few places I've specified where you'll need to enter the IP address of your CM, and down the bottom, I've made a space or two where you would enter the extensions of the phones which would register to FreeSwitch.
Additional work is required on the Avaya side. You'll have to set up UDP and AAR to get calls over to the SIP Trunk to the FreeSwitch. You'll also need to set up the signalling group and trunk to the FreeSwitch. Finally, you'll need to set up the station on the Avaya side. You can either set up a new station of type 9620SIP and put the trunk on page 6, or set up off-PBX station mapping on an existing station (application OPS).
<?xml version="1.0"?>
<document type="freeswitch/xml">
<section name="configuration" description="Various Configurations">
<configuration name="switch.conf" description="Core Configuration">
<settings>
<param name="colorize-console" value="true"/>
<param name="max-db-handles" value="50"/>
<param name="db-handle-timeout" value="10"/>
<param name="max-sessions" value="1000"/>
<param name="sessions-per-second" value="30"/>
<param name="loglevel" value="debug"/>
</settings>
</configuration>
<configuration name="console.conf" description="Console Logger">
<mappings>
<map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>
</mappings>
<settings>
<param name="colorize" value="true"/>
<param name="loglevel" value="info"/>
</settings>
</configuration>
<configuration name="sofia.conf" description="Sofia Endpoint">
<profiles>
<profile name="p_default">
<domains>
<domain name="all" alias="false" parse="true"/>
</domains>
<gateways>
<gateway name="avaya">
<param name="realm" value="xxx.xxx.xxx.xxx"/> //***REPLACE with your Avaya's IP address e.g. 192.168.1.1
<param name="register" value="false"/>
<param name="register-transport" value="tcp"/>
<param name="contact-params" value="tport=tcp"/>
</gateway>
</gateways>
<settings>
<param name="sip-port" value="5060"/>
<param name="rfc2833-pt" value="101"/>
<param name="dialplan" value="XML"/>
<param name="context" value="d_default"/>
<param name="inbound-codec-negotiation" value="greedy"/>
<param name="codec-prefs" value="PCMU"/>
<param name="disable-transcoding" value="true"/>
<param name="inbound-late-negotiation" value="false"/>
<param name="caller-id-type" value="rpid"/>
<param name="force-register-domain" value="$${local_ip_v4}"/>
<param name="enable-timer" value="false"/>
<param name="minimum-session-expires" value="120"/>
</settings>
</profile>
</profiles>
</configuration>
<configuration name="modules.conf" description="Modules">
<modules>
<load module="mod_console"/>
<load module="mod_sofia"/>
<load module="mod_commands"/>
<load module="mod_dptools"/>
<load module="mod_dialplan_xml"/>
</modules>
</configuration>
</section>
<section name="dialplan" description="Regex/XML Dialplan">
<context name="d_default">
<extension name="in from avaya">
<condition field="network_addr" expression="(xxx\.xxx\.xxx\.xxx)"/> //***REPLACE with your Avaya's IP address e.g. 192.168.1.1 becomes 192\.168\.1\.1 here
<condition field="destination_number" expression="(\d{4})$">
<action application="bridge" data="sofia/p_default/$1%$${local_ip_v4}"/>
</condition>
</extension>
<extension name="out from phones">
<condition field="destination_number" expression="(\*?\d+)">
<action application="bridge" data="sofia/gateway/avaya/$1"/>
</condition>
</extension>
</context>
</section>
<section name="directory" description="User Directory">
<domain name="$${local_ip_v4}">
<variables>
<variable name="default_gateway" value="avaya"/>
</variables>
<user id="xxxx"> //***REPLACE with the extension of your phone e.g. 1000
<params>
<param name="password" value="whateverpasswordyouwantforthephone"/>
</params>
</user>
<user id="xxxx"> //***REPLACE with the extension of the next phone e.g. 1001
<params>
<param name="password" value="whateverpasswordyouwantforthephone"/>
</params>
</user>
</domain>
</section>
</document>