[asterisk-commits] file: trunk r400246 - in /trunk: ./ res/res_pjsip_session.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Oct 2 09:13:56 CDT 2013
Author: file
Date: Wed Oct 2 09:13:55 2013
New Revision: 400246
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400246
Log:
Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time.
........
Merged revisions 400245 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/res/res_pjsip_session.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Oct 2 09:13:55 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194,400196,400205,400217,400227,400236
+/branches/12:1-398558,398560-398577,398579-399305,399307-400181,400194,400196,400205,400217,400227,400236,400245
Modified: trunk/res/res_pjsip_session.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_session.c?view=diff&rev=400246&r1=400245&r2=400246
==============================================================================
--- trunk/res/res_pjsip_session.c (original)
+++ trunk/res/res_pjsip_session.c Wed Oct 2 09:13:55 2013
@@ -47,6 +47,9 @@
#define MOD_DATA_ON_RESPONSE "on_response"
#define MOD_DATA_NAT_HOOK "nat_hook"
+
+/* Hostname used for origin line within SDP */
+static const pj_str_t *hostname;
/* Some forward declarations */
static void handle_incoming_request(struct ast_sip_session *session, pjsip_rx_data *rdata);
@@ -1991,7 +1994,7 @@
pj_strdup2(inv->pool, &local->origin.user, session->endpoint->media.sdpowner);
local->origin.net_type = STR_IN;
local->origin.addr_type = session->endpoint->media.rtp.ipv6 ? STR_IP6 : STR_IP4;
- local->origin.addr = *pj_gethostname();
+ local->origin.addr = *hostname;
pj_strdup2(inv->pool, &local->name, session->endpoint->media.sdpsession);
/* Now let the handlers add streams of various types, pjmedia will automatically reorder the media streams for us */
@@ -2137,6 +2140,7 @@
pjsip_inv_usage_init(endpt, &inv_callback);
pjsip_100rel_init_module(endpt);
pjsip_timer_init_module(endpt);
+ hostname = pj_gethostname();
if (ast_sip_register_service(&session_module)) {
return AST_MODULE_LOAD_DECLINE;
}
More information about the asterisk-commits
mailing list