[Asterisk-cvs] asterisk/channels chan_sip.c,1.188,1.189

markster at lists.digium.com markster at lists.digium.com
Thu Oct 2 01:45:08 CDT 2003


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

Modified Files:
	chan_sip.c 
Log Message:
Make sip show channel display a given callid when only partly specified


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -d -r1.188 -r1.189
--- chan_sip.c	1 Oct 2003 16:05:40 -0000	1.188
+++ chan_sip.c	2 Oct 2003 06:46:19 -0000	1.189
@@ -4139,12 +4139,14 @@
 {
 	struct sip_pvt *cur;
 	char tmp[256];
+	size_t len;
 	if (argc != 4)
 		return RESULT_SHOWUSAGE;
+	len = strlen(argv[3]);
 	ast_mutex_lock(&iflock);
 	cur = iflist;
 	while(cur) {
-		if (!strcasecmp(cur->callid, argv[3])) {
+		if (!strncasecmp(cur->callid, argv[3],len)) {
 			ast_cli(fd, "Call-ID: %s\n", cur->callid);
 			ast_cli(fd, "Our Codec Capability: %d\n", cur->capability);
 			ast_cli(fd, "Non-Codec Capability: %d\n", cur->noncodeccapability);
@@ -4162,14 +4164,13 @@
 				strcat(tmp, "info ");
 			if (cur->dtmfmode & SIP_DTMF_INBAND)
 				strcat(tmp, "inband ");
-			ast_cli(fd, "DTMF Mode: %s\n", tmp);
-			break;
+			ast_cli(fd, "DTMF Mode: %s\n\n", tmp);
 		}
 		cur = cur->next;
 	}
 	ast_mutex_unlock(&iflock);
 	if (!cur) 
-		ast_cli(fd, "No such SIP Call ID '%s'\n", argv[3]);
+		ast_cli(fd, "No such SIP Call ID starting with '%s'\n", argv[3]);
 	return RESULT_SUCCESS;
 }
 




More information about the svn-commits mailing list