[asterisk-commits] nadi: branch 1.4 r59804 - in /branches/1.4: ./ channels/ channels/misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Apr 3 04:02:46 MST 2007


Author: nadi
Date: Tue Apr  3 06:02:46 2007
New Revision: 59804

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59804
Log:
Merged revisions 59788,59803 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59788 | nadi | 2007-04-03 11:37:00 +0200 (Di, 03 Apr 2007) | 2 lines

Use the new sysfs way of mISDN 1.2 to check if a port is NT or not.

........
r59803 | nadi | 2007-04-03 12:40:58 +0200 (Di, 03 Apr 2007) | 2 lines

ptp is the 5th bit, not the 4th.

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/misdn/chan_misdn_config.h
    branches/1.4/channels/misdn_config.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/chan_misdn_config.h?view=diff&rev=59804&r1=59803&r2=59804
==============================================================================
--- branches/1.4/channels/misdn/chan_misdn_config.h (original)
+++ branches/1.4/channels/misdn/chan_misdn_config.h Tue Apr  3 06:02:46 2007
@@ -84,7 +84,9 @@
 	
 	/* general config items */
 	MISDN_GEN_FIRST,
+#ifndef MISDN_1_2
 	MISDN_GEN_MISDN_INIT,           /* char[] */
+#endif
 	MISDN_GEN_DEBUG,               /* int */
 	MISDN_GEN_TRACEFILE,           /* char[] */
 	MISDN_GEN_BRIDGING,            /* int (bool) */

Modified: branches/1.4/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn_config.c?view=diff&rev=59804&r1=59803&r2=59804
==============================================================================
--- branches/1.4/channels/misdn_config.c (original)
+++ branches/1.4/channels/misdn_config.c Tue Apr  3 06:02:46 2007
@@ -328,8 +328,10 @@
 		"\t2 - Messages + Message specific Informations (e.g. bearer capability)\n"
 		"\t3 - very Verbose, the above + lots of Driver specific infos\n"
 		"\t4 - even more Verbose than 3" },
+#ifndef MISDN_1_2
 	{ "misdn_init", MISDN_GEN_MISDN_INIT, MISDN_CTYPE_STR, "/etc/misdn-init.conf", NONE,
 		"Set the path to the misdn-init.conf (for nt_ptp mode checking)." },
+#endif
 	{ "tracefile", MISDN_GEN_TRACEFILE, MISDN_CTYPE_STR, "/var/log/asterisk/misdn.log", NONE,
 		"Set the path to the massively growing trace file, if you want that." },
 	{ "bridging", MISDN_GEN_BRIDGING, MISDN_CTYPE_BOOL, "yes", NONE,
@@ -978,6 +980,7 @@
 
 void misdn_cfg_update_ptp (void)
 {
+#ifndef MISDN_1_2
 	char misdn_init[BUFFERSIZE];
 	char line[BUFFERSIZE];
 	FILE *fp;
@@ -1008,6 +1011,26 @@
 			ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno));
 		}
 	}
+#else
+	int i;
+	int proto;
+	char filename[128];
+	FILE *fp;
+
+	for (i = 1; i <= max_ports; ++i) {
+		snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8);
+		fp = fopen(filename, "r");
+		if (!fp) {
+			ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno));
+			continue;
+		}
+		if (fscanf(fp, "0x%08x", &proto) != 1)
+			ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename);
+		else
+			ptp[i] = proto & 1<<5 ? 1 : 0;
+		fclose(fp);
+	}
+#endif
 }
 
 static void _fill_defaults (void)



More information about the asterisk-commits mailing list