Commit Graph

539 Commits

Author SHA1 Message Date
Matthew Fredrickson
b83fc0c33f Add silly fake MDL error Z for kicking L2 to reactivate if a DISC or DM is received in proper states on PTP links.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1878 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-23 22:13:44 +00:00
Richard Mudgett
b2e28bd1e4 No audio on inbound J1 calls.
Incoming calls specifying the channel using a slot map could not negotiate
a B channel correctly.  Libpri historically has handled this as an any
channel request.  However, when chan_dahdi picked a new channel, libpri
sent out the recorded slot map and not the new channel selected.  Thus the
two endpoints would be attached to different B channels and the parties
would not hear anything or would hear the wrong parties.

This patch restores the historical preference of sending out the channel
id using the channel number method if a channel number is available.

JIRA LIBPRI-35
Patches:
      libpri-35_v1.4.11.3.patch uploaded by rmudgett (license 664)
      libpri-35_v1.4.patch uploaded by rmudgett (license 664)
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1853 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-06 18:35:35 +00:00
Richard Mudgett
9d1fa7f276 Learn (AGAIN!) why state 7 and state 8 transitions were suppressed.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1852 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-06 18:22:39 +00:00
Richard Mudgett
fc203e3101 Improved Q.921/Q.931 debug output.
* Debug output for a sent Q.931 message in TE PTMP now uses the best
available TEI number instead of always using 127.  It could still be wrong
if layer 2 does not have a TEI assigned.

* Q.921 debug output is grouped better so a decoded message is not split
by a blank line.

* The Q.921 state is also decoded to a name.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1848 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-03 23:04:52 +00:00
Richard Mudgett
5372776ef0 Q921_TIMER_RECOVERY SDL issue in q921_rnr_rx()
Added missing code specified by Q.921 (Figure B.8 Page 85) when receive
RNR in "Timer Recovery" state.

