[Asterisk-cvs] asterisk/channels chan_sip.c,1.720,1.721

kpfleming at lists.digium.com kpfleming at lists.digium.com
Mon May 2 22:25:39 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv4608/channels

Modified Files:
	chan_sip.c 
Log Message:
use symbolic constants for RTP method flags, and add debugging output to sip_alloc to indicate when RTP is/is not allocated (bug #3986)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.720
retrieving revision 1.721
diff -u -d -r1.720 -r1.721
--- chan_sip.c	3 May 2005 02:16:45 -0000	1.720
+++ chan_sip.c	3 May 2005 02:32:50 -0000	1.721
@@ -131,26 +131,28 @@
 #define SIP_PUBLISH	14
 #define SIP_RESPONSE	100
 
+#define RTP 	1
+#define NO_RTP	0
 const struct  cfsip_methods { 
 	int id;
 	int need_rtp;		/* when this is the 'primary' use for a pvt structure, does it need RTP? */
 	char *text;
 } sip_methods[] = {
-	{ 0,		 1, "-UNKNOWN-" },
-	{ SIP_REGISTER,	 0, "REGISTER" },
- 	{ SIP_OPTIONS,	 0, "OPTIONS" },
-	{ SIP_NOTIFY,	 0, "NOTIFY" },
-	{ SIP_INVITE,	 1, "INVITE" },
-	{ SIP_ACK,	 0, "ACK" },
-	{ SIP_PRACK,	 0, "PRACK" },
-	{ SIP_BYE,	 0, "BYE" },
-	{ SIP_REFER,	 0, "REFER" },
-	{ SIP_SUBSCRIBE, 0, "SUBSCRIBE" },
-	{ SIP_MESSAGE,	 0, "MESSAGE" },
-	{ SIP_UPDATE,	 0, "UPDATE" },
-	{ SIP_INFO,	 0, "INFO" },
-	{ SIP_CANCEL,	 0, "CANCEL" },
-	{ SIP_PUBLISH,	 0, "PUBLISH" }
+	{ 0,		 RTP, "-UNKNOWN-" },
+	{ SIP_REGISTER,	 NO_RTP, "REGISTER" },
+ 	{ SIP_OPTIONS,	 NO_RTP, "OPTIONS" },
+	{ SIP_NOTIFY,	 NO_RTP, "NOTIFY" },
+	{ SIP_INVITE,	 RTP, "INVITE" },
+	{ SIP_ACK,	 NO_RTP, "ACK" },
+	{ SIP_PRACK,	 NO_RTP, "PRACK" },
+	{ SIP_BYE,	 NO_RTP, "BYE" },
+	{ SIP_REFER,	 NO_RTP, "REFER" },
+	{ SIP_SUBSCRIBE, NO_RTP, "SUBSCRIBE" },
+	{ SIP_MESSAGE,	 NO_RTP, "MESSAGE" },
+	{ SIP_UPDATE,	 NO_RTP, "UPDATE" },
+	{ SIP_INFO,	 NO_RTP, "INFO" },
+	{ SIP_CANCEL,	 NO_RTP, "CANCEL" },
+	{ SIP_PUBLISH,	 NO_RTP, "PUBLISH" }
 };
 
 
@@ -2571,17 +2573,17 @@
 	if (ast_test_flag(p, SIP_DTMF) == SIP_DTMF_RFC2833)
 		p->noncodeccapability |= AST_RTP_DTMF;
 	strcpy(p->context, default_context);
-	/* Add to list */
+	/* Add to active dialog list */
 	ast_mutex_lock(&iflock);
 	p->next = iflist;
 	iflist = p;
 	ast_mutex_unlock(&iflock);
 	if (option_debug)
-		ast_log(LOG_DEBUG, "Allocating new SIP call for %s\n", callid);
+		ast_log(LOG_DEBUG, "Allocating new SIP dialog for %s - %s (%s)\n", callid ? callid : "(No Call-ID)", sip_methods[intended_method].text, p->rtp ? "With RTP" : "No RTP");
 	return p;
 }
 
-/*--- find_call: Connect incoming SIP message to current call or create new call structure */
+/*--- find_call: Connect incoming SIP message to current dialog or create new dialog structure */
 /*               Called by handle_request ,sipsock_read */
 static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method)
 {




More information about the svn-commits mailing list