Asterisk 安装过程有完整文档。 内核头文件的更新已经完成。 安装 DAHDI 不会造成任何问题。 然而,LibPRI 的安装确实如此。 使不工作。 多次搜索没有得到任何结果。 我附上一长串错误。
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -MD -MT q921.o -MF .q921.o.d -MP -c -o q921.o q921.c
q921.c: In function ‘q921_dump’:
q921.c:1333:71: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1333 | if ((h->u.ft == 3) && (h->u.m3 == 0) && (h->u.m2 == 0) && (h->u.data[0] == 0x0f)) {
| ~~~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1338:38: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1338 | type = q921_tei_mgmt2str(h->u.data[3]);
| ~~~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1340:19: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1340 | ri = (h->u.data[1] << 8) | h->u.data[2];
| ~~~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1340:40: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1340 | ri = (h->u.data[1] << 8) | h->u.data[2];
| ~~~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1342:13: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1342 | action = &h->u.data[4];
| ^~~~~~~~~~~~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c: In function ‘q921_mdl_send.constprop’:
q921.c:215:9: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
215 | f->data[0] = 0x0f; /* Management entity */
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:216:9: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
216 | f->data[1] = (ri >> 8) & 0xff;
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:217:9: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
217 | f->data[2] = ri & 0xff;
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:218:9: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
218 | f->data[3] = message;
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:219:9: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
219 | f->data[4] = (ai << 1) | 1;
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c: In function ‘q921_receive’:
q921.c:1501:13: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1501 | if (h->data[0] != 0x0f) {
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1510:13: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1510 | if (h->data[3] != Q921_TEI_IDENTITY_CHECK_RESPONSE
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1511:15: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1511 | && !(h->data[4] & 0x01)) {
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1528:15: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1528 | ri = (h->data[1] << 8) | h->data[2];
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1528:34: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1528 | ri = (h->data[1] << 8) | h->data[2];
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1529:16: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1529 | tei = (h->data[4] >> 1);
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1531:17: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1531 | switch (h->data[3]) {
| ~~~~~~~^~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
q921.c:1606:12: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1606 | action = &h->data[4];
| ^~~~~~~~~~~
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:11: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^~~~
cc1: all warnings being treated as errors
make: *** [Makefile:190 : q921.o] Erreur 1
最有可能的问题是:
你的 gcc 编译器是 TOO NEW(是的,太新了,不太旧)来编译这个代码库。
只需使用较旧的编译器。也许旧的操作系统内核也是如此。