(closes issue #16791)
Reported by: alecdavis
Patches:
      rnr_timer_recovery.diff.txt uploaded by alecdavis (license 585)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1845 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-03 17:33:54 +00:00
Richard Mudgett
589ea41f86 Renamed local struct pri *pri variables to struct pri *ctrl in q921.c.
The context tagging for my editor is much happier now that the struct and
the variable do not have the same name.  (At least for this file.)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1842 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-08-02 18:47:10 +00:00
Richard Mudgett
4b21faa82d Add pri_new_bri_cb() API - Create BRI D-channel with user defined I/O callbacks and data
There currently exists a pri_new_cb() API call that allows you to create a
PRI with user-defined I/O read and write callbacks, and option userdata.

Add the same capability for BRI interfaces by adding a pri_new_bri_cb()
API function.

(closes issue #16477)
Reported by: nic_bellamy
Patches:
      pri_new_bri_cb_api.patch uploaded by nic bellamy (license 299) (with minor cosmetic changes)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1836 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-07-22 17:59:57 +00:00
Richard Mudgett
02c5939a33 pritest hadn't been ported to DAHDI
pritest hadn't been ported to DAHDI, made the trivial changes to make it
work.  (I haven't found the equivalent to zap_playf, so changed the
behaviour to an echo box)

(closes issue #17274)
Reported by: horape
Patches:
      pritest.diff uploaded by horape (license 1035) (with minor cosmetic changes)


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1833 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-07-16 22:55:15 +00:00
Richard Mudgett
cf6a952c31 Only need to output one version of the version message.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1830 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-07-16 17:20:21 +00:00
Richard Mudgett
14ff4bfad6 Added a libpri version output line as a sanity check for rosetest.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1829 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-07-16 17:15:07 +00:00
Richard Mudgett
8c4f87a9e0 Calling name not successfully processed on inbound QSIG PRI calls from Mitel PBX
The alternate form of the Q.SIG Name sequence that allows manufacturer
extensions for CallingName, CalledName, ConnectedName, and BusyName was
not consuming the next ASN.1 tag.  The code that processed the ASN.1 Name
structure was then using a stale tag value.  The stale tag value was then
rejected with the "Did not expect" message.

I have added a test case using the supplied PRI debug output to the
rosetest utility to verify that this alternate encoding is tested in the
future.

(closes issue #17619)
Reported by: jims8650
Patches:
      issue17619_v1.4.11.3.patch uploaded by rmudgett (license 664)
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1828 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-07-16 16:37:07 +00:00
Richard Mudgett
c5fce8da41 [regression] Calling Number assignment logic change in libpri 1.4.11.
Restored the old behaviour if there is more than one calling number in the
incoming SETUP message.  A network provided number is reported as ANI.

(closes issue #17495)
Reported by: ibercom
Patches:
      issue_17495_v1.4.11.2.patch uploaded by rmudgett (license 664)
      issue_17495_v1.4.patch uploaded by rmudgett (license 664)
Tested by: ibercom


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1823 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-06-29 16:15:03 +00:00
Richard Mudgett
bf5ef150e6 PRI: XXX Missing handling for mandatory IE 12
The switch is sending the Connected Address ie (12) and there was no
handler for that ie.  That is why the reporter was getting the "Missing
mandatory ie" message.

The simple fix is to just add the missing receive handler for that ie.
Since connected line (COLP) functionality has been added and this is just
an alternate for the Connected Number ie (0x4C), the handler was already
written.  I also changed the ie name to what Q.931 calls it: Connected
Address.

Also some minor code clean up in q931_handle_ie() and ie2str().

JIRA SWP-1678
(closes issue #16915)
Reported by: kobaz


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1818 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-06-25 20:22:23 +00:00
Richard Mudgett
b4375c8aba Q.SIG calling name in FACILITY message not reported to the upper layer.
Q.SIG can send the CallingName, CalledName, and ConnectedName in stand
alone FACILITY messages.  If the CallingName was not sent in the SETUP
message, the caller id name was not reported to the upper layer.

(closes issue #17458)
Reported by: jsmith
Patches:
      issue17458_post_qsig_name.patch uploaded by rmudgett (license 664)
      issue17458_post_qsig_name_v1.4.11.1.patch uploaded by rmudgett (license 664)
Tested by: rmudgett, jsmith


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1810 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-06-04 22:45:59 +00:00
Richard Mudgett
297ff74885 Inband disconnect setting does nothing on BRI spans.
The acceptinbanddisconnect flag is not inherited when creating a new TEI
and thus rendering the setting (and its respective equivalent in Asterisk)
a no-op on BRI setups.

(closes issue #15265)
Reported by: paravoid
Patches:
      inband-bri.diff uploaded by paravoid (license 200)
Tested by: paravoid


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1794 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-06-01 22:59:41 +00:00
Richard Mudgett
505181cc1e Multi component FACILITY messages only process the first component.
The code was only processing the first ROSE component in the facility
message.  I also updated rosetest.c to have a multiple component ROSE
message test.

(closes issue #17428)
Reported by: patrol-cz
Patches:
      issue17428.patch uploaded by rmudgett (license 664)
Tested by: rmudgett, patrol-cz


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1785 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-06-01 16:30:09 +00:00
David Vossel
660609c45b support for sending ETSI advice of charge
Review: https://reviewboard.asterisk.org/r/619/


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1776 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 22:34:24 +00:00
Richard Mudgett
8c5eeeae79 ETSI Message Waiting Indication (MWI) support.
Add the ability to report waiting messages to ISDN endpoints (phones).

Relevant specification: EN 300 650 and EN 300 745

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1767 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 21:50:14 +00:00
Richard Mudgett
0b28bf0aab ETSI Malicious Call ID support.
Add the ability to report malicious callers.

Relevant specification: EN 300 180

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1757 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 20:26:23 +00:00
Richard Mudgett
e4b8bed7e9 ETSI Call Waiting support.
Add the ability to announce a call to an endpoint when there are no B
channels available.  A call waiting call is a SETUP message with no B
channel selected.

Relevant specification: EN 300 056, EN 300 057, EN 300 058

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1746 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 18:43:57 +00:00
Richard Mudgett
9bb285fdc1 ETSI Advice Of Charge (AOC) event reporting.
This feature passes ETSI AOC-S, AOC-D, and AOC-E message information to
the upper layer (i.e.  Asterisk) for processing.

Relevant specification: EN 300 182

Consideration was made for the possible future addition of Q.SIG AOC
support (ECMA-212) with the events passed to the upper layer.

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1737 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 18:03:38 +00:00
Richard Mudgett
382e7e5c86 Added ETSI Explicit Call Transfer (ECT) support.
Added ability to send and receive ETSI ECT messages to eliminate tromboned
calls.

Added ETSI support to an existing API call to send ECT messages when the
upper level indicates to transfer specified calls.

The libpri API was extended to indicate to the upper layer that the far
end requests the transfer of the indicated calls.

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1723 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-28 15:19:08 +00:00
Richard Mudgett
6829faae06 Add Call Completion Suppplementary Service
Call Completion Supplementary Service (CCSS) added for the following 
switch types: ETSI PTMP, ETSI PTP, Q.SIG.  

Specifications:
ETS 300 359 CCBS for PTMP and PTP
ETS 301 065 CCNR for PTMP and PTP
ECMA-186 Call Completion for Q.SIG

Several support services were added to support CC:
Dummy Call Reference.
Q.931 REGISTER message.
Dynamic expansion of the number of available timers (up to 8192).
Enhanced facility message handling.

Current implementation limitations preclude the following:
CC service retention is not supported.
Q.SIG path reservation is not supported.

(closes issue #14292)
Reported by: tomaso
Tested by: rmudgett

JIRA SWP-1493

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


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1714 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-26 16:01:10 +00:00
Richard Mudgett
07b3f1dc45 T309 should not do anything with the global call reference call record.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1703 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-19 21:50:34 +00:00
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
d808143f8f Dialing an invalid extension causes incomplete hangup sequence.
Revision -r1489 corrected a deviation from Q.931 Section 5.3.2.  However,
this resulted in an unexpected behaviour change to the upper layer
(Asterisk).

This change restores the legacy hangup behaviour if the new API call is
not used.  Use pri_hangup_fix_enable() to follow Q.931 Section 5.3.2 call
hangup better.

(closes issue #17104)
Reported by: shawkris
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1688 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-05-11 22:14:15 +00:00
Richard Mudgett
14c3616e02 Simplified some protocol discriminator handling code.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1675 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-26 19:54:00 +00:00
Richard Mudgett
bfcab2eabe Garbage on the end of Q.931 messages causing calls to fail to connect.
The DAHDI driver had a bug where an extra byte appeared on the end of
Q.931 messages.  This garbage byte caused the message to be discarded with
the diagnostic "XXX Message longer than it should be??  XXX".  The Q.931
message will no longer be discarded if there were earlier ie's in the
message.

This patch also addresses the potential problem of reading beyond the
buffer when trying to parse the garbage data.

Thanks to roeften for the base patch.

(closes issue #14378)
Reported by: timking


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1674 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-26 19:39:28 +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
d933b7e7e6 Cleanup some pri debug output line presentation.
git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1664 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-26 16:57:57 +00:00
Richard Mudgett
e42108aaae PTMP NT mode call reference value ambiguity.
Since the TE side can pick CR values independently, the TE CR needs to be
qualified by TEI to distinguish CR values from other devices.  Without
doing this, multiple phones on the BRI line will have intermittent call
failures.

JIRA LIBPRI-30

Also eliminated some wierdness in q931_status() and several places where
it is called.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1630 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2010-04-19 22:40:41 +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
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