Ich bin auch nicht so der C/C++ Freak wie du, aber guck mal rein in die Sourcen. Soweit ich das beurteilen kann, sind die Happen, die euch interessieren könnten, relativ leicht verdaulich von der Menge ;-)@prodigy:
ich erinnere mich. Wir hatten auch mal drüber gesprochen
Ein Kernel-Modul wäre natürlich das Optimum. Leider bin ich da noch nicht so fit drin, deswegen habe erstmal die libcapi20.so Variante im User-Mode gewählt. Die Controller werden in der libcapi20 "virtuell" angehängt. 10 bzw. 5 falls kein lokales CAPI besteht.
CAPI manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0004711
10 controllers found, enumerating...
Controller 1:
manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0000000
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
T.30 modem for Group 3 fax
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
T.30 for Group 3 fax
B3 protocols:
Transparent
T.30 for Group 3 fax
manufacturer specific information:
01 00 00 01 00 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
Controller 2:
manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0000000
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
T.30 modem for Group 3 fax
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
T.30 for Group 3 fax
B3 protocols:
Transparent
T.30 for Group 3 fax
manufacturer specific information:
01 00 00 01 00 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
Controller 3:
manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0000000
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
T.30 modem for Group 3 fax
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
T.30 for Group 3 fax
B3 protocols:
Transparent
T.30 for Group 3 fax
manufacturer specific information:
01 00 00 00 20 02 00 00 00 00 00 00 00 00 00 00 .... ...........
00 00 00 00 ....
Controller 4:
manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0000000
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
1 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
T.30 modem for Group 3 fax
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
T.30 for Group 3 fax
B3 protocols:
Transparent
T.30 for Group 3 fax
manufacturer specific information:
01 00 00 00 40 02 00 00 00 00 00 00 00 00 00 00 ....@...........
00 00 00 00 ....
Controller 5:
manufacturer: AVM Berlin
CAPI version: 2.0 49.23
CAPI serial: 0000000
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
3 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
T.30 modem for Group 3 fax
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
T.30 for Group 3 fax
B3 protocols:
Transparent
T.30 for Group 3 fax
manufacturer specific information:
01 00 00 00 80 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
Controller 6:
manufacturer: AVM 000
CAPI version: 2.0 0.1
CAPI serial: 0004711
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
B3 protocols:
Transparent
manufacturer specific information:
01 00 00 01 00 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
Controller 7:
manufacturer: AVM 711
CAPI version: 2.0 0.1
CAPI serial: 0004711
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
B3 protocols:
Transparent
manufacturer specific information:
01 00 00 01 00 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
Controller 8:
manufacturer: AVM 711
CAPI version: 2.0 0.1
CAPI serial: 0004711
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
2 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
B3 protocols:
Transparent
manufacturer specific information:
01 00 00 00 20 02 00 00 00 00 00 00 00 00 00 00 .... ...........
00 00 00 00 ....
Controller 9:
manufacturer: AVM 711
CAPI version: 2.0 0.1
CAPI serial: 0004711
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
1 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
B3 protocols:
Transparent
manufacturer specific information:
01 00 00 00 40 02 00 00 00 00 00 00 00 00 00 00 ....@...........
00 00 00 00 ....
Controller 10:
manufacturer: AVM 711
CAPI version: 2.0 0.1
CAPI serial: 0004711
featuring global options:
Internal controller
DTMF
Supplementary services
Channel allocation
3 B-channels featuring
B1 protocols:
64 kbits/s with HDLC framing
64 kbits/s transparent operation with byte framing from network
V.110 synchronous operation with HDLC framing
reserved 10
reserved 11
reserved 12
reserved 13
reserved 31
B2 protocols:
ISO 7776 (X.75 SLP)
Transparent
B3 protocols:
Transparent
manufacturer specific information:
01 00 00 00 80 02 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ....
...
const int CAPI20_FB_TCP_DEFAULT_PORT = 5031;
const char* CAPI20_FB_TCP_DEFAULT_IP = "192.168.178.1";
...
capiinfo unter einem i686-Linux gibt manchmal ein segfault aus - Anwendungen scheinen aber zu laufen.
Habe es mal mit CapiFaxSp probiert. Funktioniert auch. Die alte Fax-Problematik bleibt natürlich, was zu erwarten war.
Besteht an der Weiterentwicklung überhaupt Interesse? Ansonsten belasse ich es dabei.... Wäre natürlich schön, wenn sich ein paar Leute mehr daran wagen würden. Irgendwie ist man hier (leider) oft Einzelkämpfer![]()
@laland:
Die Anzahl der Controller bekommt man über den CAPI20_GET_PROFILE() Befehl. Ctrl muss dafür auf 0 gesetzt sein, um die komplette Anzahl zu ermitteln. Siehe auch hier.
Ohja... jetzt wo du es sagst. Das timeval struct darf bei dem select() ruhig NULL sein, da es dann für immer wartet. Nur wenn man lokal und remote capi gleichzeitig ansprechen möchte, sollte es nicht NULL sein. wait_for_message() darf nicht zu lange warten, da sonst der eine select() den anderen blockieren könnte. Deswegen hatte ich timeval auf 1ms gesetzt, egal welcher Wert übergeben wird (außer tv_sec = 0, tv_usec = 0). Werde auch auf Null-Pointer prüfen... Dankeonaj schrieb:Bei mir gibt es immer einen segfault (capiinfo auf meinem lokalen Rechner). Grund dafür ist, dass capiinfo die Funktion capi20_waitformessage mit einer 0 statt mit gültiger struct timeval aufruft (was wohl so auch OK ist). Das führt dann zum segfault beim ersten Zugriff auf TimeOut->tv_sec in Deiner capi20.c.
Bei mir läuft es (libtiff 3.8.2, spandsp-pre7), bricht aber nach ca. 64 kb ab. Das war aber schon auf der FB so. Liegt daran, dass die capi-Pakete verfälscht werden und so Schrott empfangen wirdonaj schrieb:Bei mir läuft CapiFaxSp leider nicht, sondern produziert munter segfaults. Habe aber noch nicht weiter mit gdb nachschauen können, wo die herkommen.
Wenn Du Hilfe beim Testen brauchst, sag' einfach bescheid. Zeit ist allerdings momentan leider ein Problem bei mir.
Man könnte sich an ETSI orientieren.laland schrieb:Aber wie verschicke ich diesen GET_PROFILE-Request? In den Capi-PDFs wurde er zwar erwähnt, jedoch fand ich keine Informationen über den Coammand, Subcommand, den ich in so einer Message verwendet muss.
export FB_REMOTE_CAPI_IP=192.168.178.1
export FB_REMOTE_CAPI_PORT=5031
./CapiSpFax -v -i 12345 -r ./
capiinfo
Number of Controllers : 0
could not register - (0x1008)
ll /usr/lib/libcapi*
lrwxrwxrwx 1 root root 25 2008-04-29 09:45 /usr/lib/libcapi20_remote.so.3 -> libcapi20_remote.so.3.0.4
-rw-r--r-- 1 root root 23148 2008-04-29 09:47 /usr/lib/libcapi20_remote.so.3.0.4
lrwxrwxrwx 1 root root 25 2008-04-29 14:18 /usr/lib/libcapi20.so.3 -> libcapi20_remote.so.3.0.4
-rw-r--r-- 1 root root 31184 2008-04-04 23:07 /usr/lib/libcapi20.so.3.0.4
whoopie@notebook:~$ sudo strace ./CapiSpFax -d 1234567
execve("./CapiSpFax", ["./CapiSpFax", "-d", "1234567", "-t", "fax.tif"], [/* 16 vars */]) = 0
brk(0) = 0x8050000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb806e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78320, ...}) = 0
mmap2(NULL, 78320, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb805a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libcapi20.so.3", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\23\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=23148, ...}) = 0
mmap2(NULL, 34368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb8051000
mmap2(0xb8056000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5) = 0xb8056000
mmap2(0xb8057000, 9792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb8057000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libtiff.so.4", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20J\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=335512, ...}) = 0
mmap2(NULL, 339456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ffe000
mmap2(0xb804f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x50) = 0xb804f000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libspandsp.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\276"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=594184, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ffd000
mmap2(NULL, 600564, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f6a000
mmap2(0xb7ff9000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8e) = 0xb7ff9000
mmap2(0xb7ffc000, 2548, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7ffc000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libstdc++.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`*\4\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=970680, ...}) = 0
mmap2(NULL, 993036, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e77000
mmap2(0xb7f5f000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe8) = 0xb7f5f000
mmap2(0xb7f64000, 22284, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f64000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libm.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@4\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=149328, ...}) = 0
mmap2(NULL, 147584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e52000
mmap2(0xb7e75000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23) = 0xb7e75000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\31\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=42700, ...}) = 0
mmap2(NULL, 41700, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e47000
mmap2(0xb7e51000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa) = 0xb7e51000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1364388, ...}) = 0
mmap2(NULL, 1369712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7cf8000
mmap2(0xb7e41000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x149) = 0xb7e41000
mmap2(0xb7e44000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7e44000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libjpeg.so.62", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260&\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=125316, ...}) = 0
mmap2(NULL, 128152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7cd8000
mmap2(0xb7cf7000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e) = 0xb7cf7000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\31\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=81240, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7cd7000
mmap2(NULL, 83968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7cc2000
mmap2(0xb7cd6000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0xb7cd6000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7cc1000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7cc16c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7e41000, 4096, PROT_READ) = 0
mprotect(0xb7f5f000, 12288, PROT_READ) = 0
munmap(0xb805a000, 78320) = 0
setpriority(PRIO_PROCESS, 0, -10) = 0
open("/dev/rcapi20", O_RDWR) = -1 ENOENT (No such file or directory)
write(2, "CAPI not installed!\n", 20CAPI not installed!
) = 20
exit_group(1) = ?
Process 29190 detached
ll /usr/lib/libcapi*
lrwxrwxrwx 1 root root 25 2008-04-29 09:45 /usr/lib/libcapi20_remote.so.3 -> libcapi20_remote.so.3.0.4
-rw-r--r-- 1 root root 23148 2008-04-29 09:47 /usr/lib/libcapi20_remote.so.3.0.4
[COLOR="Red"]lrwxrwxrwx 1 root root 25 2008-04-29 14:18 /usr/lib/libcapi20.so.3 -> libcapi20_remote.so.3.0.4[/COLOR]
-rw-r--r-- 1 root root 31184 2008-04-04 23:07 /usr/lib/libcapi20.so.3.0.4