FreeSWITCH mod_freetdm, Libpri Issue: T316 Timer restart. Channels suspended, only 2 or 3 calls are successful.

If you are seeing something like this in your FS console:

ftmod_libpri.c:1997 [s1c21][1:21] — T316 timed out, resending RESTART request
[ERR] ftmod_libpri.c:1993 [s1c5][1:5] — T316 timed out, channel reached restart attempt limit ‘3’ and is suspended
 
then you will have to make a simple hack in the FS source code:
 
  1. Go to FS source directory and change dir to this path libs/freetdm/src/ftmod/ftmod_libpri.h
  2. change #define T316_TIMEOUT_MS_DEFAULT to 10000
  3. #define T316_TIMEOUT_MS_MAX to 300000
  4. #define T316_ATTEMPT_LIMIT_DEFAULT to 30 (in case of PRI lines or no. of ,max. channels in your case)

After this recompile mod_freetdm and restart freeswitch. You will see channels restarting one by one. Also during this period in which the channels are restart do not make calls as it will show NORMAL_CIRCUIT_CONGESTION. It will take some time to restart the channels and probably the system should work after doing this.