diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2009-08-11 12:42:38 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2009-08-11 12:42:38 +0000 |
commit | 6f204c13ce8519524eb4da79359ac9b2aea08252 (patch) | |
tree | fd03248a6aa6c121822cbca2507113cf5b86b0f0 /pjsip-apps/src/pjsua/pjsua_app.c | |
parent | 04fbadef1554da3b61c412e030081d1f05c6a99a (diff) |
Ticket #833:
- Initial version of Session Timers (RFC 4028).
- Added new options in pjsua app to configure Session Timers settings.
- Added python tests for Session Timers.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2858 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/pjsua/pjsua_app.c')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index 41630132..94782173 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -190,6 +190,9 @@ static void usage(void) puts (" --password=string Set authentication password"); puts (" --publish Send presence PUBLISH for this account"); puts (" --use-100rel Require reliable provisional response (100rel)"); + puts (" --use-timer Require session timers"); + puts (" --timer-se Session timers expiration period, in secs (def:1800)"); + puts (" --timer-min-se Session timers minimum expiration period, in secs (def:90)"); puts (" --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind"); puts (" symmetric NAT (default 1)"); puts (" --next-cred Add another credentials"); @@ -498,7 +501,8 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_STDOUT_NO_BUF, #endif OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC, - OPT_NO_FORCE_LR + OPT_NO_FORCE_LR, + OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE }; struct pj_getopt_option long_options[] = { { "config-file",1, 0, OPT_CONFIG_FILE}, @@ -609,6 +613,9 @@ static pj_status_t parse_args(int argc, char *argv[], #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6 { "ipv6", 0, 0, OPT_IPV6}, #endif + { "use-timer", 0, 0, OPT_TIMER}, + { "timer-se", 1, 0, OPT_TIMER_SE}, + { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, { NULL, 0, 0, 0} }; pj_status_t status; @@ -825,6 +832,33 @@ static pj_status_t parse_args(int argc, char *argv[], cfg->cfg.require_100rel = PJ_TRUE; break; + case OPT_TIMER: /** session timer */ + cur_acc->require_timer = PJ_TRUE; + cfg->cfg.require_timer = PJ_TRUE; + break; + + case OPT_TIMER_SE: /** session timer session expiration */ + cur_acc->timer_se = pj_strtoul(pj_cstr(&tmp, pj_optarg)); + if (cur_acc->timer_se < 90) { + PJ_LOG(1,(THIS_FILE, + "Error: invalid value for --timer-se " + "(expecting higher than 90)")); + return PJ_EINVAL; + } + cfg->cfg.timer_se = cur_acc->timer_se; + break; + + case OPT_TIMER_MIN_SE: /** session timer minimum session expiration */ + cur_acc->timer_min_se = pj_strtoul(pj_cstr(&tmp, pj_optarg)); + if (cur_acc->timer_min_se < 90) { + PJ_LOG(1,(THIS_FILE, + "Error: invalid value for --timer-min-se " + "(expecting higher than 90)")); + return PJ_EINVAL; + } + cfg->cfg.timer_min_se = cur_acc->timer_min_se; + break; + case OPT_USE_IMS: /* Activate IMS settings */ cur_acc->auth_pref.initial_auth = PJ_TRUE; break; |