Skip to main content

FreeSwitch

note

This documentation is for FreeSwitch v1.6. For newer versions – please reach out to the support.

xDR files​

In order to set up xDR files integration, you have to perform the following steps:

  1. Install FreeSWITCH v1.6 according to the vendor's installation guide using compile from source method.

  2. Make sure cdr_csv.conf.xml file (located in /usr/local/freeswitch/conf/autoload_configs), contains the following data:

    /usr/local/freeswitch/conf/autoload_configs/cdr_csv.conf.xml
    <configuration name="cdr_csv.conf" description="CDR CSV Format">
    <settings>
    <!-- 'cdr-csv' will always be appended to log-base -->
    <!--<param name="log-base" value="/var/log"/>-->
    <param name="default-template" value="jerasoft"/>
    <!-- This is like the info app but after the call is hung up -->
    <!--<param name="debug" value="true"/>-->
    <param name="rotate-on-hup" value="true"/>
    <!-- may be a b or ab -->
    <param name="legs" value="ab"/>
    <!-- Only log in Master.csv -->
    <param name="master-file-only" value="true"/>
    </settings>
    <templates>
    <template name="jerasoft">"${billuuid}","${uuid}","${network_addr}","${sip_to_host}","${sip_auth_username}",
    "${caller_id_number}","${destination_number}","${sip_to_uri}","${start_stamp}","${answer_stamp}",
    "${end_stamp}","${billsec}","${hangup_cause}","${progresssec}","${read_codec}","${write_codec}",
    "${call-origin}","${touser}"</template>
    </templates>
    </configuration>
  3. Set password in event_socket_conf.xml (located in /usr/local/freeswitch/conf/autoload_configs). The contents of the file will be similar to the example below, with the actual password set instead of XXX:

    /usr/local/freeswitch/conf/autoload_configs/event_socket_conf.xml
    <configuration name="event_socket.conf" description="Socket Client">
    <settings>
    <param name="nat-map" value="false"/>
    <param name="listen-ip" value="0.0.0.1"/>
    <param name="listen-port" value="8021"/>
    <param name="password" value="XXX"/>
    <!--<param name="apply-inbound-acl" value="lan"/>-->
    </settings>
    </configuration>
  4. Configure CDR files rotation via Cron – create file /etc/cron.d/freeswitch-cdr-rotate with the following content:

    /etc/cron.d/freeswitch-cdr-rotate
    0,30 * * * * root /usr/local/freeswitch/bin/fs_cli -p XXX -x 'cdr_csv rotate'

    If you decided not to use password on the previous step, remove -p XXX part of the line above.

  5. Restart FreeSwitch.

  6. Perform configuration on the JeraSoft Billing side using Billing configuration article.

info

For this integration please use "Freeswitch (CSV format)" files collector in the JeraSoft Billing.

RADIUS & External routing​

In order to set up RADIUS integration and external routing (supported via SIP redirect), please perform the following steps:

  1. Install FreeSWITCH v1.6 according to the vendor's installation guide using compile from source method. During "Compile from Source" installation, after running ./bootstrap.sh and before compiling freeswitch package, uncomment the following lines in modules.conf file:

    xml_int/mod_xml_radius
    applications/mod_rad_auth
  2. After installation is over, completely delete /usr/local/freeswitch/conf folder and replace it with /opt/jerasoft/vcs/docs/examples/freeswitch/conf, located on the billing server. Make sure you’ve changed owner and group of this folder and all its contents to freeswitch:freeswitch.

  3. Edit following lines in the /usr/local/freeswitch/conf/vars.xml file:

    /usr/local/freeswitch/conf/vars.xml
    <X-PRE-PROCESS cmd="set" data="radiusauth=<BILLING_IP>:<RADIUS AUTH PORT>:<RADIUS SECRET>"/>
    <X-PRE-PROCESS cmd="set" data="radiusacct=<BILLING_IP>:<RADIUS ACCT PORT>:<RADIUS SECRET>"/>
    <X-PRE-PROCESS cmd="set" data="sipredirect=<BILLING_IP>"/>

    change the following values:

    • <BILLING_IP> – set to the IP of the JeraSoft Billing
    • <RADIUS AUTH PORT> – set to 1812 (or another port you defined in the JeraSoft Billing)
    • <RADIUS ACCT PORT> – set to 1813 (or another port you defined in the JeraSoft Billing)
    • <RADIUS SECRET> – set to a random value (same as you defined in the JeraSoft Billing)
  4. Restart FreeSwitch.

info

For this integration please use "JeraSoft Billing Common" RADIUS collector and "FreeSwitch v1.6" SIP collector in the JeraSoft Billing.