Commit Graph

428 Commits

Author SHA1 Message Date
Jeff Peeler 58061391a1 Fix regression with distinctive ring detection.
The issue here is that passing an array to a function prohibits the ARRAY_LEN
macro from returning the real size. To avoid this the size is now defined and
use of ARRAY_LEN is avoided.

(closes issue #15718)
Reported by: alecdavis
Patches: 
      bug15718.patch uploaded by jpeeler (license 325)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-19 14:39:07 +00:00
Richard Mudgett 34bc4b1dcb Merged revisions 277419 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277419 | rmudgett | 2010-07-16 15:18:54 -0500 (Fri, 16 Jul 2010) | 15 lines
  
  priexclusive in chan_dahdi.conf ignored when reloading dahdi module
  
  During a reload, the priexclusive and outsignalling parameters are not
  read in from the config file as intended.  Unfortunately, they get set to
  defaults as a result.  This patch makes sure that they do not get set to
  defaults during a reload.
  
  (closes issue #17441)
  Reported by: mtryfoss
  Patches:
        issue17441_v1.4.patch uploaded by rmudgett (license 664)
        issue17441_v1.6.2.patch uploaded by rmudgett (license 664)
        issue17441_trunk.patch uploaded by rmudgett (license 664)
  Tested by: rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 20:27:51 +00:00
Richard Mudgett cf7bbcc4c6 Expand the caller ANI field to an ast_party_id
Expand the ani field in ast_party_caller and ast_party_connected_line to
an ast_party_id.

This is an extension to the ast_callerid restructuring patch in review:
https://reviewboard.asterisk.org/r/702/

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 16:58:03 +00:00
Richard Mudgett ec37ffbdaf ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Eliel C. Sardanons a1b89a6a50 Implement AstData API data providers as part of the GSOC 2010 project,
midterm evaluation.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 14:48:42 +00:00
Richard Mudgett fd3297a272 Add missing conditional around chan_dahdi mfcr2_skip_category config parameter.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-07 18:32:35 +00:00
Richard Mudgett d20ca64e70 Merged revisions 274579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r274579 | rmudgett | 2010-07-07 13:12:41 -0500 (Wed, 07 Jul 2010) | 1 line
  
  Close the DAHDI FD on error when processing chan_dahdi toneduration config parameter.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-07 18:20:00 +00:00
Tilghman Lesher 5754933045 Status shows all non-CRC4 lines as "yellow", even if "yellow" was not in the bitfield.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-06 22:09:23 +00:00
Tzafrir Cohen c613897d1c Fix various typos reported by Lintian
(Also fix the typos in the comments)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-02 15:57:02 +00:00
Russell Bryant 746d8e6013 Don't try to lock/unlock an uninitialized lock on a dahdi_pri.
This small changes prevents destroy_all_channels() from accessing a lock on an
unused dahdi_pri struct, resolving a ton of ERRORs that get spewed out when
shutting Asterisk down gracefully.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-22 23:20:37 +00:00
Richard Mudgett fb5fddd987 Extract sig_ss7_init_linkset() to sig_ss7.
Also found a place where sig_pri_init_pri() was inlined and called it
instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-14 20:51:09 +00:00
Richard Mudgett 93a5e74e37 Add digit manipulation tag support to chan_dahdi/sig_pri like chan_misdn.
Add the append_msn_to_cid_tag option to chan_dahdi like chan_misdn.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-14 15:55:35 +00:00
Russell Bryant 8f92f95530 Attempt to fix a FreeBSD build error by including sys/stat.h.
http://bamboo.asterisk.org/download/AST-TRUNKFREEBSD/build_logs/AST-TRUNKFREEBSD-187.log


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10 00:32:31 +00:00
Richard Mudgett 717570899c Add missing API function to sig_ss7: sig_ss7_fixup().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09 17:06:41 +00:00
Richard Mudgett 6c6260d4c7 Eliminate deadlock potential in dahdi_fixup().
Calling dahdi_indicate() within dahdi_fixup() while the owner pointers are
in a potentially inconsistent state is a potentially bad thing in
principle.

However, calling dahdi_indicate() when the channel private lock is already
held can cause a deadlock if the PRI lock is needed because
dahdi_indicate() will also get the channel private lock.  The pri_grab()
function assumes that the channel private lock is held once to avoid
deadlock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09 16:54:38 +00:00
Tzafrir Cohen 6d627b8c38 dial by name in chan_dahdi
* chan_dahdi supports dialing configuring and dialing by device file name.
  DAHDI/span-name!local!1 will use /dev/dahdi/span-name/local/1 . Likewise
  it may appear in chan_dahdi.conf as 'channel => span-name!local!1'.
* A new options for chan_dahdi.conf: 'ignore_failed_channels'. Boolean.
  False by default. If set, chan_dahdi will ignore failed 'channel' entries.
  Handy for the above name-based syntax as it does not depend on
  initialization order.
* have my_pri_make_cc_dialstring() only manupulate dial-strings of group
  (gGrR) dialing, which make it lsightly more complicated.

https://reviewboard.asterisk.org/r/535/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09 13:17:43 +00:00
Leif Madsen c672763af8 Fix some doxygen warnings.
(closes issue #17336)
Reported by: snuffy
Patches:
      doxygen-fixes1.diff uploaded by snuffy (license 35)
Tested by: russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 14:38:18 +00:00
Richard Mudgett 0122ccd29c Extract sig_ss7 out of chan_dahdi.
Extract the SS7 specific code out of chan_dahdi like what was done to
ISDN/PRI and analog signaling.  The new SS7 structures were modeled on
sig_pri.

The changes to sig_pri are an enhancement and a bug fix made possible
because SS7 was extracted.

1) The sig_pri TRANSFERCAPABILITY channel variable should have been set
unconditionally in sig_pri_new_ast_channel().

2) SS7/PRI transfer capability interaction in dahdi_new() fixed because of
SS7 extraction.

3) Module ref count error in dahdi_new() if startpbx failed to start the
PBX for some reason.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07 20:04:42 +00:00
Richard Mudgett 1c67f208a7 Add 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/599/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-03 00:02:14 +00:00
Richard Mudgett afcbc93dae Add 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

For DAHDI/ISDN channels, the CHANNEL() dialplan function now supports the
"no_media_path" option.
* Returns "0" if there is a B channel associated with the call.
* Returns "1" if no B channel is associated with the call.  The call is
either on hold or is a call waiting call.

