Compare commits

..

113 Commits

Author SHA1 Message Date
Matthew Fredrickson
11206c4ddf git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.2@1165 2fbb986a-6c06-0410-b554-c9c1f0a7f128 2009-10-08 19:58:50 +00:00
Matthew Fredrickson
30a3abe6c5 Update .version file and Changelog correctly this time...
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.2@1164 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-08 19:56:28 +00:00
Matthew Fredrickson
eb34562959 This fix is more like the fix that was used to resolve the issue for the PRI case
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.2@1144 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-29 15:32:23 +00:00
Matthew Fredrickson
fd30b495b6 Changes for 1.4.10.2
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.2@1143 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-28 19:07:01 +00:00
Matthew Fredrickson
48f28055e4 git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.2@1142 2fbb986a-6c06-0410-b554-c9c1f0a7f128 2009-09-28 18:52:56 +00:00
Shaun Ruffell
7659b102d4 Limiting last entry to 80 columns
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.1@936 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-07-02 19:15:01 +00:00
Shaun Ruffell
b0180e3283 Update the .version file to 1.4.10.1
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.1@935 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-07-02 19:09:43 +00:00
Matthew Fredrickson
b6d92b91b4 git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.1@929 2fbb986a-6c06-0410-b554-c9c1f0a7f128 2009-06-30 15:43:39 +00:00
Matthew Fredrickson
fe23002233 ------------------------------------------------------------------------
r859 | mattf | 2009-06-09 14:47:05 -0500 (Tue, 09 Jun 2009) | 19 lines

There are two changes in this commit that are bug fixes for various Q.921 issues found in internal testing.

Both were exposed/introduced by the TBR4 compliance patch for bug #12861, in changing how retransmissions and in how
the transmission queue was maintained.  TX-RX message flow and acknowledgement was severely restricted,
since the patch changed the behavior so that pending untransmitted frames would not actually be send until
the next RR was received in normal circumstances, or REJ when a reject frame was received.  On busy links,
this can severly limit the amount of useful traffic that is sent, and can slow down message transmission.

Until someone can point out where in Q.921 it is mandated for us to wait for RR frames to start sending
untransmitted messages, the first change is to allow us to send untransmitted frames when we receive new
I frames as well, with updated N(R).

The other bug fixed is a situation caused by the restricted traffic flow, if an outside process tries to send
an I-frame asynchronous to an RR frame, when the transmit window was previously closed and then opened up but 
an RR has not been received yet.  A bug was found with the integration of the old transmit code with the new reject 
handling code which caused the new frame to be sent immediately, regardless if there were any pending untransmitted 
I-frames in the queue to be sent and causing an out of order I-frame to be sent to the other side.  This bug is 
also fixed in this patch.

------------------------------------------------------------------------


