Changeset 3096


Ignore:
Timestamp:
Feb 10, 2010 2:24:48 PM (14 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
Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h

    r2968 r3096  
    445445 
    446446/** 
     447 *  Send un-PUBLISH 
     448 */ 
     449void pjsua_pres_unpublish(pjsua_acc *acc); 
     450 
     451/** 
    447452 * Terminate server subscription for the account  
    448453 */ 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r3032 r3096  
    12651265            goto on_return; 
    12661266        } 
     1267 
     1268        pjsua_pres_unpublish(&pjsua_var.acc[acc_id]); 
     1269 
    12671270        status = pjsip_regc_unregister(pjsua_var.acc[acc_id].regc, &tdata); 
    12681271    } 
  • 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.