summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-06-22 06:02:13 +0000
committerBenny Prijono <bennylp@teluu.com>2010-06-22 06:02:13 +0000
commit0b4550b549b2dd9770c07aef9607ece8f122060a (patch)
tree1ded269d44faa6c252eaffc4486b540a9d347c69 /pjsip-apps
parent9a61cdc66183f1c4ed0c4a4e27ebc1b6a67ac183 (diff)
Fixed #1095 (New option to control the Route headers in REGISTER request). Details:
- added new account config setting: reg_use_proxy. This contains bitmask values to indicate whether outbound proxies and account proxies are to be added in the REGISTER request. Default value is to add both. - added new pjsua cmdline option to control this: --reg-use-proxy - miscellaneous minor fixes in other pjsua cmdline arguments git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3216 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 227beca8..c3d6ca08 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -192,8 +192,12 @@ static void usage(void)
puts (" --contact-uri-params=S Append the specified parameters S in Contact URI");
puts (" --proxy=url Optional URL of proxy server to visit");
puts (" May be specified multiple times");
- puts (" --reg-timeout=SEC Optional registration interval (default 55)");
- puts (" --rereg-delay=SEC Optional auto retry registration interval (default 300)");
+ printf(" --reg-timeout=SEC Optional registration interval (default %d)\n",
+ PJSUA_REG_INTERVAL);
+ printf(" --rereg-delay=SEC Optional auto retry registration interval (default %d)\n",
+ PJSUA_REG_RETRY_INTERVAL);
+ puts (" --reg-use-proxy=N Control the use of proxy settings in REGISTER.");
+ puts (" 0=no proxy, 1=outbound only, 2=acc only, 3=all (default)");
puts (" --realm=string Set realm");
puts (" --username=string Set authentication username");
puts (" --password=string Set authentication password");
@@ -201,7 +205,8 @@ static void usage(void)
puts (" --mwi Subscribe to message summary/waiting indication");
puts (" --use-100rel Require reliable provisional response (100rel)");
puts (" --use-timer Require SIP session timers");
- puts (" --timer-se=N Session timers expiration period, in secs (def:1800)");
+ printf(" --timer-se=N Session timers expiration period, in secs (def:%d)\n",
+ PJSIP_SESS_TIMER_DEF_SE);
puts (" --timer-min-se=N 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)");
@@ -489,7 +494,7 @@ static pj_status_t parse_args(int argc, char *argv[],
OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT,
OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS,
OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD,
- OPT_REG_RETRY_INTERVAL,
+ OPT_REG_RETRY_INTERVAL, OPT_REG_USE_PROXY,
OPT_MWI, OPT_NAMESERVER, OPT_STUN_SRV,
OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE,
OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP,
@@ -558,6 +563,7 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "username", 1, 0, OPT_USERNAME},
{ "password", 1, 0, OPT_PASSWORD},
{ "rereg-delay",1, 0, OPT_REG_RETRY_INTERVAL},
+ { "reg-use-proxy", 1, 0, OPT_REG_USE_PROXY},
{ "nameserver", 1, 0, OPT_NAMESERVER},
{ "stun-srv", 1, 0, OPT_STUN_SRV},
{ "add-buddy", 1, 0, OPT_ADD_BUDDY},
@@ -975,6 +981,15 @@ static pj_status_t parse_args(int argc, char *argv[],
cur_acc->reg_retry_interval = pj_strtoul(pj_cstr(&tmp, pj_optarg));
break;
+ case OPT_REG_USE_PROXY:
+ cur_acc->reg_use_proxy = (unsigned)pj_strtoul(pj_cstr(&tmp, pj_optarg));
+ if (cur_acc->reg_use_proxy > 3) {
+ PJ_LOG(1,(THIS_FILE, "Error: invalid --reg-use-proxy value '%s'",
+ pj_optarg));
+ return PJ_EINVAL;
+ }
+ break;
+
case OPT_NEXT_CRED: /* next credential */
cur_acc->cred_count++;
break;
@@ -1571,6 +1586,20 @@ static void write_account_settings(int acc_index, pj_str_t *result)
pj_strcat2(result, "--next-cred\n");
}
+ /* reg-use-proxy */
+ if (acc_cfg->reg_use_proxy != 3) {
+ pj_ansi_sprintf(line, "--reg-use-proxy %d\n",
+ acc_cfg->reg_use_proxy);
+ pj_strcat2(result, line);
+ }
+
+ /* rereg-delay */
+ if (acc_cfg->reg_retry_interval != PJSUA_REG_RETRY_INTERVAL) {
+ pj_ansi_sprintf(line, "--rereg-delay %d\n",
+ acc_cfg->reg_retry_interval);
+ pj_strcat2(result, line);
+ }
+
/* 100rel extension */
if (acc_cfg->require_100rel) {
pj_strcat2(result, "--use-100rel\n");