- Timestamp:
- Mar 15, 2011 3:20:37 AM (14 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/python/_pjsua.h
r3352 r3441 1659 1659 PyListObject *proxy; 1660 1660 unsigned reg_timeout; 1661 unsigned reg_delay_before_refresh; 1661 1662 PyListObject *cred_info; 1662 1663 int transport_id; … … 1721 1722 1722 1723 obj->reg_timeout = cfg->reg_timeout; 1724 obj->reg_delay_before_refresh = cfg->reg_delay_before_refresh; 1723 1725 1724 1726 Py_XDECREF(obj->cred_info); … … 1777 1779 1778 1780 cfg->reg_timeout = obj->reg_timeout; 1781 cfg->reg_delay_before_refresh = obj->reg_delay_before_refresh; 1779 1782 1780 1783 cfg->cred_count = PyList_Size((PyObject*)obj->cred_info); … … 1898 1901 "If the value is zero, default interval will be used " 1899 1902 "(PJSUA_REG_INTERVAL, 55 seconds). " 1903 }, 1904 { 1905 "reg_delay_before_refresh", T_INT, 1906 offsetof(PyObj_pjsua_acc_config, reg_delay_before_refresh), 0, 1907 "Specify the number of seconds to refresh the client registration" 1908 "before the registration expires." 1909 "(PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH, 5 seconds). " 1900 1910 }, 1901 1911 { -
pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h
r3128 r3441 191 191 pj_uint32_t expires); 192 192 193 /** 194 * Set the number of seconds to refresh the client registration before 195 * the registration expires. 196 * 197 * @param regc The registration structure. 198 * @param delay The number of seconds to refresh the client 199 * registration before the registration expires. 200 * 201 * @return PJ_SUCCESS on success. 202 */ 203 PJ_DECL(pj_status_t) 204 pjsip_regc_set_delay_before_refresh( pjsip_regc *regc, 205 pj_uint32_t delay ); 206 193 207 194 208 /** -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3412 r3441 2270 2270 2271 2271 /** 2272 * Specify the number of seconds to refresh the client registration 2273 * before the registration expires. 2274 * 2275 * Default: PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH, 5 seconds 2276 */ 2277 unsigned reg_delay_before_refresh; 2278 2279 /** 2272 2280 * Specify the maximum time to wait for unregistration requests to 2273 2281 * complete during library shutdown sequence. -
pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
r3223 r3441 38 38 39 39 #define REFRESH_TIMER 1 40 #define DELAY_BEFORE_REFRESH 40 #define DELAY_BEFORE_REFRESH PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH 41 41 #define THIS_FILE "sip_reg.c" 42 42 … … 88 88 pjsip_expires_hdr *expires_hdr; 89 89 pj_uint32_t expires; 90 pj_uint32_t delay_before_refresh; 90 91 pjsip_route_hdr route_set; 91 92 pjsip_hdr hdr_list; … … 376 377 /* Set "Expires" header, if required. */ 377 378 set_expires( regc, expires); 379 regc->delay_before_refresh = DELAY_BEFORE_REFRESH; 378 380 379 381 /* Set "Call-ID" header. */ … … 387 389 388 390 /* Done. */ 391 return PJ_SUCCESS; 392 } 393 394 PJ_DEF(pj_status_t) 395 pjsip_regc_set_delay_before_refresh( pjsip_regc *regc, 396 pj_uint32_t delay ) 397 { 398 PJ_ASSERT_RETURN(regc, PJ_EINVAL); 399 regc->delay_before_refresh = delay; 389 400 return PJ_SUCCESS; 390 401 } … … 1120 1131 pj_time_val delay = { 0, 0}; 1121 1132 1122 delay.sec = expiration - DELAY_BEFORE_REFRESH;1133 delay.sec = expiration - regc->delay_before_refresh; 1123 1134 if (regc->expires != PJSIP_REGC_EXPIRATION_NOT_SPECIFIED && 1124 1135 delay.sec > (pj_int32_t)regc->expires) -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3377 r3441 100 100 101 101 dst->reg_timeout = src->reg_timeout; 102 dst->reg_delay_before_refresh = src->reg_delay_before_refresh; 102 103 dst->cred_count = src->cred_count; 103 104 … … 393 394 pjsua_acc_config_dup(acc->pool, &pjsua_var.acc[id].cfg, cfg); 394 395 395 /* Normalize registration timeout */ 396 if (pjsua_var.acc[id].cfg.reg_uri.slen && 397 pjsua_var.acc[id].cfg.reg_timeout == 0) 398 { 399 pjsua_var.acc[id].cfg.reg_timeout = PJSUA_REG_INTERVAL; 396 /* Normalize registration timeout and refresh delay */ 397 if (pjsua_var.acc[id].cfg.reg_uri.slen) { 398 if (pjsua_var.acc[id].cfg.reg_timeout == 0) { 399 pjsua_var.acc[id].cfg.reg_timeout = PJSUA_REG_INTERVAL; 400 } 401 if (pjsua_var.acc[id].cfg.reg_delay_before_refresh == 0) { 402 pjsua_var.acc[id].cfg.reg_delay_before_refresh = 403 PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH; 404 } 400 405 } 401 406 … … 941 946 /* Registration */ 942 947 acc->cfg.reg_timeout = cfg->reg_timeout; 948 acc->cfg.reg_delay_before_refresh = cfg->reg_delay_before_refresh; 943 949 acc->cfg.unreg_timeout = cfg->unreg_timeout; 944 950 acc->cfg.allow_contact_rewrite = cfg->allow_contact_rewrite; … … 946 952 acc->cfg.drop_calls_on_reg_fail = cfg->drop_calls_on_reg_fail; 947 953 948 /* Normalize registration timeout */ 949 if (acc->cfg.reg_uri.slen && acc->cfg.reg_timeout == 0) 950 acc->cfg.reg_timeout = PJSUA_REG_INTERVAL; 954 /* Normalize registration timeout and refresh delay */ 955 if (acc->cfg.reg_uri.slen ) { 956 if (acc->cfg.reg_timeout == 0) { 957 acc->cfg.reg_timeout = PJSUA_REG_INTERVAL; 958 } 959 if (acc->cfg.reg_delay_before_refresh == 0) { 960 acc->cfg.reg_delay_before_refresh = 961 PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH; 962 } 963 } 951 964 952 965 /* Registrar URI */ … … 1816 1829 pjsip_regc_set_credentials( acc->regc, acc->cred_cnt, acc->cred); 1817 1830 } 1831 1832 /* Set delay before registration refresh */ 1833 pjsip_regc_set_delay_before_refresh(acc->regc, 1834 acc->cfg.reg_delay_before_refresh); 1818 1835 1819 1836 /* Set authentication preference */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r3429 r3441 167 167 168 168 cfg->reg_timeout = PJSUA_REG_INTERVAL; 169 cfg->reg_delay_before_refresh = PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH; 169 170 cfg->unreg_timeout = PJSUA_UNREG_TIMEOUT; 170 171 pjsip_publishc_opt_default(&cfg->publish_opt);
Note: See TracChangeset
for help on using the changeset viewer.