Compare commits
34 Commits
1.4.4
...
1.6.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92fc823114 | ||
|
|
0671ab6798 | ||
|
|
682b914cd7 | ||
|
|
1de0fae287 | ||
|
|
a80635e804 | ||
|
|
b288766b85 | ||
|
|
1ee4f8aa3f | ||
|
|
414fe8f956 | ||
|
|
79bb2373f9 | ||
|
|
dd553ed543 | ||
|
|
813b2d1176 | ||
|
|
581287c8dc | ||
|
|
3071a4da29 | ||
|
|
9857425714 | ||
|
|
ad076ee67b | ||
|
|
8bb0942f1a | ||
|
|
9e05c336b1 | ||
|
|
b4970d79e9 | ||
|
|
dc7a314fb3 | ||
|
|
68b9ad1084 | ||
|
|
f611084923 | ||
|
|
a19cc73b41 | ||
|
|
cbda0d7376 | ||
|
|
453e006faa | ||
|
|
3fba8aa932 | ||
|
|
bcd84a9d79 | ||
|
|
f5d76bd5d2 | ||
|
|
0a62b72633 | ||
|
|
ec3b7c156e | ||
|
|
bcee9e2fd6 | ||
|
|
054a30cd94 | ||
|
|
fd22b45abb | ||
|
|
9a0d8c4df9 | ||
|
|
c7f3a4b899 |
308
ChangeLog
308
ChangeLog
@@ -1,71 +1,24 @@
|
||||
2008-05-07 Matthew Fredrickson <creslin@digium.com>
|
||||
2008-01-18 Russell Bryant <russell@digium.com>
|
||||
|
||||
* Libpri 1.4.4 released.
|
||||
|
||||
2008-05-06 16:43 +0000 [r553-555] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c, pri.c: Remove some unnecessary debug messages
|
||||
|
||||
* q931.c: We passed TBR3 layer 2 and layer 3 testing with this
|
||||
commit in for BRI-TE PTMP.
|
||||
|
||||
* q931.c: Final patch to pass certification
|
||||
|
||||
2008-04-22 15:30 +0000 [r546] Russell Bryant <russell@digium.com>
|
||||
|
||||
* Makefile: All versions of libpri have been installed as
|
||||
libpri.so.1.0, even though the API and ABI have changed over
|
||||
time. This patch changes the Makefile to install the library as
|
||||
libpri.so.1.4 to indicate that this is not compatible with
|
||||
previous versions. In the future, this should be changed as we
|
||||
make ABI changes. (closes issue #10376) Reported by: tzafrir
|
||||
Patches: libpri-soname.diff uploaded by tzafrir (license 46) --
|
||||
with very minor changes by me
|
||||
|
||||
2008-03-15 19:57 +0000 [r541-543] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* libpri.h, pri.c: Remove some useless event items
|
||||
|
||||
* q921.c, pri_internal.h: Make sure if we're a bri and in PTMP mode
|
||||
that we release the TEI and try to get a new one with the other
|
||||
end when we lose activity in multiframe mode
|
||||
|
||||
* q921.c, pri.c, pri_q921.h: When we recieve a UA in any TEI
|
||||
established state other than awaiting establishement make sure we
|
||||
drop the TEI and get a new one. For passing tests PC37.2 - PC41.2
|
||||
in Q.921
|
||||
|
||||
2008-03-06 23:43 +0000 [r538-539] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c: Make sure we are sending as command not as response
|
||||
|
||||
* q921.c: Make sure C/R bit is correct
|
||||
|
||||
2008-03-01 23:30 +0000 [r531-535] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c: Remove some (currently) useless code
|
||||
|
||||
* q921.c, pri.c, pri_internal.h: Some more updates to add code for
|
||||
passing PC 27.1 in Q.921
|
||||
|
||||
* q921.c, pri.c: Various coding style cleanups as well as a bug fix
|
||||
for TEI removal
|
||||
|
||||
* q921.c, q931.c, pri.c, pri_internal.h: Initial checkin of code to
|
||||
pass Q.921 PC25 and PC26
|
||||
|
||||
* q921.c: Add support for responding to TEI requests (Q.921 PC23.x)
|
||||
|
||||
2008-02-18 20:31 +0000 [r525] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, libpri.h: Improve transmission, receiving, and dumping of
|
||||
bearer capability IE (#11593)
|
||||
* libpri 1.6.0-beta1 released.
|
||||
|
||||
2008-01-16 18:06 +0000 [r518] Jason Parker <jparker@digium.com>
|
||||
|
||||
* Makefile, /: Add logging for 'make update' command (also fixes
|
||||
updates in some places). Issue #11766, initial patch by jmls.
|
||||
|
||||
2008-01-11 16:36 +0000 [r515] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, /: Merged revisions 514 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r514 | mattf | 2008-01-11 10:34:44 -0600 (Fri,
|
||||
11 Jan 2008) | 9 lines Merged revisions 513 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r513
|
||||
| mattf | 2008-01-11 10:33:52 -0600 (Fri, 11 Jan 2008) | 1 line
|
||||
We should not be parsing further into the bearer capability IE if
|
||||
the length does not confirm that there actually is data present
|
||||
........ ................
|
||||
|
||||
2007-12-26 17:35 +0000 [r505] Russell Bryant <russell@digium.com>
|
||||
|
||||
* libpri.h: Remove unnecessary usage of the extern keyword.
|
||||
@@ -104,15 +57,72 @@
|
||||
* q921.c, q931.c, libpri.h, pri.c, pritest.c, pri_internal.h: Add
|
||||
BRI support to libpri
|
||||
|
||||
2007-10-22 15:15 +0000 [r480] Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* /, pri_internal.h: Merged revisions 479 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r479 | kpfleming | 2007-10-22 10:10:06 -0500
|
||||
(Mon, 22 Oct 2007) | 11 lines Merged revisions 478 via svnmerge
|
||||
from https://origsvn.digium.com/svn/libpri/branches/1.2 ........
|
||||
r478 | kpfleming | 2007-10-22 10:09:27 -0500 (Mon, 22 Oct 2007) |
|
||||
3 lines we need to include stddef.h for 'size_t' ........
|
||||
................
|
||||
|
||||
2007-10-13 16:00 +0000 [r473] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c: Make sure that we only output the message handling debug
|
||||
when we're actually debugging
|
||||
|
||||
2007-10-05 16:46 +0000 [r471] Jason Parker <jparker@digium.com>
|
||||
|
||||
* /, libpri.h: Merged revisions 470 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4 (closes issue
|
||||
#10832) ........ r470 | qwell | 2007-10-05 11:45:39 -0500 (Fri,
|
||||
05 Oct 2007) | 4 lines Fix an incorrect pri_event structure
|
||||
definition. Issue 10832, patch by flefoll ........
|
||||
|
||||
2007-09-25 21:56 +0000 [r469] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c: Fix user-user IE order in setup message (#10705)
|
||||
|
||||
2007-09-14 21:34 +0000 [r466] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, /, libpri.h: Merged revisions 465 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4 ........ r465
|
||||
| mattf | 2007-09-14 16:32:54 -0500 (Fri, 14 Sep 2007) | 1 line
|
||||
Fix for #10189. Make sure we properly report the user layer 1 for
|
||||
H.223 and H.245 ........
|
||||
|
||||
2007-09-06 15:15 +0000 [r463] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* pri_facility.c, /, pri.c: Merged revisions 462 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r462 | mattf | 2007-09-06 10:11:29 -0500 (Thu,
|
||||
06 Sep 2007) | 9 lines Merged revisions 460 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r460
|
||||
| mattf | 2007-09-06 10:06:42 -0500 (Thu, 06 Sep 2007) | 1 line
|
||||
TBCT now works. It should work for NI2, 4E, and 5E. This code was
|
||||
tested on NI2. ........ ................
|
||||
|
||||
2007-08-27 19:22 +0000 [r447] Jason Parker <jparker@digium.com>
|
||||
|
||||
* Makefile, /: Merged revisions 446 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r446 | qwell | 2007-08-27 14:21:08 -0500 (Mon,
|
||||
27 Aug 2007) | 10 lines Merged revisions 445 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r445
|
||||
| qwell | 2007-08-27 14:20:23 -0500 (Mon, 27 Aug 2007) | 2 lines
|
||||
Make sure we build both the static and shared modules with -fPIC.
|
||||
........ ................
|
||||
|
||||
2007-08-06 19:58 +0000 [r442] Jason Parker <jparker@digium.com>
|
||||
|
||||
* Makefile, /: Merged revisions 441 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4 (closes issue
|
||||
#10253) ........ r441 | qwell | 2007-08-06 14:58:19 -0500 (Mon,
|
||||
06 Aug 2007) | 4 lines Allow setting CC to something with a
|
||||
space, such as `make CC="gcc -m32"` Issue 10253. ........
|
||||
|
||||
2007-06-20 15:18 +0000 [r428-430] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* Makefile: Revert that back to how it was
|
||||
@@ -121,155 +131,81 @@
|
||||
libpri.h, pri.c, pri_internal.h, pri_q921.h: Patch to add PTMP
|
||||
mode (BRI support)
|
||||
|
||||
* q931.c, /: Merged revisions 427 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r427 | mattf | 2007-06-19 13:23:36 -0500 (Tue,
|
||||
19 Jun 2007) | 9 lines Merged revisions 426 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r426
|
||||
| mattf | 2007-06-19 13:22:33 -0500 (Tue, 19 Jun 2007) | 1 line
|
||||
Try to send pending facility messages if we receive alerting (for
|
||||
when we don't get proceeding) (#9651) ........ ................
|
||||
|
||||
2007-06-06 21:59 +0000 [r417-425] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* pri_facility.c, /: Merged revisions 424 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r424 | mattf | 2007-06-06 16:58:22 -0500 (Wed,
|
||||
06 Jun 2007) | 9 lines Merged revisions 423 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r423
|
||||
| mattf | 2007-06-06 16:57:15 -0500 (Wed, 06 Jun 2007) | 1 line
|
||||
Oops, that should not be on one line ........ ................
|
||||
|
||||
* q931.c, pri_facility.c, pri_facility.h, pri.c, pri_internal.h:
|
||||
Preliminary patch plus mods for Q.SIG Path Replacement (Q.SIG
|
||||
version of 2BCT) #7778
|
||||
|
||||
* pri_facility.c, /: Merged revisions 416 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r416 | mattf | 2007-06-06 08:22:15 -0500 (Wed,
|
||||
06 Jun 2007) | 10 lines Merged revisions 415 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r415
|
||||
| mattf | 2007-06-06 08:20:05 -0500 (Wed, 06 Jun 2007) | 2 lines
|
||||
Make sure we only send the NFE when we are talking QSIG ........
|
||||
................
|
||||
|
||||
2007-05-25 17:36 +0000 [r413] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, pri_facility.c, pri_facility.h, libpri.h: Commit path for
|
||||
ROSE-12 and ROSE-13 support (#9076)
|
||||
|
||||
2006-11-03 18:16 +0000 [r382] Matthew Fredrickson <creslin@digium.com>
|
||||
2007-01-23 22:02 +0000 [r391-393] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c: Remove pointless recursion. (#8281)
|
||||
|
||||
2008-05-07 19:51 +0000 [r557] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* pri.c, pritest.c, pri_internal.h, pri_q921.h, Makefile, q921.c,
|
||||
q931.c, pri_facility.c, prisched.c, testprilib.c, pri_timers.h,
|
||||
pri_facility.h, libpri.h: Moving trunk changes back into 1.4
|
||||
|
||||
2008-05-02 20:21 +0000 [r552] Brett Bryant <bbryant@digium.com>
|
||||
|
||||
* Makefile, build_tools (added), build_tools/make_version (added),
|
||||
build_tools/make_version_c (added), libpri.h: Add new API call
|
||||
(pri_get_version) to show the current version of the branch for
|
||||
support purposes.
|
||||
|
||||
2008-04-16 00:21 +0000 [r544] Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* q921.c: fix the indentation in this function so that it is
|
||||
actually possible to read it and understand the logic and flow
|
||||
|
||||
2008-02-21 16:38 +0000 [r528] Joshua Colp <jcolp@digium.com>
|
||||
|
||||
* q931.c: If inband audio is being provided with a disconnect
|
||||
message let the audio be heard before releasing the channel.
|
||||
(closes issue #10552) Reported by: paravoid Patches:
|
||||
disconnect-audio.diff uploaded by paravoid (license 200)
|
||||
|
||||
2008-02-18 20:31 +0000 [r524] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, libpri.h: Improve transmission, receiving, and dumping of
|
||||
bearer capability IE (#11593)
|
||||
|
||||
2008-01-11 16:34 +0000 [r514] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, /: Merged revisions 513 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r513
|
||||
| mattf | 2008-01-11 10:33:52 -0600 (Fri, 11 Jan 2008) | 1 line
|
||||
We should not be parsing further into the bearer capability IE if
|
||||
the length does not confirm that there actually is data present
|
||||
........
|
||||
|
||||
2007-12-13 Russell Bryant <russell@digium.com>
|
||||
|
||||
* libpri 1.4.3 released.
|
||||
|
||||
2007-10-22 15:10 +0000 [r479] Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* pri_internal.h, /: Merged revisions 478 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r478
|
||||
| kpfleming | 2007-10-22 10:09:27 -0500 (Mon, 22 Oct 2007) | 3
|
||||
lines we need to include stddef.h for 'size_t' ........
|
||||
|
||||
2007-10-16 Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* libpri 1.4.2 released.
|
||||
|
||||
2007-10-05 16:45 +0000 [r470] Jason Parker <jparker@digium.com>
|
||||
|
||||
* libpri.h: Fix an incorrect pri_event structure definition. Issue
|
||||
10832, patch by flefoll
|
||||
|
||||
2007-09-25 21:37 +0000 [r468] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c: Fix user-user IE order in setup message (#10705)
|
||||
|
||||
2007-09-14 21:32 +0000 [r465] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, libpri.h: Fix for #10189. Make sure we properly report
|
||||
the user layer 1 for H.223 and H.245
|
||||
|
||||
2007-09-06 15:11 +0000 [r462] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* pri.c, pri_facility.c, /: Merged revisions 460 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r460
|
||||
| mattf | 2007-09-06 10:06:42 -0500 (Thu, 06 Sep 2007) | 1 line
|
||||
TBCT now works. It should work for NI2, 4E, and 5E. This code was
|
||||
tested on NI2. ........
|
||||
|
||||
2007-08-27 19:21 +0000 [r446] Jason Parker <jparker@digium.com>
|
||||
|
||||
* Makefile, /: Merged revisions 445 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r445
|
||||
| qwell | 2007-08-27 14:20:23 -0500 (Mon, 27 Aug 2007) | 2 lines
|
||||
Make sure we build both the static and shared modules with -fPIC.
|
||||
........
|
||||
|
||||
2007-08-06 19:58 +0000 [r441] Jason Parker <jparker@digium.com>
|
||||
|
||||
* Makefile: Allow setting CC to something with a space, such as
|
||||
`make CC="gcc -m32"` Issue 10253.
|
||||
|
||||
2007-07-09 Russell Bryant <russell@digium.com>
|
||||
|
||||
* libpri 1.4.1 released.
|
||||
|
||||
2007-06-19 18:23 +0000 [r427] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, /: Merged revisions 426 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r426
|
||||
| mattf | 2007-06-19 13:22:33 -0500 (Tue, 19 Jun 2007) | 1 line
|
||||
Try to send pending facility messages if we receive alerting (for
|
||||
when we don't get proceeding) (#9651) ........
|
||||
|
||||
2007-06-06 21:58 +0000 [r416-424] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* pri_facility.c, /: Merged revisions 423 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r423
|
||||
| mattf | 2007-06-06 16:57:15 -0500 (Wed, 06 Jun 2007) | 1 line
|
||||
Oops, that should not be on one line ........
|
||||
|
||||
* pri_facility.c, /: Merged revisions 415 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r415
|
||||
| mattf | 2007-06-06 08:20:05 -0500 (Wed, 06 Jun 2007) | 2 lines
|
||||
Make sure we only send the NFE when we are talking QSIG ........
|
||||
|
||||
2007-01-22 22:29 +0000 [r390] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q931.c, /: Merged revisions 389 via svnmerge from
|
||||
* q931.c, /: Merged revisions 390 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r390 | mattf | 2007-01-22 16:29:24 -0600 (Mon,
|
||||
22 Jan 2007) | 10 lines Merged revisions 389 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r389
|
||||
| mattf | 2007-01-22 16:20:59 -0600 (Mon, 22 Jan 2007) | 2 lines
|
||||
Make sure we send DISCONNECT if we reached the active state and a
|
||||
call is disconnected, regardless of cause code. ........
|
||||
................
|
||||
|
||||
2006-12-30 19:17 +0000 [r386] Joshua Colp <jcolp@digium.com>
|
||||
* /: Fix mess up in up-port
|
||||
|
||||
* Makefile, /: Merged revisions 385 via svnmerge from
|
||||
* /: Merged revisions 389 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4 ........
|
||||
........
|
||||
|
||||
2006-12-30 19:18 +0000 [r387] Joshua Colp <jcolp@digium.com>
|
||||
|
||||
* Makefile, /: Merged revisions 386 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.4
|
||||
................ r386 | file | 2006-12-30 14:17:34 -0500 (Sat, 30
|
||||
Dec 2006) | 10 lines Merged revisions 385 via svnmerge from
|
||||
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r385
|
||||
| file | 2006-12-30 14:16:17 -0500 (Sat, 30 Dec 2006) | 2 lines
|
||||
Specify full path to restorecon instead of assuming it will be
|
||||
available from what is in $PATH. (issue #8670 reported by djflux)
|
||||
........
|
||||
........ ................
|
||||
|
||||
2006-12-23 Kevin P. Fleming <kpfleming@digium.com>
|
||||
2006-11-03 18:16 +0000 [r382] Matthew Fredrickson <creslin@digium.com>
|
||||
|
||||
* q921.c: Remove pointless recursion. (#8281)
|
||||
|
||||
2006-09-20 21:00 +0000 [r374] Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* /: set up merge tracking from 1.4 branch
|
||||
|
||||
* libpri 1.4.0 released.
|
||||
|
||||
2006-09-20 Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* libpri 1.4.0-beta1 released.
|
||||
|
||||
40
Makefile
40
Makefile
@@ -28,25 +28,18 @@
|
||||
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
|
||||
|
||||
CC=gcc
|
||||
GREP=grep
|
||||
AWK=awk
|
||||
|
||||
OSARCH=$(shell uname -s)
|
||||
PROC?=$(shell uname -m)
|
||||
|
||||
# SONAME version; should be changed on every ABI change
|
||||
# please don't change it needlessly; it's perfectly fine to have a SONAME
|
||||
# of 1.2 and a version of 1.4.x
|
||||
SONAME:=1.4
|
||||
|
||||
STATIC_LIBRARY=libpri.a
|
||||
DYNAMIC_LIBRARY:=libpri.so.$(SONAME)
|
||||
STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o version.o
|
||||
DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo version.lo
|
||||
DYNAMIC_LIBRARY=libpri.so.1.0
|
||||
STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
|
||||
DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
|
||||
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS)
|
||||
INSTALL_PREFIX=$(DESTDIR)
|
||||
INSTALL_BASE=/usr
|
||||
SOFLAGS:=-Wl,-h$(DYNAMIC_LIBRARY)
|
||||
SOFLAGS = -Wl,-hlibpri.so.1.0
|
||||
LDCONFIG = /sbin/ldconfig
|
||||
ifneq (,$(findstring X$(OSARCH)X, XLinuxX XGNU/kFreeBSDX))
|
||||
LDCONFIG_FLAGS=-n
|
||||
@@ -61,13 +54,10 @@ ifeq (${OSARCH},SunOS)
|
||||
CFLAGS += -DSOLARIS -I../zaptel-solaris
|
||||
LDCONFIG =
|
||||
LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
|
||||
SOSLINK = ln -sf libpri.so.1.0 libpri.so.1
|
||||
#INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code
|
||||
endif
|
||||
|
||||
export PRIVERSION
|
||||
|
||||
PRIVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
|
||||
|
||||
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
||||
#This works for even old (2.96) versions of gcc and provides a small boost either way.
|
||||
#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesnt support it.
|
||||
@@ -102,19 +92,20 @@ ifneq (${OSARCH},SunOS)
|
||||
install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
|
||||
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
||||
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.$(SONAME) libpri.so)
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; ln -sf libpri.so.1.0 libpri.so.1 )
|
||||
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
||||
if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib; fi
|
||||
else
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.$(SONAME) libpri.so)
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; $(SOSLINK) )
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
@echo "Removing Libpri"
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.$(SONAME)
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1.0
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.a
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
|
||||
@@ -145,15 +136,12 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
|
||||
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
|
||||
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
||||
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
||||
ln -sf libpri.so.$(SONAME) libpri.so
|
||||
|
||||
version.c:
|
||||
@build_tools/make_version_c > $@.tmp
|
||||
@cmp -s $@.tmp $@ || mv $@.tmp $@
|
||||
@rm -f $@.tmp
|
||||
ln -sf libpri.so.1.0 libpri.so
|
||||
ln -sf libpri.so.1.0 libpri.so.1
|
||||
$(SOSLINK)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so *.lo *.so.$(SONAME)
|
||||
rm -f *.o *.so *.lo *.so.1 *.so.1.0
|
||||
rm -f testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
||||
rm -f pritest pridump
|
||||
rm -f .depend
|
||||
@@ -162,5 +150,3 @@ depend: .depend
|
||||
|
||||
.depend:
|
||||
CC="$(CC)" ./mkdep ${CFLAGS} `ls *.c`
|
||||
|
||||
.PHONY: version.c
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f ${1}/.version ]; then
|
||||
cat ${1}/.version
|
||||
elif [ -d .svn ]; then
|
||||
PARTS=`LANG=C svn info ${1} | ${GREP} URL | ${AWK} '{print $2;}' | sed -e 's:^.*/svn/libpri/::' | sed -e 's:/: :g'`
|
||||
BRANCH=0
|
||||
TEAM=0
|
||||
TAG=0
|
||||
|
||||
REV=`svnversion -c ${1} | cut -d: -f2`
|
||||
|
||||
BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
|
||||
|
||||
if [ "${PARTS}" = "trunk" ] ; then
|
||||
echo SVN-trunk-r${REV}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for PART in $PARTS ; do
|
||||
if [ ${TAG} != 0 ] ; then
|
||||
if [ "${PART}" = "autotag_for_be" ] ; then
|
||||
continue
|
||||
fi
|
||||
if [ "${PART}" = "autotag_for_sx00i" ] ; then
|
||||
continue
|
||||
fi
|
||||
RESULT="${PART}"
|
||||
break
|
||||
fi
|
||||
|
||||
if [ ${BRANCH} != 0 ] ; then
|
||||
if [ -z ${RESULT} ] ; then
|
||||
RESULT="2${PART}"
|
||||
else
|
||||
RESULT="3${RESULT}-${PART}"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
|
||||
if [ ${TEAM} != 0 ] ; then
|
||||
if [ -z ${RESULT} ] ; then
|
||||
RESULT="4${PART}"
|
||||
else
|
||||
RESULT="5${RESULT}-${PART}"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "branches" ] ; then
|
||||
BRANCH=1
|
||||
RESULT="branch"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "tags" ] ; then
|
||||
TAG=1
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${PART}" = "team" ] ; then
|
||||
TEAM=1
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
RESULT="libss7"
|
||||
|
||||
if [ ${TAG} != 0 ] ; then
|
||||
echo ${RESULT}
|
||||
else
|
||||
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
|
||||
fi
|
||||
fi
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ ! -f ../.flavor ]; then
|
||||
EXTRA=""
|
||||
else
|
||||
aadkver=`cat ../.version`
|
||||
aadkflavor=`cat ../.flavor`
|
||||
EXTRA=" (${aadkflavor} ${aadkver})"
|
||||
fi
|
||||
cat << END
|
||||
/*
|
||||
* version.c
|
||||
* Automatically generated
|
||||
*/
|
||||
|
||||
#include "libpri.h"
|
||||
|
||||
static const char pri_version[] = "${PRIVERSION}${EXTRA}";
|
||||
|
||||
const char *pri_get_version(void)
|
||||
{
|
||||
return pri_version;
|
||||
}
|
||||
|
||||
END
|
||||
73
libpri.h
73
libpri.h
@@ -207,52 +207,6 @@
|
||||
#define PRI_LAYER_1_V120_RATE_ADAPT 0x28
|
||||
#define PRI_LAYER_1_X31_RATE_ADAPT 0x29
|
||||
|
||||
|
||||
/* Intermediate rates for V.110 */
|
||||
#define PRI_INT_RATE_8K 1
|
||||
#define PRI_INT_RATE_16K 2
|
||||
#define PRI_INT_RATE_32K 3
|
||||
|
||||
|
||||
/* Rate adaption for bottom 5 bits of rateadaption */
|
||||
#define PRI_RATE_USER_RATE_MASK 0x1F
|
||||
#define PRI_RATE_ADAPT_UNSPEC 0x00
|
||||
#define PRI_RATE_ADAPT_0K6 0x01
|
||||
#define PRI_RATE_ADAPT_1K2 0x02
|
||||
#define PRI_RATE_ADAPT_2K4 0x03
|
||||
#define PRI_RATE_ADAPT_3K6 0x04
|
||||
#define PRI_RATE_ADAPT_4K8 0x05
|
||||
#define PRI_RATE_ADAPT_7K2 0x06
|
||||
#define PRI_RATE_ADAPT_8K 0x07
|
||||
#define PRI_RATE_ADAPT_9K6 0x08
|
||||
#define PRI_RATE_ADAPT_14K4 0x09
|
||||
#define PRI_RATE_ADAPT_16K 0x0A
|
||||
#define PRI_RATE_ADAPT_19K2 0x0B
|
||||
#define PRI_RATE_ADAPT_32K 0x0C
|
||||
#define PRI_RATE_ADAPT_38K4 0x0D
|
||||
#define PRI_RATE_ADAPT_48K 0x0E
|
||||
#define PRI_RATE_ADAPT_56K 0x0F
|
||||
#define PRI_RATE_ADAPT_57K6 0x12
|
||||
#define PRI_RATE_ADAPT_28K8 0x13
|
||||
#define PRI_RATE_ADAPT_24K 0x14
|
||||
#define PRI_RATE_ADAPT_0K1345 0x15
|
||||
#define PRI_RATE_ADAPT_0K1 0x16
|
||||
#define PRI_RATE_ADAPT_0K075_1K2 0x17
|
||||
#define PRI_RATE_ADAPT_1K2_0K075 0x18
|
||||
#define PRI_RATE_ADAPT_0K05 0x19
|
||||
#define PRI_RATE_ADAPT_0K075 0x1A
|
||||
#define PRI_RATE_ADAPT_0K110 0x1B
|
||||
#define PRI_RATE_ADAPT_0K150 0x1C
|
||||
#define PRI_RATE_ADAPT_0K200 0x1D
|
||||
#define PRI_RATE_ADAPT_0K300 0x1E
|
||||
#define PRI_RATE_ADAPT_12K 0x1F
|
||||
|
||||
/* in-band negotiation flag for rateadaption bit 5 */
|
||||
#define PRI_RATE_ADAPT_NEGOTIATION_POSS 0x20
|
||||
|
||||
/* async flag for rateadaption bit 6 */
|
||||
#define PRI_RATE_ADAPT_ASYNC 0x40
|
||||
|
||||
/* Notifications */
|
||||
#define PRI_NOTIFY_USER_SUSPENDED 0x00 /* User suspended */
|
||||
#define PRI_NOTIFY_USER_RESUMED 0x01 /* User resumed */
|
||||
@@ -303,20 +257,24 @@ typedef struct q931_call q931_call;
|
||||
typedef struct pri_event_generic {
|
||||
/* Events with no additional information fall in this category */
|
||||
int e;
|
||||
struct pri *pri;
|
||||
} pri_event_generic;
|
||||
|
||||
typedef struct pri_event_error {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
char err[256];
|
||||
} pri_event_error;
|
||||
|
||||
typedef struct pri_event_restart {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
} pri_event_restart;
|
||||
|
||||
typedef struct pri_event_ringing {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
int cref;
|
||||
int progress;
|
||||
@@ -327,6 +285,7 @@ typedef struct pri_event_ringing {
|
||||
|
||||
typedef struct pri_event_answer {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
int cref;
|
||||
int progress;
|
||||
@@ -337,20 +296,23 @@ typedef struct pri_event_answer {
|
||||
|
||||
typedef struct pri_event_facname {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int callingpres; /* Presentation of Calling CallerID */
|
||||
int callingplan; /* Dialing plan of Calling entity */
|
||||
char callingname[256];
|
||||
char callingnum[256];
|
||||
int channel;
|
||||
int cref;
|
||||
q931_call *call;
|
||||
int callingpres; /* Presentation of Calling CallerID */
|
||||
int callingplan; /* Dialing plan of Calling entity */
|
||||
} pri_event_facname;
|
||||
|
||||
#define PRI_CALLINGPLANANI
|
||||
#define PRI_CALLINGPLANRDNIS
|
||||
typedef struct pri_event_ring {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel; /* Channel requested */
|
||||
int cref; /* Call Reference Number */
|
||||
int callingpres; /* Presentation of Calling CallerID */
|
||||
int callingplanani; /* Dialing plan of Calling entity ANI */
|
||||
int callingplan; /* Dialing plan of Calling entity */
|
||||
@@ -366,7 +328,6 @@ typedef struct pri_event_ring {
|
||||
int callingplanrdnis; /* Dialing plan of Redirecting Number */
|
||||
char useruserinfo[260]; /* User->User info */
|
||||
int flexible; /* Are we flexible with our channel selection? */
|
||||
int cref; /* Call Reference Number */
|
||||
int ctype; /* Call type (see PRI_TRANS_CAP_* */
|
||||
int layer1; /* User layer 1 */
|
||||
int complete; /* Have we seen "Complete" i.e. no more number? */
|
||||
@@ -382,9 +343,10 @@ typedef struct pri_event_ring {
|
||||
|
||||
typedef struct pri_event_hangup {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel; /* Channel requested */
|
||||
int cause;
|
||||
int cref;
|
||||
int cause;
|
||||
q931_call *call; /* Opaque call pointer */
|
||||
long aoc_units; /* Advise of Charge number of charged units */
|
||||
char useruserinfo[260]; /* User->User info */
|
||||
@@ -392,12 +354,14 @@ typedef struct pri_event_hangup {
|
||||
|
||||
typedef struct pri_event_restart_ack {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
} pri_event_restart_ack;
|
||||
|
||||
#define PRI_PROGRESS_CAUSE
|
||||
typedef struct pri_event_proceeding {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
int cref;
|
||||
int progress;
|
||||
@@ -408,18 +372,21 @@ typedef struct pri_event_proceeding {
|
||||
|
||||
typedef struct pri_event_setup_ack {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
q931_call *call;
|
||||
} pri_event_setup_ack;
|
||||
|
||||
typedef struct pri_event_notify {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
int info;
|
||||
} pri_event_notify;
|
||||
|
||||
typedef struct pri_event_keypad_digit {
|
||||
int e;
|
||||
struct pri *pri;
|
||||
int channel;
|
||||
q931_call *call;
|
||||
char digits[64];
|
||||
@@ -564,8 +531,7 @@ int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode);
|
||||
struct timeval *pri_schedule_next(struct pri *pri);
|
||||
|
||||
/* Run any pending schedule events */
|
||||
extern pri_event *pri_schedule_run(struct pri *pri);
|
||||
extern pri_event *pri_schedule_run_tv(struct pri *pri, const struct timeval *now);
|
||||
pri_event *pri_schedule_run(struct pri *pri);
|
||||
|
||||
int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
|
||||
int exclusive, int nonisdn, char *caller, int callerplan, char *callername, int callerpres,
|
||||
@@ -681,7 +647,4 @@ int pri_timer2idx(char *timer);
|
||||
#define PRI_TIMER_TM20 28 /* maximum time avaiting XID response */
|
||||
#define PRI_TIMER_NM20 29 /* number of XID retransmits */
|
||||
|
||||
/* Get PRI version */
|
||||
const char *pri_get_version(void);
|
||||
|
||||
#endif
|
||||
|
||||
7
pri.c
7
pri.c
@@ -187,12 +187,6 @@ static int __pri_write(struct pri *pri, void *buf, int buflen)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Pass in the master for this function */
|
||||
void __pri_free_tei(struct pri * p)
|
||||
{
|
||||
free (p);
|
||||
}
|
||||
|
||||
struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata, int tei, int bri)
|
||||
{
|
||||
struct pri *p;
|
||||
@@ -214,6 +208,7 @@ struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master,
|
||||
p->protodisc = Q931_PROTOCOL_DISCRIMINATOR;
|
||||
p->master = master;
|
||||
p->callpool = &p->localpool;
|
||||
p->ev.gen.pri = p;
|
||||
pri_default_timers(p, switchtype);
|
||||
if (master) {
|
||||
pri_set_debug(p, master->debug);
|
||||
|
||||
@@ -84,7 +84,6 @@ struct pri {
|
||||
|
||||
/* Various timers */
|
||||
int sabme_timer; /* SABME retransmit */
|
||||
int sabme_count; /* SABME retransmit counter for BRI */
|
||||
int t203_timer; /* Max idle time */
|
||||
int t202_timer;
|
||||
int n202_counter;
|
||||
@@ -273,6 +272,4 @@ void libpri_copy_string(char *dst, const char *src, size_t size);
|
||||
|
||||
struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata, int tei, int bri);
|
||||
|
||||
void __pri_free_tei(struct pri *p);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -163,7 +163,7 @@ typedef struct q921_frame {
|
||||
#define Q921_INC(j) (j) = (((j) + 1) % 128)
|
||||
|
||||
typedef enum q921_state {
|
||||
Q921_DOWN = 0,
|
||||
Q921_DOWN,
|
||||
Q921_TEI_UNASSIGNED,
|
||||
Q921_TEI_AWAITING_ESTABLISH,
|
||||
Q921_TEI_AWAITING_ASSIGN,
|
||||
|
||||
145
q921.c
145
q921.c
@@ -52,7 +52,6 @@
|
||||
|
||||
static void reschedule_t203(struct pri *pri);
|
||||
static void q921_restart(struct pri *pri, int now);
|
||||
static void q921_tei_release_and_reacquire(struct pri *master);
|
||||
|
||||
static void q921_discard_retransmissions(struct pri *pri)
|
||||
{
|
||||
@@ -71,7 +70,7 @@ static int q921_transmit(struct pri *pri, q921_h *h, int len)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (pri->master)
|
||||
while (pri->master)
|
||||
pri = pri->master;
|
||||
|
||||
#ifdef RANDOM_DROPS
|
||||
@@ -96,7 +95,7 @@ static int q921_transmit(struct pri *pri, q921_h *h, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void q921_send_tei(struct pri *pri, int message, int ri, int ai, int iscommand)
|
||||
static void q921_send_tei(struct pri *pri, int message, int ri, int ai, int isreq)
|
||||
{
|
||||
q921_u *f;
|
||||
|
||||
@@ -104,14 +103,14 @@ static void q921_send_tei(struct pri *pri, int message, int ri, int ai, int isco
|
||||
return;
|
||||
|
||||
Q921_INIT(pri, *f);
|
||||
f->h.c_r = (pri->localtype == PRI_NETWORK) ? iscommand : !iscommand;
|
||||
f->h.c_r = isreq;
|
||||
f->ft = Q921_FRAMETYPE_U;
|
||||
f->data[0] = 0x0f; /* Management entity */
|
||||
f->data[1] = (ri >> 8) & 0xff;
|
||||
f->data[2] = ri & 0xff;
|
||||
f->data[3] = message;
|
||||
f->data[4] = (ai << 1) | 1;
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
// if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
pri_message(pri, "Sending TEI management message %d, TEI=%d\n", message, ai);
|
||||
q921_transmit(pri, (q921_h *)f, 8);
|
||||
free(f);
|
||||
@@ -190,15 +189,6 @@ static void q921_send_sabme(void *vpri, int now)
|
||||
pri_error(pri, "Don't know how to U/A on a type %d node\n", pri->localtype);
|
||||
return;
|
||||
}
|
||||
if (pri->bri && (pri->state == Q921_AWAITING_ESTABLISH)) {
|
||||
if (pri->sabme_count >= pri->timers[PRI_TIMER_N200]) {
|
||||
pri_schedule_del(pri, pri->sabme_timer);
|
||||
pri->sabme_timer = 0;
|
||||
q921_tei_release_and_reacquire(pri->master);
|
||||
} else {
|
||||
pri->sabme_count++;
|
||||
}
|
||||
}
|
||||
if (pri->debug & (PRI_DEBUG_Q921_STATE | PRI_DEBUG_Q921_DUMP))
|
||||
pri_message(pri, "Sending Set Asynchronous Balanced Mode Extended\n");
|
||||
q921_transmit(pri, &h, 3);
|
||||
@@ -379,7 +369,6 @@ static void q921_rr(struct pri *pri, int pbit, int cmd) {
|
||||
static void t200_expire(void *vpri)
|
||||
{
|
||||
struct pri *pri = vpri;
|
||||
|
||||
if (pri->txqueue) {
|
||||
/* Retransmit first packet in the queue, setting the poll bit */
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
@@ -391,35 +380,35 @@ static void t200_expire(void *vpri)
|
||||
pri->v_na = pri->v_r;
|
||||
pri->solicitfbit = 1;
|
||||
pri->retrans++;
|
||||
/* Up to three retransmissions */
|
||||
if (pri->retrans < pri->timers[PRI_TIMER_N200]) {
|
||||
/* Reschedule t200_timer */
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Retransmitting %d bytes\n", pri->txqueue->len);
|
||||
if (pri->busy)
|
||||
q921_rr(pri, 1, 1);
|
||||
else {
|
||||
if (!pri->txqueue->transmitted)
|
||||
pri_error(pri, "!! Not good - head of queue has not been transmitted yet\n");
|
||||
q921_transmit(pri, (q921_h *)&pri->txqueue->h, pri->txqueue->len);
|
||||
}
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Rescheduling retransmission (%d)\n", pri->retrans);
|
||||
pri->t200_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T200], t200_expire, pri);
|
||||
} else {
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
pri_message(pri, "-- Timeout occured, restarting PRI\n");
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE && pri->q921_state != Q921_LINK_CONNECTION_RELEASED)
|
||||
pri_message(pri, DBGHEAD "q921_state now is Q921_LINK_CONNECTION_RELEASED\n",DBGINFO);
|
||||
pri->q921_state = Q921_LINK_CONNECTION_RELEASED;
|
||||
pri->t200_timer = 0;
|
||||
q921_dchannel_down(pri);
|
||||
q921_start(pri, 1);
|
||||
pri->schedev = 1;
|
||||
/* Up to three retransmissions */
|
||||
if (pri->retrans < pri->timers[PRI_TIMER_N200]) {
|
||||
/* Reschedule t200_timer */
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Retransmitting %d bytes\n", pri->txqueue->len);
|
||||
if (pri->busy)
|
||||
q921_rr(pri, 1, 1);
|
||||
else {
|
||||
if (!pri->txqueue->transmitted)
|
||||
pri_error(pri, "!! Not good - head of queue has not been transmitted yet\n");
|
||||
q921_transmit(pri, (q921_h *)&pri->txqueue->h, pri->txqueue->len);
|
||||
}
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Rescheduling retransmission (%d)\n", pri->retrans);
|
||||
pri->t200_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T200], t200_expire, pri);
|
||||
} else {
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
pri_message(pri, "-- Timeout occured, restarting PRI\n");
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE && pri->q921_state != Q921_LINK_CONNECTION_RELEASED)
|
||||
pri_message(pri, DBGHEAD "q921_state now is Q921_LINK_CONNECTION_RELEASED\n",DBGINFO);
|
||||
pri->q921_state = Q921_LINK_CONNECTION_RELEASED;
|
||||
pri->t200_timer = 0;
|
||||
q921_dchannel_down(pri);
|
||||
q921_start(pri, 1);
|
||||
pri->schedev = 1;
|
||||
}
|
||||
} else if (pri->solicitfbit) {
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Retrying poll with f-bit\n");
|
||||
if (pri->debug & PRI_DEBUG_Q921_DUMP)
|
||||
pri_message(pri, "-- Retrying poll with f-bit\n");
|
||||
pri->retrans++;
|
||||
if (pri->retrans < pri->timers[PRI_TIMER_N200]) {
|
||||
pri->solicitfbit = 1;
|
||||
@@ -432,14 +421,9 @@ static void t200_expire(void *vpri)
|
||||
pri_message(pri, DBGHEAD "q921_state now is Q921_LINK_CONNECTION_RELEASED\n", DBGINFO);
|
||||
pri->q921_state = Q921_LINK_CONNECTION_RELEASED;
|
||||
pri->t200_timer = 0;
|
||||
if (pri->bri && pri->master) {
|
||||
q921_tei_release_and_reacquire(pri->master);
|
||||
return;
|
||||
} else {
|
||||
q921_dchannel_down(pri);
|
||||
q921_start(pri, 1);
|
||||
pri->schedev = 1;
|
||||
}
|
||||
q921_dchannel_down(pri);
|
||||
q921_start(pri, 1);
|
||||
pri->schedev = 1;
|
||||
}
|
||||
} else {
|
||||
pri_error(pri, "T200 counter expired, nothing to send...\n");
|
||||
@@ -768,7 +752,6 @@ void q921_reset(struct pri *pri)
|
||||
if (pri->t200_timer)
|
||||
pri_schedule_del(pri, pri->t200_timer);
|
||||
pri->sabme_timer = 0;
|
||||
pri->sabme_count = 0;
|
||||
pri->t203_timer = 0;
|
||||
pri->t200_timer = 0;
|
||||
pri->busy = 0;
|
||||
@@ -783,24 +766,12 @@ void q921_reset(struct pri *pri)
|
||||
q921_discard_retransmissions(pri);
|
||||
}
|
||||
|
||||
static void q921_tei_release_and_reacquire(struct pri *master)
|
||||
{
|
||||
/* Make sure the master is passed into this function */
|
||||
q921_dchannel_down(master->subchannel);
|
||||
__pri_free_tei(master->subchannel);
|
||||
master->subchannel = NULL;
|
||||
master->ev.gen.e = PRI_EVENT_DCHAN_DOWN;
|
||||
master->schedev = 1;
|
||||
q921_start(master, master->localtype == PRI_CPE);
|
||||
}
|
||||
|
||||
static pri_event *q921_receive_MDL(struct pri *pri, q921_u *h, int len)
|
||||
{
|
||||
int ri;
|
||||
struct pri *sub;
|
||||
int tei;
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
pri_message(pri, "Received MDL message\n");
|
||||
pri_message(pri, "Received MDL message\n");
|
||||
if (h->data[0] != 0x0f) {
|
||||
pri_error(pri, "Received MDL with unsupported management entity %02x\n", h->data[0]);
|
||||
return NULL;
|
||||
@@ -815,7 +786,7 @@ static pri_event *q921_receive_MDL(struct pri *pri, q921_u *h, int len)
|
||||
case Q921_TEI_IDENTITY_REQUEST:
|
||||
if (tei != 127) {
|
||||
pri_error(pri, "Received TEI identity request with invalid TEI %d\n", tei);
|
||||
q921_send_tei(pri, Q921_TEI_IDENTITY_DENIED, ri, tei, 1);
|
||||
q921_send_tei(pri, Q921_TEI_IDENTITY_DENIED, ri, tei, 0);
|
||||
}
|
||||
/* Go to master */
|
||||
for (sub = pri; sub->master; sub = sub->master);
|
||||
@@ -829,7 +800,7 @@ static pri_event *q921_receive_MDL(struct pri *pri, q921_u *h, int len)
|
||||
pri_error(pri, "Unable to allocate D-channel for new TEI %d\n", tei);
|
||||
return NULL;
|
||||
}
|
||||
q921_send_tei(pri, Q921_TEI_IDENTITY_ASSIGNED, ri, tei, 1);
|
||||
q921_send_tei(pri, Q921_TEI_IDENTITY_ASSIGNED, ri, tei, 0);
|
||||
break;
|
||||
case Q921_TEI_IDENTITY_ASSIGNED:
|
||||
if (ri != pri->ri) {
|
||||
@@ -840,12 +811,9 @@ static pri_event *q921_receive_MDL(struct pri *pri, q921_u *h, int len)
|
||||
pri_schedule_del(pri, pri->t202_timer);
|
||||
pri->t202_timer = 0;
|
||||
}
|
||||
if (pri->subchannel && (pri->subchannel->tei == tei)) {
|
||||
if (pri->subchannel) {
|
||||
pri_error(pri, "TEI already assigned (new is %d, current is %d)\n", tei, pri->subchannel->tei);
|
||||
q921_tei_release_and_reacquire(pri);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pri_message(pri, "TEI assiged to %d\n", tei);
|
||||
pri->subchannel = __pri_new_tei(-1, pri->localtype, pri->switchtype, pri, NULL, NULL, NULL, tei, 1);
|
||||
if (!pri->subchannel) {
|
||||
@@ -854,26 +822,6 @@ static pri_event *q921_receive_MDL(struct pri *pri, q921_u *h, int len)
|
||||
}
|
||||
pri->q921_state = Q921_TEI_ASSIGNED;
|
||||
break;
|
||||
case Q921_TEI_IDENTITY_CHECK_REQUEST:
|
||||
/* We're assuming one TEI per PRI in TE PTMP mode */
|
||||
|
||||
/* If no subchannel (TEI) ignore */
|
||||
if (!pri->subchannel)
|
||||
return NULL;
|
||||
|
||||
/* If it's addressed to the group TEI or to our TEI specifically, we respond */
|
||||
if ((tei == Q921_TEI_GROUP) || (tei == pri->subchannel->tei))
|
||||
q921_send_tei(pri, Q921_TEI_IDENTITY_CHECK_RESPONSE, random() % 65535, pri->subchannel->tei, 1);
|
||||
|
||||
break;
|
||||
case Q921_TEI_IDENTITY_REMOVE:
|
||||
/* XXX: Assuming multiframe mode has been disconnected already */
|
||||
if (!pri->subchannel)
|
||||
return NULL;
|
||||
|
||||
if ((tei == Q921_TEI_GROUP) || (tei == pri->subchannel->tei)) {
|
||||
q921_tei_release_and_reacquire(pri);
|
||||
}
|
||||
}
|
||||
return NULL; /* Do we need to return something??? */
|
||||
}
|
||||
@@ -1065,17 +1013,8 @@ static pri_event *__q921_receive_qualified(struct pri *pri, q921_h *h, int len)
|
||||
pri_message(pri, "-- Got UA from %s peer Link up.\n", h->h.c_r ? "cpe" : "network");
|
||||
}
|
||||
return q921_dchannel_up(pri);
|
||||
} else if ((pri->q921_state >= Q921_TEI_ASSIGNED) && pri->bri) {
|
||||
/* Possible duplicate TEI assignment */
|
||||
if (pri->master)
|
||||
q921_tei_release_and_reacquire(pri->master);
|
||||
else
|
||||
pri_error(pri, "Huh!? no master found\n");
|
||||
} else {
|
||||
/* Since we're not in the AWAITING_ESTABLISH STATE, it's unsolicited */
|
||||
} else
|
||||
pri_error(pri, "!! Got a UA, but i'm in state %d\n", pri->q921_state);
|
||||
|
||||
}
|
||||
} else
|
||||
pri_error(pri, "!! Weird frame received (m3=3, m2 = %d)\n", h->u.m2);
|
||||
break;
|
||||
@@ -1118,7 +1057,9 @@ static pri_event *__q921_receive(struct pri *pri, q921_h *h, int len)
|
||||
/* If it's not us, try any subchannels we have */
|
||||
if (pri->subchannel)
|
||||
return q921_receive(pri->subchannel, h, len + 2);
|
||||
else {
|
||||
else
|
||||
{
|
||||
pri_error(pri, "Message for SAPI/TEI=%d/%d IS NOT HANDLED\n", h->h.sapi, h->h.tei);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1156,10 +1097,12 @@ void q921_start(struct pri *pri, int isCPE)
|
||||
{
|
||||
q921_reset(pri);
|
||||
if ((pri->sapi == Q921_SAPI_LAYER2_MANAGEMENT) && (pri->tei == Q921_TEI_GROUP)) {
|
||||
pri_message(pri, "Starting in BRI mode\n");
|
||||
pri->q921_state = Q921_DOWN;
|
||||
if (isCPE)
|
||||
q921_tei_request(pri);
|
||||
} else {
|
||||
pri_message(pri, "Starting in PRI mode, isCPE=%d, SAPI/TEI=%d/%d\n", isCPE, pri->sapi, pri->tei);
|
||||
q921_send_sabme(pri, isCPE);
|
||||
}
|
||||
}
|
||||
|
||||
259
q931.c
259
q931.c
@@ -550,12 +550,12 @@ static char *mode2str(int mode)
|
||||
static char *l12str(int proto)
|
||||
{
|
||||
static struct msgtype protos[] = {
|
||||
{ PRI_LAYER_1_ITU_RATE_ADAPT, "V.110 Rate Adaption" },
|
||||
{ PRI_LAYER_1_ITU_RATE_ADAPT, "ITU Rate Adaption" },
|
||||
{ PRI_LAYER_1_ULAW, "u-Law" },
|
||||
{ PRI_LAYER_1_ALAW, "A-Law" },
|
||||
{ PRI_LAYER_1_G721, "G.721 ADPCM" },
|
||||
{ PRI_LAYER_1_G722_G725, "G.722/G.725 7kHz Audio" },
|
||||
{ PRI_LAYER_1_H223_H245, "H.223/H.245 Multimedia" },
|
||||
{ PRI_LAYER_1_H223_H245, "H.223 and H.245" }, /* Recommendation Q.931(05/98) page 60) */
|
||||
{ PRI_LAYER_1_NON_ITU_ADAPT, "Non-ITU Rate Adaption" },
|
||||
{ PRI_LAYER_1_V120_RATE_ADAPT, "V.120 Rate Adaption" },
|
||||
{ PRI_LAYER_1_X31_RATE_ADAPT, "X.31 Rate Adaption" },
|
||||
@@ -566,7 +566,7 @@ static char *l12str(int proto)
|
||||
static char *ra2str(int proto)
|
||||
{
|
||||
static struct msgtype protos[] = {
|
||||
{ PRI_RATE_ADAPT_9K6, "9.6 kbit/s" },
|
||||
{ RATE_ADAPT_56K, "from 56kbps" },
|
||||
};
|
||||
return code2str(proto, protos, sizeof(protos) / sizeof(protos[0]));
|
||||
}
|
||||
@@ -587,143 +587,32 @@ static char *l32str(int proto)
|
||||
return code2str(proto, protos, sizeof(protos) / sizeof(protos[0]));
|
||||
}
|
||||
|
||||
static char *int_rate2str(int proto)
|
||||
{
|
||||
static struct msgtype protos[] = {
|
||||
{ PRI_INT_RATE_8K, "8 kbit/s" },
|
||||
{ PRI_INT_RATE_16K, "16 kbit/s" },
|
||||
{ PRI_INT_RATE_32K, "32 kbit/s" },
|
||||
};
|
||||
return code2str(proto, protos, sizeof(protos) / sizeof(protos[0]));
|
||||
}
|
||||
|
||||
static FUNC_DUMP(dump_bearer_capability)
|
||||
{
|
||||
int pos=2;
|
||||
pri_message(pri, "%c Bearer Capability (len=%2d) [ Ext: %d Q.931 Std: %d Info transfer capability: %s (%d)\n",
|
||||
prefix, len, (ie->data[0] & 0x80 ) >> 7, (ie->data[0] & 0x60) >> 5, cap2str(ie->data[0] & 0x1f), (ie->data[0] & 0x1f));
|
||||
pri_message(pri, "%c Ext: %d Trans mode/rate: %s (%d)\n", prefix, (ie->data[1] & 0x80) >> 7, mode2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
|
||||
|
||||
/* octet 4.1 exists iff mode/rate is multirate */
|
||||
if ((ie->data[1] & 0x7f) == 0x18) {
|
||||
pri_message(pri, "%c Ext: %d Transfer rate multiplier: %d x 64\n", prefix, (ie->data[2] & 0x80) >> 7, ie->data[2] & 0x7f);
|
||||
pos++;
|
||||
}
|
||||
/* Stop here if no more */
|
||||
if (pos >= len - 2)
|
||||
return;
|
||||
|
||||
/* don't count the IE num and length as part of the data */
|
||||
len -= 2;
|
||||
|
||||
/* Look for octet 5; this is identified by bits 5,6 == 01 */
|
||||
if (pos < len &&
|
||||
(ie->data[pos] & 0x60) == 0x20) {
|
||||
|
||||
/* although the layer1 is only the bottom 5 bits of the byte,
|
||||
previous versions of this library passed bits 5&6 through
|
||||
too, so we have to do the same for binary compatability */
|
||||
u_int8_t layer1 = ie->data[pos] & 0x7f;
|
||||
|
||||
pri_message(pri, "%c User information layer 1: %s (%d)\n",
|
||||
prefix, l12str(layer1), layer1);
|
||||
if ((ie->data[1] & 0x7f) != TRANS_MODE_PACKET) {
|
||||
/* Look for octets 5 and 5.a if present */
|
||||
pri_message(pri, "%c Ext: %d User information layer 1: %s (%d)\n", prefix, (ie->data[pos] >> 7), l12str(ie->data[pos] & 0x7f), ie->data[pos] & 0x7f);
|
||||
if ((ie->data[pos] & 0x7f) == PRI_LAYER_1_ITU_RATE_ADAPT)
|
||||
pri_message(pri, "%c Ext: %d Rate adaptatation: %s (%d)\n", prefix, ie->data[pos] >> 7, ra2str(ie->data[pos] & 0x7f), ie->data[pos] & 0x7f);
|
||||
pos++;
|
||||
|
||||
/* octet 5a? */
|
||||
if (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
int ra = ie->data[pos] & 0x7f;
|
||||
|
||||
pri_message(pri, "%c Async: %d, Negotiation: %d, "
|
||||
"User rate: %s (%#x)\n",
|
||||
prefix,
|
||||
ra & PRI_RATE_ADAPT_ASYNC ? 1 : 0,
|
||||
ra & PRI_RATE_ADAPT_NEGOTIATION_POSS ? 1 : 0,
|
||||
ra2str(ra & PRI_RATE_USER_RATE_MASK),
|
||||
ra & PRI_RATE_USER_RATE_MASK);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* octet 5b? */
|
||||
if (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
u_int8_t data = ie->data[pos];
|
||||
if (layer1 == PRI_LAYER_1_ITU_RATE_ADAPT) {
|
||||
pri_message(pri, "%c Intermediate rate: %s (%d), "
|
||||
"NIC on Tx: %d, NIC on Rx: %d, "
|
||||
"Flow control on Tx: %d, "
|
||||
"Flow control on Rx: %d\n",
|
||||
prefix, int_rate2str((data & 0x60)>>5),
|
||||
(data & 0x60)>>5,
|
||||
(data & 0x10)?1:0,
|
||||
(data & 0x08)?1:0,
|
||||
(data & 0x04)?1:0,
|
||||
(data & 0x02)?1:0);
|
||||
} else if (layer1 == PRI_LAYER_1_V120_RATE_ADAPT) {
|
||||
pri_message(pri, "%c Hdr: %d, Multiframe: %d, Mode: %d, "
|
||||
"LLI negot: %d, Assignor: %d, "
|
||||
"In-band neg: %d\n", prefix,
|
||||
(data & 0x40)?1:0,
|
||||
(data & 0x20)?1:0,
|
||||
(data & 0x10)?1:0,
|
||||
(data & 0x08)?1:0,
|
||||
(data & 0x04)?1:0,
|
||||
(data & 0x02)?1:0);
|
||||
} else {
|
||||
pri_message(pri, "%c Unknown octet 5b: 0x%x\n", data );
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* octet 5c? */
|
||||
if (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
u_int8_t data = ie->data[pos];
|
||||
const char *stop_bits[] = {"?","1","1.5","2"};
|
||||
const char *data_bits[] = {"?","5","7","8"};
|
||||
const char *parity[] = {"Odd","?","Even","None",
|
||||
"zero","one","?","?"};
|
||||
|
||||
pri_message(pri, "%c Stop bits: %s, data bits: %s, "
|
||||
"parity: %s\n", prefix,
|
||||
stop_bits[(data & 0x60) >> 5],
|
||||
data_bits[(data & 0x18) >> 3],
|
||||
parity[(data & 0x7)]);
|
||||
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* octet 5d? */
|
||||
if (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
u_int8_t data = ie->data[pos];
|
||||
pri_message(pri, "%c Duplex mode: %d, modem type: %d\n",
|
||||
prefix, (data & 0x40) ? 1 : 0,data & 0x3F);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Look for octet 6; this is identified by bits 5,6 == 10 */
|
||||
if (pos < len &&
|
||||
(ie->data[pos] & 0x60) == 0x40) {
|
||||
pri_message(pri, "%c User information layer 2: %s (%d)\n",
|
||||
prefix, l22str(ie->data[pos] & 0x1f),
|
||||
ie->data[pos] & 0x1f);
|
||||
} else {
|
||||
/* Look for octets 6 and 7 but not 5 and 5.a */
|
||||
pri_message(pri, "%c Ext: %d User information layer 2: %s (%d)\n", prefix, ie->data[pos] >> 7, l22str(ie->data[pos] & 0x7f), ie->data[pos] & 0x7f);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* Look for octet 7; this is identified by bits 5,6 == 11 */
|
||||
if (pos < len && (ie->data[pos] & 0x60) == 0x60) {
|
||||
pri_message(pri, "%c User information layer 3: %s (%d)\n",
|
||||
prefix, l32str(ie->data[pos] & 0x1f),
|
||||
ie->data[pos] & 0x1f);
|
||||
pri_message(pri, "%c Ext: %d User information layer 3: %s (%d)\n", prefix, ie->data[pos] >> 7, l32str(ie->data[pos] & 0x7f), ie->data[pos] & 0x7f);
|
||||
pos++;
|
||||
|
||||
/* octets 7a and 7b? */
|
||||
if (pos + 1 < len && !(ie->data[pos-1] & 0x80) &&
|
||||
!(ie->data[pos] & 0x80)) {
|
||||
unsigned int proto;
|
||||
proto = ((ie->data[pos] & 0xF) << 4 ) |
|
||||
(ie->data[pos+1] & 0xF);
|
||||
|
||||
pri_message(pri, "%c Network layer: 0x%x\n", prefix,
|
||||
proto );
|
||||
pos += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -736,44 +625,22 @@ static FUNC_RECV(receive_bearer_capability)
|
||||
}
|
||||
call->transcapability = ie->data[0] & 0x1f;
|
||||
call->transmoderate = ie->data[1] & 0x7f;
|
||||
|
||||
/* octet 4.1 exists iff mode/rate is multirate */
|
||||
if (call->transmoderate == TRANS_MODE_MULTIRATE) {
|
||||
call->transmultiple = ie->data[pos++] & 0x7f;
|
||||
}
|
||||
if (call->transmoderate == PRI_TRANS_CAP_AUDIO_4ESS)
|
||||
call->transmoderate = PRI_TRANS_CAP_3_1K_AUDIO;
|
||||
|
||||
/* Look for octet 5; this is identified by bits 5,6 == 01 */
|
||||
if (pos < len &&
|
||||
(ie->data[pos] & 0x60) == 0x20 ) {
|
||||
/* although the layer1 is only the bottom 5 bits of the byte,
|
||||
previous versions of this library passed bits 5&6 through
|
||||
too, so we have to do the same for binary compatability */
|
||||
if (pos >= len - 2)
|
||||
return 0;
|
||||
|
||||
if (call->transmoderate != TRANS_MODE_PACKET) {
|
||||
call->userl1 = ie->data[pos] & 0x7f;
|
||||
pos++;
|
||||
|
||||
/* octet 5a? */
|
||||
if (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
call->rateadaption = ie->data[pos] & 0x7f;
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* octets 5b through 5d? */
|
||||
while (pos < len && !(ie->data[pos-1] & 0x80)) {
|
||||
pos++;
|
||||
if (call->userl1 == PRI_LAYER_1_ITU_RATE_ADAPT) {
|
||||
call->rateadaption = ie->data[++pos] & 0x7f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Look for octet 6; this is identified by bits 5,6 == 10 */
|
||||
if (pos < len &&
|
||||
(ie->data[pos] & 0x60) == 0x40) {
|
||||
call->userl2 = ie->data[pos++] & 0x1f;
|
||||
}
|
||||
|
||||
/* Look for octet 7; this is identified by bits 5,6 == 11 */
|
||||
if (pos < len &&
|
||||
(ie->data[pos] & 0x60) == 0x60) {
|
||||
call->userl3 = ie->data[pos++] & 0x1f;
|
||||
pos++;
|
||||
} else {
|
||||
/* Get 6 and 7 */
|
||||
call->userl2 = ie->data[pos++] & 0x7f;
|
||||
call->userl3 = ie->data[pos] & 0x7f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -781,7 +648,6 @@ static FUNC_RECV(receive_bearer_capability)
|
||||
static FUNC_SEND(transmit_bearer_capability)
|
||||
{
|
||||
int tc;
|
||||
int pos;
|
||||
|
||||
/* We are ready to transmit single IE only */
|
||||
if(order > 1)
|
||||
@@ -801,46 +667,34 @@ static FUNC_SEND(transmit_bearer_capability)
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (pri->switchtype == PRI_SWITCH_ATT4ESS) {
|
||||
/* 4ESS uses a different trans capability for 3.1khz audio */
|
||||
if (tc == PRI_TRANS_CAP_3_1K_AUDIO)
|
||||
tc = PRI_TRANS_CAP_AUDIO_4ESS;
|
||||
}
|
||||
ie->data[0] = 0x80 | tc;
|
||||
ie->data[1] = call->transmoderate | 0x80;
|
||||
|
||||
pos = 2;
|
||||
/* octet 4.1 exists iff mode/rate is multirate */
|
||||
if (call->transmoderate == TRANS_MODE_MULTIRATE ) {
|
||||
ie->data[pos++] = call->transmultiple | 0x80;
|
||||
}
|
||||
|
||||
if ((tc & PRI_TRANS_CAP_DIGITAL) && (pri->switchtype == PRI_SWITCH_EUROISDN_E1) &&
|
||||
(call->transmoderate == TRANS_MODE_PACKET)) {
|
||||
if ( (tc & PRI_TRANS_CAP_DIGITAL) && (pri->switchtype == PRI_SWITCH_EUROISDN_E1) &&
|
||||
(call->transmoderate == TRANS_MODE_PACKET) ) {
|
||||
/* Apparently EuroISDN switches don't seem to like user layer 2/3 */
|
||||
return 4;
|
||||
}
|
||||
if (call->transmoderate != TRANS_MODE_PACKET) {
|
||||
/* If you have an AT&T 4ESS, you don't send any more info */
|
||||
if ((pri->switchtype != PRI_SWITCH_ATT4ESS) && (call->userl1 > -1)) {
|
||||
ie->data[pos++] = call->userl1 | 0x80; /* XXX Ext bit? XXX */
|
||||
ie->data[2] = call->userl1 | 0x80; /* XXX Ext bit? XXX */
|
||||
if (call->userl1 == PRI_LAYER_1_ITU_RATE_ADAPT) {
|
||||
ie->data[pos++] = call->rateadaption | 0x80;
|
||||
ie->data[3] = call->rateadaption | 0x80;
|
||||
return 6;
|
||||
}
|
||||
return pos + 2;
|
||||
}
|
||||
|
||||
ie->data[pos++] = 0xa0 | (call->userl1 & 0x1f);
|
||||
|
||||
if (call->userl1 == PRI_LAYER_1_ITU_RATE_ADAPT) {
|
||||
ie->data[pos-1] &= ~0x80; /* clear EXT bit in octet 5 */
|
||||
ie->data[pos++] = call->rateadaption | 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (call->userl2 != -1)
|
||||
ie->data[pos++] = 0xc0 | (call->userl2 & 0x1f);
|
||||
|
||||
if (call->userl3 != -1)
|
||||
ie->data[pos++] = 0xe0 | (call->userl3 & 0x1f);
|
||||
|
||||
return pos + 2;
|
||||
return 5;
|
||||
} else
|
||||
return 4;
|
||||
} else {
|
||||
ie->data[2] = 0x80 | call->userl2;
|
||||
ie->data[3] = 0x80 | call->userl3;
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
char *pri_plan2str(int plan)
|
||||
@@ -2326,10 +2180,7 @@ static q931_call *q931_getcall(struct pri *pri, int cr, int outboundnew)
|
||||
struct pri *master;
|
||||
|
||||
/* Find the master - He has the call pool */
|
||||
if (pri->master)
|
||||
master = pri->master;
|
||||
else
|
||||
master = pri;
|
||||
for (master = pri; master->master; master = master->master);
|
||||
|
||||
cur = *master->callpool;
|
||||
prev = NULL;
|
||||
@@ -2999,8 +2850,6 @@ int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
||||
if (!req->userl1)
|
||||
req->userl1 = PRI_LAYER_1_ULAW;
|
||||
c->userl1 = req->userl1;
|
||||
c->userl2 = -1;
|
||||
c->userl3 = -1;
|
||||
c->ds1no = (req->channel & 0xff00) >> 8;
|
||||
c->ds1explicit = (req->channel & 0x10000) >> 16;
|
||||
req->channel &= 0xff;
|
||||
@@ -3681,15 +3530,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
(c->cause != PRI_CAUSE_INTERWORKING))
|
||||
pri_error(pri, "Received unsolicited status: %s\n", pri_cause2str(c->cause));
|
||||
/* Workaround for S-12 ver 7.3 - it responds for invalid/non-implemented IEs at SETUP with null call state */
|
||||
#if 0
|
||||
if (!c->sugcallstate && (c->ourcallstate != Q931_CALL_STATE_CALL_INITIATED)) {
|
||||
#else
|
||||
/* Remove "workaround" since it breaks certification testing. If we receive a STATUS message of call state
|
||||
* NULL and we are not in the call state NULL we must clear resources and return to the call state to pass
|
||||
* testing. See section 5.8.11 of Q.931 */
|
||||
|
||||
if (!c->sugcallstate) {
|
||||
#endif
|
||||
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
|
||||
pri->ev.hangup.cause = c->cause;
|
||||
pri->ev.hangup.cref = c->cr;
|
||||
@@ -3779,12 +3620,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
UPDATE_OURCALLSTATE(pri, c, Q931_CALL_STATE_DISCONNECT_INDICATION);
|
||||
c->peercallstate = Q931_CALL_STATE_DISCONNECT_REQUEST;
|
||||
c->sendhangupack = 1;
|
||||
|
||||
/* wait for a RELEASE so that sufficient time has passed
|
||||
for the inband audio to be heard */
|
||||
if (c->progressmask & PRI_PROG_INBAND_AVAILABLE)
|
||||
break;
|
||||
|
||||
/* Return such an event */
|
||||
pri->ev.e = PRI_EVENT_HANGUP_REQ;
|
||||
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
|
||||
|
||||
Reference in New Issue
Block a user