Commit Graph

57 Commits

Author SHA1 Message Date
Matthew Fredrickson
3d5f9e762a It's amazing what a tiny bug in the Q.921 SDL diagram can do to cause trouble.... Fix issue where V_R was not reset and N_R was consequentially transmitted incorrectly. Particularly in layer 2 initiated re-establishments.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1702 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-19 21:30:34 +00:00
Richard Mudgett
ca0fc1a99d Avoid using a cast.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1665 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-26 16:59:05 +00:00
Richard Mudgett
7babaeb2fe Fix potential crash when pridump.c calls q921_dump() with NULL pri ptr.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1625 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-19 22:08:50 +00:00
Richard Mudgett
d5d69dddac Miscellaneous simple reorganization.
1) Make PRI_MASTER() no longer check for a NULL parameter.  It is the
caller's responsibility.  Not many callers could have passed a NULL
without crashing before or after anyway.

2) Replace calls to q931_is_ptmp() with PTMP_MODE().  They were
equivalent.

3) Made the following boolean config options bit fields: sendfacility,
overlapdial, chan_mapping_logical, and service_message_support.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1534 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-03-17 17:47:53 +00:00
Richard Mudgett
68a107a3e3 Restore ability to change the Q.921 K value.
The Q.921 rewrite only used value of PRI_TIMER_K right after it was set to
the default.  The Q.921 window size was thus no longer alterable by the
user.

