mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@187773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user