summaryrefslogtreecommitdiff
path: root/channels/sig_pri.c
AgeCommit message (Collapse)Author
2010-04-09Merge Call completion support into trunk.Mark Michelson
From Reviewboard: CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date overview of the architecture can be found in the file doc/CCSS_architecture.pdf in the CCSS branch. Off the top of my head, the big differences between what is implemented and what is in the document are as follows: 1. We did not end up modifying the Hangup application at all. 2. The document states that a single call completion monitor may be used across multiple calls to the same device. This proved to not be such a good idea when implementing protocol-specific monitors, and so we ended up using one monitor per-device per-call. 3. There are some configuration options which were conceived after the document was written. These are documented in the ccss.conf.sample that is on this review request. For some basic understanding of terminology used throughout this code, see the ccss.tex document that is on this review. This implements CCBS and CCNR in several flavors. First up is a "generic" implementation, which can work over any channel technology provided that the channel technology can accurately report device state. Call completion is requested using the dialplan application CallCompletionRequest and can be canceled using CallCompletionCancel. Device state subscriptions are used in order to monitor the state of called parties. Next, there is a SIP-specific implementation of call completion. This method uses the methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion using SIP signaling. There are a few things to note here: * The agent/monitor terminology used throughout Asterisk sometimes is the reverse of what is defined in the referenced draft. * Implementation of the draft required support for SIP PUBLISH. I attempted to write this in a generic-enough fashion such that if someone were to want to write PUBLISH support for other event packages, such as dialog-state or presence, most of the effort would be in writing callbacks specific to the event package. * A subportion of supporting PUBLISH reception was that we had to implement a PIDF parser. The PIDF support added is a bit minimal. I first wrote a validation routine to ensure that the PIDF document is formatted properly. The rest of the PIDF reading is done in-line in the call-completion-specific PUBLISH-handling code. In other words, while there is PIDF support here, it is not in any state where it could easily be applied to other event packages as is. Finally, there are a variety of ISDN-related call completion protocols supported. These were written by Richard Mudgett, and as such I can't really say much about their implementation. There are notes in the CHANGES file that indicate the ISDN protocols over which call completion is supported. Review: https://reviewboard.asterisk.org/r/523 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.Richard Mudgett
SWP-1229 ABE-2161 * Ensure chan_local.c:local_call() will not leak cid.cid_dnid when copying. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10Simplified dahdi_request() channel selection failed reason/cause code.Richard Mudgett
Also avoid potential crash because cause could be NULL. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10Reduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.Richard Mudgett
Rework HAVE_PRI_SERVICE_MESSAGES to not use the active values directly from the database. Database access is likely expensive. Database access now only happens on initialization, destruction, and when the B channel is taken in or out of service. This change is not related to call waiting but it would cause the search for a call waiting interface to be very expensive and slow down D channel message servicing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-27overlap receiving: automatically send CALL PROCEEDING when dialplan startsAlec L Davis
Following Q.931 5.2.4 When the user has determined that sufficient call information has been received the user shall stop T302 and send CALL PROCEEDING to the network. Previously timeouts were possible if the dialplan took a long time to issue any response back to the network. Verified that our local TELCO also does the same. (issue #16789) Reported by: alecdavis Patches: overlap_receiving_trunk.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20Update CDR variables as pbx startsAlec L Davis
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call, by executing ast_cdr_update() early in __ast_pbx run. Reverts sig_pri changes in trunk that are specific to isdn technology only. (closes issue #16638) Reported by: alecdavis Patches: cdr_update.diff3.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19Update CDR variables before pbx starts (overlap dial)Alec L Davis
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call. (issue #16638) Reported by: alecdavis Patches: cdr_update.diff2.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18Update CDR variables before pbx startsAlec L Davis
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call. (closes issue #16638) Reported by: alecdavis Patches: cdr_update.diff.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07Fix using the wrong pointer type in do_idle_thread().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05Removed unused parameters from analog_available() and sig_pri_available().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21Change all refererences to 1.6.3 to be 1.8, since that will be the next ↵Kevin P. Fleming
feature release git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24Fix problem on digital channels due to digital flag not getting set Jeff Peeler
Changed areas in sig_pri to set the digital flag using a callback that will also set the corresponding flag in chan_dahdi. Modified dahdi_request slightly so that if a bearer is marked as digital, that information is available when creating the new channel. (closes issue #16151) Reported by: alecdavis Patch based on bug_16151.diff.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06Created standard location to add options to chan_dahdi for ISDN dialing.Richard Mudgett
Dial(DAHDI/g1[/extension[/options]]) Current options: K(<keypad_digits>) R Reverse charging indication (Collect calls) The earlier Dial(DAHDI/g1[/K<keypad_digits>][/extension] format was variable and did not allow for the easy addition of more options. The earlier 'C' prefix character for reverse charge indiation would conflict with the a-d DTMF digits if ISDN uses them. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04Expand codec bitfield from 32 bits to 64 bits.Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/416/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02DAHDI ISDN channel names will not allow device state to work. (Interim ↵Richard Mudgett
solution.) Since ISDN works like SIP and not analog ports in regard to devices, the device state based on the ISDN channel number could not work. This has not been an issue until the advent of PTMP NT mode. Previously, ISDN lines were used as trunks and did not have to keep track of specific devices. As an interim solution until device states are properly implemented, the channel name is being changed to the following format to use the generic device state support: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number> Dialplan hints would thus be: exten => xxx,hint,DAHDI/i2/5551212 This will work with the following restrictions: * The number of devices/phones cannot exceed the number of B channels. (i.e., BRI has 2) * Each device/phone can only have one number. No shared MSN's. * The phones/devices probably should not use subaddressing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-30Cleanup some flags on DAHDI PRI channel hangup.Richard Mudgett
* Cleanup some flags on DAHDI PRI channel hangup. (sig_pri split) * Make sure the outgoing flag is cleared if a new channel fails to get created for outgoing calls. * Remove some unused flags since sig_pri was split. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-23Add to chan_dahdi ISDN HOLD, Call deflection, and keypad facility support.Richard Mudgett
* 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)} * Added support for BRI PTMP NT mode. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22Search for the subaddress only within the extension section of the dial string.Richard Mudgett
Dial(DAHDI/(g|G|r|R)<group#(0-63)>[c|r<cadance#>|d][/extension]) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22Add support for calling and called subaddress. Partial support for COLP ↵Richard Mudgett
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: asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585) Some minor modificatons were made. Tested by: alecdavis, rmudgett Review: https://reviewboard.asterisk.org/r/405/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21Make PRI_SUBCMD_xxx handling subaddress friendly.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-19Add a callback to sig_pri which is called when sig_pri is going to queue a ↵Joshua Colp
control frame on a channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-17Merged revisions 224330 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r224330 | jpeeler | 2009-10-16 20:32:47 -0500 (Fri, 16 Oct 2009) | 13 lines Fix stale caller id data from being reported in AMI NewChannel event The problem here is that chan_dahdi is designed in such a way to set certain values in the dahdi_pvt only once. One of those such values is the configured caller id data in chan_dahdi.conf. For PRI, the configured caller id data could be overwritten during a call. Instead of saving the data and restoring, it was decided that for all non-analog channels it was simply best to not set the configured caller id in the first place and also clear it at the end of the call. (closes issue #15883) Reported by: jsmith ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-16Merged revisions 224260 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r224260 | rmudgett | 2009-10-16 15:25:23 -0500 (Fri, 16 Oct 2009) | 18 lines Never released PRI channels when using Busy() or Congestion() dialplan apps. When the Busy() or Congestion() application is used towards ISDN (an ISDN progress is sent), the responding ISDN Disconnect or Release may contain the ISDN cause user busy or one of the congestion causes. In chan_dahdi.c these causes will only set the needbusy or needcongestion flags and not activate the softhangup procedure. Unfortunately only the latter can interrupt the endless wait loop of Busy()/Congestion(). Result: PRI channels staying in state busy for the rest of asterisk life or until the other end times out and forces the call to clear. (issue #14292) Reported by: tomaso Patches: disc_rel_userbusy.patch uploaded by tomaso (license 564) (This patch is unrelated to the issue.) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-28Miscellaneous minor changes.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-28Locking issues dealing with service_lock.Richard Mudgett
* Removed unneeded and uninitialized service_lock. * Fixed potential locking imbalance in pri_dchannel():PRI_EVENT_RESTART. * Fixed verbose message typo in pri_dchannel():PRI_EVENT_RESTART. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25Reduce indentation in sig_pri_available().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10Cleanup approach in 217804 and don't reach inside the sig_pvt.Jeff Peeler
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-08Fix memory leak of sig_xxx private structures.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-08Remove duplicate entry in the sig_pri_pri private pointer array.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03Lets try not to use C++ keywords for variable names.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-02Made chan_dahdi able to ignore incoming calls that are not in a MSN list for ↵Richard Mudgett
ISDN PTMP CPE spans. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-28Move discardremoteholdretrieval test so it applies only to the specific ↵Richard Mudgett
notification indicator values. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21Update configure script for libpri COLP feature dependency requirements.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18Add COLP support to chan_dahdi/sig_pri.Richard Mudgett
Add Connected Line Presentation (COLP) support to chan_dahdi/libpri as an addition to issue 8824. This is the chan_dahdi/sig_pri portion. COLP support is now available for any switch for which libpri supports COLP (currently ETSI PTP, ETSI PTMP, and Q.SIG) with this patch. (closes issue #14068) Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/340/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10Fix PRI/BRI channels when in alarm condition to only be marked for hangup if Jeff Peeler
T309 is not enabled. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10Restoring some code to sig_pri. Not sure if it is really needed.Richard Mudgett
Putting some DSP code back into sig_pri that was removed by the chan_dahdi/sig_pri reorganization. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07Fix static on line when PRI does overlap dialing.Richard Mudgett
The wrong encoding law was used because = was used when it should have been ==. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-06Sanity adjustments to pri_ss_thread for sig_pri environment.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-05Fix potential deadlock issue with USERUSERINFO channel variable.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-05More changes from chan_dahdi that did not make it into sig_pri.Richard Mudgett
* Q.SIG channel mapping option. * discardremoteholdretrieval option. * libPRI debug defines. * pri_set_overlapdial() now set correctly. * pthread creation of pri_ss_thread now matches. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-05Merged revisions 210575 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r210575 | rmudgett | 2009-08-05 14:18:56 -0500 (Wed, 05 Aug 2009) | 14 lines Dialplan starts execution before the channel setup is complete. * Issue 15655: For the case where dialing is complete for an incoming call, dahdi_new() was asked to start the PBX and then the code set more channel variables. If the dialplan hungup before these channel variables got set, asterisk would likely crash. * Fixed potential for overlap incoming call to erroneously set channel variables as global dialplan variables if the ast_channel structure failed to get allocated. * Added missing set of CALLINGSUBADDR in the dialing is complete case. (closes issue #15655) Reported by: alecdavis ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04Fix CALLERID() values for sig_pri on incoming calls.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03Changes from chan_dahdi that did not make it into sig_pri.Richard Mudgett
* Moved SUPPORT_USERUSER to sig_pri.c * Fix PRI_DEADLOCK_AVOIDANCE parameter. * Whitespace changes. * Added missing unlock in pri_dchannel():PRI_EVENT_RING case. * Balanced curly braces. * ast_debug/ast_log changes from chan_dahdi. * sig_pri_indicate() should default to return -1 if the indication is not handled. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03Trim trailing whitespace.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-30Add missing ifdef-s for service maintenance message functionalityJeff Peeler
(closes issue #15614) Reported by: fabled git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23Fix sending of interface identifier unconditionally in sig_priJeff Peeler
The wrong logic was being used in chan_dahdi to convert a sig_pri_chan to the proper libpri channel number. The most significant bit must only be set only when trunk groups are being used. (closes issue #15452) Reported by: alecdavis Patches: bug15452.patch uploaded by jpeeler (license 325) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21Do not dial digits when none were specified for sig_pri based callsJeff Peeler
(closes issue #15524) Reported by: elguero Patches: pri-sig-no-dest-set.patch uploaded by elguero (license 37) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-15The dialing flag was mistakingly removed from sig_pri.Jeff Peeler
This readds the proper setting of the flag and is really a continuation of r205731. The flag was being set properly in sig_analog, but use of the newly added set_dialing callback allowed for some simplification in chan_dahdi. (closes issue #15486) Reported by: rmudgett git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-03Add a configure check for Reverse Charging Indication support in LibPRI.Sean Bright
Also go back and wrap all of the places that use the specific reverse charge APIs with preprocessor conditionals. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204919 65c4cc65-6c06-0410-ace0-fbb531ad65f3