aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-08 22:08:07 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-08 22:08:07 +0000
commitc3c2e5edfd715b3a99aac1567623a0b1b7d49de0 (patch)
treec05335b563c3f7cb9a3edbf3e101d8e1b80e0be4 /apps
parentaf344f1a5be5b43f1d10b95ea6e57ebfa761cf50 (diff)
Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses within Asterisk. While many files have been updated to make use of the API, chan_sip and the RTP code are the files which actually support IPv6 addresses at the time of this commit. The way has been paved for easier upgrading for other files in the near future, though. Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne for their hard work on this. (closes issue #17565) Reported by: russell Patches: asteriskv6-test-report.pdf uploaded by russell (license 2) Review: https://reviewboard.asterisk.org/r/743 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274783 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_externalivr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 5e33cdd3d..919815d73 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -492,6 +492,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
.name = "IVR",
};
struct ast_hostent hp;
+ struct sockaddr_in remote_address_tmp;
/*communicate through socket to server*/
ast_debug(1, "Parsing hostname:port for socket connect from \"%s\"\n", app_args[0]);
@@ -506,9 +507,10 @@ static int app_exec(struct ast_channel *chan, const char *data)
}
ast_gethostbyname(hostname, &hp);
- ivr_desc.remote_address.sin_family = AF_INET;
- ivr_desc.remote_address.sin_port = htons(port);
- memcpy(&ivr_desc.remote_address.sin_addr.s_addr, hp.hp.h_addr, sizeof(hp.hp.h_addr));
+ remote_address_tmp.sin_family = AF_INET;
+ remote_address_tmp.sin_port = htons(port);
+ memcpy(&remote_address_tmp.sin_addr.s_addr, hp.hp.h_addr, sizeof(hp.hp.h_addr));
+ ast_sockaddr_from_sin(&ivr_desc.remote_address, &remote_address_tmp);
if (!(ser = ast_tcptls_client_create(&ivr_desc)) || !(ser = ast_tcptls_client_start(ser))) {
goto exit;
}