diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 18:14:47 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 18:14:47 +0000 |
commit | 90e787d30c2be5d910b4a5b083e92f8a6aee1d09 (patch) | |
tree | 3aa1c04285c7bcb65dc1284aa65036ec2a9debba /res/res_rtp_asterisk.c | |
parent | f52aa657003ce48f1c2d6452a6750149939a471d (diff) |
Change how we set the local and remote address.
The code will now only change the address and port. It will not overwrite any other values.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187773 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 60e9142e7..87491e82d 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -406,13 +406,11 @@ static int ast_rtp_new(struct ast_rtp_instance *instance, struct sched_context * startplace = x; for (;;) { - struct sockaddr_in local_address = { 0, }; - - local_address.sin_port = htons(x); + sin->sin_port = htons(x); /* Try to bind, this will tell us whether the port is available or not */ - if (!bind(rtp->s, (struct sockaddr*)&local_address, sizeof(local_address))) { + if (!bind(rtp->s, (struct sockaddr *)sin, sizeof(*sin))) { ast_debug(1, "Allocated port %d for RTP instance '%p'\n", x, instance); - ast_rtp_instance_set_local_address(instance, &local_address); + ast_rtp_instance_set_local_address(instance, sin); break; } |