[asterisk-commits] rizzo: branch rizzo/astobj2 r47974 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 23 13:35:47 MST 2006


Author: rizzo
Date: Thu Nov 23 14:35:47 2006
New Revision: 47974

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47974
Log:
more profiling


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47974&r1=47973&r2=47974
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Thu Nov 23 14:35:47 2006
@@ -4471,11 +4471,15 @@
 {
 	struct sip_pvt *p;
 	static int prof_id = -1, prof_alloc = -1, prof_init = -1;
+	static int prof_tail = -1;
+	static int prof_rtp = -1;
 
 	if (prof_id == -1) {
 		prof_id = ast_add_profile("sip_alloc", 0);
 		prof_alloc = ast_add_profile("sip_alloc-alloc", 0);
 		prof_init = ast_add_profile("sip_alloc-init", 0);
+		prof_tail = ast_add_profile("sip_alloc-tail", 0);
+		prof_rtp = ast_add_profile("sip_alloc-need_rtp", 0);
 	}
 
 	ast_mark(prof_id, 1);
@@ -4529,6 +4533,7 @@
 	p->icseq = UNINITIALIZED_ICSEQ;	/* not initialized - any incoming value is good */
 
 	if (sip_methods[intended_method].need_rtp) {
+		ast_mark(prof_rtp, 1);
 		p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
 		/* If the global videosupport flag is on, we always create a RTP interface for video */
 		if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT))
@@ -4554,6 +4559,7 @@
 		p->rtpholdtimeout = global_rtpholdtimeout;
 		p->rtpkeepalive = global_rtpkeepalive;
 		p->maxcallbitrate = default_maxcallbitrate;
+		ast_mark(prof_rtp, 0);
 	}
 
 	if (useglobal_nat && sin) {
@@ -4566,8 +4572,11 @@
 	if (p->method != SIP_REGISTER)
 		ast_string_field_set(p, fromdomain, default_fromdomain);
 	build_via(p);
-	if (!callid)
+	if (!callid) {
+		ast_mark(prof_tail, 1);
 		build_callid_pvt(p);
+		ast_mark(prof_tail, 0);
+	}
 	else
 		ast_string_field_set(p, callid, callid);
 	/* Assign default music on hold class */



More information about the asterisk-commits mailing list