[asterisk-commits] file: branch file/pimp_sip_media r380919 - /team/file/pimp_sip_media/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 5 16:24:52 CST 2013


Author: file
Date: Tue Feb  5 16:24:49 2013
New Revision: 380919

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380919
Log:
Reduce pool usage.

Modified:
    team/file/pimp_sip_media/res/res_sip_session.c

Modified: team/file/pimp_sip_media/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_media/res/res_sip_session.c?view=diff&rev=380919&r1=380918&r2=380919
==============================================================================
--- team/file/pimp_sip_media/res/res_sip_session.c (original)
+++ team/file/pimp_sip_media/res/res_sip_session.c Tue Feb  5 16:24:49 2013
@@ -1080,6 +1080,9 @@
 
 static struct pjmedia_sdp_session *create_local_sdp(pjsip_inv_session *inv, struct ast_sip_session *session, const pjmedia_sdp_session *offer)
 {
+	static const pj_str_t STR_ASTERISK = { "Asterisk", 8 };
+	static const pj_str_t STR_IN = { "IN", 2 };
+	static const pj_str_t STR_IP4 = { "IP4", 3 };
 	pjmedia_sdp_session *local;
 
 	if (!(local = PJ_POOL_ZALLOC_T(inv->pool, pjmedia_sdp_session))) {
@@ -1093,13 +1096,12 @@
 		local->origin.id = offer->origin.id;
 	}
 
-	pj_strdup2(inv->dlg->pool, &local->origin.user, "Asterisk");
-
+	local->origin.user = STR_ASTERISK;
+	local->origin.net_type = STR_IN;
+	local->origin.addr_type = STR_IP4;
 	/* XXX Hardcoded origin net stuff for now. Replace with transport
 	 * stuff later
 	 */
-	pj_strdup2(inv->dlg->pool, &local->origin.net_type, "IN");
-	pj_strdup2(inv->dlg->pool, &local->origin.addr_type, "IP4");
 	local->origin.addr = *pj_gethostname();
 	local->name = local->origin.user;
 




More information about the asterisk-commits mailing list