Changeset 3322


Ignore:
Timestamp:
Sep 28, 2010 4:57:01 AM (11 years ago)
Author:
nanang
Message:

Close #1138:

  • Added new pjsua registration status callback on_reg_state2(), it includes the whole info from the lower layer registration callback pjsip_regc_cb().
Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

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

    r3313 r3322  
    412412 
    413413/** 
     414 * Structure to be passed on registration callback. 
     415 */ 
     416typedef struct pjsua_reg_info 
     417{ 
     418    struct pjsip_regc_cbparam   *cbparam;   /**< Parameters returned by  
     419                                                 registration callback. */ 
     420} pjsua_reg_info; 
     421 
     422 
     423/** 
    414424 * This structure describes application callback to receive various event 
    415425 * notification from PJSUA-API. All of these callbacks are OPTIONAL,  
     
    583593     * registration details. 
    584594     * 
    585      * @param acc_id        Account ID. 
     595     * @param acc_id        The account ID. 
    586596     */ 
    587597    void (*on_reg_state)(pjsua_acc_id acc_id); 
     598 
     599    /** 
     600     * Notify application when registration status has changed. 
     601     * Application may inspect the registration info to get the 
     602     * registration status details. 
     603     * 
     604     * @param acc_id        The account ID. 
     605     * @param info          The registration info. 
     606     */ 
     607    void (*on_reg_state2)(pjsua_acc_id acc_id, pjsua_reg_info *info); 
    588608 
    589609    /** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r3313 r3322  
    15141514    } 
    15151515 
    1516     if (pjsua_var.ua_cfg.cb.on_reg_state) 
     1516    /* Call the registration status callback */ 
     1517 
     1518    if (pjsua_var.ua_cfg.cb.on_reg_state) { 
    15171519        (*pjsua_var.ua_cfg.cb.on_reg_state)(acc->index); 
    1518  
     1520    } 
     1521 
     1522    if (pjsua_var.ua_cfg.cb.on_reg_state2) { 
     1523        pjsua_reg_info reg_info; 
     1524 
     1525        reg_info.cbparam = param; 
     1526        (*pjsua_var.ua_cfg.cb.on_reg_state2)(acc->index, &reg_info); 
     1527    } 
     1528     
    15191529    PJSUA_UNLOCK(); 
    15201530} 
Note: See TracChangeset for help on using the changeset viewer.