From be1df6e8fb26fd4c6b75bfcfb182db260593fc86 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Thu, 12 Apr 2012 08:04:03 +0000 Subject: Fix #1483: make sure that the CRC calculation of account proxy setting is done after proxy URI normalization. git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4039 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_acc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'pjsip') diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 4758f391..730aea00 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -415,13 +415,6 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg, } } - /* Get CRC of account proxy setting */ - acc->local_route_crc = calc_proxy_crc(acc->cfg.proxy, acc->cfg.proxy_cnt); - - /* Get CRC of global outbound proxy setting */ - acc->global_route_crc=calc_proxy_crc(pjsua_var.ua_cfg.outbound_proxy, - pjsua_var.ua_cfg.outbound_proxy_cnt); - /* Check the route URI's and force loose route if required */ for (i=0; icfg.proxy_cnt; ++i) { status = normalize_route_uri(acc->pool, &acc->cfg.proxy[i]); @@ -429,6 +422,13 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg, return status; } + /* Get CRC of account proxy setting */ + acc->local_route_crc = calc_proxy_crc(acc->cfg.proxy, acc->cfg.proxy_cnt); + + /* Get CRC of global outbound proxy setting */ + acc->global_route_crc=calc_proxy_crc(pjsua_var.ua_cfg.outbound_proxy, + pjsua_var.ua_cfg.outbound_proxy_cnt); + status = initialize_acc(id); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error adding account", status); @@ -744,6 +744,9 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id, pj_list_push_back(&local_route, r); } + + /* Recalculate the CRC again after route URI normalization */ + local_route_crc = calc_proxy_crc(acc_proxy, cfg->proxy_cnt); } -- cgit v1.2.3