aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_externalivr.c
diff options
context:
space:
mode:
authordiruggles <diruggles@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-07 19:48:14 +0000
committerdiruggles <diruggles@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-07 19:48:14 +0000
commit464b0269fa9f26f6df7ecdc329a6e7cd745c1c7f (patch)
treefebe434e137e857040bedc67b589e033119ce364 /apps/app_externalivr.c
parent004794f6bd195a295ab28d31a5b612d9bda2ed62 (diff)
Fix TCP Client interface
Fix a couple of very minor bugs that prevent the socket client from working. The wrong set of properties were used in one place and the size of the address variable isn't set if the host name is an ip address. Also includes a fix for a bug that was introduced previously. (closes issue #16121) Reported by: thedavidfactor Tested by: thedavidfactor Review: https://reviewboard.asterisk.org/r/439/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233545 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r--apps/app_externalivr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index ba9c211fb..95511cc65 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -419,7 +419,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
}
/* Get rid of any extraneous arguments */
- if ((s = strchr(eivr_args.options, ','))) {
+ if (eivr_args.options && (s = strchr(eivr_args.options, ','))) {
*s = '\0';
}
@@ -473,9 +473,9 @@ static int app_exec(struct ast_channel *chan, const char *data)
}
ast_gethostbyname(hostname, &hp);
- 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);
+ 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));
if (!(ser = ast_tcptls_client_create(&ivr_desc)) || !(ser = ast_tcptls_client_start(ser))) {
goto exit;
}