Ignore:
Timestamp:
May 29, 2009 1:04:03 PM (15 years ago)
Author:
bennylp
Message:

Integration of Sipit24 branch, many tickets involved:

  • #793: AMR encoder should regard 'mode-set' param specified by remote decoder.
  • #831: Automatically switch to TCP transport when sending large request
  • #832: Support for outbound proxy setting without using Route header
  • #849: Modify conference audio switch behavior in connecting ports.
  • #850: Remove 'Require=replaces' param in 'Refer-To' header (in call transfer with replaces).
  • #851: Support for regular nomination in ICE
  • #852: --ip-addr support for IPv6 for media transport in pjsua
  • #854: Adding SOFTWARE attribute in all outgoing requests may cause compatibility problem with older STUN server (thanks Alexei Kuznetsov for the report)
  • #855: Bug in digit map frequencies for DTMF digits (thanks FCCH for the report)
  • #856: Put back the ICE candidate priority values according to the default values in the draft-mmusic-ice
  • #857: Support for ICE keep-alive with Binding indication
  • #858: Do not authenticate STUN 438 response
  • #859: AMR-WB format param in the SDP is not negotiated correctly.
  • #867: Return error instead of asserting when PJSUA-LIB fails to open log file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_util.c

    r2435 r2724  
    11361136        via->rport_param = 0; 
    11371137 
     1138        pjsip_tx_data_invalidate_msg(tdata); 
     1139 
    11381140        /* Send message using this transport. */ 
    11391141        status = pjsip_transport_send( stateless_data->cur_transport, 
     
    11811183    /* Copy server addresses */ 
    11821184    pj_memcpy( &stateless_data->addr, addr, sizeof(pjsip_server_addresses)); 
     1185 
     1186    /* RFC 3261 section 18.1.1: 
     1187     * If a request is within 200 bytes of the path MTU, or if it is larger 
     1188     * than 1300 bytes and the path MTU is unknown, the request MUST be sent 
     1189     * using an RFC 2914 [43] congestion controlled transport protocol, such 
     1190     * as TCP. 
     1191     */ 
     1192    if (stateless_data->tdata->msg->type == PJSIP_REQUEST_MSG && 
     1193        addr->count > 0 &&  
     1194        addr->entry[0].type == PJSIP_TRANSPORT_UDP) 
     1195    { 
     1196        int len; 
     1197 
     1198        /* Encode the request */ 
     1199        status = pjsip_tx_data_encode(stateless_data->tdata); 
     1200        if (status != PJ_SUCCESS) { 
     1201            if (stateless_data->app_cb) { 
     1202                pj_bool_t cont = PJ_FALSE; 
     1203                (*stateless_data->app_cb)(stateless_data, -status, &cont); 
     1204            } 
     1205            pjsip_tx_data_dec_ref(stateless_data->tdata); 
     1206            return; 
     1207        } 
     1208 
     1209        /* Check if request message is larger than 1300 bytes. */ 
     1210        len = stateless_data->tdata->buf.cur -  
     1211                stateless_data->tdata->buf.start; 
     1212        if (len >= PJSIP_UDP_SIZE_THRESHOLD) { 
     1213            int i; 
     1214            int count = stateless_data->addr.count; 
     1215 
     1216            /* Insert "TCP version" of resolved UDP addresses at the 
     1217             * beginning. 
     1218             */ 
     1219            if (count * 2 > PJSIP_MAX_RESOLVED_ADDRESSES) 
     1220                count = PJSIP_MAX_RESOLVED_ADDRESSES / 2; 
     1221            for (i = 0; i < count; ++i) { 
     1222                pj_memcpy(&stateless_data->addr.entry[i+count], 
     1223                          &stateless_data->addr.entry[i], 
     1224                          sizeof(stateless_data->addr.entry[0])); 
     1225                stateless_data->addr.entry[i].type = PJSIP_TRANSPORT_TCP; 
     1226            } 
     1227            stateless_data->addr.count = count * 2; 
     1228        } 
     1229    } 
    11831230 
    11841231    /* Process the addresses. */ 
Note: See TracChangeset for help on using the changeset viewer.