If you are going to allow incoming call waiting calls then you need to use
CHANNEL(no_media_path) do determine if you must drop a call to accept the
new call.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 21:05:32 +00:00
Richard Mudgett afd4454c44 Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
  (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages

Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup

AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.

SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
  snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
  'snom_aoc_enabled' sip.conf option.

IAX AOC Support
- Natively supports AOC pass-through through the use of the new
  AST_CONTROL_AOC frame type

DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
  pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
  example usage:
  ;requests AOC-S, AOC-D, and AOC-E on call setup
  exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 18:10:15 +00:00
Richard Mudgett 48dd4d1249 Add ETSI Explicit Call Transfer (ECT) support.
Added ability to send and receive ETSI Explicit Call Transfer (ECT)
messages to eliminate tromboned calls.

Note: Asterisk already supported initiating the transfer of calls to
eliminate tromboned calls to libpri so there was nothing to do for the
asterisk portion.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 16:14:12 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Richard Mudgett 274eb8960c Fix inverted logic in cli command: ss7 set debug on/off
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 22:01:36 +00:00
Richard Mudgett 093dbfdd52 Don't crash when destroying chan_dahdi pseudo channels.
Must do a deep copy of the cc_params in duplicate_pseudo().  Otherwise,
when the duplicate pseudo channel is destroyed, it frees the original
pseudo channel cc_params.  The original pseudo channel is then left with a
dangling pointer for when the next duplicated pseudo channel is created.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-12 17:57:31 +00:00
Tzafrir Cohen 6b2e51b1ed When failing to configure, don't destroy 'cfg' twice
Fixes a crash when some config section had an incorrect channel config.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-06 07:27:31 +00:00
Richard Mudgett f0a7adb309 Avoid a crash on SS7 channels.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-05 22:22:14 +00:00
Richard Mudgett 159f0d4b24 The inalarm flag is not passed up from the sig_analog and sig_pri submodules.
The CLI "dahdi show channel" command was not correctly reporting the
InAlarm status.

The inalarm flag is now consistently passed between chan_dahdi and
submodules.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-04 21:10:58 +00:00
Jeff Peeler 6dd80de93d Merged revisions 260434 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260434 | jpeeler | 2010-04-30 17:22:46 -0500 (Fri, 30 Apr 2010) | 11 lines
  
  Ensure channel state is not incorrectly set in the case of a very early answer.
  
  The needringing bit was being read in dahdi_read after answering thereby
  setting the state to ringing from up. This clears needringing upon answering
  so that is no longer possible.
  
  (closes issue #17067)
  Reported by: tzafrir
  Patches: 
        needringing.diff uploaded by tzafrir (license 46)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-30 22:36:49 +00:00
Richard Mudgett 00a1a96ff5 Separate the uses of NUM_DCHANS and MAX_CHANNELS into PRI, SS7, and MFCR2 users.
Created
SIG_PRI_MAX_CHANNELS, SIG_PRI_NUM_DCHANS
SIG_SS7_MAX_CHANNELS, SIG_SS7_NUM_DCHANS
SIG_MFCR2_MAX_CHANNELS

Also fixed the declaration of pollers[] in mfcr2_monitor().  It was
dimensioned to the number of bytes in struct dahdi_mfcr2.pvts[] and not to
the same dimension of the struct dahdi_mfcr2.pvts[].


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-30 22:24:28 +00:00
Richard Mudgett a3ce3441bb Merged revisions 260195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260195 | rmudgett | 2010-04-29 17:11:47 -0500 (Thu, 29 Apr 2010) | 26 lines
  
  DTMF CallerID detection problems.
  
  The code handling DTMF CallerID drops digits on long CallerID numbers and
  may timeout waiting for the first ring with shorter numbers.
  
  The DTMF emulation mode was not turned off when processing DTMF CallerID.
  When the emulation code gets behind in processing the DTMF digits it can
  skip a digit.
  
  For shorter numbers, the timeout may have been too short.  I increased it
  from 2 seconds to 4 seconds.  Four seconds is a typical time between rings
  for many countries.
  
  (closes issue #16460)
  Reported by: sum
  Patches:
        issue16460.patch uploaded by rmudgett (license 664)
        issue16460_v1.6.2.patch uploaded by rmudgett (license 664)
  Tested by: sum, rmudgett
  
  Review: https://reviewboard.asterisk.org/r/634/
  
  JIRA SWP-562
  JIRA AST-334
  JIRA SWP-901
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-29 22:44:14 +00:00
Richard Mudgett 4e3269c60d Merged revisions 259531 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r259531 | rmudgett | 2010-04-27 16:53:07 -0500 (Tue, 27 Apr 2010) | 11 lines
  
  DAHDI "WARNING" message is confusing and vague
  
  "WARNING[28406]: chan_dahdi.c:6873 ss_thread: CallerID feed failed: Success"
  
  Changed the warning to "Failed to decode CallerID on channel 'name'".  The
  message before it is likely more specific about why the CallerID decode
  failed.
  
  SWP-501
  AST-283
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-27 22:18:09 +00:00
Richard Mudgett 3e04d6fe8e Merged revisions 259270 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r259270 | rmudgett | 2010-04-27 13:14:54 -0500 (Tue, 27 Apr 2010) | 14 lines
  
  hidecalleridname parameter in chan_dahdi.conf
  
  Issue #7321 implements a new chan_dahdi configuration option.  However, a
  change mentioned in the issue was never implemented.  This is the change
  that will allow the feature to work.
  
  I added a note to chan_dahdi.conf.sample about the feature.
  
  (closes issue #17143)
  Reported by: djensen99
  Patches:
        diff.txt uploaded by djensen99 (license NA) (One line change)
  Tested by: djensen99
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-27 18:29:33 +00:00
Richard Mudgett 3bda444f1e Re-fix dahdi_request() iflist locking since CCSS merged.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-27 16:52:29 +00:00
Dwayne M. Hubbard afedb856ae Enable PRI SERVICE message support in chan_dahdi for the 'national' switchtype
Revision 1072 of libpri added SERVICE message support for the 'national' 
switchtype. The attached patch enables the use of 'pri service' CLI commands 
on dahdi channels that are configured for the 'national' switchtype.

(closes issue #17142)
Reported by: dhubbard
Patches:
      dw-ni2.patch uploaded by dhubbard (license 733)
Tested by: elguero, dhubbard

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-16 19:25:30 +00:00
Mark Michelson e24661fd18 Merge Call completion support into trunk.
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-09 15:31:32 +00:00
Richard Mudgett 1a2f96573a Merged revisions 256225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r256225 | rmudgett | 2010-04-05 19:10:16 -0500 (Mon, 05 Apr 2010) | 5 lines
  
  DAHDI/PRI call to pri_channel_bridge() not protected by PRI lock.
  
  SWP-1231
  ABE-2163
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-06 00:39:44 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
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-04-03 02:12:33 +00:00
Tzafrir Cohen 8acb32460a remove unneeded explicit channel in dahdi ioctls
This patch removes some cases where the channel number for an ioctl was
passed as a member in a struct rather then through the file descriptor.

The gain setting functions passed around a channel which is always 0,
and thus this parameter is simply dropped.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 10:09:24 +00:00
Russell Bryant 24137871be Use SHRT_MAX instead of MAXSHORT.
These changes fix build issues I had with this module on FreeBSD.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 11:33:30 +00:00
Moises Silva 828bdd8929 add missing mfcr2_skip_category setting
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 21:57:40 +00:00
Richard Mudgett 76961a63f8 Doxegen this chan_dahdi lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 19:05:40 +00:00
Richard Mudgett 7f68a32417 Minor tweaks and comment updates to chan_dahdi.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-11 18:07:16 +00:00
Richard Mudgett b1ccb1a44e Simplified dahdi_request() channel selection failed reason/cause code.
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-10 16:55:34 +00:00
Richard Mudgett ee5e65194f Reduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.
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-03-10 03:16:50 +00:00
Richard Mudgett 73ef4b8daf Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:38:06 +00:00
Jeff Peeler e8a99a9962 Merged revisions 250480 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250480 | jpeeler | 2010-03-03 13:04:11 -0600 (Wed, 03 Mar 2010) | 15 lines
  
  Make sure to clear red alarm after polarity reversal.
  
  From the issue:
  The automatic overnight line tests (or manual ones) used on UK (BT) lines causes
  a red alarm on a dahdi / TDM400P connected channel. This is because the line
  uses voltage tests (battery loss) and polarity reversal. The polarity reversal
  causes chan_dahdi to initiate v23 CallerID processing but during this the event
  DAHDI_EVENT_NOALARM is ignored so that the alarm is never cleared.
  
  (closes issue #14163)
  Reported by: jedi98
  Patches: 
        chan_dahdi-1.4-inalarm.diff uploaded by jedi98 (license 653)
  Tested by: mattbrown, Chainsaw, mikeeccleston
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:06:06 +00:00
Jeff Peeler 6bd57e0720 Add new config option to control AMI alarm event reporting in chan_dahdi.
New config parameter "reportalarms" added in chan_dahdi.conf which supports the
following possible values:
"channels": report each channel alarms (current behavior, default for backward compatibility)
"spans": report an "SpanAlarm" event when the span of any configured channel is alarmed
"all": report channel and span alarms (aggregated behavior)
"none": do not report any alarms

(closes issue #16709)
Reported by: nahuelgreco
Patches: 
      chan_dahdi.c.reportalarms.patch uploaded by nahuelgreco (license 162)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 17:37:30 +00:00
David Vossel 862ebf4d00 fixes adaptive jitterbuffer configuration
When configuring the adaptive jitterbuffer, the target_extra
value not only could not be set from the configuration, but was
not even being set to its proper default.  This value is required
in order for the adaptive jitterbuffer to work correctly.  To resolve
this a config option has been added to expose this value to the conf
files, and a default value is provided when no config specific value
is present.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:08:38 +00:00
Alec L Davis 5dbe86a3c2 fix asterisk setting of pritimers from chan_dahdi.conf
regression since sig_pri split.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 06:56:14 +00:00
Moises Silva 0d838691bc mfcr2 issue 0016844 - Fix portability bit fields and make mfcr2_immediate_accept work again, reported and patched by korihor
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-19 18:38:34 +00:00
Richard Mudgett b2a1ad7946 Restore triedtopribridge flag code removed in -r211197.
Ooops.  Failed to note that we were inside a for loop and
pri_channel_bridge() needs to be executed only once.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-15 22:08:23 +00:00
Tilghman Lesher d3ae695204 The chanvar= setting should inherit the entire list of variables, not just the first one.
(closes issue #16359)
 Reported by: raarts
 Patches: 
       dahdi-setvars.diff uploaded by raarts (license 937)
 Tested by: raarts


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-03 18:34:29 +00:00
Jeff Peeler 568c057c4c Extend max call limit duration from 24.8 days to 292+ million years.
If the limit was set past MAX_INT upon answering, the call was immediately
hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup).
The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been
changed to return an int64_t to prevent overflow. Also the reporter suggested
adding a message indicating the reason for the call hanging up. Given that the
new limit is so much higher, the message (which would only really be useful in
the overflow scenario) has been made a debug message only.

(closes issue #16006)
Reported by: viraptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:31:25 +00:00
Richard Mudgett c5cfc2a867 Removed unused parameters from analog_available() and sig_pri_available().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 18:57:29 +00:00
Kevin P. Fleming ef9be94b35 Change all refererences to 1.6.3 to be 1.8, since that will be the next feature release
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21 18:51:17 +00:00
Jeff Peeler 50b7338d02 Fix call forwarding for analog phones.
(closes issue #16440)
Reported by: mmichelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-17 00:52:03 +00:00
Jeff Peeler 08ec550c16 Merged revisions 232090 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232090 | jpeeler | 2009-12-01 18:42:58 -0600 (Tue, 01 Dec 2009) | 10 lines
  
  Do not modify the gain settings on data calls.
  
  (The digital flag actually represents a data call.)
  
  (closes issue #15972)
  Reported by: udosw
  Patches: 
        transcap_digital_fix.diff.txt uploaded by alecdavis (license 585)
  Tested by: alecdavis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 00:45:18 +00:00
Tilghman Lesher f59fe83c56 More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 20:27:37 +00:00
Jeff Peeler ac9a4cecf3 Fix problem on digital channels due to digital flag not getting set
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-24 17:12:25 +00:00
Richard Mudgett 20e56c9d36 Created standard location to add options to chan_dahdi for ISDN dialing.
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-06 22:32:17 +00:00
Jeff Peeler 562a18f533 fix trunk building
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 16:25:15 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
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-04 14:05:12 +00:00
Richard Mudgett 6406f39594 DAHDI ISDN channel names will not allow device state to work. (Interim 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-11-02 17:34:22 +00:00
Richard Mudgett 7fbd314a88 Cleanup some flags on DAHDI PRI channel hangup.
*  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-30 23:26:41 +00:00
Richard Mudgett 71452322a2 Make conditionals create previous code when libpri/ss7 are present.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 16:07:09 +00:00
Tzafrir Cohen 2736168a6b span numbers in pri debug / error messages
Prefix PRI trace messages with the span number. This makes the trace
readable even when you have a multi-port device.

(closes issue #15054)
Reported by: tzafrir
Patches:
      dahdi_pri_debug_spannum.diff uploaded by tzafrir (license 46)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 13:29:54 +00:00
Tzafrir Cohen e5a57959eb Re-arange code a bit to build in dev-mode without ss7
No change of functionality here. Just localized a variable and indented
code into blocks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 11:34:06 +00:00
Tzafrir Cohen d36cecd578 Make chan_dahdi build even without PRI / SS7
(Note: still some strange build warnings without SS7 in dev-mode)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 09:40:49 +00:00
Richard Mudgett cff6d02b53 Add to chan_dahdi ISDN HOLD, Call deflection, and keypad facility support.
* 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-23 16:57:33 +00:00
Matthew Nicholson 26638d3a55 Add dynamic range compression support for analog channels.
(closes issue AST-29)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-19 22:02:41 +00:00
Jeff Peeler 03db5ef0e5 fix typo, sorry
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-17 02:01:36 +00:00
Jeff Peeler 53a95d9c84 Merged revisions 224330 via svnmerge from
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-17 01:36:08 +00:00
Jeff Peeler 4ae6bee6da Change ringt (ring timeout) styles to be consistent across chan_dahdi.
(closes issue #15684)
Reported by: alecdavis
Patches: 
      chan_dahdi.bug15684.diff2.txt uploaded by alecdavis (license 585)
Tested by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 20:08:14 +00:00
Jeff Peeler b5eb0449c0 Merged revisions 222462 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222462 | jpeeler | 2009-10-06 18:51:19 -0500 (Tue, 06 Oct 2009) | 8 lines
  
  Add missing unlock(s) in dahdi_read
  
  (two cases in trunk)
  
  (closes issue #15683)
  Reported by: alecdavis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 23:56:01 +00:00
Jeff Peeler f7fa417130 Fix 222298 (crash during destruction of second channel when variable set with
setvar).

I mistakenly reasoned that setvar would be used on all channels. Since it can
be set per channel, give each dahdi channel a copy of the variable.

(related to #15899)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 20:35:19 +00:00
Jeff Peeler 0c7f4cfb85 Fix crash during destruction of second channel when variable set with setvar.
The setvar line in chan_dahdi.conf is shared among all the channels, so make
sure to only free the resources only when the last channel is destroyed.

(closes issue #15899)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 19:24:59 +00:00
Tzafrir Cohen 0c3cd2ee45 Make sure digit events are not reported as "ERROR"
dahdievent_to_analogevent used a simple switch statement to convert DAHDI
event numbers to "ANALOG_*" event numbers. However "digit" events
(DAHDI_EVENT_PULSEDIGIT, DAHDI_EVENT_DTMFDOWN, DAHDI_EVENT_DTMFUP)
are accompannied by the digit in the low word of the event number.

This fix makes dahdievent_to_analogevent() return the event number as-is
for such an event.

This is also required to fix #15924 (in addition to r222108).  


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 16:17:30 +00:00
Jeff Peeler 10e8ee1746 Add a few missing events to analog_handle_event.
The reported bug was actually only for pulsedigit, dtmfup, and dtmfdown
handling. Also added recognition for fax events (just some verbose output) and
fixed handling for the ec_disabled_event. In order to make comparing the analog
version of events to the DAHDI events easier, the ordering has been changed to
follow that of the DAHDI events.

(closes issue #15924)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-05 19:20:36 +00:00
Richard Mudgett 9c05faf76d Prevent deadlock if chan_dahdi attempts to change PRI channel names.
The PRI channels can no longer change the channel name if a different B
channel is selected during call negotiation.  To prevent using the channel
name to infer what B channel a call is using and to avoid name collisions,
the channel name format is changed.

The new channel naming for PRI channels is:
DAHDI/ISDN-<span>-<sequence-number>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 19:48:58 +00:00
Richard Mudgett f3f456f8b6 Miscellaneous minor changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-28 21:02:20 +00:00
Jeff Peeler 0d5e318cb2 Add some changes related to 218430.
* Remove thread_spawned in handle_init_event since it was never used
* Always check handle_init_event in case a channel is destroyed


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 16:12:49 +00:00
Tzafrir Cohen b64beef2f3 Fix false error message on DAHDI_EVENT_REMOVED (RESULT_SUCCESS == 0)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-15 10:24:55 +00:00
Jeff Peeler 843a724373 Merged revisions 218401 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r218401 | jpeeler | 2009-09-14 16:47:11 -0500 (Mon, 14 Sep 2009) | 11 lines
  
  Fix handling of DAHDI_EVENT_REMOVED event to prevent crash in do_monitor.
  
  After talking to rmudgett about some of his recent iflist locking changes, it
  was determined that the only place that would destroy a channel without being
  explicitly to do so was in handle_init_event. The loop to walk the interface
  list has been modified to wait to destroy the channel until the dahdi_pvt of
  the channel to be destroyed is no longer needed.
  
  (closes issue #15378)
  Reported by: samy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-14 22:38:25 +00:00
Richard Mudgett 6c39ebaa3e Add support for multiple interface lists.
Also unlink the sig_pri_pri.pvts[] pointer in destroy_dahdi_pvt().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-14 20:08:11 +00:00
Moises Silva 2aa112b4d7 get rid of mfcr2 monitor thread condition, is problematic
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-13 05:51:46 +00:00
Jeff Peeler edb5e6efd9 Cleanup approach in 217804 and don't reach inside the sig_pvt.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 23:49:09 +00:00
Jeff Peeler 3a718192c6 Allow do not disturb to be set on analog channels via the CLI and AMI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 23:29:14 +00:00
Richard Mudgett 32352265c4 Cleaned up chan_dahdi iflist handling and locking.
*  Fixed walking the iflist so it is always done with the iflock locked.
*  Simplified iflist walking routines.
*  Created chan_dahdi iflist insertion and extraction routines.
*  Fixed duplicate_pseudo() malloc fail handling.
*  Fixed infinite loop in action_dahdishowchannels() when showing a single channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 22:31:12 +00:00
Richard Mudgett 9a1215989f Miscellaneous minor changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 22:11:17 +00:00
Jeff Peeler f558f01a81 Fix crash during attended transfer over PRI.
The owner pointers in the sig_pri_chan structure were not getting updated
in dahdi_fixup. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 20:52:57 +00:00
Jeff Peeler 5561ba19aa Stop caller id transmission when offhook event detected.
This fixes the problem that would occur if an analog phone was picked up while
the caller id was being sent. The caller id before sent the whole spill even
after pickup and is now corrected.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 20:18:30 +00:00
Richard Mudgett 98d156c5dd Fix available() for SS7, MFC/R2, and pseudo channels.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 00:35:30 +00:00
Moises Silva df7dd574fd ast_log replaced for ast_verbose in MFCR2 event notifications
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-09 21:48:04 +00:00
Richard Mudgett fd561e871f Fix memory leak of sig_xxx private structures.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-08 23:37:57 +00:00
Richard Mudgett 8562029476 Miscellaneous minor code cleanup in mkintf().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-08 23:31:27 +00:00
Richard Mudgett c2930434f6 Lets try not to use C++ keywords for variable names.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 21:09:46 +00:00
Doug Bailey 8430c87faa Added detection DTMF CID without polarity change alert.
Added detection of DTMF tone energy levels on FXO channels in chan_dahdi
monitoring loop so DTMF CID can be detected without the need of a polarity
change precursor.  

(closes issue #9096)
Reported by: fleed
Patches:
      9096-chan_dahdi-trunk.diff uploaded by dbailey (license 819)
Tested by: cyberplant, sum, maturs


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:40:37 +00:00
Richard Mudgett 595ab444af Made chan_dahdi able to ignore incoming calls that are not in a MSN list for ISDN PTMP CPE spans.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-02 23:25:33 +00:00
Doug Bailey eff8dd9a2f Fix issue where DTMF CID detect was placing channels into signed linear mode
made analog_set_linear_mode return back the mode that was being overwritten 
so it could be restored later. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-02 19:49:43 +00:00
Moises Silva 3b1682bfe5 improve handling of openr2_chan_disconnect_call API failure, unlikely, but happened on openr2 library bug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-24 04:46:28 +00:00
Moises Silva 1c14bd4bfd increment the mfcr2 monitor count when clearing the call request
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21 04:09:26 +00:00
Moises Silva 8a2302e118 fixed bug caused by calling ast_request without calling ast_call on an R2 channel, ie, CHANISAVAIL
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-20 03:26:59 +00:00
Richard Mudgett 0d2ef8ac5c Merged revisions 212430 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

Fix uninitialized variable causing random MWI indications.

(closes issue #15727)
Reported by: doda
Patches:
      dahdi_changes.patch uploaded by doda (license 853)

........
  r212430 | rmudgett | 2009-08-17 10:36:28 -0500 (Mon, 17 Aug 2009) | 1 line
  
  Fix uninitialized variable.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-17 15:42:51 +00:00
Jeff Peeler 132204459c More code that somehow got left out of sig_analog
* confirmanswer option now respected
* check and set waiting for dialtone timer
* unneeded needcallerid flag removed from analog_subchannel
* ss_astchan does not need to be a void pointer
* swap_channels callback updated to trunk
* analog_hangup now resets channel to default law


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-14 22:39:11 +00:00
Jeff Peeler b65c0edd52 Fix chan_dahdi option ringtimeout
dahdi_read relies on the dahdi_pvt copy of ringt which was not getting set
in sig_analog. This patch adds a callback to do so.

(closes issue #15288)
Reported by: alecdavis
Patches:
      chan_dahdi.ringtimeout.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-12 20:47:45 +00:00
Richard Mudgett 148d49e362 Encapsulate testing for which signaling styles are used by sig_pri.
Created the dahdi_sig_pri_lib_handles() function and
SIG_PRI_LIB_HANDLE_CASES macro to simplify testing for which signaling
styles are handled by sig_pri.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 23:21:57 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Jeff Peeler 93b6a46fde Fix PRI/BRI channels when in alarm condition to only be marked for hangup if
T309 is not enabled.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 17:17:06 +00:00
Richard Mudgett bc0a3453cd Restoring some code to sig_pri. Not sure if it is really needed.
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-10 15:53:23 +00:00
Richard Mudgett 4f80468245 Fixed some unsafe down cast pointer operations for sig_pri.
You cannot cast the struct dahdi_pvt.sig_pvt pointer to a specific
signaling private pointer without first checking that it is in fact
pointing to the correct signaling private structure.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07 23:30:32 +00:00
Richard Mudgett 53ea9a0576 More changes from chan_dahdi that did not make it into sig_pri.
*  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-05 22:46:37 +00:00
Richard Mudgett ff91b378e0 Fix CALLERID() values for sig_pri on incoming calls.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 17:46:03 +00:00
Richard Mudgett e5b19910ed Removed some dead code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 16:36:03 +00:00
Richard Mudgett 070de85e56 Changes from chan_dahdi that did not make it into sig_pri.
*  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-03 18:05:46 +00:00
Kevin P. Fleming ed2a3cedd1 Merged revisions 209759 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209759 | kpfleming | 2009-07-31 19:52:00 -0500 (Fri, 31 Jul 2009) | 7 lines
  
  Minor changes inspired by testing with latest GCC.
  
  The latest GCC (what will become 4.5.x) has a few new warnings, that in these
  cases found some either downright buggy code, or at least seriously poorly
  designed code that could be improved.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 01:03:07 +00:00
David Brooks 48363c16e1 Fixes numerous spelling errors. Patch submitted by alecdavis.
(closes issue #15595)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-30 16:07:05 +00:00
David Brooks d81d6d3415 Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 16:33:50 +00:00
Jeff Peeler dcd6227f6c Merged revisions 208380 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208380 | jpeeler | 2009-07-23 14:19:53 -0500 (Thu, 23 Jul 2009) | 6 lines
  
  Only set the priindication setting when not performing a reload
  
  (closes issue #14696)
  Reported by: fdecher
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 19:21:50 +00:00
Jeff Peeler 980db1601a Fix sending of interface identifier unconditionally in sig_pri
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-23 15:59:44 +00:00
Jeff Peeler 58699809a5 Reset the fax buffers back to default settings regardless of signaling in use -
Pointed out by Matt F.
Also in the case of not using a signaling module, set the law back to the
default as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-22 22:42:33 +00:00
Jeff Peeler 56c59985de whitespace fix only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 22:24:56 +00:00
Jeff Peeler 7466e00663 Fix my_is_off_hook to check rxbits only for FXS signaling
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 22:02:25 +00:00
Jeff Peeler 6ac23c3eca Merged revisions 207827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207827 | jpeeler | 2009-07-21 15:16:55 -0500 (Tue, 21 Jul 2009) | 9 lines
  
  Wait for wink before dialing when using E&M wink signaling
  
  There was already code for other signaling types in dahdi_handle_event to
  handle dialing if a dial operation dial string was present. Simply add
  SIG_EMWINK to the list.
  
  (closes issue #14434)
  Reported by: araasch
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 20:26:02 +00:00
Jeff Peeler 74de8256bd Merged revisions 207155 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207155 | jpeeler | 2009-07-17 14:36:19 -0500 (Fri, 17 Jul 2009) | 7 lines
  
  Fix format specifier to print out an unsigned long long.
  
  Yep, it's even ifdefed out code. But it made it to the RR list...
  
  (closes issue #14726)
  Reported by: lmadsen
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 19:37:38 +00:00
Jeff Peeler 8270339965 Fix segfault in sig_analog when using callwaiting, respect callwaiting options
Sig_analog handles allocating the sub channel for callwaiting, so no longer try
to do it in chan_dahdi. Modified analog_alloc_sub to only mark the sub as
allocated upon success of the alloc_sub callback, which was responsible for the
segfault. Also, the callwaiting and callwaitingcallerid options were being
unconditionally set to true. Now, the options are properly set from
chan_dahdi.conf.

(closes issue #15508)
Reported by: elguero
Tested by: elguero



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 17:02:44 +00:00
Jeff Peeler 646cd02c09 The dialing flag was mistakingly removed from sig_pri.
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-15 22:02:55 +00:00
Jeff Peeler b9e898017e Restore some missing functionality to sig_analog.
The main purpose of this commit is to restore missing functionality present in 
the ss_thread before all the sig related work was done. Two of the biggest
missing things were distinctive ring detection and cid handling for V23.
fxsoffhookstate and associated mwi variables have been moved inside sig_analog
as they were not being set properly as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 20:01:10 +00:00
Sean Bright ee0cd5a32c Add a configure check for Reverse Charging Indication support in LibPRI.
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
2009-07-03 15:44:01 +00:00
Sean Bright 719917fe59 Support setting and receiving Reverse Charging Indication over ISDN PRI.
This is a continuation of revision 885 to LibPRI (Capture and expose the Reverse
Charging Indication IE on ISDN PRI) which added the ability to get/set Reverse
Charging Indication in LibPRI.  This patch adds the ability to specify RCI on
the outbound leg of a PRI call from within Asterisk, by prefixing the dialed
number with a capital 'C' like:

...,Dial(DAHDI/g1/C4445556666)

And to read it off an inbound channel:

exten => s,1,Set(RCI=${CHANNEL(reversecharge)})

Thanks again to rmudgett for the thorough review.

(closes issue #13760)
Reported by: mrgabu

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 17:46:14 +00:00
Jeff Peeler 5606db2224 Merged revisions 203848 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r203848 | jpeeler | 2009-06-26 17:09:19 -0500 (Fri, 26 Jun 2009) | 5 lines
  
  Make sure to recreate the dahdi pseudo channel after dahdi restart
  
  (closes issue #14477)
  Reported by: timking
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 22:11:31 +00:00
Russell Bryant 0264eef115 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
Jeff Peeler 6fad61406c make sure chan_dahdi compiles with only libss7 and not libpri installed
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 22:48:33 +00:00
Richard Mudgett 3930f83be6 Picking nits
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 21:34:18 +00:00
Jeff Peeler bbfe6967ab Remove some unnecessary code and update sample config file with respect to GR-303.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 21:22:12 +00:00
Jeff Peeler 5c7da226e4 New signaling module to handle PRI/BRI operations in chan_dahdi
This merge splits the PRI/BRI signaling logic out of chan_dahdi.c into
sig_pri.c. Functionality in theory should not change (mostly). A few trivial
changes were made in sig_analog with verbose messages and commenting.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 19:54:12 +00:00
Jason Parker afa8db54a0 Unmute when we get a dtmfup (we muted on dtmfdown) event.
This would occasionally cause one-way audio when using hardware DTMF detection.

(closes issue #14761)
Reported by: tzafrir
Patches:
      v1-14761.patch uploaded by dimas (license 88)
Tested by: tzafrir, dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 19:22:46 +00:00
Doug Bailey ce70b28f38 Insure ring cadence is set for fxs ports
Moved SETCADENCE ioctl call to before call into new analog signal module
to insure that it gets set. 

(closes issue #15381)
Reported by: alecdavis
Patches:
      fix15381.diff uploaded by dbailey (license 819)
Tested by: dbailey



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 16:18:48 +00:00
Richard Mudgett 80822297d4 Merged revisions 203036 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r203036 | rmudgett | 2009-06-24 16:01:43 -0500 (Wed, 24 Jun 2009) | 8 lines
  
  Improved chan_dahdi.conf pritimer error checking.
  
  Valid format is: pritimer=timer_name,timer_value
  
  *  Fixed segfault if the ',' is missing.
  *  Completely check the range returned by pri_timer2idx() to prevent
  possible access outside array bounds.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24 21:08:55 +00:00
Matthew Fredrickson 2a68d05b96 I could have sworn I committed this patch ages ago, but... bug fix with setting NAI properly on linksets in certain situations.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-23 22:08:43 +00:00
Kevin P. Fleming f1dc620467 Enable applications to enable/disable digit and tone detection.
Some applications (notably app_fax) do not need digit detection nor FAX tone
detection while they are running, and if Asterisk is using software DSPs to provide
the detection, this consumes extra CPU cycles that could be better spent on the
actual application. This patch allows applications to query and control the state
of digit and tone detection on a channel, and modifies app_fax to disable them
while the FAX operations are occurring (and re-enable digit detection afterwards).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 21:10:15 +00:00
Moises Silva 2c8cd1db92 keep backwards compatible chan_dahdi with older openr2 versions by not using the new skip category feature unless supported
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 02:24:30 +00:00
Kevin P. Fleming 4379249674 Convert a number of global module variables to 'static'.
These modules all contained variables that are module-global but not system-global,
but were not marked 'static'.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:06:34 +00:00
Moises Silva b52abf3d21 added openr2 to menuselect-deps.in, recent commit in menuselect made me realize this was never done but was working anyways
also added support for skip category request feature of openr2 and updated chan_dahdi.conf.sample


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-14 06:13:48 +00:00
Mark Michelson d068c2f5e6 Correct "dahdi show channels" output when specifying a group.
Since a DAHDI channel may belong to multiple groups, we need to use
a bitwise and instead of equivalence to determine whether to display
the channel information.


(closes issue #15248)
Reported by: gentian
Patches:
      15248.patch uploaded by mmichelson (license 60)
Tested by: gentian



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-05 13:51:08 +00:00
Jeff Peeler aaf5eb105e New signaling module to handle analog operations in chan_dahdi
This branch splits all the analog signaling logic out of chan_dahdi.c into
sig_analog.c. Functionality in theory should not change at all. As noted
in the code, there is still some unused code remaining that will be cleaned
up in a later commit.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 19:19:51 +00:00
Tilghman Lesher 98ce0e5b6c Eliminate several needless checks and fix a few memory leaks
(closes issue #14833)
 Reported by: contactmayankjain
 Patches: 
       all_changes.patch uploaded by contactmayankjain (license 740)
       slightly modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 15:35:23 +00:00
Moises Silva b93c1a2df5 set MFCR2_CATEGORY just when starting the pbx
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-23 04:27:47 +00:00
Eliel C. Sardanons 2c882626a0 Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 17:52:35 +00:00
Russell Bryant 76e9c034be resolve compiler warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 16:20:16 +00:00
Sean Bright fcda626f3c Fix build under dev mode and remove some casts that are no longer necessary as
a result of the const-ify the world patch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 16:10:33 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Richard Mudgett 0163194d93 The facilityenable parameter does not have anything to do with pritimer parameters.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 16:29:06 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Matthew Fredrickson 965b0f328e Revert CPC patch for now, until I decide whether or not it all should be merged into libss7/1.0 (It's still in the bug13495 branch and in libss7/trunk)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 17:33:42 +00:00
Sean Bright a0766f8113 Conditional include ioctl's to change EC policy based on DAHDI caps.
This feels like a sane change (wouldn't compile without this addition), but I'm
not intimately familiar with this code.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 16:43:59 +00:00
Kevin P. Fleming d9d2779008 Add buffer and echo canceller control to CHANNEL() dialplan function for DAHDI channels
Adds ability for CHANNEL() dialplan function, when used on DAHDI channels,
to temporarily change the number of buffers and/or the buffer policy, and also
to enable, disable, or switch the echo canceller between FAX/data and voice
modes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-30 21:42:35 +00:00
Matthew Fredrickson a082ad616f Add support setting CPC from channel variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-28 22:07:24 +00:00
Matthew Fredrickson 6389ec15fb Make sure that we do not clear the down flag on the BRI during PTMP link transients
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-28 22:05:05 +00:00
Russell Bryant cba19c8a67 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

Review: http://reviewboard.digium.com/r/203/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 14:04:26 +00:00
Joshua Colp b0347267b3 Merged revisions 188937 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r188937 | file | 2009-04-17 11:25:57 -0300 (Fri, 17 Apr 2009) | 4 lines
  
  Fix a situation where the DAHDI channel private structure lock was not unlocked when it should have been.
  
  (issue AST-210)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 14:26:53 +00:00
Joshua Colp ac48378d28 Fix a bug with the dahdi_setoption callback in chan_dahdi.
This function incorrectly reported success even if the option was
unsupported. This was exposed by the options to change the underlying
channel format. The function now returns a failure if the option
is unsupported.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-16 13:42:52 +00:00
David Vossel b2e77d5f5d Merged revisions 188646 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r188646 | dvossel | 2009-04-15 17:08:40 -0500 (Wed, 15 Apr 2009) | 12 lines
  
  National prefix inserted even when caller ID not available
  
  When the caller ID is restricted, the expected behavior is for the caller id to be blank.  In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank.
  
  (closes issue #13207)
  Reported by: shawkris
  Patches:
        national_prefix.diff uploaded by dvossel (license 671)
  
  Review: http://reviewboard.digium.com/r/220/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-15 22:10:04 +00:00
Jeff Peeler 2fd695d23c Don't try to do anything in pri_check_restart with service messages unless
libpri supports it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-15 14:57:20 +00:00
Jeff Peeler 50ecc19ca0 change some capitalization
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 16:49:12 +00:00
Jeff Peeler 1172c38647 Add service maintenance message support
This is the companion commit to libpri r732. Service messages are now supported
for switch types 4ess/5ess. A new option service_message_support has been added
to chan_dahdi.conf and is noted in the sample config file. The service message
support is turned off by default. The current implementation relies on AstDB
to keep track of channel state, which allows the statuses to be preserved
across Asterisk restarts. Below is a description of the storage format.

The state and reason for the service state are in the form <state>:<reason>,
where:
<state> ::= { 'O' }  // 'O' – Out Of Service
<reason> ::= { '0' | '1' | '2' | '3' }, where:
'0' – No reason (backwards compatibility)
'1' – NEAR END
'2' – FAR END
'3' – both NEAR and FAR END

The new CLI commands to handle channel service state are:
pri service disable channel <chan>
pri service enable channel <chan>

Many people contributed to the development of this functionality. Because I
entered at the very end I do not know the exact history. Special thanks to 
all who moved the bug forward one way or another:
cmaj, PCadach, markster, mattf, drmac, MikeJ, serge-v, murf, kanelbullar, Seb7,
tilghman, lmadsen, and especially dhubbard (he answered lots of my questions
and did a large portion of the work)

(closes issue #3450)
Reported by: cmaj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 15:54:16 +00:00
Mark Michelson 6f53ed4c67 This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

Review: http://reviewboard.digium.com/r/201



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 22:41:46 +00:00
Kevin P. Fleming 3525e37e63 Merged revisions 186458 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186458 | kpfleming | 2009-04-03 15:19:20 -0500 (Fri, 03 Apr 2009) | 5 lines
  
  Fix a bug where DAHDI/Zaptel channels would not properly switch formats when requested
  
  Don't offer AST_FORMAT_SLINEAR on DAHDI/Zaptel channels... while it could provide a slight performance benefit, the translation core in Asterisk has some flaws when a channel driver offers multiple raw formats. this fix is much simpler than fixing the translation core to solve that issue (although that will be done later).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 20:20:01 +00:00
Kevin P. Fleming 612fc2e7e3 Merged revisions 186081 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186081 | kpfleming | 2009-04-02 12:21:29 -0500 (Thu, 02 Apr 2009) | 3 lines
  
  ensure that the buffer passed to DAHDI_SET_BUFINFO is fully initialized
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:26:07 +00:00
Kevin P. Fleming d99d2f22cd Merged revisions 185952 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185952 | kpfleming | 2009-04-02 08:43:43 -0500 (Thu, 02 Apr 2009) | 5 lines
  
  the DAHDI_GETCONF, DAHDI_SETCONF and DAHDI_GET_PARAMS ioctls were recently corrected to show that they do, in fact, read data from userspace as part of their work. due to this fix, valgrind now reports a number of cases where chan_dahdi passed an uninitialized (or partially) buffer to these ioctls, which could lead to unexpected behavior.
  
  this patch corrects chan_dahdi to ensure that buffers passed to these ioctls are always fully initialized.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 13:51:44 +00:00
Russell Bryant ee77b475f2 Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 21:57:19 +00:00
Leif Madsen 18b4508c8e Fixes a documentation error introduced during the CLI cleanup at AstriDevCon 2008.
(closes issue #14655)
Reported by: ulogic
Patches:
      chan_dahdi.patch uploaded by ulogic (license 728)
Tested by: lmadsen

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-23 18:06:40 +00:00
Eliel C. Sardanons 830602bc69 Remove duplicate <description> inside the xml documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-20 12:12:49 +00:00
Tilghman Lesher 2e516d0c26 Merged revisions 183319 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183319 | tilghman | 2009-03-19 14:15:33 -0500 (Thu, 19 Mar 2009) | 8 lines
  
  Delay signalling progress until a PRI channel really signals progress.
  (closes issue #13034)
   Reported by: klaus3000
   Patches: 
         20090316__bug13034.diff.txt uploaded by tilghman (license 14)
         patch_trunk_183progress_klaus3000.txt uploaded by klaus3000 (license 65)
   Tested by: klaus3000
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 19:17:31 +00:00
Kevin P. Fleming 4f390ec024 Merged revisions 182882 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182882 | kpfleming | 2009-03-18 06:31:41 -0500 (Wed, 18 Mar 2009) | 3 lines
  
  fix another symbol namespace issue (reported by Andrew on asterisk-dev)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 11:40:11 +00:00
Richard Mudgett 7cfc92cc32 OPENR2 uses an incorrect string value if the extension delimiter is not present.
*  Fixed OPENR2 using an incorrect string value if the extension
delimiter is not present in the Dial() function.  This was fixed for
SS7 and PRI in trunk -r172400.
*  Made OPENR2 stripmsd behavior the same as the SS7, PRI, and others.
*  Removed trailing whitespace that appeared with OPENR2.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 01:54:53 +00:00
Russell Bryant 77a6840fd3 Add MFC/R2 support for chan_dahdi.
This commit introduces official support for R2 signaling in chan_dahdi.  The
modifications to chan_dahdi, and the supporting library, LibOpenR2, were both
written by Moises Silva.

Many users are using this code, or a variant of it, in Asterisk 1.2, 1.4 and 1.6
in Brazil, México and Argentina. An unknown number of users (but at least 1) 
are using it in each of the following countries: Colombia, Nepal, Thailand, 
Venezuela, Perú, and probably others.

To use this code, LibOpenR2 must be installed from http://www.libopenr2.org/.
Information about configuration can be found in configs/chan_dahdi.conf.sample.

The code committed is the most up to date version, which was being maintained
in svn/asterisk/team/moy/mfcr2/.

I would also like to include a Thank You to the many others that tested this
code beyond those listed in this commit message.  These are the names that I
could find in the mantis issue.

(closes issue #12509)
Reported by: moy
Patches:
      chan_zap-mfr2.patch uploaded by moy (license 222)
Tested by: moy, korihor, viniciusfontes, Skarmeth, loloski, asbestoshead, titogarrido, heliocoelhojr, konsultex, ncorrare, ecarruda, rtorresduque, PTorres, ychen

Review: http://reviewboard.digium.com/r/40/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-16 20:35:58 +00:00
Tilghman Lesher 6cc10eb351 Can't set debug level 2 (intense debugging) unless the syntax matches
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 17:44:51 +00:00
Dwayne M. Hubbard d11e6f0591 Add dynamic fax buffer configuration option to chan_dahdi.conf
When the 'faxdetect' configuration option is used, one may also want to use
the 'faxbuffers' configuration option in chan_dahdi.conf.  This option will
dynamically use the configured 'faxbuffers' buffer policy on a channel for
the life of the call following the detection of fax tones.  The faxbuffers
buffer policy will be reverted during call teardown.

An example use of 'faxbuffers' is below.  This example would switch to using
6 buffers with a full buffer policy.

faxbuffers=>6,full


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 00:13:38 +00:00
Joshua Colp fa389ab17a Don't subscribe to a mailbox on pseudo channels. It is futile. This solves an issue where duplicated pseudo channels would cause a crash because the first one would unsubscribe and the next one would also try to unsubscribe the same subscription.
(closes issue #14322)
Reported by: amessina


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 19:28:53 +00:00
Richard Mudgett e70fc3d136 Broke up the large conditional blocks so it is easy to see if a function is compiled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 17:35:37 +00:00
Richard Mudgett 97b4e9cf2a channels/chan_dahdi.c
*  Added doxygen comments to the major dahdi structures.
*  Fixed PRI and SS7 using an incorrect string value if the extension
delimiter is not present in the Dial() function.
*  Fixed SS7 not checking if the dialed extension is at least as long
as the stripmsd option.
*  Fixed PRI not handling unknown TON/NPI prefix letters correctly.
*  Fixed some uninitialized string variables on FXS ports.

configs/chan_dahdi.conf.sample
*  Updated some documentation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 20:38:34 +00:00
Tilghman Lesher ca052f64d0 Merged revisions 171963 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r171963 | tilghman | 2009-01-28 11:25:18 -0600 (Wed, 28 Jan 2009) | 2 lines
  
  Clarify log message (suggested by manxpower on #asterisk-dev)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 17:27:40 +00:00
Matthew Fredrickson 7a69506727 Don't complain about lack of D-channels on PTMP connections
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 23:28:51 +00:00
Doug Bailey 906d665477 Handle new VMWI ioctl structure (Now there are two VMWI ioctl calls.)
(issue #14104)
Reported by: alecdavis
Tested by: dbailey



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 15:23:40 +00:00
Matthew Fredrickson f5ee4e99fa We should not do restart messages if we're in PTMP mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 17:03:41 +00:00
Doug Bailey de63e93a39 MWI messages included in CID spill was not being properly handled and prevented the call from being processed
(issue #14313)
Reported by: seandarcy
Tested by: dbailey


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 16:35:30 +00:00
Matthew Fredrickson 55fd5f2d2d Make sure we don't set the channel to be inalarm for a D-channel drop on PTMP connections
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 23:23:22 +00:00
Doug Bailey 9a28a07739 change VMWI to use new DAHDI_VMWI ioctl call.
Change configure script to detect the new ioctl call data structure.    
(issue #14104)
Reported by: alecdavis
Patches:
      mwiioctl_structure_asterisk.diff4.txt uploaded by dbailey (license )
Tested by: alecdavis, dbailey


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 15:49:24 +00:00
Richard Mudgett 2da6670f10 * Adjust some conditionals to balance curly braces.
*  Other minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 02:10:41 +00:00
Richard Mudgett e13016057e Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 00:23:30 +00:00
Mark Michelson f6bb99a5c5 Test commit for test issue #14303
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 23:20:27 +00:00
Doug Bailey 42d4853f61 Get rid of magic number and replace with DAHDI_VMWI_NUMBER_MASK when
determining the number of messages pending for MWI call


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 18:22:44 +00:00
Doug Bailey 82d76adeb8 Add enhanced MWI generation to take advantage of new dahdi line reversal MWI ability.
(closes issue #14104)
Reported by: alecdavis
Patches:
      asttrunk-14104.diff2.txt uploaded by dbailey (license )
      chan_dahdi.rpas_and_fsk.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, dbailey


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 16:33:41 +00:00
Doug Bailey 65120a3b33 Add discriminator for when ring pulse alert signal is used to preface MWI spills
This prevents the situation when MWI messages are added to caller ID spills causing the channel to be hung up


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-17 18:26:44 +00:00
Doug Bailey 5d2a24d138 This fixes a problem where MWI FSK spills were being injected onto off hook fxs lines.
(closes issue #14143)
Reported by: alecdavis
Patches:
      chan_dahdi-14143.patch.txt uploaded by dbailey (license )
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 21:19:45 +00:00
Tilghman Lesher a4505c6e1f Convert dialplan application DAHDISendCallreroutingFacility to use commas.
(closes issue #13836)
 Reported by: eliel
 Patches: 
       chan_dahdi.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-08 19:44:19 +00:00
Doug Bailey 08e142b1e7 Cleanup fsk spill if off hook is detected during mwi spill.
Correct logic error in handling events when sending mwi spill 
(closes issue #14143)
Reported by: alecdavis
Patches:
      chan_dahdi.handle_init_event2.diff.txt uploaded by dbailey



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 17:05:37 +00:00
Mark Michelson 4412a4ba24 Change some incorrect syntax for pri set debug and correct
an off-by-one error in ss7 set debug command



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-31 21:52:02 +00:00
Mark Michelson 61c0d20d20 Merged revisions 166380 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r166380 | mmichelson | 2008-12-22 14:56:29 -0600 (Mon, 22 Dec 2008) | 36 lines

Fix a deadlock relating to channel locks and autoservice

It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to 
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of 
autoservice.

The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.

The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.

In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.

It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.

(closes issue #14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

Review: http://reviewboard.digium.com/r/107/


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 21:08:03 +00:00