Ignore:
Timestamp:
Feb 10, 2010 2:24:48 PM (11 years ago)
Author:
bennylp
Message:

Ticket #995: Send un-PUBLISH when pjsua_acc_set_registration(FALSE) is called (thanks Johan Lantz for the suggestion)

  • in this implementation, when pjsua_acc_set_registration(FALSE) is called, the un-REGISTER request will be sent immediately after un-PUBLISH, unlike the process during shutdown where the un-REGISTER request will be sent only after un-PUBLISH transaction is complete
File:
1 edited

Legend:

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

    r3031 r3096  
    12761276 
    12771277 
     1278/* Unpublish presence publication */ 
     1279void pjsua_pres_unpublish(pjsua_acc *acc) 
     1280{ 
     1281    if (acc->publish_sess) { 
     1282        pjsua_acc_config *acc_cfg = &acc->cfg; 
     1283 
     1284        acc->online_status = PJ_FALSE; 
     1285        send_publish(acc->index, PJ_FALSE); 
     1286        /* By ticket #364, don't destroy the session yet (let the callback 
     1287           destroy it) 
     1288        if (acc->publish_sess) { 
     1289            pjsip_publishc_destroy(acc->publish_sess); 
     1290            acc->publish_sess = NULL; 
     1291        } 
     1292        */ 
     1293        acc_cfg->publish_enabled = PJ_FALSE; 
     1294    } 
     1295} 
     1296 
    12781297/* Terminate server subscription for the account */ 
    12791298void pjsua_pres_delete_acc(int acc_id) 
    12801299{ 
    12811300    pjsua_acc *acc = &pjsua_var.acc[acc_id]; 
    1282     pjsua_acc_config *acc_cfg = &pjsua_var.acc[acc_id].cfg; 
    12831301    pjsua_srv_pres *uapres; 
    12841302 
     
    13151333 
    13161334    /* Terminate presence publication, if any */ 
    1317     if (acc->publish_sess) { 
    1318         acc->online_status = PJ_FALSE; 
    1319         send_publish(acc_id, PJ_FALSE); 
    1320         /* By ticket #364, don't destroy the session yet (let the callback 
    1321            destroy it) 
    1322         if (acc->publish_sess) { 
    1323             pjsip_publishc_destroy(acc->publish_sess); 
    1324             acc->publish_sess = NULL; 
    1325         } 
    1326         */ 
    1327         acc_cfg->publish_enabled = PJ_FALSE; 
    1328     } 
     1335    pjsua_pres_unpublish(acc); 
    13291336} 
    13301337 
Note: See TracChangeset for help on using the changeset viewer.