diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-06 16:25:59 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-06 16:25:59 +0000 |
commit | f6e88e0c3564207609925acae24798c84dbceb2b (patch) | |
tree | 0432c4c0dfd37744354cdc730f314622ac0d0136 /pjsip/src/pjsua-lib/pjsua_settings.c | |
parent | 094150d602cf3b5f6b8eff1ba128756c2c25b8b3 (diff) |
Added --uas-duration and --uas-refresh option (the later is broken)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@305 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_settings.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_settings.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_settings.c b/pjsip/src/pjsua-lib/pjsua_settings.c index 234a5943..9ea7de41 100644 --- a/pjsip/src/pjsua-lib/pjsua_settings.c +++ b/pjsip/src/pjsua-lib/pjsua_settings.c @@ -101,6 +101,8 @@ static void usage(void) puts ("User Agent options:"); puts (" --auto-answer=code Automatically answer incoming calls with code (e.g. 200)"); puts (" --max-calls=N Maximum number of concurrent calls (default:4, max:255)"); + puts (" --uas-refresh=N Interval in UAS to send re-INVITE (default:-1)"); + puts (" --uas-duration=N Maximum duration of incoming call (default:-1)"); puts (""); fflush(stdout); } @@ -225,7 +227,8 @@ pj_status_t pjsua_parse_args(int argc, char *argv[]) OPT_AUTO_CONF, OPT_PLAY_FILE, OPT_WB, OPT_UWB, OPT_RTP_PORT, OPT_ADD_CODEC, OPT_COMPLEXITY, OPT_QUALITY, - OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, + OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, OPT_UAS_REFRESH, + OPT_UAS_DURATION, }; struct pj_getopt_option long_options[] = { { "config-file",1, 0, OPT_CONFIG_FILE}, @@ -265,6 +268,8 @@ pj_status_t pjsua_parse_args(int argc, char *argv[]) { "next-account",0,0, OPT_NEXT_ACCOUNT}, { "next-cred", 0, 0, OPT_NEXT_CRED}, { "max-calls", 1, 0, OPT_MAX_CALLS}, + { "uas-refresh",1, 0, OPT_UAS_REFRESH}, + { "uas-duration",1,0, OPT_UAS_DURATION}, { NULL, 0, 0, 0} }; pj_status_t status; @@ -536,6 +541,22 @@ pj_status_t pjsua_parse_args(int argc, char *argv[]) return -1; } break; + + case OPT_UAS_REFRESH: + pjsua.uas_refresh = my_atoi(pj_optarg); + if (pjsua.uas_refresh < 1) { + PJ_LOG(1,(THIS_FILE,"Invalid value for --uas-refresh (must be >0)")); + return -1; + } + break; + + case OPT_UAS_DURATION: + pjsua.uas_duration = my_atoi(pj_optarg); + if (pjsua.uas_duration < 1) { + PJ_LOG(1,(THIS_FILE,"Invalid value for --uas-duration (must be >0)")); + return -1; + } + break; } } @@ -915,6 +936,19 @@ int pjsua_dump_settings(char *buf, pj_size_t max) pjsua.max_calls); pj_strcat2(&cfg, line); + /* Uas-refresh. */ + if (pjsua.uas_refresh > 0) { + pj_ansi_sprintf(line, "--uas-refresh %d\n", + pjsua.uas_refresh); + pj_strcat2(&cfg, line); + } + + /* Uas-duration. */ + if (pjsua.uas_duration > 0) { + pj_ansi_sprintf(line, "--uas-duration %d\n", + pjsua.uas_duration); + pj_strcat2(&cfg, line); + } pj_strcat2(&cfg, "#\n# Buddies:\n#\n"); |