(closes issue #16909)
Reported by: alecdavis
Patches:
      pritimer.libpri.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1511 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-03-02 23:47:12 +00:00
Matthew Fredrickson
9d9412e681 Revert useless check of pri->t200_timer value, since scheduler routines check the value anyways.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1476 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-08 23:29:51 +00:00
Matthew Fredrickson
a09da00b0a Make sure we set the l3initiated flag when PTP links are attempted to be re-established
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1470 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-08 22:14:17 +00:00
Matthew Fredrickson
6443238ed0 Sense of statement was inverted from what it should have been. Might have caused false T200 operation on reception of I-frames.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1457 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-29 21:55:52 +00:00
Richard Mudgett
f80fa82b33 Only set eres if there actually is an event to pass up.
(issue 16713)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1451 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-29 19:32:58 +00:00
Matthew Fredrickson
3995397fa3 Fix bug in which an event was lost if an I-frame was received during a timer recovery state (related to #16713)
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1445 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-29 17:27:43 +00:00
Richard Mudgett
cec71a81e5 Don't be so noisy when D channel is down.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1439 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-26 21:04:48 +00:00
Richard Mudgett
7dd6494c61 Fix TE PTMP side sending FACILITY messages on the dummy call reference.
Only the NT PTMP side can send Q.931 broadcast messages.

Also removed an inaccurate comment in Q.921 and made
q921_mdl_handle_error_callback() call the correct struct pri free
function.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1426 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-19 21:53:31 +00:00
Richard Mudgett
79fbecc5ae Make some debugging messages conditional and some minor reformating changes.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1414 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-15 18:28:54 +00:00
Matthew Fredrickson
4d3bb14731 Merge of Q.921 rewrite branch for wider testing.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1406 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-01-13 19:37:59 +00:00
Matthew Fredrickson
80c8c46b89 Make sure we also revive links for PRIs, not just PTMP TE BRIs when we get a disconnect message
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1291 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-11 00:22:47 +00:00
Matthew Fredrickson
44ad020fe8 Re-add back in support for TE initiated layer 2 activation
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1276 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-10 20:25:02 +00:00
Richard Mudgett
a2dcb6adba Add BRI PTMP NT mode, HOLD/RETRIEVE, Call rerouting/deflection, and keypad facility support.
* Added support for BRI PTMP NT mode.  (Overlap dialing NT -> TE not supported.)
* Added handling of received HOLD/RETRIEVE messages and the optional ability
  to transfer a held call on disconnect similar to an analog phone.
* Added CallRerouting/CallDeflection support for Q.SIG, ETSI PTP, ETSI PTMP.
  Will reroute/deflect an outgoing call when receive the message.
  Can use the DAHDISendCallreroutingFacility to send the message for the
  supported switches.
* Added ability to send/receive keypad digits in the SETUP message.
  Send keypad digits in SETUP message: Dial(DAHDI/g1[/K<keypad_digits>][/extension])
  Access any received keypad digits in SETUP message by: ${CHANNEL(keypad_digits)}

(closes issue #15048)
Tested by: rmudgett, mattf


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1242 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-23 19:50:45 +00:00
Richard Mudgett
175c1e470f Merged revisions 1143, 1144 from
https://origsvn.digium.com/svn/libpri/tags/1.4.10.2

  ..........
  r1144 | mattf | 2009-09-29 10:32:23 -0500 (Tue, 29 Sep 2009) | 1 line

  This fix is more like the fix that was used to resolve the issue for the PRI case
  ..........
  r1143 | mattf | 2009-09-28 14:07:01 -0500 (Mon, 28 Sep 2009) | 1 line

  Changes for 1.4.10.2
  ..........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1151 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-07 18:33:09 +00:00
Matthew Fredrickson
25b2496b0f Output multiline output with multiple calls to pri_message, so that logs look normal in Asterisk
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1077 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-14 22:32:40 +00:00
Richard Mudgett
6d9c1cb0d9 Optimized calls to pri_schedule_del().
There is no need to test if a scheduled event is running before calling
pri_schedule_del().


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1060 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-02 20:04:03 +00:00
Matthew Fredrickson
3a1739883b 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/branches/1.4@859 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-06-09 19:47:05 +00:00
Richard Mudgett
ac40946c11 Comment changes.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@782 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-05-01 22:47:41 +00:00
Jeff Peeler
18fa4716a5 Add service maintenance message support
This adds support for two new message types: Service and Service Acknowledge.
When a channel receives a service message it will either take the channel in
or out of service and then send a service acknowledgment. Although not
enforced here (enforced in chan_dahdi), the service messages are only supported
with switch types 4ess/5ess. The required Asterisk changes will be coming next.

(issue #3450)
Reported by: cmaj


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@732 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-04-14 15:05:21 +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
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
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
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
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
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
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
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
Kevin P. Fleming
f622f51004 use libpri_copy_string() (same as ast_copy_string()) instead of strncpy
update file headers for proper copyrights and licenses
various other minor optimizations


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@230 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-06-21 22:47:39 +00:00
Matthew Fredrickson
64088fe864 PRI debug additions -- testing...
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@219 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-05-23 15:06:33 +00:00
Mark Spencer
23a638cf66 Allow PRI to support callback functions (Diana's patch, placed in public domain)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@202 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-03-17 15:46:23 +00:00
Mark Spencer
a6977c6ddb Complete port to solaris (bug #3062)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@168 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-12-15 20:15:28 +00:00
James Golovich
ba5a5ca907 Allow PRI timers to be congfigurable. (bug 2518)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@138 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-10-02 14:55:20 +00:00
Mark Spencer
748702c5c5 Don't seg when out of memory (bug #2120)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@129 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-07-23 16:04:01 +00:00
Mark Spencer
6dd859f5de Don't process subchannels by default
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@128 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-07-16 02:14:04 +00:00
Mark Spencer
de0e6ba4cc Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@106 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-06-07 17:00:29 +00:00
Mark Spencer
30d983f45f More GR-303 fixes, detect drop of D-channel
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@105 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-06-07 15:55:39 +00:00
Mark Spencer
f065327cc1 Major changes in preparation for GR-303 and NFAS support
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@101 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-06-05 06:50:55 +00:00
Mark Spencer
c591726079 We have to update n_r when transmitting backlogged packets
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@91 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-05-17 03:32:11 +00:00
Mark Spencer
f2eb8afb7f Revert jcdutton's changes which are not subject to be disclaimed
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@87 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-04-11 01:55:54 +00:00
Mark Spencer
8da0a1e5a7 Debug improvements (bug #1329)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@86 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-04-11 01:27:11 +00:00
James Golovich
949afd2385 Format q921 log string before printing. Fixes those annoying half patch
packet decodes when logging data with something like script or tee


git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@84 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-04-05 08:22:14 +00:00
Mark Spencer
91b4a60c1f Add test program for windowing, implement proper windowing
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@79 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-03-29 08:09:01 +00:00