git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.1@928 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-06-30 15:37:25 +00:00
Matthew Fredrickson
09eb3b1453 git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10.1@927 2fbb986a-6c06-0410-b554-c9c1f0a7f128 2009-06-30 15:34:46 +00:00
Matthew Fredrickson
a12412eec8 Importing files for 1.4.10 release.
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10@761 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-18 21:27:42 +00:00
Matthew Fredrickson
d681c61357 Creating tag for the release of libpri-1.4.10
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10@760 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-18 21:26:56 +00:00
Matthew Fredrickson
26ced75a26 Importing files for 1.4.10 release.
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10@758 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-18 21:26:07 +00:00
Matthew Fredrickson
9757b33103 Creating tag for the release of libpri-1.4.10
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.10@757 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-18 21:25:41 +00:00
Richard Mudgett
f9d5aa3c3a Comment changes and some string content corrections.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@726 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-02 19:33:38 +00:00
Richard Mudgett
88551af7ef Comment changes to note what ISDN message type causes the event.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@715 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-03-26 16:01:45 +00:00
Richard Mudgett
29ded17c0b Added pSS1InfoElement comments in qsig_cf_callrerouting().
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@711 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-03-19 01:39:21 +00:00
Richard Mudgett
bbaeec9513 Use the correct branch integrated property when generating the version string.
Update the make_version file to the latest Asterisk version with the
appropriate libpri required chage.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@705 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-03-13 01:05:54 +00:00
Joshua Colp
48fc219865 Make sure we only have 4 octects on unrestricted 64k data calls.
(closes issue #14507)
Reported by: jsmith
Patches:
      64k-data.patch uploaded by jsmith (license 15)
Tested by: jsmith
(closes issue #13118)
Reported by: radpeter


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@701 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-03-04 20:31:20 +00:00
Leif Madsen
9ecdbed001 Fix a small spelling error.
(closes issue #14375)
Reported by: jeremy1

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@687 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-02-02 20:18:03 +00:00
Matthew Fredrickson
3d91cd5e30 A couple of last BRI fixes in libpri... don't discard pending iframes when we call the q921_dchannel_up routine, since we need to be able to send the ones that were queued up while the D-channel went down and is being reactivated. Also fix some buggy logic in the frame transmission decision code.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@680 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-27 23:22:06 +00:00
Matthew Fredrickson
a30eeee9a8 Change behavior so that we do not send I-frames when link is down, but instead queue them up until the link comes up and send them out then.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@675 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-22 21:48:41 +00:00
Matthew Fredrickson
07c4195876 Add additional case where T200 expires greater than N200 times and we need to release and reacquire the TEI.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@656 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-09 17:58:28 +00:00
Matthew Fredrickson
40ae2a030a Add some additional debug for Q.921 MDL messages as well as fix a bug in RESTART messages on BRI
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@653 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-12-23 21:38:25 +00:00
Matthew Fredrickson
2c104c4dbd Fix a number of Q.921 bugs, found doing TBR4 compliance testing, thanks to Tzafrir, Xorcom, and co. (#12861). Thanks!
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@645 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-11-22 00:34:26 +00:00
Matthew Fredrickson
e1bfec4b1e Merging in additional Q.SIG features in #13454. Includes Q.SIG physical/logical channel mapping support, extended coding of Q.SIG name operations (calling name), and call rerouting support via added dialplan application.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@636 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-10-17 16:13:42 +00:00
Jason Parker
aeb5a6d284 Make install paths use libdir, like libss7
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@616 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-08-06 18:20:51 +00:00
Kevin P. Fleming
64eaca5bfa Merged revisions 610 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r610 | kpfleming | 2008-08-05 17:16:58 -0500 (Tue, 05 Aug 2008) | 2 lines

clean up license headers, and explicitly grant additional permissions when used with Asterisk

........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@611 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-08-05 22:18:12 +00:00
Kevin P. Fleming
67bc1003ab update ignore list
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@607 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-30 15:43:55 +00:00
Kevin P. Fleming
419282d399 use better version.c creation process, and better dependency tracking process too
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@606 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-30 15:39:37 +00:00
Jason Parker
9e6df1092c I believe this is what was meant. (it matches how Asterisk does it)
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@602 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-29 22:47:37 +00:00
Jason Parker
1c7588ead5 libpri is not libss7 :D
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@598 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-29 22:29:11 +00:00
Kevin P. Fleming
16df54e01a correct comments to match code
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@594 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-22 22:36:25 +00:00
Kevin P. Fleming
16719a5f74 rename API call and option (nothing has been released to use it yet so this should be safe) to be more accurate in describing what it does
(closes issue #13042)



git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@589 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-22 19:43:26 +00:00
Kevin P. Fleming
8c5da8a278 ignore generated files
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@579 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-11 16:44:11 +00:00
Kevin P. Fleming
aad7c3e8f1 modify work done for issue #10552, making the support of inband audio after RELEASE a configurable option, since it is causing problems for a number of users
(closes issue #13042)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@574 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-07-11 16:24:01 +00:00
Dwayne M. Hubbard
95ccc0e03c While working on issue 3450 I noticed that the information channel selection field in the channel identification IE was displayed incorrectly when using 'pri intense debug'. I wanted another pair of eyes to look at the code because everything looked correct until Shaun Ruffell noticed the missing comma in the msg_chan_sel array.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@562 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-06-04 17:02:12 +00:00
Matthew Fredrickson
b9a6ab0c69 Moving trunk changes back into 1.4
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@557 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-05-07 19:51:44 +00:00
Brett Bryant
dee4c9ae0f Add new API call (pri_get_version) to show the current version of the branch for support purposes.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@552 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-05-02 20:21:04 +00:00
Kevin P. Fleming
b9bd97cdb7 fix the indentation in this function so that it is actually possible to read it and understand the logic and flow
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@544 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-04-16 00:21:01 +00:00
Joshua Colp
c93dfbae5f 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)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@528 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-02-21 16:38:11 +00:00
Matthew Fredrickson
160be09f76 Improve transmission, receiving, and dumping of bearer capability IE (#11593)
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@524 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-02-18 20:31:38 +00:00
Matthew Fredrickson
ba46c5ca03 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
........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@514 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2008-01-11 16:34:44 +00:00
Kevin P. Fleming
33a28eeda1 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'


........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@479 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-10-22 15:10:06 +00:00
Jason Parker
595154da5a Fix an incorrect pri_event structure definition.
Issue 10832, patch by flefoll


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@470 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-10-05 16:45:39 +00:00
Matthew Fredrickson
cdb9c294c1 Fix user-user IE order in setup message (#10705)
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@468 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-09-25 21:37:40 +00:00
Matthew Fredrickson
2a27c0f173 Fix for #10189. Make sure we properly report the user layer 1 for H.223 and H.245
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@465 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-09-14 21:32:54 +00:00
Matthew Fredrickson
e498bef21f 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.
........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@462 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-09-06 15:11:29 +00:00
Jason Parker
ac51a8e058 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.

........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@446 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-08-27 19:21:08 +00:00
Jason Parker
11f13f9b2d Allow setting CC to something with a space, such as make CC="gcc -m32"
Issue 10253.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@441 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-08-06 19:58:19 +00:00
Matthew Fredrickson
cd56dc1b1c 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)
........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@427 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-06-19 18:23:36 +00:00
Matthew Fredrickson
a17ce5bdea 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
........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@424 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-06-06 21:58:22 +00:00
Matthew Fredrickson
fcd5775b8b 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

........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@416 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-06-06 13:22:15 +00:00
Matthew Fredrickson
199d4c7fc5 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.

........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@390 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2007-01-22 22:29:24 +00:00
Joshua Colp
a22bd0df05 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)

........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@386 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-12-30 19:17:34 +00:00
Kevin P. Fleming
a898653315 how about we use the correct name for this one
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@373 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-09-20 21:00:32 +00:00
Kevin P. Fleming
16ae0df732 it's time :-)
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/branch-1.4@372 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-09-20 20:58:27 +00:00
Matthew Fredrickson
342c1f81ca Make sure we send any pending facility APDUs after we receive proceeding. #7551
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@367 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-28 14:41:57 +00:00
Matthew Fredrickson
9969553056 Make IE debug more consistent and readable. (#7559)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@366 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-21 15:55:54 +00:00
Matthew Fredrickson
9037525b7b Improve call state handling code. (#7269)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@365 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-21 15:43:31 +00:00
Russell Bryant
f245f64a2e Blocked revisions 360 via svnmerge
........
r360 | russell | 2006-07-12 15:08:31 -0400 (Wed, 12 Jul 2006) | 2 lines

ensure buffer is initialized (issue #7512, klaus3000)

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@361 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-12 19:09:07 +00:00
Russell Bryant
cd91dba660 ensure buffer gets initialized (issue #7512, klaus3000)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@359 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-12 19:04:12 +00:00
Matthew Fredrickson
a24748c0f8 Fix for #7378, namespace collision issue.
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@357 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-07 15:35:48 +00:00
Matthew Fredrickson
8c69834e21 Updates to add T309 to libpri. Thanks flefoll!
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@356 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-06 21:11:37 +00:00
Kevin P. Fleming
8192b42674 prepare for new zaptel.h location
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@355 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-07-05 16:17:05 +00:00
Kevin P. Fleming
de00a26f71 remove support for CVS checkouts
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@354 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-19 15:18:47 +00:00
Kevin P. Fleming
fe9fff6dcb revert change that didn't actually change anything, and fix formatting of conditional expression so it's more clear what it does
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@352 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-08 22:34:25 +00:00
Matthew Fredrickson
2ce7890fdd Make sure we don't send display if callername is set to a 0 length string.
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@351 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-08 22:16:55 +00:00
Matthew Fredrickson
de008c4d60 Changes to improve state reporting in libpri. (#7260)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@350 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-06 22:06:52 +00:00
Matthew Fredrickson
7db8af4b80 Minor state fix (#7269)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@348 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-02 16:06:27 +00:00
Matthew Fredrickson
a33fd59dc6 Fix for 7115. Don't call pri_message multiple times
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@346 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-02 14:34:20 +00:00
Matthew Fredrickson
a3ee176154 Fixes so that fields are initialized in events from #7241. Thanks flefoll!
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@343 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-06-01 18:00:31 +00:00
Kevin P. Fleming
f316eed834 this is a portable sh script, not a bash script
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@336 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-05-09 08:22:27 +00:00
Kevin P. Fleming
c6ccbf69ca restore functionality for Debian with FreeBSD kernel without breaking regular FreeBSD
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@335 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-05-09 08:21:45 +00:00
Matthew Fredrickson
f10e2174b4 FreeBSD fixes for build process
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@334 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-05-09 08:15:51 +00:00
Kevin P. Fleming
fd75f5ade1 Merged revisions 316,323,327,332 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r332 | kpfleming | 2006-04-30 10:17:47 -0500 (Sun, 30 Apr 2006) | 3 lines

set LDCONFIG_FLAGS for GNU/kFreeBSD as well
use the flags during installation

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@333 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-04-30 15:20:00 +00:00
Matthew Fredrickson
ed9c90a985 Make sure we pass the call back in setup_ack
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@328 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-04-27 16:09:11 +00:00
Matthew Fredrickson
f57f033aac Fix for 6841, so that we offer caller name on NI1 within the display IE
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@324 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-04-04 15:38:25 +00:00
Matthew Fredrickson
11984069b6 Fix for #6566 (Makefile doesn't honor DESTDIR)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@322 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-04-04 15:34:35 +00:00
Matthew Fredrickson
533412e361 Fix the transmit_display function to not send DISPLAY from CPE->Network on EuroISDN
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@321 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-03-31 22:37:46 +00:00
Matthew Fredrickson
e2091c29ef Cause code clarifications (Q.SIG versus non Q.SIG)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@317 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-17 21:19:37 +00:00
Matthew Fredrickson
b92b08dad7 Fix for 6480 (crash when accepting calling_part_subaddress with nothing in it)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@315 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-17 18:54:20 +00:00
Matthew Fredrickson
e225476864 More TODO updates
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@314 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-16 19:21:30 +00:00
Matthew Fredrickson
e17aebfc82 Update our TODO list
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@313 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-16 19:07:06 +00:00
Matt O'Gorman
d8f64e6c98 Merged revisions 311 via svnmerge from
https://svn.digium.com/svn/libpri/branches/1.2

........
r311 | mogorman | 2006-02-15 11:59:38 -0600 (Wed, 15 Feb 2006) | 2 lines

bug 6500 typo in README.

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@312 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-15 18:01:03 +00:00
Matthew Fredrickson
3c061000b5 Make sure we reset the field if we get one in a disconnect
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@310 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-14 19:30:32 +00:00
Kevin P. Fleming
a98061f019 set mime-type and eol-style on all files
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@309 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-14 19:22:26 +00:00
Kevin P. Fleming
3ea2ea8cf1 Merged revisions 296,306 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r296 | russell | 2006-01-17 22:53:47 -0600 (Tue, 17 Jan 2006) | 2 lines

remove old ChangeLog ... it will now only be in the tags

........
r306 | kpfleming | 2006-02-13 17:06:02 -0600 (Mon, 13 Feb 2006) | 2 lines

suppress annoying message about unsupported components in facility messages

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@308 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-13 23:07:56 +00:00
Kevin P. Fleming
6f831daaed rename merge property
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@307 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-02-13 23:07:11 +00:00
Matthew Fredrickson
681a5f582e RLT works!!! Tested successfully on a DMS100 switch. (For those wondering, RLT
is basically 2 B-channel transfer on DMS100)


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@305 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 23:27:27 +00:00
Matthew Fredrickson
0a326a9744 More little updates for RLT on DMS100. Fix ASN.1 dump code for multibyte facility IE headers
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@303 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 22:24:41 +00:00
Matthew Fredrickson
30188c642d More changes for RLT
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@302 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 22:18:01 +00:00
Matthew Fredrickson
3f78370c92 More fixes for RLT
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@301 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 21:56:10 +00:00
Matthew Fredrickson
4c20e50a5d Fix the extension bit on our facility IE
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@300 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 21:15:31 +00:00
Matthew Fredrickson
6b5781bb3a More silly cleanups
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@299 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 18:36:32 +00:00
Matthew Fredrickson
333a5eb67a Header file cleanups
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@298 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 18:31:48 +00:00
Matthew Fredrickson
0e2e37b537 Numerous updates for RLT (just remember, trunk can be a bumpy ride)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@297 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-19 18:22:06 +00:00
Kevin P. Fleming
cb7b843e10 update to reflect all merged revisions from 1.2 branch
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@293 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-17 13:44:58 +00:00
Kevin P. Fleming
d97a630a81 Merged revisions 291 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r291 | kpfleming | 2006-01-17 07:43:18 -0600 (Tue, 17 Jan 2006) | 2 lines

ensure that user-user info field in call is properly reset when not needed

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@292 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-17 13:44:12 +00:00
Matthew Fredrickson
9447f39f3f Makefile update to correctly do library version numbers
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@289 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-10 20:17:34 +00:00
Matthew Fredrickson
8fa183a4bc Lots of changes for APDU handling and debugging. Thanks PCadach (bug #5265)!
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@286 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-05 20:50:51 +00:00
Matthew Fredrickson
9e03b9b8c7 Add tzanger's patch which (among other things) prints whitespace in IE dumps
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@285 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2006-01-05 19:33:32 +00:00
Matthew Fredrickson
274f535654 Make sure that the called number field is reset in case we only get sending complete in an INFORMATION message
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@283 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-27 13:59:37 +00:00
Matthew Fredrickson
424fa816e3 Send RR as command instead of response when T200 expires after receiving RNR.
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@279 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-06 21:18:44 +00:00
Russell Bryant
9c8628715f change 'char *' to 'const char *' for useruserinfo to go along with the fixes
from r7327 in the asterisk trunk


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@277 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-04 15:32:46 +00:00
Russell Bryant
bb1f882f8a fix compiler warning that actually causes the build to fail since we treat
warnings as errors in libpri


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@276 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-02 03:59:41 +00:00
Kevin P. Fleming
8738891752 Merged revisions 274 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2

........
r274 | kpfleming | 2005-12-01 17:13:49 -0600 (Thu, 01 Dec 2005) | 2 lines

Makefile 'update' target now supports Subversion repositories (issue #5875)

........


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@275 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-02 00:57:34 +00:00
Kevin P. Fleming
b1db8aaae6 configure trunk for merging fixes from 1.2 branch
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@273 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-01 19:18:54 +00:00
Matthew Fredrickson
dd611af000 Modify the warning #define
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@272 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-01 18:06:20 +00:00
Matthew Fredrickson
8d6d58ab09 Add in keypad facility transmission support
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@271 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-12-01 17:59:56 +00:00
Matthew Fredrickson
d6cab1d527 Allow receival of single digit keypad facility IEs. Was broken before.
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@269 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-30 22:42:40 +00:00
Kevin P. Fleming
a634c4253b remove CVS ignore lists
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@267 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-29 18:40:06 +00:00
Kevin P. Fleming
cf8c723f8b remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@266 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-29 18:39:18 +00:00
21 changed files with 3401 additions and 950 deletions

View File

@@ -1 +1 @@
1.2.8
1.4.10.2

492
ChangeLog
View File

@@ -1,16 +1,190 @@
2009-10-08 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.10.2 released. A bug was found which was introduced
during the PTMP rewrite, which causes timers to not be cleared
before being set in certain situations. This can cause the
scheduler to be completely filled, as well as improper Q.921 link
operation.
2009-04-18 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.10.1 released. Includes a fix for a regression found in
the last few revisions of libpri, but fixed in revision 859 of
branches/1.4. The summary is as follows:
* q921.c: There are two changes in this commit that are bug fixes for
various Q.921 issues found in internal testing.
Both were exposed/introduced by the TBR4 compliance patch for bug
#12861, in changing how retransmissions and in how the transmission
queue was maintained. TX-RX message flow and acknowledgement was
severely restricted, since the patch changed the behavior so that
pending untransmitted frames would not actually be send until the
next RR was received in normal circumstances, or REJ when a reject
frame was received. On busy links, this can severly limit the
amount of useful traffic that is sent, and can slow down message
transmission.
Until someone can point out where in Q.921 it is mandated for us to
wait for RR frames to start sending untransmitted messages, the
first change is to allow us to send untransmitted frames when we
receive new I frames as well, with updated N(R).
The other bug fixed is a situation caused by the restricted traffic
flow, if an outside process tries to send an I-frame asynchronous to
an RR frame, when the transmit window was previously closed and then
opened up but an RR has not been received yet. A bug was found with
the integration of the old transmit code with the new reject
handling code which caused the new frame to be sent immediately,
regardless if there were any pending untransmitted I-frames in the
queue to be sent and causing an out of order I-frame to be sent to
the other side. This bug is also fixed in this patch.
2009-04-18 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.10 released.
2009-04-02 19:33 +0000 [r726] Richard Mudgett <rmudgett@digium.com>
* pri_facility.c: Comment changes and some string content
corrections.
2009-03-26 16:01 +0000 [r715] Richard Mudgett <rmudgett@digium.com>
* libpri.h: Comment changes to note what ISDN message type causes
the event.
2009-03-19 01:39 +0000 [r711] Richard Mudgett <rmudgett@digium.com>
* pri_facility.c: Added pSS1InfoElement comments in
qsig_cf_callrerouting().
2009-03-13 01:05 +0000 [r705] Richard Mudgett <rmudgett@digium.com>
* build_tools/make_version: Use the correct branch integrated
property when generating the version string. Update the
make_version file to the latest Asterisk version with the
appropriate libpri required chage.
2009-03-04 20:31 +0000 [r701] Joshua Colp <jcolp@digium.com>
* q931.c: Make sure we only have 4 octects on unrestricted 64k data
calls. (closes issue #14507) Reported by: jsmith Patches:
64k-data.patch uploaded by jsmith (license 15) Tested by: jsmith
(closes issue #13118) Reported by: radpeter
2009-02-02 20:18 +0000 [r687] Leif Madsen <lmadsen@digium.com>
* libpri.h: Fix a small spelling error. (closes issue #14375)
Reported by: jeremy1
2009-01-27 23:22 +0000 [r680] Matthew Fredrickson <creslin@digium.com>
* q921.c: A couple of last BRI fixes in libpri... don't discard
pending iframes when we call the q921_dchannel_up routine, since
we need to be able to send the ones that were queued up while the
D-channel went down and is being reactivated. Also fix some buggy
logic in the frame transmission decision code.
2009-01-22 21:48 +0000 [r675] Matthew Fredrickson <creslin@digium.com>
* q921.c: Change behavior so that we do not send I-frames when link
is down, but instead queue them up until the link comes up and
send them out then.
2009-01-09 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.9 released.
2009-01-09 17:58 +0000 [r656] Matthew Fredrickson <creslin@digium.com>
* q921.c: Add additional case where T200 expires greater than N200
times and we need to release and reacquire the TEI.
2008-12-23 21:38 +0000 [r653] Matthew Fredrickson <creslin@digium.com>
* q921.c, q931.c: Add some additional debug for Q.921 MDL messages
as well as fix a bug in RESTART messages on BRI
2008-11-22 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.8 released.
2008-11-22 00:34 +0000 [r645] Matthew Fredrickson <creslin@digium.com>
* q921.c: Fix a number of Q.921 bugs, found doing TBR4 compliance
testing, thanks to Tzafrir, Xorcom, and co. (#12861). Thanks!
2008-10-17 16:13 +0000 [r636] Matthew Fredrickson <creslin@digium.com>
* pri.c, pri_internal.h, pri_q931.h, q931.c, pri_facility.c,
pri_facility.h, libpri.h: Merging in additional Q.SIG features in
#13454. Includes Q.SIG physical/logical channel mapping support,
extended coding of Q.SIG name operations (calling name), and call
rerouting support via added dialplan application.
2008-08-06 18:20 +0000 [r616] Jason Parker <jparker@digium.com>
* Makefile: Make install paths use libdir, like libss7
2008-08-05 Kevin P. Fleming <kpfleming@digium.com>
* libpri 1.2.8 Released
* libpri 1.4.7 released.
2008-08-05 22:16 +0000 [r610] Kevin P. Fleming <kpfleming@digium.com>
2008-08-05 22:18 +0000 [r611] Kevin P. Fleming <kpfleming@digium.com>
* pritest.c, pri.c, pri_internal.h, q921.c, q931.c, copy_string.c,
prisched.c, pri_q921.h, pri_q931.h, pri_facility.c, compiler.h,
pridump.c, testprilib.c, pri_timers.h, pri_facility.h, libpri.h:
clean up license headers, and explicitly grant additional
permissions when used with Asterisk
prisched.c, pri_q921.h, pri_q931.h, pri_facility.c, /,
compiler.h, pridump.c, testprilib.c, pri_timers.h,
pri_facility.h, libpri.h: Merged revisions 610 via svnmerge from
https://origsvn.digium.com/svn/libpri/branches/1.2 ........ r610
| kpfleming | 2008-08-05 17:16:58 -0500 (Tue, 05 Aug 2008) | 2
lines clean up license headers, and explicitly grant additional
permissions when used with Asterisk ........
2008-06-04 16:59 +0000 [r561] Dwayne M. Hubbard <dhubbard@digium.com>
2008-07-30 15:43 +0000 [r606-607] Kevin P. Fleming <kpfleming@digium.com>
* /: update ignore list
* Makefile, mkdep (removed): use better version.c creation process,
and better dependency tracking process too
2008-07-29 22:47 +0000 [r598-602] Jason Parker <jparker@digium.com>
* build_tools/make_version: I believe this is what was meant. (it
matches how Asterisk does it)
* build_tools/make_version: libpri is not libss7 :D
2008-07-22 22:36 +0000 [r594] Kevin P. Fleming <kpfleming@digium.com>
* pri_internal.h, libpri.h: correct comments to match code
2008-07-22 Kevin P. Fleming <kpfleming@digium.com>
* Libpri 1.4.6 released.
2008-07-22 19:43 +0000 [r589] Kevin P. Fleming <kpfleming@digium.com>
* pri.c, pri_internal.h, q931.c, libpri.h: rename API call and
option (nothing has been released to use it yet so this should be
safe) to be more accurate in describing what it does (closes
issue #13042)
2008-07-11 Jason Parker <jparker@digium.com>
* Libpri 1.4.5 released.
2008-07-11 16:44 +0000 [r574-579] Kevin P. Fleming <kpfleming@digium.com>
* /: ignore generated files
* pri.c, pri_internal.h, q931.c, libpri.h: modify work done for
issue #10552, making the support of inband audio after RELEASE a
configurable option, since it is causing problems for a number of
users (closes issue #13042)
2008-06-04 17:02 +0000 [r562] Dwayne M. Hubbard <dhubbard@digium.com>
* q931.c: While working on issue 3450 I noticed that the
information channel selection field in the channel identification
@@ -19,168 +193,284 @@
everything looked correct until Shaun Ruffell noticed the missing
comma in the msg_chan_sel array.
2008-02-20 21:36 +0000 [r527] Matthew Fredrickson <creslin@digium.com>
2008-05-07 19:51 +0000 [r557] Matthew Fredrickson <creslin@digium.com>
* q931.c: Don't send a status error when we receive connect
acknowledge during an active state
* 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-02-18 20:31 +0000 [r521-523] Matthew Fredrickson <creslin@digium.com>
2008-05-07 Matthew Fredrickson <creslin@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)
* q931.c, libpri.h: Revert previous commit 521
2008-01-16 18:06 +0000 [r518] Jason Parker <jparker@digium.com>
* q931.c, libpri.h: Fix for bug #960. Better support for more
exotic bearer capabilities
* Makefile, /: Add logging for 'make update' command (also fixes
updates in some places). Issue #11766, initial patch by jmls.
2008-01-11 16:33 +0000 [r513] Matthew Fredrickson <creslin@digium.com>
2007-12-26 17:35 +0000 [r505] Russell Bryant <russell@digium.com>
* q931.c: We should not be parsing further into the bearer
capability IE if the length does not confirm that there actually
is data present
* libpri.h: Remove unnecessary usage of the extern keyword.
2007-12-13 Russell Bryant <russell@digium.com>
2007-12-06 22:16 +0000 [r494-496] Russell Bryant <russell@digium.com>
* libpri 1.2.7 Released
* q921.c, q931.c, pri_facility.c, pri.c: Change malloc+memset to
calloc. Also, handle allocation failures early to reduce
indentation. (closes issue #11469) Reported by: eliel Patches:
pri.c.patch uploaded by eliel (license 64) q931.c.patch uploaded
by eliel (license 64) q921.c.patch uploaded by eliel (license 64)
pri_facility.c.patch uploaded by eliel (license 64)
2007-10-22 15:09 +0000 [r478] Kevin P. Fleming <kpfleming@digium.com>
* pri.c: Change a use of malloc+memset to calloc. Also, reduce
indentation of a function by doing the check for memory
allocation failure at the beginning.
* pri_internal.h: we need to include stddef.h for 'size_t'
* pri.c: Change the table used to hold the default timers to be
global and const, instead of allocating it on the stack each time
the function is called.
2007-10-16 Matthew Fredrickson <creslin@digium.com>
2007-12-05 00:20 +0000 [r491-493] Matthew Fredrickson <creslin@digium.com>
* libpri 1.2.6 Released
* q931.c: Improve the parameter name to better reflect its use
2007-09-25 21:33 +0000 [r467] Matthew Fredrickson <creslin@digium.com>
* q921.c, q931.c: More PTMP fixes. Stand by, more changes to come
* q921.c, q931.c, testprilib.c: More magic to make BRI CPE PTMP
work
2007-11-21 22:30 +0000 [r486-487] Matthew Fredrickson <creslin@digium.com>
* q931.c: Make sure we loop BRI call references for one byte CREFs
instead of two
* q921.c, q931.c, libpri.h, pri.c, pritest.c, pri_internal.h: Add
BRI support to libpri
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-09-25 21:56 +0000 [r469] Matthew Fredrickson <creslin@digium.com>
* q931.c: Fix user-user IE order in setup message (#10705)
2007-09-06 15:06 +0000 [r460] Matthew Fredrickson <creslin@digium.com>
2007-06-20 15:18 +0000 [r428-430] Matthew Fredrickson <creslin@digium.com>
* pri.c, pri_facility.c: TBCT now works. It should work for NI2,
4E, and 5E. This code was tested on NI2.
* Makefile: Revert that back to how it was
2007-08-27 19:20 +0000 [r445] Jason Parker <jparker@digium.com>
* Makefile, q921.c, q931.c, prisched.c, testprilib.c, pri_timers.h,
libpri.h, pri.c, pri_internal.h, pri_q921.h: Patch to add PTMP
mode (BRI support)
* Makefile: Make sure we build both the static and shared modules
with -fPIC.
2007-06-06 21:59 +0000 [r417-425] Matthew Fredrickson <creslin@digium.com>
2007-07-09 Russell Bryant <russell@digium.com>
* 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
* libpri 1.2.5 Released
2007-05-25 17:36 +0000 [r413] Matthew Fredrickson <creslin@digium.com>
2007-06-19 18:22 +0000 [r426] 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)
* q931.c: Try to send pending facility messages if we receive
alerting (for when we don't get proceeding) (#9651)
2006-11-03 18:16 +0000 [r382] Matthew Fredrickson <creslin@digium.com>
2007-06-06 21:57 +0000 [r415-423] Matthew Fredrickson <creslin@digium.com>
* q921.c: Remove pointless recursion. (#8281)
* pri_facility.c: Oops, that should not be on one line
2008-05-07 19:51 +0000 [r557] Matthew Fredrickson <creslin@digium.com>
* pri_facility.c: Make sure we only send the NFE when we are
talking QSIG
* 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
2007-01-22 22:20 +0000 [r389] Matthew Fredrickson <creslin@digium.com>
2008-05-02 20:21 +0000 [r552] Brett Bryant <bbryant@digium.com>
* q931.c: Make sure we send DISCONNECT if we reached the active
state and a call is disconnected, regardless of cause code.
* 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.
2006-12-30 19:16 +0000 [r385] Joshua Colp <jcolp@digium.com>
2008-04-16 00:21 +0000 [r544] Kevin P. Fleming <kpfleming@digium.com>
* Makefile: Specify full path to restorecon instead of assuming it
will be available from what is in $PATH. (issue #8670 reported by
djflux)
* q921.c: fix the indentation in this function so that it is
actually possible to read it and understand the logic and flow
2006-10-17 Kevin P. Fleming <kpfleming@digium.com>
2008-02-21 16:38 +0000 [r528] Joshua Colp <jcolp@digium.com>
* libpri 1.2.4 Released
* 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)
2006-07-28 14:44 +0000 [r368] Matt Frederickson <creslin@digium.com>
2008-02-18 20:31 +0000 [r524] Matthew Fredrickson <creslin@digium.com>
* q931.c: Make sure we send any pending facilty APDUs after we get
proceeding. (#7551)
* q931.c, libpri.h: Improve transmission, receiving, and dumping of
bearer capability IE (#11593)
2006-07-12 19:08 +0000 [r360] Russell Bryant <russell@digium.com>
2008-01-11 16:34 +0000 [r514] Matthew Fredrickson <creslin@digium.com>
* q931.c: ensure buffer is initialized (issue #7512, klaus3000)
* 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
........
2006-07-07 15:36 +0000 [r358] Matt Frederickson <creslin@digium.com>
2007-12-13 Russell Bryant <russell@digium.com>
* q931.c: Fix for #7378 (namespace collision)
* libpri 1.4.3 released.
2006-06-02 16:05 +0000 [r342-347] Matt Frederickson <creslin@digium.com>
2007-10-22 15:10 +0000 [r479] Kevin P. Fleming <kpfleming@digium.com>
* q931.c: Minor state fix. (#7269)
* 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' ........
* q931.c: Fix for 7115 (Don't call pri_message multiple times per
line)
2007-10-16 Matthew Fredrickson <creslin@digium.com>
* q931.c: Fixes to fill in non-filled fields in libpri. (Issue
#7241) Thanks flefoll!
* libpri 1.4.2 released.
2006-05-30 Kevin P. Fleming <kpfleming@digium.com>
2007-10-05 16:45 +0000 [r470] Jason Parker <jparker@digium.com>
* libpri 1.2.3 Released
* libpri.h: Fix an incorrect pri_event structure definition. Issue
10832, patch by flefoll
2006-04-30 15:17 +0000 [r332] Kevin P. Fleming <kpfleming@digium.com>
2007-09-25 21:37 +0000 [r468] Matthew Fredrickson <creslin@digium.com>
* Makefile: set LDCONFIG_FLAGS for GNU/kFreeBSD as well use the
flags during installation
* q931.c: Fix user-user IE order in setup message (#10705)
2006-04-27 16:08 +0000 [r327] Matt Frederickson <creslin@digium.com>
2007-09-14 21:32 +0000 [r465] Matthew Fredrickson <creslin@digium.com>
* q931.c, libpri.h: Make sure we pass the call back in the
setup_ack
* q931.c, libpri.h: Fix for #10189. Make sure we properly report
the user layer 1 for H.223 and H.245
2006-04-04 15:36 +0000 [r323] Matt Frederickson <creslin@digium.com>
2007-09-06 15:11 +0000 [r462] Matthew Fredrickson <creslin@digium.com>
* Makefile: Fix for #6566 (Makefile does not honor DESTDIR)
* 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. ........
2006-02-17 18:55 +0000 [r316] Matt Frederickson <creslin@digium.com>
2007-08-27 19:21 +0000 [r446] Jason Parker <jparker@digium.com>
* q931.c: Backport of 6480
* 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.
........
2006-02-15 17:59 +0000 [r311] Matt O'Gorman <mogorman@digium.com>
2007-08-06 19:58 +0000 [r441] Jason Parker <jparker@digium.com>
* README: bug 6500 typo in README.
* Makefile: Allow setting CC to something with a space, such as
`make CC="gcc -m32"` Issue 10253.
2006-02-13 23:06 +0000 [r306] Kevin P. Fleming <kpfleming@digium.com>
2007-07-09 Russell Bryant <russell@digium.com>
* pri_facility.c: suppress annoying message about unsupported
components in facility messages
* libpri 1.4.1 released.
2006-01-18 Russell Bryant <russell@digium.com>
2007-06-19 18:23 +0000 [r427] Matthew Fredrickson <creslin@digium.com>
* Libpri 1.2.2 Released
* 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) ........
2006-01-17 13:43 +0000 [r291] Kevin P. Fleming <kpfleming@digium.com>
2007-06-06 21:58 +0000 [r416-424] Matthew Fredrickson <creslin@digium.com>
* q931.c: ensure that user-user info field in call is properly
reset when not needed
* 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 ........
2006-01-10 20:19 +0000 [r290] Matt Frederickson <creslin@digium.com>
* 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 ........
* Makefile: Backport of doing correct minor numbers to 1.2 (#6188)
2007-01-22 22:29 +0000 [r390] Matthew Fredrickson <creslin@digium.com>
2005-12-27 14:01 +0000 [r284] Matt Frederickson <creslin@digium.com>
* q931.c, /: 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. ........
* q931.c: Fix for issue #6039 backported to 1.2
2006-12-30 19:17 +0000 [r386] Joshua Colp <jcolp@digium.com>
2005-12-06 21:35 +0000 [r280] Matt Frederickson <creslin@digium.com>
* Makefile, /: 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)
........
* q921.c: Send RR as command instead of response when T200 expires
after receiving RNR.
2005-12-01 23:13 +0000 [r274] Kevin P. Fleming <kpfleming@digium.com>
* Makefile: Makefile 'update' target now supports Subversion
repositories (issue #5875)
2005-12-01 02:34 +0000 [r270] Matt Frederickson <creslin@digium.com>
* q931.c: Backport of fix from trunk. Fix broken single digit
keypad facility code.
2006-12-23 Kevin P. Fleming <kpfleming@digium.com>
* libpri 1.4.0 released.
2006-09-20 Kevin P. Fleming <kpfleming@digium.com>
* libpri 1.4.0-beta1 released.

102
Makefile
View File

@@ -28,37 +28,47 @@
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
CC=gcc
GREP=grep
AWK=awk
OSARCH=$(shell uname -s)
PROC?=$(shell uname -m)
TOBJS=testpri.o
T2OBJS=testprilib.o
# 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.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
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
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS)
INSTALL_PREFIX=$(DESTDIR)
INSTALL_BASE=/usr
SOFLAGS = -Wl,-hlibpri.so.1.0
libdir?=$(INSTALL_BASE)/lib
SOFLAGS:=-Wl,-h$(DYNAMIC_LIBRARY)
LDCONFIG = /sbin/ldconfig
ifneq (,$(findstring $(OSARCH), Linux GNU/kFreeBSD))
ifneq (,$(findstring X$(OSARCH)X, XLinuxX XGNU/kFreeBSDX))
LDCONFIG_FLAGS=-n
else
ifeq (${OSARCH},FreeBSD)
LDCONFIG_FLAGS=-m
CFLAGS += -I../zaptel -I../zapata
INSTALL_BASE=/usr/local
endif
endif
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.
@@ -67,42 +77,47 @@ PROC=ultrasparc
CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
endif
all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
all: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
update:
@if [ -d .svn ]; then \
echo "Updating from Subversion..." ; \
svn update -q; \
elif [ -d CVS ]; then \
echo "Updating from CVS..." ; \
cvs -q -z3 update -Pd; \
fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
svn update | tee update.out; \
torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
echo "`date` Updated from revision $${fromrev} to $${torev}." >> update.log; \
rm -f .version; \
if [ `grep -c ^C update.out` -gt 0 ]; then \
echo ; echo "The following files have conflicts:" ; \
grep ^C update.out | cut -b4- ; \
fi ; \
rm -f update.out; \
else \
echo "Not under version control"; \
fi
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
mkdir -p $(INSTALL_PREFIX)$(libdir)
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
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.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
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v $(INSTALL_PREFIX)$(libdir)/$(DYNAMIC_LIBRARY); fi
( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libpri.so.$(SONAME) libpri.so)
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS) $(INSTALL_PREFIX)$(libdir); 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.1.0 libpri.so ; $(SOSLINK) )
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
install -f $(INSTALL_PREFIX)$(libdir) -m 755 $(DYNAMIC_LIBRARY)
( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libpri.so.$(SONAME) libpri.so)
install -f $(INSTALL_PREFIX)$(libdir) -m 644 $(STATIC_LIBRARY)
endif
uninstall:
@echo "Removing Libpri"
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)$(libdir)/libpri.so.$(SONAME)
rm -f $(INSTALL_PREFIX)$(libdir)/libpri.so
rm -f $(INSTALL_PREFIX)$(libdir)/libpri.a
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
pritest: pritest.o
@@ -117,12 +132,13 @@ testprilib: testprilib.o
pridump: pridump.o
$(CC) -o pridump pridump.o -L. -lpri $(CFLAGS)
ifneq ($(wildcard .depend),)
include .depend
endif
MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP
%.lo : %.c
$(CC) $(CFLAGS) -o $@ -c $<
%.o: %.c
$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
%.lo: %.c
$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
$(STATIC_LIBRARY): $(STATIC_OBJS)
ar rcs $(STATIC_LIBRARY) $(STATIC_OBJS)
@@ -131,17 +147,23 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
$(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1.0 libpri.so
ln -sf libpri.so.1.0 libpri.so.1
$(SOSLINK)
ln -sf libpri.so.$(SONAME) libpri.so
version.c: FORCE
@build_tools/make_version_c > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
clean:
rm -f *.o *.so *.lo *.so.1 *.so.1.0
rm -f testpri testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
rm -f *.o *.so *.lo *.so.$(SONAME)
rm -f testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
rm -f pritest pridump
rm -f .depend
rm -f .*.d
depend: .depend
.PHONY:
.depend:
CC=$(CC) ./mkdep ${CFLAGS} `ls *.c`
FORCE:
ifneq ($(wildcard .*.d),)
include .*.d
endif

4
TODO
View File

@@ -1,10 +1,8 @@
General:
-- D-Channel Backup
-- Test against 4e
Q.921:
-- Support unnumbered information frames
-- Get TEI codes working for BRI interfaces
Q.931:
-- Locking Shift IE
-- Implement the 11 missing Q.931 timers

79
build_tools/make_version Executable file
View File

@@ -0,0 +1,79 @@
#!/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`
INTEGRATED=`LANG=C svn pg automerge-propname ${1}`
if [ -z "${INTEGRATED}" ] ; then
INTEGRATED=svnmerge-integrated
fi
BASE=`LANG=C svn pg ${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="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
break
fi
if [ ${TEAM} != 0 ] ; then
if [ -z "${RESULT}" ] ; then
RESULT="${PART}"
else
RESULT="${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
if [ ${TAG} != 0 ] ; then
echo ${RESULT}
else
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
fi
else
echo "UNKNOWN__and_probably_unsupported"
fi

24
build_tools/make_version_c Executable file
View File

@@ -0,0 +1,24 @@
#!/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

199
libpri.h
View File

@@ -64,23 +64,23 @@
/* PRI D-Channel Events */
#define PRI_EVENT_DCHAN_UP 1 /* D-channel is up */
#define PRI_EVENT_DCHAN_DOWN 2 /* D-channel is down */
#define PRI_EVENT_DCHAN_DOWN 2 /* D-channel is down */
#define PRI_EVENT_RESTART 3 /* B-channel is restarted */
#define PRI_EVENT_CONFIG_ERR 4 /* Configuration Error Detected */
#define PRI_EVENT_RING 5 /* Incoming call */
#define PRI_EVENT_HANGUP 6 /* Call got hung up */
#define PRI_EVENT_RINGING 7 /* Call is ringing (alerting) */
#define PRI_EVENT_ANSWER 8 /* Call has been answered */
#define PRI_EVENT_RING 5 /* Incoming call (SETUP) */
#define PRI_EVENT_HANGUP 6 /* Call got hung up (RELEASE/RELEASE_COMPLETE/other) */
#define PRI_EVENT_RINGING 7 /* Call is ringing (ALERTING) */
#define PRI_EVENT_ANSWER 8 /* Call has been answered (CONNECT) */
#define PRI_EVENT_HANGUP_ACK 9 /* Call hangup has been acknowledged */
#define PRI_EVENT_RESTART_ACK 10 /* Restart complete on a given channel */
#define PRI_EVENT_RESTART_ACK 10 /* Restart complete on a given channel (RESTART_ACKNOWLEDGE) */
#define PRI_EVENT_FACNAME 11 /* Caller*ID Name received on Facility */
#define PRI_EVENT_INFO_RECEIVED 12 /* Additional info (keypad) received */
#define PRI_EVENT_PROCEEDING 13 /* When we get CALL_PROCEEDING or PROGRESS */
#define PRI_EVENT_INFO_RECEIVED 12 /* Additional info (digits) received (INFORMATION) */
#define PRI_EVENT_PROCEEDING 13 /* When we get CALL_PROCEEDING */
#define PRI_EVENT_SETUP_ACK 14 /* When we get SETUP_ACKNOWLEDGE */
#define PRI_EVENT_HANGUP_REQ 15 /* Requesting the higher layer to hangup */
#define PRI_EVENT_NOTIFY 16 /* Notification received */
#define PRI_EVENT_PROGRESS 17 /* When we get CALL_PROCEEDING or PROGRESS */
#define PRI_EVENT_KEYPAD_DIGIT 18 /* When we receive during ACTIVE state */
#define PRI_EVENT_HANGUP_REQ 15 /* Requesting the higher layer to hangup (DISCONNECT) */
#define PRI_EVENT_NOTIFY 16 /* Notification received (NOTIFY) */
#define PRI_EVENT_PROGRESS 17 /* When we get PROGRESS */
#define PRI_EVENT_KEYPAD_DIGIT 18 /* When we receive during ACTIVE state (INFORMATION) */
/* Simple states */
#define PRI_STATE_DOWN 0
@@ -147,10 +147,10 @@
/* Causes for disconnection */
#define PRI_CAUSE_UNALLOCATED 1
#define PRI_CAUSE_NO_ROUTE_TRANSIT_NET 2
#define PRI_CAUSE_NO_ROUTE_TRANSIT_NET 2 /* !Q.SIG */
#define PRI_CAUSE_NO_ROUTE_DESTINATION 3
#define PRI_CAUSE_CHANNEL_UNACCEPTABLE 6
#define PRI_CAUSE_CALL_AWARDED_DELIVERED 7
#define PRI_CAUSE_CALL_AWARDED_DELIVERED 7 /* !Q.SIG */
#define PRI_CAUSE_NORMAL_CLEARING 16
#define PRI_CAUSE_USER_BUSY 17
#define PRI_CAUSE_NO_USER_RESPONSE 18
@@ -159,27 +159,29 @@
#define PRI_CAUSE_NUMBER_CHANGED 22
#define PRI_CAUSE_DESTINATION_OUT_OF_ORDER 27
#define PRI_CAUSE_INVALID_NUMBER_FORMAT 28
#define PRI_CAUSE_FACILITY_REJECTED 29
#define PRI_CAUSE_FACILITY_REJECTED 29 /* !Q.SIG */
#define PRI_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30
#define PRI_CAUSE_NORMAL_UNSPECIFIED 31
#define PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION 34
#define PRI_CAUSE_NETWORK_OUT_OF_ORDER 38
#define PRI_CAUSE_NETWORK_OUT_OF_ORDER 38 /* !Q.SIG */
#define PRI_CAUSE_NORMAL_TEMPORARY_FAILURE 41
#define PRI_CAUSE_SWITCH_CONGESTION 42
#define PRI_CAUSE_ACCESS_INFO_DISCARDED 43
#define PRI_CAUSE_SWITCH_CONGESTION 42 /* !Q.SIG */
#define PRI_CAUSE_ACCESS_INFO_DISCARDED 43 /* !Q.SIG */
#define PRI_CAUSE_REQUESTED_CHAN_UNAVAIL 44
#define PRI_CAUSE_PRE_EMPTED 45
#define PRI_CAUSE_FACILITY_NOT_SUBSCRIBED 50
#define PRI_CAUSE_OUTGOING_CALL_BARRED 52
#define PRI_CAUSE_INCOMING_CALL_BARRED 54
#define PRI_CAUSE_PRE_EMPTED 45 /* !Q.SIG */
#define PRI_CAUSE_FACILITY_NOT_SUBSCRIBED 50 /* !Q.SIG */
#define PRI_CAUSE_OUTGOING_CALL_BARRED 52 /* !Q.SIG */
#define PRI_CAUSE_INCOMING_CALL_BARRED 54 /* !Q.SIG */
#define PRI_CAUSE_BEARERCAPABILITY_NOTAUTH 57
#define PRI_CAUSE_BEARERCAPABILITY_NOTAVAIL 58
#define PRI_CAUSE_SERVICEOROPTION_NOTAVAIL 63 /* Q.SIG */
#define PRI_CAUSE_BEARERCAPABILITY_NOTIMPL 65
#define PRI_CAUSE_CHAN_NOT_IMPLEMENTED 66
#define PRI_CAUSE_FACILITY_NOT_IMPLEMENTED 69
#define PRI_CAUSE_CHAN_NOT_IMPLEMENTED 66 /* !Q.SIG */
#define PRI_CAUSE_FACILITY_NOT_IMPLEMENTED 69 /* !Q.SIG */
#define PRI_CAUSE_INVALID_CALL_REFERENCE 81
#define PRI_CAUSE_IDENTIFIED_CHANNEL_NOTEXIST 82 /* Q.SIG */
#define PRI_CAUSE_INCOMPATIBLE_DESTINATION 88
#define PRI_CAUSE_INVALID_MSG_UNSPECIFIED 95
#define PRI_CAUSE_INVALID_MSG_UNSPECIFIED 95 /* !Q.SIG */
#define PRI_CAUSE_MANDATORY_IE_MISSING 96
#define PRI_CAUSE_MESSAGE_TYPE_NONEXIST 97
#define PRI_CAUSE_WRONG_MESSAGE 98
@@ -187,9 +189,9 @@
#define PRI_CAUSE_INVALID_IE_CONTENTS 100
#define PRI_CAUSE_WRONG_CALL_STATE 101
#define PRI_CAUSE_RECOVERY_ON_TIMER_EXPIRE 102
#define PRI_CAUSE_MANDATORY_IE_LENGTH_ERROR 103
#define PRI_CAUSE_MANDATORY_IE_LENGTH_ERROR 103 /* !Q.SIG */
#define PRI_CAUSE_PROTOCOL_ERROR 111
#define PRI_CAUSE_INTERWORKING 127
#define PRI_CAUSE_INTERWORKING 127 /* !Q.SIG */
/* Transmit capabilities */
#define PRI_TRANS_CAP_SPEECH 0x0
@@ -205,7 +207,7 @@
#define PRI_LAYER_1_ALAW 0x23
#define PRI_LAYER_1_G721 0x24
#define PRI_LAYER_1_G722_G725 0x25
#define PRI_LAYER_1_G7XX_384K 0x26
#define PRI_LAYER_1_H223_H245 0x26
#define PRI_LAYER_1_NON_ITU_ADAPT 0x27
#define PRI_LAYER_1_V120_RATE_ADAPT 0x28
#define PRI_LAYER_1_X31_RATE_ADAPT 0x29
@@ -345,6 +347,8 @@ typedef struct pri_event_facname {
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
@@ -435,7 +439,7 @@ typedef union {
pri_event_ring ring; /* Ring */
pri_event_hangup hangup; /* Hang up */
pri_event_ringing ringing; /* Ringing */
pri_event_ringing answer; /* Answer */
pri_event_answer answer; /* Answer */
pri_event_restart_ack restartack; /* Restart Acknowledge */
pri_event_proceeding proceeding; /* Call proceeding & Progress */
pri_event_setup_ack setup_ack; /* SETUP_ACKNOWLEDGE structure */
@@ -454,73 +458,78 @@ typedef int (*pri_io_cb)(struct pri *pri, void *buf, int buflen);
channel operating in HDLC mode with FCS computed by the fd's driver. Also it
must be NON-BLOCKING! Frames received on the fd should include FCS. Nodetype
must be one of PRI_NETWORK or PRI_CPE. switchtype should be PRI_SWITCH_* */
extern struct pri *pri_new(int fd, int nodetype, int switchtype);
struct pri *pri_new(int fd, int nodetype, int switchtype);
struct pri *pri_new_bri(int fd, int ptpmode, int nodetype, int switchtype);
/* Create D-channel just as above with user defined I/O callbacks and data */
extern struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata);
struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata);
/* Retrieve the user data associated with the D channel */
extern void *pri_get_userdata(struct pri *pri);
void *pri_get_userdata(struct pri *pri);
/* Set the user data associated with the D channel */
extern void pri_set_userdata(struct pri *pri, void *userdata);
void pri_set_userdata(struct pri *pri, void *userdata);
/* Set Network Specific Facility for PRI */
extern void pri_set_nsf(struct pri *pri, int nsf);
void pri_set_nsf(struct pri *pri, int nsf);
/* Set debug parameters on PRI -- see above debug definitions */
extern void pri_set_debug(struct pri *pri, int debug);
void pri_set_debug(struct pri *pri, int debug);
/* Get debug parameters on PRI -- see above debug definitions */
extern int pri_get_debug(struct pri *pri);
int pri_get_debug(struct pri *pri);
#define PRI_FACILITY_ENABLE
/* Enable transmission support of Facility IEs on the pri */
extern void pri_facility_enable(struct pri *pri);
void pri_facility_enable(struct pri *pri);
/* Run PRI on the given D-channel, taking care of any events that
need to be handled. If block is set, it will block until an event
occurs which needs to be handled */
extern pri_event *pri_dchannel_run(struct pri *pri, int block);
pri_event *pri_dchannel_run(struct pri *pri, int block);
/* Check for an outstanding event on the PRI */
pri_event *pri_check_event(struct pri *pri);
/* Give a name to a given event ID */
extern char *pri_event2str(int id);
char *pri_event2str(int id);
/* Give a name to a node type */
extern char *pri_node2str(int id);
char *pri_node2str(int id);
/* Give a name to a switch type */
extern char *pri_switch2str(int id);
char *pri_switch2str(int id);
/* Print an event */
extern void pri_dump_event(struct pri *pri, pri_event *e);
void pri_dump_event(struct pri *pri, pri_event *e);
/* Turn presentation into a string */
extern char *pri_pres2str(int pres);
char *pri_pres2str(int pres);
/* Turn numbering plan into a string */
extern char *pri_plan2str(int plan);
char *pri_plan2str(int plan);
/* Turn cause into a string */
extern char *pri_cause2str(int cause);
char *pri_cause2str(int cause);
/* Acknowledge a call and place it on the given channel. Set info to non-zero if there
is in-band data available on the channel */
extern int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
/* Send a digit in overlap mode */
extern int pri_information(struct pri *pri, q931_call *call, char digit);
int pri_information(struct pri *pri, q931_call *call, char digit);
#define PRI_KEYPAD_FACILITY_TX
/* Send a keypad facility string of digits */
int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits);
/* Answer the incomplete(call without called number) call on the given channel.
Set non-isdn to non-zero if you are not connecting to ISDN equipment */
extern int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
/* Answer the call on the given channel (ignored if you called acknowledge already).
Set non-isdn to non-zero if you are not connecting to ISDN equipment */
extern int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
/* Set CRV reference for GR-303 calls */
@@ -537,60 +546,60 @@ extern int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn
/* Hangup a call */
#define PRI_HANGUP
extern int pri_hangup(struct pri *pri, q931_call *call, int cause);
int pri_hangup(struct pri *pri, q931_call *call, int cause);
#define PRI_DESTROYCALL
extern void pri_destroycall(struct pri *pri, q931_call *call);
void pri_destroycall(struct pri *pri, q931_call *call);
#define PRI_RESTART
extern int pri_restart(struct pri *pri);
int pri_restart(struct pri *pri);
extern int pri_reset(struct pri *pri, int channel);
int pri_reset(struct pri *pri, int channel);
/* Create a new call */
extern q931_call *pri_new_call(struct pri *pri);
q931_call *pri_new_call(struct pri *pri);
/* Retrieve CRV reference for GR-303 calls. Returns >0 on success. */
extern int pri_get_crv(struct pri *pri, q931_call *call, int *callmode);
int pri_get_crv(struct pri *pri, q931_call *call, int *callmode);
/* Retrieve CRV reference for GR-303 calls. CRV must be >0, call mode should be 0 */
extern int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode);
int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode);
/* How long until you need to poll for a new event */
extern struct timeval *pri_schedule_next(struct pri *pri);
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);
extern int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
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,
char *called,int calledplan, int ulayer1);
extern struct pri_sr *pri_sr_new(void);
extern void pri_sr_free(struct pri_sr *sr);
struct pri_sr *pri_sr_new(void);
void pri_sr_free(struct pri_sr *sr);
extern int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
extern int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1);
extern int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
extern int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
extern int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1);
int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
#define PRI_USER_USER_TX
/* Set the user user field. Warning! don't send binary data accross this field */
extern void pri_sr_set_useruser(struct pri_sr *sr, char *userchars);
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
extern void pri_call_set_useruser(q931_call *sr, char *userchars);
void pri_call_set_useruser(q931_call *sr, const char *userchars);
extern int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
/* Set a call has a call indpendent signalling connection (i.e. no bchan) */
extern int pri_sr_set_connection_call_independent(struct pri_sr *req);
int pri_sr_set_connection_call_independent(struct pri_sr *req);
/* Send an MWI indication to a remote location. If activate is non zero, activates, if zero, decativates */
extern int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
/* Send an MWI indication to a remote location. If activate is non zero, activates, if zero, deactivates */
int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
/* Send an MWI deactivate request to a remote location */
extern int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
#define PRI_2BCT
/* Attempt to pass the channels back to the NET side if compatable and
@@ -599,30 +608,40 @@ int pri_channel_bridge(q931_call *call1, q931_call *call2);
/* Override message and error stuff */
#define PRI_NEW_SET_API
extern void pri_set_message(void (*__pri_error)(struct pri *pri, char *));
extern void pri_set_error(void (*__pri_error)(struct pri *pri, char *));
void pri_set_message(void (*__pri_error)(struct pri *pri, char *));
void pri_set_error(void (*__pri_error)(struct pri *pri, char *));
/* Set overlap mode */
#define PRI_SET_OVERLAPDIAL
extern void pri_set_overlapdial(struct pri *pri,int state);
void pri_set_overlapdial(struct pri *pri,int state);
/* QSIG logical channel mapping option, do not skip channel 16 */
#define PRI_SET_CHAN_MAPPING_LOGICAL
void pri_set_chan_mapping_logical(struct pri *pri, int state);
#define PRI_DUMP_INFO_STR
extern char *pri_dump_info_str(struct pri *pri);
char *pri_dump_info_str(struct pri *pri);
/* Get file descriptor */
extern int pri_fd(struct pri *pri);
int pri_fd(struct pri *pri);
#define PRI_PROGRESS
/* Send call proceeding */
extern int pri_progress(struct pri *pri, q931_call *c, int channel, int info);
/* Send progress */
int pri_progress(struct pri *pri, q931_call *c, int channel, int info);
/* Send progress with cause IE */
int pri_progress_with_cause(struct pri *pri, q931_call *c, int channel, int info, int cause);
#define PRI_PROCEEDING_FULL
/* Send call proceeding */
extern int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
/* Enable inband progress when a DISCONNECT is received */
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable);
/* Enslave a PRI to another, so they share the same call list
(and maybe some timers) */
extern void pri_enslave(struct pri *master, struct pri *slave);
void pri_enslave(struct pri *master, struct pri *slave);
#define PRI_GR303_SUPPORT
#define PRI_ENSLAVE_SUPPORT
@@ -633,20 +652,22 @@ extern void pri_enslave(struct pri *master, struct pri *slave);
#define PRI_ANI
/* Send notification */
extern int pri_notify(struct pri *pri, q931_call *c, int channel, int info);
int pri_notify(struct pri *pri, q931_call *c, int channel, int info);
int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason);
/* Get/Set PRI Timers */
#define PRI_GETSET_TIMERS
extern int pri_set_timer(struct pri *pri, int timer, int value);
extern int pri_get_timer(struct pri *pri, int timer);
extern int pri_timer2idx(char *timer);
int pri_set_timer(struct pri *pri, int timer, int value);
int pri_get_timer(struct pri *pri, int timer);
int pri_timer2idx(char *timer);
#define PRI_MAX_TIMERS 32
#define PRI_TIMER_N200 0 /* Maximum numer of q921 retransmissions */
#define PRI_TIMER_N201 1 /* Maximum numer of octets in an information field */
#define PRI_TIMER_N202 2 /* Maximum numer of transmissions of the TEI identity request message */
#define PRI_TIMER_K 3 /* Maximum number of outstanding I-frames */
#define PRI_TIMER_K 3 /* Maximum number of outstanding I-frames */
#define PRI_TIMER_T200 4 /* time between SABME's */
#define PRI_TIMER_T201 5 /* minimum time between retransmissions of the TEI Identity check messages */
@@ -674,4 +695,10 @@ extern int pri_timer2idx(char *timer);
#define PRI_TIMER_T321 26
#define PRI_TIMER_T322 27
#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

125
mkdep
View File

@@ -1,125 +0,0 @@
#!/bin/bash -
#
# $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
# $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
#
# Copyright (c) 1991, 1993
# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the University of
# California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
#
D=.depend # default dependency file is .depend
append=0
pflag=
while :
do case "$1" in
# -a appends to the depend file
-a)
append=1
shift ;;
# -f allows you to select a makefile name
-f)
D=$2
shift; shift ;;
# the -p flag produces "program: program.c" style dependencies
# so .o's don't get produced
-p)
pflag=p
shift ;;
*)
break ;;
esac
done
if [ $# = 0 ] ; then
echo 'usage: mkdep [-p] [-f depend_file] [cc_flags] file ...'
exit 1
fi
DTMP=/tmp/mkdep$$
TMP=$DTMP/mkdep
um=`umask`
umask 022
if ! mkdir $DTMP ; then
echo failed to create tmp dir $DTMP
exit 1
fi
umask $um
trap 'rm -rf $DTMP ; trap 2 ; kill -2 $$' 1 2 3 13 15
if [ x$pflag = x ]; then
${CC:-cc} -M "$@" 2>/dev/null | sed -e 's; \./; ;g' > $TMP
else
${CC:-cc} -M "$@" 2>/dev/null | sed -e 's;\.o :; :;' -e 's; \./; ;g' > $TMP
fi
if [ $? != 0 ]; then
echo 'mkdep: compile failed.'
rm -rf $DTMP
exit 1
fi
if [ $append = 1 ]; then
cat $TMP >> $D
if [ $? != 0 ]; then
echo 'mkdep: append failed.'
rm -rf $DTMP
exit 1
fi
cat $TMP | sed -e 's/\.o:/.lo:/g' >>$D
if [ $? != 0 ]; then
echo 'mkdep: append failed.'
rm -rf $DTMP
exit 1
fi
else
cat $TMP > $D
if [ $? != 0 ]; then
echo 'mkdep: overwrite failed.'
rm -rf $DTMP
exit 1
fi
cat $TMP | sed -e 's/\.o:/.lo:/g' >>$D
if [ $? != 0 ]; then
echo 'mkdep: append failed.'
rm -rf $DTMP
exit 1
fi
fi
rm -rf $DTMP
exit 0

196
pri.c
View File

@@ -86,7 +86,7 @@ char *pri_switch2str(int sw)
static void pri_default_timers(struct pri *pri, int switchtype)
{
int defaulttimers[20][PRI_MAX_TIMERS] = PRI_TIMERS_ALL;
static const int defaulttimers[20][PRI_MAX_TIMERS] = PRI_TIMERS_ALL;
int x;
for (x = 0; x<PRI_MAX_TIMERS; x++) {
@@ -192,73 +192,86 @@ static int __pri_write(struct pri *pri, void *buf, int buflen)
return res;
}
static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata)
/* 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;
p = malloc(sizeof(struct pri));
if (p) {
memset(p, 0, sizeof(struct pri));
p->fd = fd;
p->read_func = rd;
p->write_func = wr;
p->userdata = userdata;
p->localtype = node;
p->switchtype = switchtype;
p->cref = 1;
p->sapi = Q921_SAPI_CALL_CTRL;
p->tei = 0;
p->nsf = PRI_NSF_NONE;
p->protodisc = Q931_PROTOCOL_DISCRIMINATOR;
p->master = master;
p->callpool = &p->localpool;
pri_default_timers(p, switchtype);
#ifdef LIBPRI_COUNTERS
p->q921_rxcount = 0;
p->q921_txcount = 0;
p->q931_rxcount = 0;
p->q931_txcount = 0;
#endif
if (switchtype == PRI_SWITCH_GR303_EOC) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_EOC;
p->tei = Q921_TEI_GR303_EOC_OPS;
p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL);
if (!p->subchannel) {
free(p);
p = NULL;
}
} else if (switchtype == PRI_SWITCH_GR303_TMC) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_TMC_CALLPROC;
p->tei = Q921_TEI_GR303_TMC_CALLPROC;
p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL);
if (!p->subchannel) {
free(p);
p = NULL;
}
} else if (switchtype == PRI_SWITCH_GR303_TMC_SWITCHING) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_TMC_SWITCHING;
p->tei = Q921_TEI_GR303_TMC_SWITCHING;
} else if (switchtype == PRI_SWITCH_GR303_EOC_PATH) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_EOC;
p->tei = Q921_TEI_GR303_EOC_PATH;
}
/* Start Q.921 layer, Wait if we're the network */
if (p)
q921_start(p, p->localtype == PRI_CPE);
if (!(p = calloc(1, sizeof(*p))))
return NULL;
p->bri = bri;
p->fd = fd;
p->read_func = rd;
p->write_func = wr;
p->userdata = userdata;
p->localtype = node;
p->switchtype = switchtype;
p->cref = 1;
p->sapi = (tei == Q921_TEI_GROUP) ? Q921_SAPI_LAYER2_MANAGEMENT : Q921_SAPI_CALL_CTRL;
p->tei = tei;
p->nsf = PRI_NSF_NONE;
p->protodisc = Q931_PROTOCOL_DISCRIMINATOR;
p->master = master;
p->callpool = &p->localpool;
pri_default_timers(p, switchtype);
if (master) {
pri_set_debug(p, master->debug);
if (master->sendfacility)
pri_facility_enable(p);
}
#ifdef LIBPRI_COUNTERS
p->q921_rxcount = 0;
p->q921_txcount = 0;
p->q931_rxcount = 0;
p->q931_txcount = 0;
#endif
if (switchtype == PRI_SWITCH_GR303_EOC) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_EOC;
p->tei = Q921_TEI_GR303_EOC_OPS;
p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL, Q921_TEI_GR303_EOC_PATH, 0);
if (!p->subchannel) {
free(p);
p = NULL;
}
} else if (switchtype == PRI_SWITCH_GR303_TMC) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_TMC_CALLPROC;
p->tei = Q921_TEI_GR303_TMC_CALLPROC;
p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL, Q921_TEI_GR303_TMC_SWITCHING, 0);
if (!p->subchannel) {
free(p);
p = NULL;
}
} else if (switchtype == PRI_SWITCH_GR303_TMC_SWITCHING) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_TMC_SWITCHING;
p->tei = Q921_TEI_GR303_TMC_SWITCHING;
} else if (switchtype == PRI_SWITCH_GR303_EOC_PATH) {
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
p->sapi = Q921_SAPI_GR303_EOC;
p->tei = Q921_TEI_GR303_EOC_PATH;
}
/* Start Q.921 layer, Wait if we're the network */
if (p)
q921_start(p, p->localtype == PRI_CPE);
return p;
}
void pri_call_set_useruser(q931_call *c, char *userchars)
void pri_call_set_useruser(q931_call *c, const char *userchars)
{
if (userchars)
libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo));
}
void pri_sr_set_useruser(struct pri_sr *sr, char *userchars)
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars)
{
sr->useruserinfo = userchars;
}
@@ -267,7 +280,7 @@ int pri_restart(struct pri *pri)
{
/* Restart Q.921 layer */
if (pri) {
q921_reset(pri);
q921_reset(pri, 1);
q921_start(pri, pri->localtype == PRI_CPE);
}
return 0;
@@ -275,7 +288,15 @@ int pri_restart(struct pri *pri)
struct pri *pri_new(int fd, int nodetype, int switchtype)
{
return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL);
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 0);
}
struct pri *pri_new_bri(int fd, int ptpmode, int nodetype, int switchtype)
{
if (ptpmode)
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 1);
else
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_GROUP, 1);
}
struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata)
@@ -284,7 +305,7 @@ struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read,
io_read = __pri_read;
if (!io_write)
io_write = __pri_write;
return __pri_new(fd, nodetype, switchtype, NULL, io_read, io_write, userdata);
return __pri_new_tei(fd, nodetype, switchtype, NULL, io_read, io_write, userdata, Q921_TEI_PRI, 0);
}
void *pri_get_userdata(struct pri *pri)
@@ -462,10 +483,19 @@ int pri_proceeding(struct pri *pri, q931_call *call, int channel, int info)
return q931_call_proceeding(pri, call, channel, info);
}
int pri_progress_with_cause(struct pri *pri, q931_call *call, int channel, int info, int cause)
{
if (!pri || !call)
return -1;
return q931_call_progress_with_cause(pri, call, channel, info, cause);
}
int pri_progress(struct pri *pri, q931_call *call, int channel, int info)
{
if (!pri || !call)
return -1;
return q931_call_progress(pri, call, channel, info);
}
@@ -476,6 +506,23 @@ int pri_information(struct pri *pri, q931_call *call, char digit)
return q931_information(pri, call, digit);
}
int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits)
{
if (!pri || !call || !digits || !digits[0])
return -1;
return q931_keypad_facility(pri, call, digits);
}
int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason)
{
if (!pri || !call)
return -1;
return qsig_cf_callrerouting(pri, call, dest, original, reason);
}
int pri_notify(struct pri *pri, q931_call *call, int channel, int info)
{
if (!pri || !call)
@@ -547,6 +594,20 @@ int pri_channel_bridge(q931_call *call1, q931_call *call2)
else
return 0;
break;
case PRI_SWITCH_DMS100:
if (rlt_initiate_transfer(call1->pri, call1, call2))
return -1;
else
return 0;
break;
case PRI_SWITCH_QSIG:
call1->bridged_call = call2;
call2->bridged_call = call1;
if (anfpr_initiate_transfer(call1->pri, call1, call2))
return -1;
else
return 0;
break;
default:
return -1;
}
@@ -744,6 +805,17 @@ void pri_set_overlapdial(struct pri *pri,int state)
pri->overlapdial = state;
}
void pri_set_chan_mapping_logical(struct pri *pri, int state)
{
if (pri->switchtype == PRI_SWITCH_QSIG)
pri->chan_mapping_logical = state;
}
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable)
{
pri->acceptinbanddisconnect = (enable != 0);
}
int pri_fd(struct pri *pri)
{
return pri->fd;
@@ -782,10 +854,12 @@ char *pri_dump_info_str(struct pri *pri)
len += sprintf(buf + len, "Retrans: %d\n", pri->retrans);
len += sprintf(buf + len, "Busy: %d\n", pri->busy);
len += sprintf(buf + len, "Overlap Dial: %d\n", pri->overlapdial);
len += sprintf(buf + len, "Logical Channel Mapping: %d\n", pri->chan_mapping_logical);
len += sprintf(buf + len, "T200 Timer: %d\n", pri->timers[PRI_TIMER_T200]);
len += sprintf(buf + len, "T203 Timer: %d\n", pri->timers[PRI_TIMER_T203]);
len += sprintf(buf + len, "T305 Timer: %d\n", pri->timers[PRI_TIMER_T305]);
len += sprintf(buf + len, "T308 Timer: %d\n", pri->timers[PRI_TIMER_T308]);
len += sprintf(buf + len, "T309 Timer: %d\n", pri->timers[PRI_TIMER_T309]);
len += sprintf(buf + len, "T313 Timer: %d\n", pri->timers[PRI_TIMER_T313]);
len += sprintf(buf + len, "N200 Counter: %d\n", pri->timers[PRI_TIMER_N200]);
@@ -811,7 +885,7 @@ void pri_enslave(struct pri *master, struct pri *slave)
struct pri_sr *pri_sr_new(void)
{
struct pri_sr *req;
req = malloc(sizeof(struct pri_sr));
req = malloc(sizeof(*req));
if (req)
pri_sr_init(req);
return req;

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,7 @@
#ifndef _PRI_FACILITY_H
#define _PRI_FACILITY_H
#include "pri_q931.h"
/* Protocol Profile field */
#define Q932_PROTOCOL_ROSE 0x11 /* X.219 & X.229 */
@@ -40,7 +41,10 @@
/* Argument values */
#define ROSE_NAME_PRESENTATION_ALLOWED_SIMPLE 0x80
#define ROSE_NAME_PRESENTATION_RESTRICTED_NULL 0x87
#define ROSE_NAME_NOT_AVAIL 0x84
#define ROSE_NAME_PRESENTATION_ALLOWED_EXTENDED 0xA1
#define ROSE_NAME_PRESENTATION_RESTRICTED_SIMPLE 0xA2
#define ROSE_NAME_PRESENTATION_RESTRICTED_EXTENDED 0xA3
#define ROSE_NAME_NOT_AVAIL 0x84
/* Component types */
#define COMP_TYPE_INTERPRETATION 0x8B
@@ -52,6 +56,15 @@
#define COMP_TYPE_NFE 0xAA
/* Operation ID values */
/* Q.952.7 (ECMA-178) ROSE operations (Transfer) */
#define ROSE_CALL_TRANSFER_IDENTIFY 7
#define ROSE_CALL_TRANSFER_ABANDON 8
#define ROSE_CALL_TRANSFER_INITIATE 9
#define ROSE_CALL_TRANSFER_SETUP 10
#define ROSE_CALL_TRANSFER_ACTIVE 11
#define ROSE_CALL_TRANSFER_COMPLETE 12
#define ROSE_CALL_TRANSFER_UPDATE 13
#define ROSE_SUBADDRESS_TRANSFER 14
/* Q.952 ROSE operations (Diverting) */
#define ROSE_DIVERTING_LEG_INFORMATION1 18
#define ROSE_DIVERTING_LEG_INFORMATION2 0x15
@@ -68,6 +81,7 @@
#define ROSE_AOC_IDENTIFICATION_OF_CHARGE 37
/* Q.SIG operations */
#define SS_CNID_CALLINGNAME 0
#define SS_ANFPR_PATHREPLACEMENT 4
#define SS_DIVERTING_LEG_INFORMATION2 21
#define SS_MWI_ACTIVATE 80
#define SS_MWI_DEACTIVATE 81
@@ -124,7 +138,7 @@
#define ASN1_CLAN_MASK 0xc0
#define ASN1_UNIVERSAL 0x00
#define ASN1_APPLICATION 0x40
#define ASN1_CONTEXT_SPECIFIC 0x80
#define ASN1_CONTEXT_SPECIFIC 0x80
#define ASN1_PRIVATE 0xc0
/* ASN.1 Length masks */
@@ -155,30 +169,44 @@
#define Q932_TON_SUBSCRIBER 0x04
#define Q932_TON_ABBREVIATED 0x06
/* RLT related Operations */
#define RLT_SERVICE_ID 0x3e
#define RLT_OPERATION_IND 0x01
#define RLT_THIRD_PARTY 0x02
struct rose_component {
u_int8_t type;
u_int8_t len;
u_int8_t data[0];
};
#define GET_COMPONENT(component, idx, ptr, length) \
#if 1
#define GET_COMPONENT(component, idx, ptr, length) \
if ((idx)+2 > (length)) \
break; \
(component) = (struct rose_component*)&((ptr)[idx]); \
if ((idx)+(component)->len+2 > (length)) { \
if ((component)->len != ASN1_LEN_INDEF) \
pri_message(pri, "Length (%d) of 0x%X component is too long\n", (component)->len, (component)->type); \
}
#else /* Debugging */
#define GET_COMPONENT(component, idx, ptr, length) \
if ((idx)+2 > (length)) \
break; \
(component) = (struct rose_component*)&((ptr)[idx]); \
if ((idx)+(component)->len+2 > (length)) { \
if ((component)->len != 128) \
pri_message(pri, "Length (%d) of 0x%X component is too long\n", (component)->len, (component)->type); \
}
/*
pri_message("XX Got component %d (0x%02X), length %d\n", (component)->type, (component)->type, (component)->len); \
} \
pri_message(pri, "XX %s:%d Got component %d (0x%02X), length %d\n", __FUNCTION__, __LINE__, (component)->type, (component)->type, (component)->len); \
if ((component)->len > 0) { \
int zzz; \
pri_message("XX Data:"); \
pri_message(pri, "XX Data:"); \
for (zzz = 0; zzz < (component)->len; ++zzz) \
pri_message(" %02X", (component)->data[zzz]); \
pri_message("\n"); \
pri_message(pri, " %02X", (component)->data[zzz]); \
pri_message(pri, "\n"); \
}
*/
#endif
#define NEXT_COMPONENT(component, idx) \
(idx) += (component)->len + 2
@@ -189,6 +217,7 @@ struct rose_component {
#define CHECK_COMPONENT(component, comptype, message) \
if ((component)->type && ((component)->type & ASN1_TYPE_MASK) != (comptype)) { \
pri_message(pri, (message), (component)->type); \
asn1_dump(pri, (component), (component)->len+2); \
break; \
}
@@ -249,35 +278,53 @@ struct rose_component {
(stack)[(stackpointer)]->len = (unsigned char *)&((data)[(idx)]) - (unsigned char *)(stack)[(stackpointer)] - 2; \
} while (0)
/* Decoder for the invoke part of a ROSE request */
extern int rose_invoke_decode(struct pri *pri, struct q931_call *call, unsigned char *data, int len);
/* Decoder for the invoke ROSE component */
int rose_invoke_decode(struct pri *pri, struct q931_call *call, q931_ie *ie, unsigned char *data, int len);
extern int asn1_copy_string(char * buf, int buflen, struct rose_component *comp);
/* Decoder for the return result ROSE component */
int rose_return_result_decode(struct pri *pri, struct q931_call *call, q931_ie *ie, unsigned char *data, int len);
extern int asn1_string_encode(unsigned char asn1_type, void *data, int len, int max_len, void *src, int src_len);
/* Decoder for the return error ROSE component */
int rose_return_error_decode(struct pri *pri, struct q931_call *call, q931_ie *ie, unsigned char *data, int len);
/* Decoder for the reject ROSE component */
int rose_reject_decode(struct pri *pri, struct q931_call *call, q931_ie *ie, unsigned char *data, int len);
int asn1_copy_string(char * buf, int buflen, struct rose_component *comp);
int asn1_string_encode(unsigned char asn1_type, void *data, int len, int max_len, void *src, int src_len);
/* Get Name types from ASN.1 */
extern int asn1_name_decode(void * data, int len, char *namebuf, int buflen);
int asn1_name_decode(void * data, int len, char *namebuf, int buflen);
extern int typeofnumber_from_q931(struct pri *pri, int ton);
int typeofnumber_from_q931(struct pri *pri, int ton);
extern int redirectingreason_from_q931(struct pri *pri, int redirectingreason);
int redirectingreason_from_q931(struct pri *pri, int redirectingreason);
/* Queues an MWI apdu on a the given call */
extern int mwi_message_send(struct pri *pri, q931_call *call, struct pri_sr *req, int activate);
int mwi_message_send(struct pri *pri, q931_call *call, struct pri_sr *req, int activate);
/* starts a 2BCT */
extern int eect_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
int eect_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
/* Use this function to queue a facility-IE born ADPU onto a call
int rlt_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest, const char* original, const char* reason);
/* starts a QSIG Path Replacement */
int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
/* Use this function to queue a facility-IE born APDU onto a call
* call is the call to use, messagetype is any one of the Q931 messages,
* apdu is the apdu data, apdu_len is the length of the apdu data */
extern int pri_call_apdu_queue(q931_call *call, int messagetype, void *apdu, int apdu_len, void (*function)(void *data), void *data);
int pri_call_apdu_queue(q931_call *call, int messagetype, void *apdu, int apdu_len, void (*function)(void *data), void *data);
/* Used by q931.c to cleanup the apdu queue upon destruction of a call */
extern int pri_call_apdu_queue_cleanup(q931_call *call);
int pri_call_apdu_queue_cleanup(q931_call *call);
/* Adds the "standard" ADPUs to a call */
extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call);
/* Adds the "standard" APDUs to a call */
int pri_call_add_standard_apdus(struct pri *pri, q931_call *call);
int asn1_dump(struct pri *pri, void *comp, int len);
#endif /* _PRI_FACILITY_H */

View File

@@ -33,6 +33,9 @@
#include <stddef.h>
#include <sys/time.h>
#define DBGHEAD __FILE__ ":%d %s: "
#define DBGINFO __LINE__,__PRETTY_FUNCTION__
struct pri_sched {
struct timeval when;
void (*callback)(void *data);
@@ -66,6 +69,8 @@ struct pri {
int sapi;
int tei;
int protodisc;
unsigned int bri:1;
unsigned int acceptinbanddisconnect:1; /* Should we allow inband progress after DISCONNECT? */
/* Q.921 State */
int q921_state;
@@ -85,7 +90,11 @@ 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;
int ri;
int t200_timer; /* T-200 retransmission timer */
/* All ISDN Timer values */
int timers[MAX_TIMERS];
@@ -105,6 +114,9 @@ struct pri {
/* do we do overlap dialing */
int overlapdial;
/* do not skip channel 16 */
int chan_mapping_logical;
#ifdef LIBPRI_COUNTERS
/* q921/q931 packet counters */
unsigned int q921_txcount;
@@ -135,7 +147,8 @@ struct pri_sr {
int redirectingpres;
int redirectingreason;
int justsignalling;
char *useruserinfo;
const char *useruserinfo;
int transferable;
};
/* Internal switch types */
@@ -212,7 +225,7 @@ struct q931_call {
char callernum[256];
char callername[256];
char digitbuf[64]; /* Buffer for digits that come in KEYPAD_FACILITY */
char keypad_digits[64]; /* Buffer for digits that come in KEYPAD_FACILITY */
int ani2; /* ANI II */
@@ -245,6 +258,12 @@ struct q931_call {
long aoc_units; /* Advice of Charge Units */
struct apdu_event *apdus; /* APDU queue for call */
int transferable;
unsigned int rlt_call_id; /* RLT call id */
/* Bridged call info */
q931_call *bridged_call; /* Pointer to other leg of bridged call */
};
extern int pri_schedule_event(struct pri *pri, int ms, void (*function)(void *data), void *data);
@@ -261,4 +280,8 @@ extern void pri_error(struct pri *pri, char *fmt, ...);
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

View File

@@ -51,10 +51,11 @@
#define Q921_FRAMETYPE_I 0x0
#define Q921_FRAMETYPE_S 0x1
#define Q921_TEI_GROUP 127
#define Q921_TEI_GROUP 127
#define Q921_TEI_PRI 0
#define Q921_TEI_GR303_EOC_PATH 0
#define Q921_TEI_GR303_EOC_OPS 4
#define Q921_TEI_GR303_TMC_SWITCHING 0
#define Q921_TEI_GR303_TMC_SWITCHING 0
#define Q921_TEI_GR303_TMC_CALLPROC 0
#define Q921_SAPI_CALL_CTRL 0
@@ -68,6 +69,14 @@
#define Q921_SAPI_LAYER2_MANAGEMENT 63
#define Q921_TEI_IDENTITY_REQUEST 1
#define Q921_TEI_IDENTITY_ASSIGNED 2
#define Q921_TEI_IDENTITY_DENIED 3
#define Q921_TEI_IDENTITY_CHECK_REQUEST 4
#define Q921_TEI_IDENTITY_CHECK_RESPONSE 5
#define Q921_TEI_IDENTITY_REMOVE 6
#define Q921_TEI_IDENTITY_VERIFY 7
typedef struct q921_header {
#if __BYTE_ORDER == __BIG_ENDIAN
u_int8_t sapi:6; /* Service Access Point Indentifier (always 0 for PRI) (0) */
@@ -159,6 +168,12 @@ typedef struct q921_frame {
#define Q921_INC(j) (j) = (((j) + 1) % 128)
typedef enum q921_state {
Q921_DOWN = 0,
Q921_TEI_UNASSIGNED,
Q921_TEI_AWAITING_ESTABLISH,
Q921_TEI_AWAITING_ASSIGN,
Q921_TEI_ASSIGNED,
Q921_NEGOTIATION,
Q921_LINK_CONNECTION_RELEASED, /* Also known as TEI_ASSIGNED */
Q921_LINK_CONNECTION_ESTABLISHED,
Q921_AWAITING_ESTABLISH,
@@ -171,7 +186,7 @@ extern void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx
/* Bring up the D-channel */
extern void q921_start(struct pri *pri, int now);
extern void q921_reset(struct pri *pri);
extern void q921_reset(struct pri *pri, int reset_iqueue);
extern pri_event *q921_receive(struct pri *pri, q921_h *h, int len);

View File

@@ -248,10 +248,16 @@ typedef struct q931_ie {
/* EuroISDN */
#define Q931_SENDING_COMPLETE 0xa1
/* Q.SIG specific */
#define QSIG_IE_TRANSIT_COUNT 0x31
extern int q931_receive(struct pri *pri, q931_h *h, int len);
extern int q931_alerting(struct pri *pri, q931_call *call, int channel, int info);
extern int q931_call_progress_with_cause(struct pri *pri, q931_call *call, int channel, int info, int cause);
extern int q931_call_progress(struct pri *pri, q931_call *call, int channel, int info);
extern int q931_notify(struct pri *pri, q931_call *call, int channel, int info);
@@ -262,6 +268,8 @@ extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int non
extern int q931_information(struct pri *pri, q931_call *call, char digit);
extern int q931_keypad_facility(struct pri *pri, q931_call *call, char *digits);
extern int q931_connect(struct pri *pri, q931_call *call, int channel, int nonisdn);
extern int q931_release(struct pri *pri, q931_call *call, int cause);
@@ -284,5 +292,7 @@ extern int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req);
extern void q931_dump(struct pri *pri, q931_h *h, int len, int txrx);
extern void __q931_destroycall(struct pri *pri, q931_call *c);
extern void q931_dl_indication(struct pri *pri, int event);
#endif

View File

@@ -31,34 +31,37 @@
#define _PRI_TIMERS_H
/* -1 means we dont currently support the timer/counter */
#define PRI_TIMERS_DEFAULT { 3, /* N200 */ \
-1, /* N201 */ \
-1, /* N202 */ \
7, /* K */ \
#define PRI_TIMERS_DEFAULT { \
3, /* N200 */ \
-1, /* N201 */ \
3, /* N202 */ \
7, /* K */ \
1000, /* T200 */ \
-1, /* T201 */ \
-1, /* T202 */ \
-1, /* T201 */ \
10000, /* T202 */ \
10000, /* T203 */ \
-1, /* T300 */ \
-1, /* T301 */ \
-1, /* T302 */ \
-1, /* T303 */ \
-1, /* T304 */ \
-1, /* T300 */ \
-1, /* T301 */ \
-1, /* T302 */ \
-1, /* T303 */ \
-1, /* T304 */ \
30000, /* T305 */ \
-1, /* T306 */ \
-1, /* T307 */ \
-1, /* T306 */ \
-1, /* T307 */ \
4000, /* T308 */ \
-1, /* T309 */ \
-1, /* T310 */ \
-1, /* T309 */ \
-1, /* T310 */ \
4000, /* T313 */ \
-1, /* T314 */ \
-1, /* T316 */ \
-1, /* T317 */ \
-1, /* T318 */ \
-1, /* T319 */ \
-1, /* T320 */ \
-1, /* T321 */ \
-1 /* T322 */ \
-1, /* T314 */ \
-1, /* T316 */ \
-1, /* T317 */ \
-1, /* T318 */ \
-1, /* T319 */ \
-1, /* T320 */ \
-1, /* T321 */ \
-1, /* T322 */ \
2500, /* TM20 - Q.921 Appendix IV */ \
3, /* NM20 - Q.921 Appendix IV */ \
}
/* XXX Only our default timers are setup now XXX */

View File

@@ -42,11 +42,7 @@
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/types.h>
#if defined(__linux__)
#include <linux/zaptel.h>
#elif defined(__FreeBSD__)
#include <zaptel.h>
#endif
#include <zaptel/zaptel.h>
#include "libpri.h"
#include "pri_q921.h"
#include "pri_q931.h"

View File

@@ -40,6 +40,9 @@ int pri_schedule_event(struct pri *pri, int ms, void (*function)(void *data), vo
{
int x;
struct timeval tv;
/* Scheduling runs on master channels only */
while (pri->master)
pri = pri->master;
for (x=1;x<MAX_SCHED;x++)
if (!pri->pri_sched[x].callback)
break;
@@ -118,6 +121,8 @@ pri_event *pri_schedule_run(struct pri *pri)
void pri_schedule_del(struct pri *pri,int id)
{
while (pri->master)
pri = pri->master;
if ((id >= MAX_SCHED) || (id < 0))
pri_error(pri, "Asked to delete sched id %d???\n", id);
pri->pri_sched[id].callback = NULL;

View File

@@ -45,11 +45,7 @@
#include <sys/wait.h>
#include <sys/resource.h>
#include <sys/time.h>
#if defined(__linux__)
#include <linux/zaptel.h>
#elif defined(__FreeBSD__)
#include <zaptel.h>
#endif
#include <zaptel/zaptel.h>
#include <zap.h>
#include "libpri.h"
@@ -303,7 +299,7 @@ static int run_pri(int dfd, int swtype, int node)
fd_set rfds, efds;
int res,x;
pri = pri_new(dfd, node, swtype);
pri = pri_new_bri(dfd, 1, node, swtype);
if (!pri) {
fprintf(stderr, "Unable to create PRI\n");
return -1;

701
q921.c

File diff suppressed because it is too large Load Diff

729
q931.c

File diff suppressed because it is too large Load Diff

View File

@@ -48,11 +48,7 @@
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/socket.h>
#if defined(__linux__)
#include <linux/zaptel.h>
#elif defined(__FreeBSD__) || defined(SOLARIS)
#include <zaptel.h>
#endif
#include <zaptel/zaptel.h>
#ifndef SOLARIS
#include <zap.h>
#endif
@@ -74,7 +70,7 @@ static struct pri *first, *cur;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
#define TEST_CALLS 32
#define TEST_CALLS 1
static void event1(struct pri *pri, pri_event *e)
{
@@ -153,7 +149,7 @@ static void event2(struct pri *pri, pri_event *e)
}
}
static void testmsg(char *s)
static void testmsg(struct pri *pri, char *s)
{
char *c;
static int keeplast = 0;
@@ -179,7 +175,7 @@ static void testmsg(char *s)
keeplast = 0;
}
static void testerr(char *s)
static void testerr(struct pri *pri, char *s)
{
char *c;
static int keeplast = 0;
@@ -242,9 +238,9 @@ static void *dchan(void *data)
}
if (e) {
if (first == pri) {
event1(pri, e);
event1(e->gen.pri, e);
} else {
event2(pri, e);
event2(e->gen.pri, e);
}
}
pthread_mutex_unlock(&lock);
@@ -264,21 +260,23 @@ int main(int argc, char *argv[])
perror("socketpair");
exit(1);
}
if (!(pri = pri_new(pair[0], PRI_NETWORK, PRI_DEF_SWITCHTYPE))) {
if (!(pri = pri_new_bri(pair[0], 0, PRI_NETWORK, PRI_DEF_SWITCHTYPE))) {
perror("pri(0)");
exit(1);
}
first = pri;
pri_set_debug(pri, DEBUG_LEVEL);
pri_facility_enable(pri);
if (pthread_create(&tmp, NULL, dchan, pri)) {
perror("thread(0)");
exit(1);
}
if (!(pri = pri_new(pair[1], PRI_CPE, PRI_DEF_SWITCHTYPE))) {
if (!(pri = pri_new_bri(pair[1], 0, PRI_CPE, PRI_DEF_SWITCHTYPE))) {
perror("pri(1)");
exit(1);
}
pri_set_debug(pri, DEBUG_LEVEL);
pri_facility_enable(pri);
if (pthread_create(&tmp, NULL, dchan, pri)) {
perror("thread(1)");
exit(1);