[Asterisk-code-review] res pjsip sdp rtp: Control endpoints media address use per c... (asterisk[13])

Sean Bright asteriskteam at digium.com
Fri Oct 5 08:55:04 CDT 2018


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/10431 )

Change subject: res_pjsip_sdp_rtp: Control endpoints media_address use per call basis
......................................................................


Patch Set 5: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/10431/5/res/res_pjsip_sdp_rtp.c
File res/res_pjsip_sdp_rtp.c:

https://gerrit.asterisk.org/#/c/10431/5/res/res_pjsip_sdp_rtp.c@1249
PS5, Line 1249: 		const char *use_media_address = pbx_builtin_getvar_helper(session->channel, "PJSIP_USE_MEDIA_ADDRESS");
              : 		if (!ast_strlen_zero(use_media_address)) {
              : 			if (!strcmp("yes", use_media_address)) {
              : 				hostip = session->endpoint->media.address;
              : 			} else if (!strcmp("no", use_media_address)) {
              : 				hostip = ast_sip_get_host_ip_string(session->endpoint->media.rtp.ipv6 ? pj_AF_INET6() : pj_AF_INET());
              : 			} else {
              : 				hostip = session->endpoint->media.address;
              : 			}
              : 		} else {
              : 			hostip = session->endpoint->media.address;
              : 		}
This block can be simplified to just:

 const char *use_media_address = pbx_builtin_getvar_helper(...);
 hostip = session->endpoint->media.address;
 if (!ast_strlen_zero(use_media_address) && !strcmp("no", use_media_address)) {
   hostip = ast_sip_get_host_ip_string(...);
 }



-- 
To view, visit https://gerrit.asterisk.org/10431
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I852adbee9f8b034ec332fbe4e1b6692cb2939518
Gerrit-Change-Number: 10431
Gerrit-PatchSet: 5
Gerrit-Owner: Salah Ahmed <txrubel at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Fri, 05 Oct 2018 13:55:04 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181005/ed1861f3/attachment.html>


More information about the asterisk-code-review mailing list