[Asterisk-code-review] chan_rtp: Make usage of ast_rtp_instance_get_local_address clearer (asterisk[master])
Friendly Automation
asteriskteam at digium.com
Wed Nov 2 10:45:19 CDT 2022
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19526 )
Change subject: chan_rtp: Make usage of ast_rtp_instance_get_local_address clearer
......................................................................
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
---
M channels/chan_rtp.c
1 file changed, 26 insertions(+), 1 deletion(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/channels/chan_rtp.c b/channels/chan_rtp.c
index 087ddae..0740c2c 100644
--- a/channels/chan_rtp.c
+++ b/channels/chan_rtp.c
@@ -381,9 +381,9 @@
ast_channel_tech_pvt_set(chan, instance);
+ ast_rtp_instance_get_local_address(instance, &local_address);
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));
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19526
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4
Gerrit-Change-Number: 19526
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221102/d8bee5b9/attachment.html>
More information about the asterisk-code-review
mailing list