aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-19 15:33:49 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-19 15:33:49 +0000
commitd16d0f65db522fbfc7d4ab89ecdb0f9913fa5abe (patch)
treef211ee90595e865ade437561e0f8fba734e6b374
parent8276a883b814831548c93903a8c4c79b240b0280 (diff)
Fix two issues with domains and transfers. If a port was given in the hostname it was treated as part of the hostname. If domains were configured but external domains were not enabled all transfers would be considered remote.
(closes issue #11027) Reported by: ramonpeek Patches: 11027-1.diff uploaded by ramonpeek (license 266) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@86471 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e823f6aef..adf83ce64 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8875,13 +8875,18 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
}
if ((ptr = strchr(refer_to, '@'))) { /* Separate domain */
- char *urioption;
-
+ char *urioption = NULL, *domain;
*ptr++ = '\0';
- if ((urioption = strchr(ptr, ';')))
+
+ if ((urioption = strchr(ptr, ';'))) /* Separate urioptions */
*urioption++ = '\0';
+
+ domain = ptr;
+ if ((ptr = strchr(domain, ':'))) /* Remove :port */
+ *ptr = '\0';
+
/* Save the domain for the dial plan */
- ast_copy_string(referdata->refer_to_domain, ptr, sizeof(referdata->refer_to_domain));
+ ast_copy_string(referdata->refer_to_domain, domain, sizeof(referdata->refer_to_domain));
if (urioption)
ast_copy_string(referdata->refer_to_urioption, urioption, sizeof(referdata->refer_to_urioption));
}
@@ -14166,11 +14171,10 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
p->refer->localtransfer = 1;
if (sipdebug && option_debug > 2)
ast_log(LOG_DEBUG, "This SIP transfer is local : %s\n", p->refer->refer_to_domain);
- } else if (AST_LIST_EMPTY(&domain_list)) {
- /* This PBX don't bother with SIP domains, so all transfers are local */
+ } else if (AST_LIST_EMPTY(&domain_list) || check_sip_domain(p->refer->refer_to_domain, NULL, 0)) {
+ /* This PBX doesn't bother with SIP domains or domain is local, so this transfer is local */
p->refer->localtransfer = 1;
- } else
- if (sipdebug && option_debug > 2)
+ } else if (sipdebug && option_debug > 2)
ast_log(LOG_DEBUG, "This SIP transfer is to a remote SIP extension (remote domain %s)\n", p->refer->refer_to_domain);
/* Is this a repeat of a current request? Ignore it */