diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-12-10 16:54:16 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-12-10 16:54:16 +0000 |
commit | eb5756d2c401568e24c448776cc1a914b57b80b0 (patch) | |
tree | 227210f2e0d329cf7c785b2f7934e05b05f36912 /pjsip-apps | |
parent | 51ea10ee4adb41c3e8ddcfdee5fb165faffa432e (diff) |
Ticket #672: Option to add custom parameters in the account Contact URI
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2373 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index b3b5a98d..13f948fa 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -177,6 +177,7 @@ static void usage(void) puts (" --registrar=url Set the URL of registrar server"); puts (" --id=url Set the URL of local ID (used in From header)"); puts (" --contact=url Optionally override the Contact information"); + puts (" --contact-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)"); @@ -462,6 +463,7 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO, OPT_SND_AUTO_CLOSE, OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY, OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT, + OPT_CONTACT_PARAMS, OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, OPT_NAMESERVER, OPT_STUN_DOMAIN, OPT_STUN_SRV, OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, @@ -517,6 +519,7 @@ static pj_status_t parse_args(int argc, char *argv[], { "use-ims", 0, 0, OPT_USE_IMS}, { "id", 1, 0, OPT_ID}, { "contact", 1, 0, OPT_CONTACT}, + { "contact-params",1,0, OPT_CONTACT_PARAMS}, { "auto-update-nat", 1, 0, OPT_AUTO_UPDATE_NAT}, { "use-compact-form", 0, 0, OPT_USE_COMPACT_FORM}, { "accept-redirect", 1, 0, OPT_ACCEPT_REDIRECT}, @@ -826,6 +829,10 @@ static pj_status_t parse_args(int argc, char *argv[], cur_acc->force_contact = pj_str(pj_optarg); break; + case OPT_CONTACT_PARAMS: + cur_acc->contact_params = pj_str(pj_optarg); + break; + case OPT_AUTO_UPDATE_NAT: /* OPT_AUTO_UPDATE_NAT */ cur_acc->allow_contact_rewrite = pj_strtoul(pj_cstr(&tmp, pj_optarg)); break; @@ -1370,6 +1377,14 @@ static void write_account_settings(int acc_index, pj_str_t *result) pj_strcat2(result, line); } + /* Contact parameters */ + if (acc_cfg->contact_params.slen) { + pj_ansi_sprintf(line, "--contact-params %.*s\n", + (int)acc_cfg->contact_params.slen, + acc_cfg->contact_params.ptr); + pj_strcat2(result, line); + } + /* */ if (acc_cfg->allow_contact_rewrite!=1) { |