FreeSWITCH HowTos
- FreeSwitch E & M Wink Config
- FreeSwitch Logrotate Config
- Configuring TON and NPI per call (PRI/BRI only).
- Specify Network Facility on outbound calls (PRI)
- T38 fax with FreeSwitch
E & M Wink Configuration
At this point only Zaptel/DAHDI spans are allowed. In order to use this, you must install as if you are install Dahdi/Zaptel as if you are installing for Asterisk. After the install, modify the following files:
/usr/local/freeswitch/conf/freetdm.conf
[span zt wp1]
trunk_type => EM
em-channel => 1-24
/usr/local/freeswitch/conf/autoload_configs/freetdm.conf.xml
<configuration name="freetdm.conf" description="Freetdm Configuration">
<analog_em_spans>
<span name="wp1">
<param name="dialplan" value="XML"/>
<param name="context" value="default"/>
</span>
</analog_em_spans>
</configuration>
/usr/local/freeswitch/conf/zt.conf
[defaults]
codec_ms => 20
wink_ms => 150
flash_ms => 750
echo_cancel_level => 64
rxgain => 0.0
txgain => 0.0
FreeSwitch Logrotate Configuration
File:
/etc/logrotate.d/freeswitch
---- cut -----
/usr/local/freeswitch/log/freeswitch.log {
daily
missingok
rotate 4
#compress
notifempty
create 640 root adm
postrotate
/bin/rm -f /usr/local/freeswitch/log/freeswitch.log > /dev/null 2>&1
/usr/local/freeswitch/bin/fs_cli -x "fsctl send_sighup" > /dev/null 2>&1
endscript
}
--- cut ----
Configuring TON and NPI per call (PRI/BRI only)
You can modify the TON and NPI from the Freeswitch dialplan before the outgoing call is made.
<extension name="outbound">
<condition field="destination_number" expression="(.*)">
<action application="set_profile_var" data="caller_ton=5"/>
<action application="set_profile_var" data="caller_numplan=4"/>
<action application="set_profile_var" data="destination_number_ton=3"/>
<action application="set_profile_var" data="destination_number_numplan=6"/>
<action application="bridge" data="freetdm/grp1/a/${destination_number}"/>
</condition>
</extension>
You will need the numeric ISDN values:
| TON | NPI | |||
| Option | Value | Option | Value | |
| Unknown | 0 | Unknown | 0 | |
| International | 1 | ISDN/E.164 | 1 | |
| National | 2 | Data/X.121 | 3 | |
| Network Specific | 3 | Telex/F.69 | 4 | |
| Subscriber | 4 | National | 8 | |
| Abbreviated | 6 | Private | 9 | |
| Reserved | 7 | Reserved | 15 |
|
Network Specific Facility (PRI)
You can modify the Network Specific Facility Specification from the Freeswitch dialplan before the outgoing call is made.
<extension name="outbound">
<condition field="destination_number" expression="(.*)">
<action application="bridge" data="{freetdm_isdn.netFac.spec=e2}freetdm/grp1/a/${destination_number}"/>
</condition>
</extension>
You can also specify some pre-set configurations, for example:
<action application="bridge" data="{freetdm_isdn.netFac.spec=megacom-800}freetdm/grp1/a/${destination_number}"/>
Current present values:
| Preset | Value |
| megacom | e3 |
| megacom-800 | e2 |
| accunet | e6 |
| sddn | e1 |
T38 FAX
From pstn to sip:
FAX --> A200 --> Freeswitch --> SIP --> ATA --> FAX
<action application="export" data="fax_enable_t38_request=true"/>
<action application="set" data="execute_on_answer=t38_gateway peer"/>
<action application="bridge" data="${sofia_contact($${gwuser}@$${domain})}"/>
From sip to pstn:
FAX --> ATA --> SIP --> Freeswitch --> A200 --> FAX
<action application="set" data="fax_enable_t38_request=true"/>
<action application="set" data="execute_on_answer=t38_gateway self"/>
<action application="bridge" data="freetdm/${group}/${hunting}/$1"/>
How to verify that it is T38
In the cli, to make sure to know if it is T38, you will see the following:
(192.168.1.119 is the one receiving the T38 fax)
o=FreeSWITCH 1299496468 1299496470 IN IP4 192.168.1.119
s=FreeSWITCH
c=IN IP4 192.168.1.119
t=0 0
m=image 30632 udptl t38
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxFillBitRemoval
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:2000
a=T38FaxMaxDatagram:400
a=T38FaxUdpEC:t38UDPRedundancy
Those are messages decoded by sofia with sip messages.
When the fax is coming into 192.168.1.119, your cli will be filled with T38 messages until all the fax has been received.
The above example was according to the following call diagram:
Fax 1 --> A200 --> FreeSwitch --> Sip --> SMG --> A200 --> Fax 2