[Asterisk-code-review] res pjsip session: Rewrite o= with dynamic external media ad... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Fri Oct 13 17:49:23 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6793 )

Change subject: res_pjsip_session: Rewrite o= with dynamic external_media_address.
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/6793/2/res/res_pjsip_session.c
File res/res_pjsip_session.c:

https://gerrit.asterisk.org/#/c/6793/2/res/res_pjsip_session.c@3137
PS2, Line 3137: 			ast_debug(5, "Setting external media address to %s\n", ast_sockaddr_stringify_host(&transport_state->external_media_address));
              : 			pj_strdup2(tdata->pool, &sdp->conn->addr, ast_sockaddr_stringify_host(&transport_state->external_media_address));
              : 			pj_strdup2(tdata->pool, &sdp->origin.addr, ast_sockaddr_stringify_host(&transport_state->external_media_address));
ast_sockaddr_stringify_host() could be an expensive call and here we are calling it up to three times in a row.

ast_sockaddr_stringify_host() returns a pointer to a thread specific string buffer so we can safely save the pointer to use in these three locations.



-- 
To view, visit https://gerrit.asterisk.org/6793
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I690163b6e762042ec38b3995aa5c9bea909d8ec4
Gerrit-Change-Number: 6793
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 13 Oct 2017 22:49:23 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171013/3c550c3e/attachment.html>


More information about the asterisk-code-review mailing list