Commit Graph

507 Commits

Author SHA1 Message Date
Richard Mudgett
5ff4710e77 Make some internal routines available to other libpri components.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1596 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-15 18:43:37 +00:00
Richard Mudgett
9a7686d792 Only one PROCEEDING message per call please.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1577 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-09 21:43:42 +00:00
Richard Mudgett
ba4d759752 Move a comment closer to where it has relevance.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1547 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-03-18 15:50:19 +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
Richard Mudgett
307264f7c6 Must send DISCONNECT if we have sent a response to a SETUP message.
Q.931 Section 5.3.2 a) says we send a RELEASE_COMPLETE to reject a call
SETUP if we have not already sent a message in response to the SETUP
message.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1489 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-11 21:47:24 +00:00
Richard Mudgett
2ec071bae6 Minor comment changes.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1488 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-11 21:40:35 +00:00
Wendell Thompson
d4354b4873 Added CPUARCH option for selecting a 32-bit build from the command line.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1482 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-11 17:35:49 +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
Richard Mudgett
748c69e160 pri_restart() is no longer needed since the Q.921 rewrite.
Don't output error message for a deprecated function.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1464 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-02-05 23:34:54 +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
Richard Mudgett
14f04072c8 Extracted q931_fill_ring_event() from post_handle_q931_message().
Done so it is easier to see what was done in ccbs branch.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1374 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-12-09 20:59:16 +00:00
Richard Mudgett
46df6d2cd4 Fix debug output so built up output lines are readable again.
A recent change to Asterisk put the span number at the begining of each
line.  This is a good thing if you need to debug multiple spans or forget
which span you are debugging.  Unfortunately, any pri_message() output
that is not a complete line is messed up.

The pri_message() function now will accumulate line output until a '\n' is
seen on the end.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1351 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-21 02:40:23 +00:00
Richard Mudgett
b9397c7541 Delay processing of facility ie's after all other ie's are processed.
*  Some ROSE message processing depends on the presence of other ies.  The
DivertingLegInformation1, and 3 messages will be used as the default
connected line number if the connected number ie is not present.  The
redirecting number ie is used as a default to the redirecting number in
the DivertingLegInformation2 message if the ROSE message does not contain
it and the redirecting number ie is present.

*  Some ROSE message processing depends upon other ie values.  The
StatusRequest, CCBS-T-Call, and CcRingout messages collectively need the
BC, HLC, LLC, called number, called subaddress, calling number, and
calling subaddress ie information to be available.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1345 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-20 23:42:40 +00:00
Richard Mudgett
04d911112d Merged revision 1328 from
https://origsvn.digium.com/svn/libpri/team/mattf/libpri-1.4-q921-rewrite

..........
  r1328 | mattf | 2009-11-17 15:16:11 -0600 (Tue, 17 Nov 2009) | 1 line

  outboundbroadcast isn't set at this time, since it is set after the
  message is transmited, so we must use other criteria to determine the need
  for broadcast on a setup
..........


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1331 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-18 00:36:20 +00:00
Richard Mudgett
b698032e04 Reimplement callback mechanism to handle APDU response messages that we care about.
1) No sent messages will remain in the APDU queue unless they have an
active timer to remove them.  The dummy call reference call and global
call reference call structures will not act like a memory leak to sent
messages.

2) The new T-RESPONSE timer will be the generic response guard if the
standards do not otherwise specify a timer for a message response.

3) The callback will be called.  If it is called because of a response
message, then the callback has an opportunity to indicate if more
responses are expected.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1322 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-14 00:20:53 +00:00
Richard Mudgett
62d35faf6b We now have 32 timers. No need to reserve minimum space anymore.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1316 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-13 23:46:57 +00:00
Richard Mudgett
d305dbc609 There must be only one source for the invoke id values per D channel group.
If there are potentially multiple sources for the invoke id sequence then
we could get confused if there are multiple outstanding messages with the
same invoke id that get responses.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1310 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-13 22:59:35 +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
Richard Mudgett
6a121d4c74 The facility ie queue needs to remove facilities that have been sent.
The facility ie queue needs to remove facilities that have been sent.
Otherwise, the queue just grows until the call is terminated.  AOC
messages can clog the queue during a long call and the dummy call
reference may never be deleted.

Also removed unneeded elements of struct apdu_event.  The callback
function was not a good idea since many facility messages do not have
responses and the callback would prevents removal of events from the list.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1283 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-10 21:51:26 +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
e23ea9568c Add dummy call reference support.
Fixes problem where PTMP NT mode responds erroneously to a FACILITY
message from a phone on the dummy call reference.  LibPRI behaved as if
the dummy call reference were an invalid call reference and proceeded to
respond on the global call reference.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1275 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-10 19:27:34 +00:00
Richard Mudgett
c7c670aa85 Remove unused callingsubaddr[].
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1268 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-09 20:53:10 +00:00
Richard Mudgett
618acf9d53 Unknown IE 50 (cs5, Unknown Information Element)
Add code to recognize the code set 5 ie 50 (calling party category) to
suppress the unknown IE message.

