summaryrefslogtreecommitdiffstats
path: root/usr.sbin/i4b/isdntelctl
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>1999-03-07 16:12:47 +0000
committerhm <hm@FreeBSD.org>1999-03-07 16:12:47 +0000
commit36b481d4f3a44d80e63d9ab230c89bdc520fb8c2 (patch)
treeabc3088378a2452b0fa146a0004c2c09e5cffdb7 /usr.sbin/i4b/isdntelctl
parentb5deeb6bf1fe0c49cd65fd1140c0935a47d172de (diff)
downloadFreeBSD-src-36b481d4f3a44d80e63d9ab230c89bdc520fb8c2.zip
FreeBSD-src-36b481d4f3a44d80e63d9ab230c89bdc520fb8c2.tar.gz
update the i4b userland to i4b release 0.71.00
Diffstat (limited to 'usr.sbin/i4b/isdntelctl')
-rw-r--r--usr.sbin/i4b/isdntelctl/isdntelctl.815
-rw-r--r--usr.sbin/i4b/isdntelctl/main.c35
2 files changed, 40 insertions, 10 deletions
diff --git a/usr.sbin/i4b/isdntelctl/isdntelctl.8 b/usr.sbin/i4b/isdntelctl/isdntelctl.8
index 2bd45d2..945bfc2 100644
--- a/usr.sbin/i4b/isdntelctl/isdntelctl.8
+++ b/usr.sbin/i4b/isdntelctl/isdntelctl.8
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
+.\" Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: isdntelctl.8,v 1.4 1998/12/14 10:31:55 hm Exp $
+.\" $Id: isdntelctl.8,v 1.6 1999/02/16 10:40:18 hm Exp $
.\"
-.\" last edit-date: [Mon Dec 14 11:34:51 1998]
+.\" last edit-date: [Sun Feb 14 10:20:38 1999]
.\"
.Dd December 14, 1998
.Dt isdntelctl 8
@@ -38,6 +38,7 @@
.Op Fl u Ar unit
.Op Fl A
.Op Fl U
+.Op Fl R
.Sh DESCRIPTION
.Nm isdntelctl
is part of the isdn4bsd package and is used to configure the sound format
@@ -56,6 +57,14 @@ device /dev/i4btel0.
Set sound format to A-Law.
.It Fl U
Set sound format to u-Law.
+.It Fl R
+Set sound format to canonical (regular) A-Law format.
+.El
+.Pp
+By default, isdn4bsd sends and receives audio in A-Law as provided by the
+hardware. However, these samples cannot easily be processed further as the
+sample word is bit-reversed. Both the u-Law and canonical A-Law formats
+store samples in a way suitable for post-processing by e.\ g. sox(1).
.Pp
.Sh FILES
/dev/i4btel<n>
diff --git a/usr.sbin/i4b/isdntelctl/main.c b/usr.sbin/i4b/isdntelctl/main.c
index 4309b24..aec72f6 100644
--- a/usr.sbin/i4b/isdntelctl/main.c
+++ b/usr.sbin/i4b/isdntelctl/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,9 +27,9 @@
* isdntelctl - i4b set telephone interface options
* ------------------------------------------------
*
- * $Id: main.c,v 1.4 1998/12/14 10:31:57 hm Exp $
+ * $Id: main.c,v 1.7 1999/02/16 10:40:18 hm Exp $
*
- * last edit-date: [Sat Dec 5 18:17:17 1998]
+ * last edit-date: [Tue Feb 16 11:32:09 1999]
*
*---------------------------------------------------------------------------*/
@@ -58,6 +58,7 @@ int opt_unit = 0;
int opt_U = 0;
int opt_A = 0;
int opt_C = 0;
+int opt_R = 0;
/*---------------------------------------------------------------------------*
* program entry
@@ -70,7 +71,7 @@ main(int argc, char **argv)
int telfd;
char namebuffer[128];
- while ((c = getopt(argc, argv, "cgu:AU?")) != EOF)
+ while ((c = getopt(argc, argv, "cgu:AUR?")) != EOF)
{
switch(c)
{
@@ -96,6 +97,10 @@ main(int argc, char **argv)
opt_U = 1;
break;
+ case 'R':
+ opt_R = 1;
+ break;
+
case '?':
default:
usage();
@@ -103,12 +108,12 @@ main(int argc, char **argv)
}
}
- if(opt_get == 0 && opt_U == 0 && opt_A && opt_C == 0)
+ if(opt_get == 0 && opt_R == 0 && opt_U == 0 && opt_A == 0 && opt_C == 0)
{
opt_get = 1;
}
- if((opt_get + opt_U + opt_A + opt_C) > 1)
+ if((opt_get + opt_R + opt_U + opt_A + opt_C) > 1)
{
usage();
}
@@ -139,6 +144,10 @@ main(int argc, char **argv)
{
printf("device %s uses u-Law sound format\n", namebuffer);
}
+ else if(format == CVT_ALAW_CANON)
+ {
+ printf("device %s uses canonical A-Law sound format\n", namebuffer);
+ }
else
{
printf("ERROR, device %s uses unknown format %d!\n", namebuffer, format);
@@ -169,6 +178,17 @@ main(int argc, char **argv)
}
exit(0);
}
+ if(opt_R)
+ {
+ int format = CVT_ALAW_CANON;
+
+ if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
+ {
+ fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
+ exit(1);
+ }
+ exit(0);
+ }
if(opt_C)
{
int dummy;
@@ -190,11 +210,12 @@ usage(void)
{
fprintf(stderr, "\n");
fprintf(stderr, "isdntelctl - i4b telephone i/f control, compiled %s %s\n",__DATE__, __TIME__);
- fprintf(stderr, "usage: isdndebug -e -h -g -l <layer> -m -r -s <value> -u <unit> -z -H\n");
+ fprintf(stderr, "usage: isdntelctl -g -u <unit> -A -U -c\n");
fprintf(stderr, " -g get current settings\n");
fprintf(stderr, " -u unit specify unit number\n");
fprintf(stderr, " -A set interface to A-Law coding\n");
fprintf(stderr, " -U set interface to u-Law coding\n");
+ fprintf(stderr, " -R set interface to canonical (regular) A-Law coding\n");
fprintf(stderr, " -c clear input queue\n");
fprintf(stderr, "\n");
exit(1);
OpenPOWER on IntegriCloud