Changeset 3001


Ignore:
Timestamp:
Nov 10, 2009 3:45:42 AM (15 years ago)
Author:
bennylp
Message:

Ticket #864: Revise on account registration Contact update rule

  • don't switch if only port number is different and the Via received address is private
  • always update the transport (i.e. Via) address as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r2968 r3001  
    682682    if (acc->cfg.allow_contact_rewrite != 2 && !is_private_ip(&uri->host) && 
    683683        !is_private_ip(&srv_ip) && is_private_ip(via_addr)) 
     684    { 
     685        /* Don't switch */ 
     686        pj_pool_release(pool); 
     687        return PJ_FALSE; 
     688    } 
     689 
     690    /* Also don't switch if only the port number part is different, and 
     691     * the Via received address is private. 
     692     * See http://trac.pjsip.org/repos/ticket/864 
     693     */ 
     694    if (acc->cfg.allow_contact_rewrite != 2 && 
     695        pj_sockaddr_cmp(&contact_addr, &recv_addr)==0 && 
     696        is_private_ip(via_addr)) 
    684697    { 
    685698        /* Don't switch */ 
     
    744757    } 
    745758 
    746     /* For UDP transport, if STUN is enabled then update the transport's 
    747      * published name as well. 
    748      */ 
    749     if (tp->key.type==PJSIP_TRANSPORT_UDP && 
    750         (pjsua_var.ua_cfg.stun_domain.slen != 0 || 
    751          pjsua_var.ua_cfg.stun_host.slen != 0)) 
    752     { 
    753         pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); 
    754         tp->local_name.port = rport; 
    755     } 
     759    /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ 
     760    pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); 
     761    tp->local_name.port = rport; 
    756762 
    757763    /* Perform new registration */ 
Note: See TracChangeset for help on using the changeset viewer.