summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-02-24 17:49:59 +0000
committerJoshua Colp <jcolp@digium.com>2017-02-24 17:49:59 +0000
commitd49af061bc689c1b9d9539c05619fa02380c060d (patch)
tree7ed46a997eeb2435ed63529b3ea4d9232961e2d1 /res
parentda0cadd100a136038827f3be706372cd16134dcd (diff)
config: Improve documentation and behavior of outbound_proxy option.
This change updates the documentation for the outbound_proxy option to ensure it is consistently stated that a full SIP URI must be provided for the option. The res_pjsip_outbound_registration module has also been changed so that the provided outbound_proxy value is checked to ensure it is a URI and if not an error is output stating so. ASTERISK-26782 Change-Id: I6c239a32274846fd44e65b44ad9bf6373479b593
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c2
-rw-r--r--res/res_pjsip_outbound_publish.c2
-rw-r--r--res/res_pjsip_outbound_registration.c13
3 files changed, 14 insertions, 3 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 9970d84f4..b3722a88a 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -349,7 +349,7 @@
</description>
</configOption>
<configOption name="outbound_proxy">
- <synopsis>Proxy through which to send requests, a full SIP URI must be provided</synopsis>
+ <synopsis>Full SIP URI of the outbound proxy used to send requests</synopsis>
</configOption>
<configOption name="rewrite_contact">
<synopsis>Allow Contact header to be rewritten with the source IP address-port</synopsis>
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 37f64481e..0273c6a68 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -68,7 +68,7 @@
</description>
</configOption>
<configOption name="outbound_proxy" default="">
- <synopsis>SIP URI of the outbound proxy used to send publishes</synopsis>
+ <synopsis>Full SIP URI of the outbound proxy used to send publishes</synopsis>
</configOption>
<configOption name="server_uri">
<synopsis>SIP URI of the server and entity to publish to</synopsis>
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 122d5bb69..622df03f7 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -96,7 +96,7 @@
</description>
</configOption>
<configOption name="outbound_proxy" default="">
- <synopsis>Outbound Proxy used to send registrations</synopsis>
+ <synopsis>Full SIP URI of the outbound proxy used to send registrations</synopsis>
</configOption>
<configOption name="retry_interval" default="60">
<synopsis>Interval in seconds between retries if outbound registration is unsuccessful</synopsis>
@@ -1210,6 +1210,17 @@ static int sip_outbound_registration_regc_alloc(void *data)
return -1;
}
+ if (!ast_strlen_zero(registration->outbound_proxy)) {
+ pj_strdup2_with_null(pool, &tmp, registration->outbound_proxy);
+ uri = pjsip_parse_uri(pool, tmp.ptr, tmp.slen, 0);
+ if (!uri) {
+ ast_log(LOG_ERROR, "Invalid outbound proxy URI '%s' specified on outbound registration '%s'\n",
+ registration->outbound_proxy, ast_sorcery_object_get_id(registration));
+ pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
+ return -1;
+ }
+ }
+
pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);