]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_rtp: Make usage of ast_rtp_instance_get_local_address clearer
authorGeorge Joseph <gjoseph@digium.com>
Wed, 2 Nov 2022 12:41:29 +0000 (06:41 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 2 Nov 2022 13:36:10 +0000 (07:36 -0600)
commit9de862242f7d44f947bafc8e2a44ff5ebf7c64b5
tree74918e88b48fa5332a9f8410b2102a4e2708fd6b
parent40ce4345122ee98c23176e3d5f6134870980ec50
chan_rtp: Make usage of ast_rtp_instance_get_local_address clearer

unicast_rtp_request() was setting the channel variables like this:

pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_ADDRESS",
    ast_sockaddr_stringify_addr(&local_address));
ast_rtp_instance_get_local_address(instance, &local_address);
pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_PORT",
    ast_sockaddr_stringify_port(&local_address));

...which made it appear that UNICASTRTP_LOCAL_ADDRESS was being
set before local_address was set.  In fact, the address part of
local_address was set earlier in the function, just not the port.
This was confusing however so ast_rtp_instance_get_local_address()
is now being called before setting UNICASTRTP_LOCAL_ADDRESS.

ASTERISK-30281

Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4
channels/chan_rtp.c