diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-27 23:01:43 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-27 23:01:43 +0000 |
commit | f133bc9117bb3013f503067f8feb299799d0a346 (patch) | |
tree | 9eb414d06096872f2696efd8a7f2db2a5a1c5ac8 | |
parent | ffa0c30f51510b3df73851214e157bf7ce452a8c (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@15374 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 79f6bf49f..8e668509d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6606,6 +6606,7 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq) char tmp[256] = "", *uri, *a; char tmpf[256], *from; struct sip_request *req; + char *colon; req = oreq; if (!req) @@ -6637,20 +6638,24 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq) ast_uri_decode(from); } + /* Skip any options */ + if ((a = strchr(uri, ';'))) { + *a = '\0'; + } + /* Get the target domain */ if ((a = strchr(uri, '@'))) { - char *colon; *a = '\0'; a++; - colon = strchr(a, ':'); /* Remove :port */ - if (colon) - *colon = '\0'; - ast_copy_string(p->domain, a, sizeof(p->domain)); - } - /* Skip any options */ - if ((a = strchr(uri, ';'))) { - *a = '\0'; + } else { /* No username part */ + a = uri; + uri = "s"; /* Set extension to "s" */ } + colon = strchr(a, ':'); /* Remove :port */ + if (colon) + *colon = '\0'; + + ast_copy_string(p->domain, a, sizeof(p->domain)); if (!AST_LIST_EMPTY(&domain_list)) { char domain_context[AST_MAX_EXTENSION]; |