Changeset 3213 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
- Timestamp:
- Jun 20, 2010 8:58:26 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3190 r3213 1099 1099 1100 1100 PJ_LOG(3,(THIS_FILE, "IP address change detected for account %d " 1101 "(%.*s:%d --> %.*s:%d). Updating registration..", 1101 "(%.*s:%d --> %.*s:%d). Updating registration " 1102 "(using method %d)", 1102 1103 acc->index, 1103 1104 (int)uri->host.slen, … … 1106 1107 (int)via_addr->slen, 1107 1108 via_addr->ptr, 1108 rport)); 1109 1110 /* Unregister current contact */ 1111 pjsua_acc_set_registration(acc->index, PJ_FALSE); 1112 if (acc->regc != NULL) { 1113 pjsip_regc_destroy(acc->regc); 1114 acc->regc = NULL; 1115 acc->contact.slen = 0; 1116 } 1117 1118 /* Update account's Contact header */ 1109 rport, 1110 acc->cfg.contact_rewrite_method)); 1111 1112 pj_assert(acc->cfg.contact_rewrite_method == 1 || 1113 acc->cfg.contact_rewrite_method == 2); 1114 1115 if (acc->cfg.contact_rewrite_method == 1) { 1116 /* Unregister current contact */ 1117 pjsua_acc_set_registration(acc->index, PJ_FALSE); 1118 if (acc->regc != NULL) { 1119 pjsip_regc_destroy(acc->regc); 1120 acc->regc = NULL; 1121 acc->contact.slen = 0; 1122 } 1123 } 1124 1125 /* 1126 * Build new Contact header 1127 */ 1119 1128 { 1120 1129 char *tmp; … … 1152 1161 } 1153 1162 pj_strdup2_with_null(acc->pool, &acc->contact, tmp); 1154 } 1155 1156 /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ 1157 pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); 1158 tp->local_name.port = rport; 1163 1164 /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ 1165 pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); 1166 tp->local_name.port = rport; 1167 1168 } 1169 1170 if (acc->cfg.contact_rewrite_method == 2 && acc->regc != NULL) { 1171 pjsip_regc_update_contact(acc->regc, 1, &acc->contact); 1172 } 1159 1173 1160 1174 /* Perform new registration */
Note: See TracChangeset
for help on using the changeset viewer.