Changeset 5356
- Timestamp:
- Jun 24, 2016 1:03:25 PM (8 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h
r4586 r5356 78 78 int contact_cnt;/**<Number of contacts in response. */ 79 79 pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts. */ 80 pj_bool_t is_unreg; /**< Expire header, if any, set to zero?*/ 80 81 }; 81 82 -
pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
r5353 r5356 747 747 const pj_str_t *reason, 748 748 pjsip_rx_data *rdata, pj_int32_t expiration, 749 int contact_cnt, pjsip_contact_hdr *contact[]) 749 int contact_cnt, pjsip_contact_hdr *contact[], 750 pj_bool_t is_unreg) 750 751 { 751 752 cbparam->regc = regc; … … 758 759 cbparam->expiration = (expiration >= 0? expiration: 759 760 regc->expires_requested); 761 cbparam->is_unreg = is_unreg; 760 762 if (contact_cnt) { 761 763 pj_memcpy( cbparam->contact, contact, … … 767 769 const pj_str_t *reason, 768 770 pjsip_rx_data *rdata, pj_int32_t expiration, 769 int contact_cnt, pjsip_contact_hdr *contact[]) 771 int contact_cnt, pjsip_contact_hdr *contact[], 772 pj_bool_t is_unreg) 770 773 { 771 774 struct pjsip_regc_cbparam cbparam; … … 775 778 776 779 cbparam_init(&cbparam, regc, status, st_code, reason, rdata, expiration, 777 contact_cnt, contact );780 contact_cnt, contact, is_unreg); 778 781 (*regc->cb)(&cbparam); 779 782 } … … 802 805 char errmsg[PJ_ERR_MSG_SIZE]; 803 806 pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg)); 804 call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL); 807 call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL, 808 PJ_FALSE); 805 809 } 806 810 … … 1100 1104 (event->body.tsx_state.type==PJSIP_EVENT_RX_MSG) ? 1101 1105 event->body.tsx_state.src.rdata : NULL, 1102 -1, 0, NULL );1106 -1, 0, NULL, PJ_FALSE); 1103 1107 1104 1108 /* Call regc tsx callback before handling any response */ … … 1139 1143 pjsip_rx_data *rdata = event->body.tsx_state.src.rdata; 1140 1144 pjsip_tx_data *tdata; 1145 pj_bool_t is_unreg; 1141 1146 1142 1147 /* reset current op */ 1148 is_unreg = (regc->current_op == REGC_UNREGISTERING); 1143 1149 regc->current_op = REGC_IDLE; 1144 1150 … … 1206 1212 call_callback(regc, status, tsx->status_code, 1207 1213 &rdata->msg_info.msg->line.status.reason, 1208 rdata, -1, 0, NULL );1214 rdata, -1, 0, NULL, is_unreg); 1209 1215 pj_lock_acquire(regc->lock); 1210 1216 } … … 1295 1301 call_callback(regc, status, tsx->status_code, 1296 1302 &rdata->msg_info.msg->line.status.reason, 1297 rdata, -1, 0, NULL );1303 rdata, -1, 0, NULL, PJ_FALSE); 1298 1304 pj_lock_acquire(regc->lock); 1299 1305 } … … 1310 1316 unsigned contact_cnt = 0; 1311 1317 pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; 1318 pj_bool_t is_unreg; 1312 1319 1313 1320 if (tsx->status_code/100 == 2) { … … 1334 1341 1335 1342 /* Mark operation as complete */ 1343 is_unreg = (regc->current_op == REGC_UNREGISTERING); 1336 1344 regc->current_op = REGC_IDLE; 1337 1345 … … 1345 1353 : &tsx->status_text), 1346 1354 rdata, expiration, 1347 contact_cnt, contact );1355 contact_cnt, contact, is_unreg); 1348 1356 pj_lock_acquire(regc->lock); 1349 1357 } -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5337 r5356 2305 2305 reg_info.cbparam = param; 2306 2306 reg_info.regc = param->regc; 2307 reg_info.renew = (rinfo.interval != 0);2307 reg_info.renew = !param->is_unreg; 2308 2308 (*pjsua_var.ua_cfg.cb.on_reg_state2)(acc->index, ®_info); 2309 2309 }
Note: See TracChangeset
for help on using the changeset viewer.