aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-12 17:59:39 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-12 17:59:39 +0000
commit02a324bee230ec761e8c5871bf0927a6b107dddc (patch)
tree2e00fe56ef294667235ee275ef1eefb7efb35f18 /channels
parentfca20dd555768ecbb65b7a9fbc6314e5b815a37f (diff)
fixes areas where port should be removed from domain during parsing
A patch was committed recently that converted duplicate uri parsing code to use the parse_uri function. There were two instances where this conversion did not mimic previous behavior exactly because the port was not being parsed off the end of the domain. In order to do this, a dummy pointer argument needs to be passed into parse_uri so it will know it must parse out the port from the domain. If a port output paramenter is not present, the domain is returned with the port still attached. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246420 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index dd918de59..acad72536 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11904,7 +11904,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr
enum check_auth_result res = AUTH_NOT_FOUND;
struct sip_peer *peer;
char tmp[256];
- char *name = NULL, *c, *domain = NULL;
+ char *name = NULL, *c, *domain = NULL, *dummy = NULL;
char *uri2 = ast_strdupa(uri);
terminate_uri(uri2);
@@ -11914,7 +11914,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr
c = get_in_brackets(tmp);
c = remove_uri_parameters(c);
- if (parse_uri(c, "sip:,sips:", &name, NULL, &domain, NULL, NULL)) {
+ if (parse_uri(c, "sip:,sips:", &name, &dummy, &domain, &dummy, NULL)) {
ast_log(LOG_NOTICE, "Invalid to address: '%s' from %s (missing sip:) trying to use anyway...\n", c, ast_inet_ntoa(sin->sin_addr));
return -1;
}
@@ -12407,7 +12407,7 @@ static int get_rdnis(struct sip_pvt *p, struct sip_request *oreq, char **name, c
*/
static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
{
- char tmp[256] = "", *uri, *domain;
+ char tmp[256] = "", *uri, *domain, *dummy = NULL;
char tmpf[256] = "", *from = NULL;
struct sip_request *req;
char *decoded_uri;
@@ -12422,7 +12422,7 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
uri = get_in_brackets(tmp);
- if (parse_uri(uri, "sip:,sips:", &uri, NULL, &domain, NULL, NULL)) {
+ if (parse_uri(uri, "sip:,sips:", &uri, &dummy, &domain, &dummy, NULL)) {
ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", uri);
return -1;
}