Changeset 3841 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
- Timestamp:
- Oct 24, 2011 9:28:13 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
- Property svn:mergeinfo changed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r3753 r3841 1321 1321 1322 1322 /* Unpublish presence publication */ 1323 void pjsua_pres_unpublish(pjsua_acc *acc )1323 void pjsua_pres_unpublish(pjsua_acc *acc, unsigned flags) 1324 1324 { 1325 1325 if (acc->publish_sess) { … … 1327 1327 1328 1328 acc->online_status = PJ_FALSE; 1329 send_publish(acc->index, PJ_FALSE); 1329 1330 if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) { 1331 send_publish(acc->index, PJ_FALSE); 1332 } 1333 1330 1334 /* By ticket #364, don't destroy the session yet (let the callback 1331 1335 destroy it) … … 1340 1344 1341 1345 /* Terminate server subscription for the account */ 1342 void pjsua_pres_delete_acc(int acc_id )1346 void pjsua_pres_delete_acc(int acc_id, unsigned flags) 1343 1347 { 1344 1348 pjsua_acc *acc = &pjsua_var.acc[acc_id]; … … 1362 1366 pjsip_pres_set_status(uapres->sub, &pres_status); 1363 1367 1364 if (pjsip_pres_notify(uapres->sub, 1365 PJSIP_EVSUB_STATE_TERMINATED, NULL, 1366 &reason, &tdata)==PJ_SUCCESS) 1367 { 1368 pjsip_pres_send_request(uapres->sub, tdata); 1368 if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) { 1369 if (pjsip_pres_notify(uapres->sub, 1370 PJSIP_EVSUB_STATE_TERMINATED, NULL, 1371 &reason, &tdata)==PJ_SUCCESS) 1372 { 1373 pjsip_pres_send_request(uapres->sub, tdata); 1374 } 1375 } else { 1376 pjsip_pres_terminate(uapres->sub, PJ_FALSE); 1369 1377 } 1370 1378 … … 1377 1385 1378 1386 /* Terminate presence publication, if any */ 1379 pjsua_pres_unpublish(acc );1387 pjsua_pres_unpublish(acc, flags); 1380 1388 } 1381 1389 … … 2252 2260 pjsua_acc *acc = &pjsua_var.acc[i]; 2253 2261 2262 /* Acc may not be ready yet, otherwise assertion will happen */ 2263 if (!pjsua_acc_is_valid(i)) 2264 continue; 2265 2254 2266 /* Retry PUBLISH */ 2255 2267 if (acc->cfg.publish_enabled && acc->publish_sess==NULL) … … 2325 2337 * Shutdown presence. 2326 2338 */ 2327 void pjsua_pres_shutdown( void)2339 void pjsua_pres_shutdown(unsigned flags) 2328 2340 { 2329 2341 unsigned i; … … 2340 2352 if (!pjsua_var.acc[i].valid) 2341 2353 continue; 2342 pjsua_pres_delete_acc(i );2354 pjsua_pres_delete_acc(i, flags); 2343 2355 } 2344 2356 … … 2347 2359 } 2348 2360 2349 refresh_client_subscriptions(); 2350 2351 for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 2352 if (pjsua_var.acc[i].valid) 2353 pjsua_pres_update_acc(i, PJ_FALSE); 2361 if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) { 2362 refresh_client_subscriptions(); 2363 2364 for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 2365 if (pjsua_var.acc[i].valid) 2366 pjsua_pres_update_acc(i, PJ_FALSE); 2367 } 2354 2368 } 2355 2369
Note: See TracChangeset
for help on using the changeset viewer.