Issue #6409 - Make calls to URI without username go to "s" extension (imported from 1.2)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2006-03-27 23:13:31 +00:00
parent e9cf7dbfff
commit 450bc8dad6

View File

@@ -6704,6 +6704,7 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
char tmp[256] = "", *uri, *a; char tmp[256] = "", *uri, *a;
char tmpf[256], *from; char tmpf[256], *from;
struct sip_request *req; struct sip_request *req;
char *colon;
req = oreq; req = oreq;
if (!req) if (!req)
@@ -6735,20 +6736,27 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
ast_uri_decode(from); ast_uri_decode(from);
} }
/* Skip any options */
if ((a = strchr(uri, ';'))) {
*a = '\0';
}
/* Get the target domain */ /* Get the target domain */
if ((a = strchr(uri, '@'))) { if ((a = strchr(uri, '@'))) {
char *colon;
*a = '\0'; *a = '\0';
a++; a++;
colon = strchr(a, ':'); /* Remove :port */ colon = strchr(a, ':'); /* Remove :port */
if (colon) if (colon)
*colon = '\0'; *colon = '\0';
} else { /* No username part */
a = uri;
uri = "s"; /* Set extension to "s" */
}
colon = strchr(a, ':'); /* Remove :port */
if (colon)
*colon = '\0';
ast_string_field_set(p, domain, a); ast_string_field_set(p, domain, a);
}
/* Skip any options */
if ((a = strchr(uri, ';'))) {
*a = '\0';
}
if (!AST_LIST_EMPTY(&domain_list)) { if (!AST_LIST_EMPTY(&domain_list)) {
char domain_context[AST_MAX_EXTENSION]; char domain_context[AST_MAX_EXTENSION];