summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c8
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h5
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c4
3 files changed, 16 insertions, 1 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 31281afc..51438ee5 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -128,6 +128,7 @@ 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 (" --service-route Enable Service-Route processing");
puts (" --next-cred Add another credentials");
puts ("");
puts ("SIP Account Control:");
@@ -371,7 +372,7 @@ static pj_status_t parse_args(int argc, char *argv[],
OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO,
OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY,
OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT,
- OPT_100REL, OPT_REALM, OPT_USERNAME, OPT_PASSWORD,
+ OPT_100REL, OPT_SERVICE_ROUTE, 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,
OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP,
@@ -408,6 +409,7 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "reg-timeout",1, 0, OPT_REG_TIMEOUT},
{ "publish", 0, 0, OPT_PUBLISH},
{ "use-100rel", 0, 0, OPT_100REL},
+ { "service-route", 0, 0, OPT_SERVICE_ROUTE},
{ "id", 1, 0, OPT_ID},
{ "contact", 1, 0, OPT_CONTACT},
{ "realm", 1, 0, OPT_REALM},
@@ -634,6 +636,10 @@ static pj_status_t parse_args(int argc, char *argv[],
cfg->cfg.require_100rel = PJ_TRUE;
break;
+ case OPT_SERVICE_ROUTE: /* Service-Route processing */
+ cur_acc->enable_service_route = PJ_TRUE;
+ break;
+
case OPT_ID: /* id */
if (pjsua_verify_sip_url(pj_optarg) != 0) {
PJ_LOG(1,(THIS_FILE,
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index df5aa259..d076c668 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1888,6 +1888,11 @@ typedef struct pjsua_acc_config
*/
pj_str_t proxy[PJSUA_ACC_MAX_PROXIES];
+ /**
+ * Enable Service-Route processing for this account.
+ */
+ pj_bool_t enable_service_route;
+
/**
* Optional interval for registration, in seconds. If the value is zero,
* default interval will be used (PJSUA_REG_INTERVAL, 55 seconds).
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index a1cab41a..012832c5 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -541,6 +541,10 @@ void update_service_route(pjsua_acc *acc, pjsip_rx_data *rdata)
pjsip_uri *uri[PJSUA_ACC_MAX_PROXIES];
unsigned i, uri_cnt = 0, rcnt;
+ /* Skip processing is enable_service_route is not set */
+ if (!acc->cfg.enable_service_route)
+ return;
+
/* Find and parse Service-Route headers */
for (;;) {
char saved;