capability condition not working in lcr's routing.conf

Bodo Pfelzer <bodo.pfelzer-S0/[email protected]>
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <[email protected]>
Hi,

dialing=12345 capability=speech : intern

did not work. The attached patch does fix it.

Bodo

_______________________________________________
isdn4linux mailing list
[email protected]
https://www.isdn4linux.de/mailman/listinfo/isdn4linux
route.patch (text/x-patch, 1.3 KB)
--- lcr-HEAD-6911e09/route.c	2012-08-19 20:55:02.000000000 +0200
+++ lcr-bodo/route.c	2012-11-12 16:45:09.000000000 +0100
@@ -1220,19 +1220,25 @@
 
 				/* parse service value */
 				case COND_TYPE_CAPABILITY:
-				if (!strncasecmp("speech", p, 6))
+				if (!strncasecmp("speech", p, 6)) {
 					cond->integer_value = INFO_BC_SPEECH;
-				else if (!strncasecmp("audio", p, 5))
+					p+=6;
+				} else if (!strncasecmp("audio", p, 5)) {
 					cond->integer_value = INFO_BC_AUDIO;
-				else if (!strncasecmp("video", p, 5))
+					p+=5;
+				} else if (!strncasecmp("video", p, 5)) {
 					cond->integer_value = INFO_BC_VIDEO;
-				else if (!strncasecmp("digital-restricted", p, 18))
+					p+=5;
+				} else if (!strncasecmp("digital-restricted", p, 18)) {
 					cond->integer_value = INFO_BC_DATARESTRICTED;
-				else if (!strncasecmp("digital-unrestricted", p, 20))
+					p+=18;
+				} else if (!strncasecmp("digital-unrestricted", p, 20)) {
 					cond->integer_value = INFO_BC_DATAUNRESTRICTED;
-				else if (!strncasecmp("digital-unrestricted-tones", p, 26))
+					p+=20;
+				} else if (!strncasecmp("digital-unrestricted-tones", p, 26)) {
 					cond->integer_value = INFO_BC_DATAUNRESTRICTED_TONES;
-				else {
+					p+=26;
+				} else {
 					SPRINT(failure, "Given service type is invalid or misspelled.");
 					goto parse_error;
 				}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.