diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-19 19:33:42 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-19 19:33:42 +0000 |
commit | f2eeaf54c03ab0dfb007c29fc8b2e2654fbe6428 (patch) | |
tree | 9e0e89b7e45c397b082bffcef81ddeada65ca384 /apps | |
parent | bd8e83639f40e4919a65a6c1a10cd107244a82a5 (diff) |
Merged revisions 151101 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r151101 | kpfleming | 2008-10-19 22:11:28 +0300 (Sun, 19 Oct 2008) | 13 lines
cleaup of the TCP/TLS socket API:
1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines
2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines)
3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines)
4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied
5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@151135 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_externalivr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index a73a19dfb..20eda9b43 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/utils.h" #include "asterisk/tcptls.h" +#include "asterisk/astobj2.h" static const char *app = "ExternalIVR"; @@ -419,7 +420,7 @@ static int app_exec(struct ast_channel *chan, void *data) } if (!strncmp(app_args[0], "ivr://", 6)) { - struct server_args ivr_desc = { + struct ast_tcptls_session_args ivr_desc = { .accept_fd = -1, .name = "IVR", }; @@ -438,9 +439,9 @@ static int app_exec(struct ast_channel *chan, void *data) } ast_gethostbyname(hostname, &hp); - ivr_desc.sin.sin_family = AF_INET; - ivr_desc.sin.sin_port = htons(port); - memmove(&ivr_desc.sin.sin_addr.s_addr, hp.hp.h_addr, hp.hp.h_length); + ivr_desc.local_address.sin_family = AF_INET; + ivr_desc.local_address.sin_port = htons(port); + memcpy(&ivr_desc.local_address.sin_addr.s_addr, hp.hp.h_addr, hp.hp.h_length); ser = ast_tcptls_client_start(&ivr_desc); if (!ser) { |