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/pjnath/src/pjnath/ice_strans.c

    r2599 r2724  
    5151 * specify preference among candidates with the same type. Since 
    5252 * we don't have the facility to specify that, we'll just set it 
    53  * all to zero. 
    54  */ 
    55 #define SRFLX_PREF  0 
    56 #define HOST_PREF   0 
    57 #define RELAY_PREF  0 
     53 * all to the same value. 
     54 */ 
     55#if PJNATH_ICE_PRIO_STD 
     56#   define SRFLX_PREF  65535 
     57#   define HOST_PREF   65535 
     58#   define RELAY_PREF  65535 
     59#else 
     60#   define SRFLX_PREF  0 
     61#   define HOST_PREF   0 
     62#   define RELAY_PREF  0 
     63#endif 
     64 
    5865 
    5966/* The candidate type preference when STUN candidate is used */ 
    6067static pj_uint8_t srflx_pref_table[4] =  
    6168{ 
     69#if PJNATH_ICE_PRIO_STD 
     70    100,    /**< PJ_ICE_HOST_PREF           */ 
     71    126,    /**< PJ_ICE_SRFLX_PREF          */ 
     72    110,    /**< PJ_ICE_PRFLX_PREF          */ 
     73    0       /**< PJ_ICE_RELAYED_PREF    */ 
     74#else 
    6275    /* Keep it to 2 bits */ 
    6376    1,  /**< PJ_ICE_HOST_PREF       */ 
     
    6578    3,  /**< PJ_ICE_PRFLX_PREF      */ 
    6679    0   /**< PJ_ICE_RELAYED_PREF    */ 
     80#endif 
    6781}; 
    6882 
     
    198212    pj_turn_alloc_param_default(&cfg->turn.alloc_param); 
    199213 
     214    pj_ice_sess_options_default(&cfg->opt); 
     215 
    200216    cfg->af = pj_AF_INET(); 
    201217    cfg->stun.port = PJ_STUN_PORT; 
    202218    cfg->turn.conn_type = PJ_TURN_TP_UDP; 
     219 
     220    cfg->stun.max_host_cands = 64; 
    203221} 
    204222 
     
    246264 
    247265    /* Create STUN transport if configured */ 
    248     if (ice_st->cfg.stun.server.slen || !ice_st->cfg.stun.no_host_cands) { 
     266    if (ice_st->cfg.stun.server.slen || ice_st->cfg.stun.max_host_cands) { 
    249267        pj_stun_sock_cb stun_sock_cb; 
    250268        pj_ice_sess_cand *cand; 
     
    310328        } 
    311329 
    312         /* Add local addresses to host candidates, unless no_host_cands 
    313          * flag is set. 
     330        /* Add local addresses to host candidates, unless max_host_cands 
     331         * is set to zero. 
    314332         */ 
    315         if (ice_st->cfg.stun.no_host_cands == PJ_FALSE) { 
     333        if (ice_st->cfg.stun.max_host_cands) { 
    316334            pj_stun_sock_info stun_sock_info; 
    317335            unsigned i; 
     
    322340                return status; 
    323341 
    324             for (i=0; i<stun_sock_info.alias_cnt; ++i) { 
     342            for (i=0; i<stun_sock_info.alias_cnt &&  
     343                      i<ice_st->cfg.stun.max_host_cands; ++i)  
     344            { 
    325345                char addrinfo[PJ_INET6_ADDRSTRLEN+10]; 
    326346                const pj_sockaddr *addr = &stun_sock_info.aliases[i]; 
     
    648668 
    649669/* 
     670 * Get the value of various options of the ICE stream transport. 
     671 */ 
     672PJ_DEF(pj_status_t) pj_ice_strans_get_options( pj_ice_strans *ice_st, 
     673                                               pj_ice_sess_options *opt) 
     674{ 
     675    PJ_ASSERT_RETURN(ice_st && opt, PJ_EINVAL); 
     676    pj_memcpy(opt, &ice_st->cfg.opt, sizeof(*opt)); 
     677    return PJ_SUCCESS; 
     678} 
     679 
     680/* 
     681 * Specify various options for this ICE stream transport.  
     682 */ 
     683PJ_DEF(pj_status_t) pj_ice_strans_set_options(pj_ice_strans *ice_st, 
     684                                              const pj_ice_sess_options *opt) 
     685{ 
     686    PJ_ASSERT_RETURN(ice_st && opt, PJ_EINVAL); 
     687    pj_memcpy(&ice_st->cfg.opt, opt, sizeof(*opt)); 
     688    if (ice_st->ice) 
     689        pj_ice_sess_set_options(ice_st->ice, &ice_st->cfg.opt); 
     690    return PJ_SUCCESS; 
     691} 
     692 
     693/* 
    650694 * Create ICE! 
    651695 */ 
     
    682726    /* Associate user data */ 
    683727    ice_st->ice->user_data = (void*)ice_st; 
     728 
     729    /* Set options */ 
     730    pj_ice_sess_set_options(ice_st->ice, &ice_st->cfg.opt); 
    684731 
    685732    /* If default candidate for components are SRFLX one, upload a custom 
Note: See TracChangeset for help on using the changeset viewer.