(closes issue #13828)
Reported by: fdecher
Patches:
      libpri_ie50_cs5-trunk.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1261 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-03 17:19:20 +00:00
Richard Mudgett
9f39144986 NT PTMP did not report busy when calling a busy phone.
The caller would not get a busy indication when calling a busy phone.
Timer T303 is not supposed to be stopped when RELEASE_COMPLETE received.
When T303 expires we will now report the last clearing cause code to the
caller if we received one.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1255 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-11-02 23:28:59 +00:00
Richard Mudgett
16f2f02ce8 Add subaddress handling to existing messages and functions.
Connected line updates when transfering calls does not completely support
subaddresses yet.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1249 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-23 23:47:58 +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
a78ee730c9 Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing
"desk to desk" between offices each with an asterisk box over the ISDN
should then be possible, without a whole load of DDI numbers required.

(closes issue #15604)
Reported by: alecdavis
Patches:
      libpri_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585)
      Some minor modificatons were made.
Tested by: alecdavis, rmudgett

Review:	https://reviewboard.asterisk.org/r/406/


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1230 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-22 16:16:50 +00:00
Richard Mudgett
6cb01561eb Fix call state ie transmission.
Sending a STATUS message failed to include the call state ie for some
reason.  We will now always send a call state ie when a message ie list
includes one.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1220 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-19 22:49:59 +00:00
Richard Mudgett
5537dbec1d Fix comparision of invalid party name and number structs in comparison functions.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1219 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-19 22:38:32 +00:00
Richard Mudgett
0c210c19fa Take diverted-to-number from DivLegInfo1 and use it as connected number.
If no connected number is signaled in the CONNECT message we will use the
last diverted to number.

(issue #14292)
Reported by: tomaso
Patches:
      divleginfo1_to_connectednum.patch uploaded by tomaso (license 564)
      (Used as a guide since it no longer will apply.)
      (This patch is unrelated to the issue.)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1212 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-15 22:34:52 +00:00
Richard Mudgett
92c277dae5 In q931_getcall(): Simplify test and add related switch types.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1205 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-14 19:03:49 +00:00
Richard Mudgett
28e7e1cdfe Reduce future conflicts when adding ie's to the SETUP message.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1191 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-13 19:06:26 +00:00
Richard Mudgett
296c64df23 Miscellaneous changes:
*  Removed unnecessary Q931_IE_CONNECTED_NUM ie from setup_ack_ies[].
*  Added internal state Q931_CALL_STATE_NOT_SET to Q.931 state enum.
*  Made q931_is_ptmp() take a const pointer.
*  pri_facility.c: Some preparations for subaddressing.
*  pri.c: Eliminate use of a magic number.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1177 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-12 17:17:48 +00:00
Richard Mudgett
ab1580de67 Conditional out noisy and redundant ASN.1 parse dump of facility ie contents.
1) Outgoing messages have the facility ie ASN.1 decoded and dumped when the
ie is added to the message.  The whole message is then dumped.
2) Incoming messages have the facility ie ASN.1 decoded and dumped when the
ie is processed.  The whole message has already been dumped.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1169 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-09 23:20:37 +00:00
Richard Mudgett
3a9af361fd Sent Q.SIG call rerouting message fixes.
a) Account for pSS1InfoElement where the bearer capability for the new
rerouted call is described.  The call could be a fax or data call, let's
use the appropriate signaling to avoid call rejects on the other end.
b) Handle calling number appropriately, number can be prohibited or
non-existent.
c) Add calling name if available.
d) Use the diversion counter from DivLegInfo2 (if was present in the
incoming Setup) and increment.

(issue #14292)
Reported by: tomaso
Patches:
      libpri-1.4-2009-01-29-rerouting-0.1.9.patch uploaded by tomaso (license 564)
      (Used as a guide since it no longer will apply.)
      (This patch is unrelated to the issue.)



git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1152 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-10-07 18:34:06 +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
Jeff Peeler
18ea19900c Fix call reference to be associated with the D channel message was received
The problem is that once a call reference was associated with a particular D
channel, it always was. This created an issue with NFAS when the secondary D
channel became active as the messages were still being sent on the non-active
D channel.

(closes issue #14959)
Reported by: remiq
Patches: 
      bug14959.patch uploaded by jpeeler (license 325)
Tested by: remiq


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1120 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-22 17:12:23 +00:00
Richard Mudgett
4d19486781 Update pri_event2str() to current defined events.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1107 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-22 02:23:48 +00:00
Richard Mudgett
599128a65a Another place where timeout events with subcmds should clear any old subcmds.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1097 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-18 00:31:21 +00:00
Richard Mudgett
c8de5d057b Timeout events with subcmds should clear any old subcmds.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1084 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-15 22:24:12 +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
Dwayne M. Hubbard
d9af5b25ce Add SERVICE message support for the 'national' switchtype
This set of changes integrates SERVICE message support for the 
'national' switchtype.  The 'national' switchtype uses the 0x43
protocol discriminator.  The 'national' SERVICE/SERVICE ACKNOWLEDGE
and AT&T SERVICE/SERVICE ACKNOWLEDGE message values are opposite
of each other.  This is handled by first determining which
protocol discriminator is in use, then responding with the appropriate
SERVICE ACKNOWLEDGE value.  AT&T SERVICE messages use the
0x3 protocol discriminator.

(closes issue #15803)
Reported by: dhubbard

Review: https://reviewboard.asterisk.org/r/347/


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1072 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-09-13 22:54:10 +00:00