~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to main/udptl.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2009-09-22 16:22:14 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090922162214-awce8id0lt9v51jb
Tags: 1:1.6.2.0~rc2-0ubuntu1

* New upstream version, upstream is now DFSG compliant.
  - ilibc has been removed upstream.
  - Music on Hold is now cc-by-sa.
  - binary firmware iaxy.bin has been removed upstream.
* debian/rules: Santitised UPSTREAM variable for compatiability
  with Ubuntu and other variants.
* debian/control: Removed Debian Vcs-Svn entry and replaced 
  with ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
* patches/makefile_appdocs_dtd: Removed, merged upstream.
* patches/disable_moh: Previosly disabled, removed from pool.
* patches/ubuntu-banner: Ported debian-banner to display Ubuntu
  centric bug report information.
* Refresh quilt patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
#include "asterisk.h"
50
50
 
51
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 209135 $")
 
51
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 210995 $")
52
52
 
53
53
#include <sys/time.h>
54
54
#include <signal.h>
742
742
 
743
743
static void calculate_far_max_ifp(struct ast_udptl *udptl)
744
744
{
745
 
        unsigned new_max = 40;
 
745
        unsigned new_max = 60;
746
746
 
747
747
        /* calculate the maximum IFP the local endpoint should
748
748
         * generate based on the far end's maximum datagram size
749
 
         * and the current error correction mode
 
749
         * and the current error correction mode. some endpoints
 
750
         * bogus 'max datagram' values that would result in unusable
 
751
         * (too small) maximum IFP values, so we have a a reasonable
 
752
         * minimum value to ensure that we can actually construct
 
753
         * UDPTL packets.
750
754
         */
751
755
        switch (udptl->error_correction_scheme) {
752
756
        case UDPTL_ERROR_CORRECTION_NONE:
753
757
                /* only need room for sequence number and length indicators */
754
 
                new_max = udptl->far_max_datagram - 6;
 
758
                new_max = MAX(new_max, udptl->far_max_datagram - 6);
755
759
                break;
756
760
        case UDPTL_ERROR_CORRECTION_REDUNDANCY:
757
761
                /* need room for sequence number, length indicators and the
758
762
                 * configured number of redundant packets
759
763
                 */
760
 
                new_max = (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1);
 
764
                new_max = MAX(new_max, (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1));
761
765
                break;
762
766
        case UDPTL_ERROR_CORRECTION_FEC:
763
767
                /* need room for sequence number, length indicators and a
764
768
                 * a single IFP of the maximum size expected
765
769
                 */
766
 
                new_max = (udptl->far_max_datagram - 10) / 2;
 
770
                new_max = MAX(new_max, (udptl->far_max_datagram - 10) / 2);
767
771
                break;
768
772
        }
769
773
        /* subtract 25% of space for insurance */