Changeset 4180


Ignore:
Timestamp:
Jun 26, 2012 9:37:41 AM (12 years ago)
Author:
ming
Message:

Re #1540: Modify MWI subscription setting on run-time

  • Add subscription state callback
  • Terminate subscription when deleting acc
Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

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

    r4175 r4180  
    11711171 
    11721172    /** 
     1173     * This callback is called when message waiting indication subscription 
     1174     * state has changed. Application can then query the subscription state 
     1175     * by calling #pjsip_evsub_get_state(). 
     1176     * 
     1177     * @param acc_id    The account ID. 
     1178     * @param evsub     The subscription instance. 
     1179     */ 
     1180    void (*on_mwi_state)(pjsua_acc_id acc_id, pjsip_evsub *evsub); 
     1181 
     1182    /** 
    11731183     * This callback is called when a NOTIFY request for message summary /  
    11741184     * message waiting indication is received. 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r4173 r4180  
    611611        } 
    612612        acc->regc = NULL; 
     613    } 
     614 
     615    /* Terminate mwi subscription */ 
     616    if (acc->cfg.mwi_enabled) { 
     617        acc->cfg.mwi_enabled = PJ_FALSE; 
     618        pjsua_start_mwi(acc_id, PJ_FALSE); 
    613619    } 
    614620 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r4173 r4180  
    19591959              pjsip_evsub_get_state_name(sub))); 
    19601960 
     1961    /* Call callback */ 
     1962    if (pjsua_var.ua_cfg.cb.on_mwi_state) { 
     1963        (*pjsua_var.ua_cfg.cb.on_mwi_state)(acc->index, sub); 
     1964    } 
     1965 
    19611966    if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { 
    19621967        /* Clear subscription */ 
Note: See TracChangeset for help on using the changeset viewer.