[dahdi-commits] kmoore: tools/trunk r9067 - /tools/trunk/dahdi_cfg.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Fri Jul 30 10:28:42 CDT 2010
Author: kmoore
Date: Fri Jul 30 10:28:31 2010
New Revision: 9067
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9067
Log:
dahdi_cfg: Display more appropriate error messages when an invalid signaling is chosen along with suggestions on how to fix the problem.
Modified:
tools/trunk/dahdi_cfg.c
Modified: tools/trunk/dahdi_cfg.c
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/dahdi_cfg.c?view=diff&rev=9067&r1=9066&r2=9067
==============================================================================
--- tools/trunk/dahdi_cfg.c (original)
+++ tools/trunk/dahdi_cfg.c Fri Jul 30 10:28:31 2010
@@ -1552,8 +1552,61 @@
if (needupdate && ioctl(fd, DAHDI_CHANCONFIG, &cc[x])) {
fprintf(stderr, "DAHDI_CHANCONFIG failed on channel %d: %s (%d)\n", x, strerror(errno), errno);
if (errno == EINVAL) {
- fprintf(stderr, "Did you forget that FXS interfaces are configured with FXO signalling\n"
- "and that FXO interfaces use FXS signalling?\n");
+ /* give helpful suggestions on signaling errors */
+ fprintf(stderr, "Selected signaling not "
+ "supported\n");
+ fprintf(stderr, "Possible causes:\n");
+ switch(cc[x].sigtype) {
+ case DAHDI_SIG_FXOKS:
+ case DAHDI_SIG_FXOLS:
+ case DAHDI_SIG_FXOGS:
+ fprintf(stderr, "\tFXO signaling is "
+ "being used on a FXO interface"
+ " (use a FXS signaling variant"
+ ")\n");
+ fprintf(stderr, "\tRBS signaling is "
+ "being used on a E1 CCS span"
+ "\n");
+ break;
+ case DAHDI_SIG_FXSKS:
+ case DAHDI_SIG_FXSLS:
+ case DAHDI_SIG_FXSGS:
+ fprintf(stderr, "\tFXS signaling is "
+ "being used on a FXS interface"
+ " (use a FXO signaling variant"
+ ")\n");
+ fprintf(stderr, "\tRBS signaling is "
+ "being used on a E1 CCS span"
+ "\n");
+ break;
+ case DAHDI_SIG_EM:
+ fprintf(stderr, "\te&m signaling is "
+ "being used on a E1 line (use"
+ " e&me1)\n");
+ break;
+ case DAHDI_SIG_EM_E1:
+ fprintf(stderr, "\te&me1 signaling is "
+ "being used on a T1 line (use "
+ "e&m)\n");
+ fprintf(stderr, "\tRBS signaling is "
+ "being used on a E1 CCS span"
+ "\n");
+ break;
+ case DAHDI_SIG_HARDHDLC:
+ fprintf(stderr, "\thardhdlc is being "
+ "used on a TE12x (use dchan)\n"
+ );
+ break;
+ case DAHDI_SIG_HDLCFCS:
+ fprintf(stderr, "\tdchan is being used"
+ " on a BRI span (use hardhdlc)"
+ "\n");
+ break;
+ default:
+ break;
+ }
+ fprintf(stderr, "\tSignaling is being assigned"
+ " to channel 16 of an E1 CAS span\n");
}
close(fd);
exit(1);
More information about the dahdi-commits
mailing list