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(). git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3322 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
00f8827827
commit
4ea1bcc610
|
@ -410,6 +410,16 @@ typedef struct pjsua_mwi_info
|
|||
} pjsua_mwi_info;
|
||||
|
||||
|
||||
/**
|
||||
* Structure to be passed on registration callback.
|
||||
*/
|
||||
typedef struct pjsua_reg_info
|
||||
{
|
||||
struct pjsip_regc_cbparam *cbparam; /**< Parameters returned by
|
||||
registration callback. */
|
||||
} pjsua_reg_info;
|
||||
|
||||
|
||||
/**
|
||||
* This structure describes application callback to receive various event
|
||||
* notification from PJSUA-API. All of these callbacks are OPTIONAL,
|
||||
|
@ -582,10 +592,20 @@ typedef struct pjsua_callback
|
|||
* Application may then query the account info to get the
|
||||
* registration details.
|
||||
*
|
||||
* @param acc_id Account ID.
|
||||
* @param acc_id The account ID.
|
||||
*/
|
||||
void (*on_reg_state)(pjsua_acc_id acc_id);
|
||||
|
||||
/**
|
||||
* Notify application when registration status has changed.
|
||||
* Application may inspect the registration info to get the
|
||||
* registration status details.
|
||||
*
|
||||
* @param acc_id The account ID.
|
||||
* @param info The registration info.
|
||||
*/
|
||||
void (*on_reg_state2)(pjsua_acc_id acc_id, pjsua_reg_info *info);
|
||||
|
||||
/**
|
||||
* Notification when incoming SUBSCRIBE request is received. Application
|
||||
* may use this callback to authorize the incoming subscribe request
|
||||
|
|
|
@ -1513,9 +1513,19 @@ static void regc_cb(struct pjsip_regc_cbparam *param)
|
|||
schedule_reregistration(acc);
|
||||
}
|
||||
|
||||
if (pjsua_var.ua_cfg.cb.on_reg_state)
|
||||
(*pjsua_var.ua_cfg.cb.on_reg_state)(acc->index);
|
||||
/* Call the registration status callback */
|
||||
|
||||
if (pjsua_var.ua_cfg.cb.on_reg_state) {
|
||||
(*pjsua_var.ua_cfg.cb.on_reg_state)(acc->index);
|
||||
}
|
||||
|
||||
if (pjsua_var.ua_cfg.cb.on_reg_state2) {
|
||||
pjsua_reg_info reg_info;
|
||||
|
||||
reg_info.cbparam = param;
|
||||
(*pjsua_var.ua_cfg.cb.on_reg_state2)(acc->index, ®_info);
|
||||
}
|
||||
|
||||
PJSUA_UNLOCK();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue