Changeset 1508


Ignore:
Timestamp:
Oct 18, 2007 3:28:33 PM (13 years ago)
Author:
bennylp
Message:

Updated Service-Route calculation

File:
1 edited

Legend:

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

    r1507 r1508  
    540540    const pj_str_t HROUTE = { "Route", 5 }; 
    541541    pjsip_uri *uri[PJSUA_ACC_MAX_PROXIES]; 
    542     unsigned i, uri_cnt = 0; 
     542    unsigned i, uri_cnt = 0, rcnt; 
    543543 
    544544    /* Find and parse Service-Route headers */ 
     
    603603     
    604604    /* First remove all routes which are not the outbound proxies */ 
    605     for (i=0, hr=acc->route_set.prev;  
    606          i<pjsua_var.ua_cfg.outbound_proxy_cnt;  
    607          ++i) 
    608      { 
    609         pjsip_route_hdr *prev = hr->prev; 
    610         pj_list_erase(hr); 
    611         hr = prev; 
    612      } 
     605    rcnt = pj_list_size(&acc->route_set); 
     606    if (rcnt != pjsua_var.ua_cfg.outbound_proxy_cnt) { 
     607        for (i=pjsua_var.ua_cfg.outbound_proxy_cnt, hr=acc->route_set.prev;  
     608             i<rcnt;  
     609             ++i) 
     610         { 
     611            pjsip_route_hdr *prev = hr->prev; 
     612            pj_list_erase(hr); 
     613            hr = prev; 
     614         } 
     615    } 
    613616 
    614617    /* Then append the Service-Route URIs */ 
Note: See TracChangeset for help on using the changeset viewer.