Changeset 482 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_reg.c
- Timestamp:
- May 28, 2006 2:58:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_reg.c
r476 r482 18 18 */ 19 19 #include <pjsua-lib/pjsua.h> 20 #include "pjsua_imp.h" 20 21 21 22 … … 83 84 84 85 86 /** 87 * Get number of accounts. 88 */ 89 PJ_DEF(unsigned) pjsua_get_acc_count(void) 90 { 91 return pjsua.config.acc_cnt; 92 } 93 94 95 /** 96 * Get account info. 97 */ 98 PJ_DEF(pj_status_t) pjsua_acc_get_info( unsigned acc_index, 99 pjsua_acc_info *info) 100 { 101 pjsua_acc *acc = &pjsua.acc[acc_index]; 102 pjsua_acc_config *acc_cfg = &pjsua.config.acc_config[acc_index]; 103 104 PJ_ASSERT_RETURN(acc_index < pjsua.config.acc_cnt, PJ_EINVAL); 105 106 pj_memset(info, 0, sizeof(pjsua_acc_info)); 107 108 info->index = acc_index; 109 info->acc_id = acc_cfg->id; 110 info->has_registration = (acc->regc != NULL); 111 info->online_status = acc->online_status; 112 113 if (acc->reg_last_err) { 114 info->status = acc->reg_last_err; 115 pj_strerror(acc->reg_last_err, info->buf, sizeof(info->buf)); 116 info->status_text = pj_str(info->buf); 117 } else { 118 info->status = acc->reg_last_code; 119 info->status_text = *pjsip_get_status_text(acc->reg_last_code); 120 } 121 122 if (acc->regc) { 123 pjsip_regc_info regc_info; 124 pjsip_regc_get_info(acc->regc, ®c_info); 125 info->expires = regc_info.next_reg; 126 } 127 128 return PJ_SUCCESS; 129 } 130 131 85 132 /* 86 133 * Update registration. If renew is false, then unregistration will be performed. 87 134 */ 88 PJ_DECL(void) pjsua_ regc_update(intacc_index, pj_bool_t renew)135 PJ_DECL(void) pjsua_acc_set_registration(unsigned acc_index, pj_bool_t renew) 89 136 { 90 137 pj_status_t status = 0;
Note: See TracChangeset
for help on using the changeset viewer.