Commit Graph

186 Commits

Author SHA1 Message Date
Alec L Davis a4f6d96b2e push 'outgoing' flag from sig_XXX up to chan_dahdi
'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag.
sig_pri and sig_ss7 were keeping 'outgoing' flag insync.

Now provides a callback for all the low level sig_XXX modules.

(issue ASTERISK-19316)

alecdavis (license 585)
Reported by: Jeremy Pepper
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1747/
........

Merged revisions 355850 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 355851 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-18 08:02:08 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Richard Mudgett 63c5eaee43 Restore the 'w' modifier support for ISDN spans. Dial(DAHDI/g0/1234w888)
This feature also causes the sending complete ie to be sent for switch
types that do not automatically send the ie.  (EuroISDN/ETSI)

The main difference between dialing Dial(DAHDI/g0/1234w888) and
Dial(DAHDI/g0/1234,,D(888)) is the sending of the sending complete ie.

(closes issue ASTERISK-19176)
Reported by: rmudgett
Tested by: rmudgett
........

Merged revisions 353867 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 353868 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02 20:18:11 +00:00
Richard Mudgett 23bc964e1c Constify some more channel driver technology callback parameters.
Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Richard Mudgett 4a125f45a0 Remove dead code since pri_grab() can never fail.
Dead code makes programmers sick.  I am sick of looking at it.
........

Merged revisions 345546 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 345558 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-17 17:31:16 +00:00
Richard Mudgett bd4f81b51f Fix typo in sig_pri using wrong structure name.
It is fortunate that the typo does not alter generated code since the
e->restart.channel and e->ring.channel members are in the same position.

(closes issue ASTERISK-18868)
Reported by: zvision
Patches:
      sig_pri.c.diff (License #5755) patch uploaded by zvision
........

Merged revisions 345370 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 345371 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-15 18:18:11 +00:00
Richard Mudgett 6cf08ad550 Change D-channel warning to be less confusing on non-NFAS setups.
The "No D-channels available!  Using Primary channel as D-channel anyway!"
WARNING message has been confusing on non-NFAS setups.  The message refers
to things that are NFAS specific.

* Changed the warning to several different warnings to be more accurate
for the situation and less confusing as a result:
"No D-channels up!  Switching selected D-channel from X to Y.",
"No D-channels up!", and
"D-channel is down!".
........

Merged revisions 342484 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 342485 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25 21:54:31 +00:00
Richard Mudgett 50350a47ea Merged revisions 338323 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r338323 | rmudgett | 2011-09-28 17:36:57 -0500 (Wed, 28 Sep 2011) | 12 lines
  
  Merged revisions 338322 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r338322 | rmudgett | 2011-09-28 17:35:52 -0500 (Wed, 28 Sep 2011) | 5 lines
    
    Make duplicate call ptr warning message more helpful.
    
    * Adds the value of the call ptr to the duplicate call ptr message to help
    trace why there is a duplicate call ptr.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-28 22:38:00 +00:00
Richard Mudgett e39f6bba33 Merged revisions 337721 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337721 | rmudgett | 2011-09-22 16:37:41 -0500 (Thu, 22 Sep 2011) | 25 lines
  
  Merged revisions 337720 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337720 | rmudgett | 2011-09-22 16:29:46 -0500 (Thu, 22 Sep 2011) | 18 lines
    
    Made ISDN not add numbering plan prefix strings to empty numbers.
    
    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 Caller-ID number even if it is restricted (empty) causing the
    Caller-ID to be the national prefix rather than blank.
    
    This behavior was lost when sig_pri was extracted from chan_dahdi.
    
    * Made not add prefix strings to empty connected line, calling, and ANI
    number strings.
    
    (closes issue ASTERISK-18577)
    Reported by: Kris Shaw
    Patches:
          jira_asterisk_18577_v1.8.patch (license #5621) patch uploaded by rmudgett
    Tested by: Kris Shaw
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-22 21:42:35 +00:00
Richard Mudgett 0f9330b58c Merged revisions 336570 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336570 | rmudgett | 2011-09-19 10:32:00 -0500 (Mon, 19 Sep 2011) | 11 lines
  
  Merged revisions 336569 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336569 | rmudgett | 2011-09-19 10:25:34 -0500 (Mon, 19 Sep 2011) | 4 lines
    
    Rework sig_pri_hangup() to be simpler and clearer.
    
    JIRA AST-675
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 15:36:39 +00:00
Matthew Jordan 8b5ba33fe0 Merged revisions 335078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines
  
  Merged revisions 335064 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines
    
    Updated SIP 484 handling; added Incomplete control frame
    
    When a SIP phone uses the dial application and receives a 484 Address 
    Incomplete response, if overlapped dialing is enabled for SIP, then
    the 484 Address Incomplete is forwarded back to the SIP phone and the
    HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
    application dialplan logic was automatically triggered; now, explicit
    dialplan usage of the application is required.
    
    Additionally, this patch adds a new AST_CONTOL_FRAME type called
    AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
    it is an indication that the dialplan expects more digits back from the
    device.  If the device supports overlap dialing it should attempt to 
    notify the device that the dialplan is waiting for more digits; otherwise,
    it can handle the frame in a manner appropriate to the channel driver.
    
    (closes issue ASTERISK-17288)
    Reported by: Mikael Carlsson
    Tested by: Matthew Jordan
    
    Review: https://reviewboard.asterisk.org/r/1416/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:28:23 +00:00
Richard Mudgett 265102faf8 Merged revisions 332265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r332265 | rmudgett | 2011-08-17 11:01:29 -0500 (Wed, 17 Aug 2011) | 33 lines
  
  Merged revisions 332264 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r332264 | rmudgett | 2011-08-17 10:51:08 -0500 (Wed, 17 Aug 2011) | 26 lines
    
    Outgoing BRI calls fail when using Asterisk 1.8 with HA8, HB8, and B410P cards.
    
    France Telecom brings layer 2 and layer 1 down on BRI lines when the line
    is idle.  When layer 1 goes down Asterisk cannot make outgoing calls and
    the HA8 and HB8 cards also get IRQ misses.
    
    The inability to make outgoing calls is because the line is in red alarm
    and Asterisk will not make calls over a line it considers unavailable.
    The IRQ misses for the HA8 and HB8 card are because the hardware is
    switching clock sources from the line which just brought layer 1 down to
    internal timing.
    
    There is a DAHDI option for the B410P card to not tell Asterisk that layer
    1 went down so Asterisk will allow outgoing calls: "modprobe wcb4xxp
    teignored=1".  There is a similar DAHDI option for the HA8 and HB8 cards:
    "modprobe wctdm24xxp bri_teignored=1".  Unfortunately that will not clear
    up the IRQ misses when the telco brings layer 1 down.
    
    * Add layer 2 persistence option to customize the layer 2 behavior on BRI
    PTMP lines.  The new option has three settings: 1) Use libpri default
    layer 2 setting.  2) Keep layer 2 up.  Bring layer 2 back up when the peer
    brings it down.  3) Leave layer 2 down when the peer brings it down.
    Layer 2 will be brought up as needed for outgoing calls.
    
    JIRA AST-598
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-17 16:18:27 +00:00
Richard Mudgett a3ba55e7c7 Merged revisions 330051 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330051 | rmudgett | 2011-07-28 12:10:37 -0500 (Thu, 28 Jul 2011) | 29 lines
  
  Merged revisions 330050 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r330050 | rmudgett | 2011-07-28 12:04:24 -0500 (Thu, 28 Jul 2011) | 22 lines
    
    Merged revisions 330033 from
    https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
    
    ..........
      r330033 | rmudgett | 2011-07-28 11:26:38 -0500 (Thu, 28 Jul 2011) | 15 lines
    
      Datacalls with B410P fail.
    
      Incoming and outgoing call legs of a data call are using different
      formats: a-law, u-law.  When the call is bridged, the media stream is run
      through translation to convert the media formats.  The translation is bad
      for data calls.
    
      * Make incoming call that does not explicitly specify u-law or a-law use
      the DAHDI channel's default law.  The outgoing call always uses the
      default law from the DAHDI channel.
    
      (closes issue ABE-2800)
      Patches:
    	jira_abe_2800_companding.patch (license #5621) patch uploaded by rmudgett
    ..........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-28 17:16:07 +00:00
Russell Bryant f243d129c9 Merged revisions 329257 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r329257 | russell | 2011-07-21 15:22:36 -0500 (Thu, 21 Jul 2011) | 2 lines
  
  s/1.10/10.0/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-21 20:26:44 +00:00
Richard Mudgett 5257a915a8 Option needed for Q931_IE_TIME_DATE to be optional in CONNECT message.
The NEC SV8300 rejects the Q931_IE_TIME_DATE for Q.SIG.

Add option to specify if and how much of the current time is put in
Q931_IE_TIME_DATE.
* Send date/time ie never.
* Send date/time ie date only.
* Send date/time ie date and hour.
* Send date/time ie date, hour, and minute.
* Send date/time ie date, hour, minute, and second.
* Send date/time ie default: Libpri will send date and hhmm only when in
NT PTMP mode to support ISDN phones.

(closes issue #19221)
Reported by: kenner

JIRA SWP-3396


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-17 20:13:27 +00:00
Richard Mudgett 1ad49f46ce Merged revisions 318783 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r318783 | rmudgett | 2011-05-12 20:47:05 -0500 (Thu, 12 May 2011) | 14 lines
  
  PRI early media won't ring.
  
  And another way to pass early media.  Don't indicate that there is inband
  information present, just assume that the B channel is connected.
  
  * Restore clearing the dialing flag Rx squelch unconditionally when a
  PROCEEDING message comes in.
  
  (closes issue #19268)
  Reported by: tbsky
  Patches:
        issue19268_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: tbsky
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-13 01:50:15 +00:00
Richard Mudgett d1e27b1026 Merged revisions 318499 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r318499 | rmudgett | 2011-05-10 18:41:08 -0500 (Tue, 10 May 2011) | 15 lines
  
  Unable to pickup DAHDI/PRI call because call state is reported as DIALING.
  
  The channel state is not updated to RINGING when an ALERTING message is
  received.  Regression caused when sig_pri.c (also sig_ss7.c) extracted
  from chan_dahdi.c.
  
  * Added missing channel state update to RINGING when the
  AST_CONTROL_RINGING frame is queued for ISDN and SS7.
  
  (closes issue #19257)
  Reported by: alecdavis
  Patches:
        issue19257_v1.8_v2.patch uploaded by rmudgett (license 664)
  Tested by: alecdavis, rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-10 23:42:57 +00:00
Richard Mudgett d7c94e1e04 Merged revisions 318231 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r318231 | rmudgett | 2011-05-09 11:57:18 -0500 (Mon, 09 May 2011) | 41 lines
  
  Don't get early media for ISDN on outgoing calls.
  
  It looks to be a long-standing misinterpretation of the progress indicator
  ie values:
  1 - Call is not end-to-end ISDN; further call progress information may be
  available in-band.
  8 - In-band information or an appropriate pattern is now available.
  
  Only value 8 is handled by chan_dahdi/sig_pri.  The 1 value is not handled
  as early media probably because the meaning of the second half of it's
  description was overlooked.
  
  * Test to see if either PRI_PROG_CALL_NOT_E2E_ISDN(1) or
  PRI_PROG_INBAND_AVAILABLE(8) bits are set to open the media path.
  
  (closes issue #18868)
  Reported by: isrl
  Patches:
        issue18868_19246_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: satish_lx
  
  ..........
  
  No inband progress on PRI_EVENT_RINGING even if inband flag set.
  
  My ISDN-PRI provider sends an ALERTING with "Inband information or
  appropriate pattern now available", but Asterisk only generates and passes
  the RING to the SIP extension, not the inband message.  Unfortunately, the
  inband message is not a ringback tone but a prompt that says the number is
  not in service.  The SIP extension then hears two rings and the call is
  hungup which confuses the caller.
  
  * Post an AST_CONTROL_PROGRESS as well as opening the media path if inband
  audio is indicated with an ALERTING message.
  
  (closes issue #19246)
  Reported by: cristiandimache
  Patches:
        issue19246_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: cristiandimache
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-09 17:00:05 +00:00
Richard Mudgett 810b9c8879 Merged revisions 316224 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316224 | rmudgett | 2011-05-03 14:18:30 -0500 (Tue, 03 May 2011) | 16 lines
  
  The dahdi_hangup() call does not clean up the channel fully.
  
  After dahdi_hangup() has supposedly hungup an ISDN channel there is still
  traffic on the S0-bus because the channel was not cleaned up fully.
  
  Shuffled the hangup code to include some missing cleanup.  Also fixed some
  code formatting in the area.  I think the primary missing clean up code
  was the call to tone_zone_play_tone() to turn off any active tones on the
  channel.
  
  (closes issue #19188)
  Reported by: jg1234
  Patches:
        issue19188_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: jg1234
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 19:22:29 +00:00
Richard Mudgett 0f1ff9141e Implement AMI action PRIShowSpans.
PRIShowSpans works like the AMI action DAHDIShowChannels but for PRI
spans.  It is similar to the CLI command "pri show spans".

(closes issue #15980)
Reported by: dwery


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 22:53:05 +00:00
Richard Mudgett 13e925b276 Simplify sig_pri.c:build_status().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 22:42:41 +00:00
Richard Mudgett 37274c73ee Problems with ISDN MWI to phones.
The "controlling user number" is always the number of the voice mail box
which is identical with the subscriber number itself.  This number which
is listed in the ISDN phone MWI menu cannot be called back to contact the
voice mail box.  The controlling user number should be made configurable.

JIRA ABE-2738
JIRA SWP-2846


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-18 19:48:00 +00:00
Richard Mudgett ce17f956dc Add private lock deadlock avoidance callback to PRI and SS7.
Factor out the equivalent function for analog.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-08 16:17:32 +00:00
Alec L Davis 1e33d71b79 Merged revisions 313001 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r313001 | alecdavis | 2011-04-07 22:19:31 +1200 (Thu, 07 Apr 2011) | 13 lines
  
  Fix ISDN calling subaddr User Specified Odd/Even Flag
  
  Calculation of the Odd/Even flag was wrong.
  Implement correct algo, and set odd/even=0 if data would be truncated.
  Only allow automatic calculation of the O/E flag, don't let dialplan influence.
  
  (closes issue #19062)
  Reported by: festr
  Patches: 
        bug19062.diff2.txt uploaded by alecdavis (license 585)
  Tested by: festr, alecdavis, rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-07 10:30:26 +00:00
Richard Mudgett 698a356737 Merged revisions 312949 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r312949 | rmudgett | 2011-04-05 13:45:24 -0500 (Tue, 05 Apr 2011) | 6 lines
  
  Crash if ISDN span layer 1 is down on initial load.
  
  Regression from -r312575 B channel shifting during negotiation.
  
  * Also combine updating the alarm flag with clearing the resetting flag.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-05 18:47:11 +00:00
Richard Mudgett 121b90a47d Remove the channel parameter from sig_pri_handle_subcmds().
It was only used in a debug message and may not be correct anyway.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-04 19:31:37 +00:00
Richard Mudgett e1ceb52b51 Merged revisions 312575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r312575 | rmudgett | 2011-04-04 11:10:50 -0500 (Mon, 04 Apr 2011) | 52 lines
  
  Merged revisions 312574 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r312574 | rmudgett | 2011-04-04 11:00:02 -0500 (Mon, 04 Apr 2011) | 45 lines
    
    Merged revisions 312573 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r312573 | rmudgett | 2011-04-04 10:49:30 -0500 (Mon, 04 Apr 2011) | 38 lines
      
      Issues with ISDN calls changing B channels during call negotiations.
      
      The handling of the PROCEEDING message was not using the correct call
      structure if the B channel was changed.  (The same for PROGRESS.) The call
      was also not hungup if the new B channel is not provisioned or is busy.
      
      * Made all call connection messages (SETUP_ACKNOWLEDGE, PROCEEDING,
      PROGRESS, ALERTING, CONNECT, CONNECT_ACKNOWLEDGE) ensure that they are
      using the correct structure and B channel.  If there is any problem with
      the operations then the call is now hungup with an appropriate cause code.
      
      * Made miscellaneous messages (INFORMATION, FACILITY, NOTIFY) find the
      correct structure by looking for the call and not using the channel ID.
      NOTIFY is an exception with versions of libpri before v1.4.11 because a
      call pointer is not available for Asterisk to use.
      
      * Made all hangup messages (DISCONNECT, RELEASE, RELEASE_COMPLETE) find
      the correct structure by looking for the call and not using the channel
      ID.
      
      (closes issue #18313)
      Reported by: destiny6628
      Tested by: rmudgett
      JIRA SWP-2620
      
      (closes issue #18231)
      Reported by: destiny6628
      Tested by: rmudgett
      JIRA SWP-2924
      
      (closes issue #18488)
      Reported by: jpokorny
      JIRA SWP-2929
      
      JIRA AST-437 (The issues fixed here are most likely causing this JIRA issue.)
      JIRA DAHDI-406
      JIRA LIBPRI-33 (Stuck resetting flag likely fixed)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-04 16:17:58 +00:00
Richard Mudgett d000b76ebc Merged revisions 311297 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r311297 | rmudgett | 2011-03-17 21:59:05 -0500 (Thu, 17 Mar 2011) | 12 lines
  
  Race condition when ISDN CallRerouting/CallDeflection invoked.
  
  The queued AST_CONTROL_BUSY could sometimes be processed before the
  call_forward dial string is recognized.
  
  * Moved setting the call_forwarding dial string after sending a response
  to the initiator and just queue an empty frame to wake up the media thread
  instead of an AST_CONTROL_BUSY.
  
  * Added check for empty rerouting/deflection number and respond with an
  error.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@311298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-18 03:00:39 +00:00
Richard Mudgett c551e9105d Merged revisions 309994 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r309994 | rmudgett | 2011-03-08 10:37:02 -0600 (Tue, 08 Mar 2011) | 1 line
  
  Make pri parameter description consistent.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-08 16:46:16 +00:00
Richard Mudgett 928ec2b990 Merged revisions 309445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r309445 | rmudgett | 2011-03-04 09:22:04 -0600 (Fri, 04 Mar 2011) | 46 lines
  
  Get real channel of a DAHDI call.
  
  Starting with Asterisk v1.8, the DAHDI channel name format was changed for
  ISDN calls to: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number>
  
  There were several reasons that the channel name had to change.
  
  1) Call completion requires a device state for ISDN phones.  The generic
  device state uses the channel name.
  
  2) Calls do not necessarily have B channels.  Calls placed on hold by an
  ISDN phone do not have B channels.
  
  3) The B channel a call initially requests may not be the B channel the
  call ultimately uses.  Changes to the internal implementation of the
  Asterisk master channel list caused deadlock problems for chan_dahdi if it
  needed to change the channel name.  Chan_dahdi no longer changes the
  channel name.
  
  4) DTMF attended transfers now work with ISDN phones because the channel
  name is "dialable" like the chan_sip channel names.
  
  For various reasons, some people need to know which B channel a DAHDI call
  is using.
  
  * Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and
  CHANNEL(dahdi_type) so the dialplan can determine the B channel currently
  in use by the channel.  Use CHANNEL(no_media_path) to determine if the
  channel even has a B channel.
  
  * Added AMI event DAHDIChannel to associate a DAHDI channel with an
  Asterisk channel so AMI applications can passively determine the B channel
  currently in use.  Calls with "no-media" as the DAHDIChannel do not have
  an associated B channel.  No-media calls are either on hold or
  call-waiting.
  
  (closes issue #17683)
  Reported by: mrwho
  Tested by: rmudgett
  
  (closes issue #18603)
  Reported by: arjankroon
  Patches:
        issue17683_18603_v1.8_v2.patch uploaded by rmudgett (license 664)
  Tested by: stever28, rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 15:28:20 +00:00
Richard Mudgett 2b063d4dca Merged revisions 308622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r308622 | rmudgett | 2011-02-23 17:38:04 -0600 (Wed, 23 Feb 2011) | 9 lines
  
  sig_pri_new_ast_channel() should return NULL when new_ast_channel() fails.
  
  (closes issue #18874)
  Reported by: cmaj
  Patches:
        patch-sig_pri-crash-possible-null-channel-pointer.diff.txt uploaded by cmaj (license 830)
  
  JIRA SWP-3172
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-23 23:45:02 +00:00
Richard Mudgett 4a48600231 Add CLI "pri show channels" command.
List the current mapping of DAHDI B channels to Asterisk channel names and
which calls are on hold or call-waiting.  Calls on hold or call-waiting
are not associated with any B channel.

JIRA LIBPRI-27
JIRA SWP-2547


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 21:42:55 +00:00
Richard Mudgett b2ef13cb60 Merged revisions 307879 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r307879 | rmudgett | 2011-02-15 10:13:55 -0600 (Tue, 15 Feb 2011) | 37 lines
  
  No response sent for SIP CC subscribe/resubscribe request.
  
  Asterisk does not send a response if we try to subscribe for call
  completion after we have received a 180 Ringing.  You can only subscribe
  for call completion when the call has been cleared.
  
  When we receive the 180 Ringing, for this call, its call-completion state
  is 'CC_AVAILABLE'.  If we then send a subscribe message to Asterisk, it
  trys to change the call-completion state to 'CC_CALLER_REQUESTED'.
  Because this is an invalid state change, it just ignores the message.  The
  only state Asterisk will accept our subscribe message is in the
  'CC_CALLER_OFFERED' state.
  
  Asterisk will go into the 'CC_CALLER_OFFERED' when the SIP client clears
  the call by sending a CANCEL.
  
  Asterisk should always send a response.  Even if its a negative one.
  
  
  The fix is to allow for the CCSS core to notify a CC agent that a failure
  has occurred when CC is requested.  The "ack" callback is replaced with a
  "respond" callback.  The "respond" callback has a parameter indicating
  either a successful response or a specific type of failure that may need
  to be communicated to the requester.
  
  (closes issue #18336)
  Reported by: GeorgeKonopacki
  Tested by: mmichelson, rmudgett
  
  JIRA SWP-2633
  
  (closes issue #18337)
  Reported by: GeorgeKonopacki
  Tested by: mmichelson
  
  JIRA SWP-2634
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 16:18:43 +00:00
Richard Mudgett 49feb747ba Pass a MCID request to the bridged channel.
Pass a MCID request to the bridged channel so the bridged channel can send
it to the network.

The ability to send the MCID request on an ISDN span is enabled with the
new chan_dahdi.conf mcid_send option.

JIRA SWP-2845
JIRA ABE-2736


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-07 23:33:44 +00:00
Richard Mudgett a8aeb04a9f Add ISDN display ie text handling options to chan_dahdi.conf.
The display ie handling can be controlled independently in the send and
receive directions with the following options:

* Block display text data.

* Use display text in SETUP/CONNECT messages for name.

* Use display text for COLP name updates (FACILITY/NOTIFY as appropriate).

* Pass arbitrary display text during a call.  Sent in INFORMATION
messages.  Received from any message that the display text was not used as
a name.

If the display options are not set then the options default to legacy
behavior.

The arbitrary display text is exchanged between bridged channels using the
AST_FRAME_TEXT frame type.

To send display text from the dialplan use the SendText() application when
the arbitrary display text option is enabled.

JIRA SWP-2688
JIRA ABE-2693


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 20:30:48 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
Richard Mudgett 44349de2df Merged revisions 305343 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r305343 | rmudgett | 2011-01-31 18:01:09 -0600 (Mon, 31 Jan 2011) | 21 lines
  
  Merged revisions 305342 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r305342 | rmudgett | 2011-01-31 17:50:10 -0600 (Mon, 31 Jan 2011) | 14 lines
    
    Merged revisions 305341 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r305341 | rmudgett | 2011-01-31 17:45:58 -0600 (Mon, 31 Jan 2011) | 7 lines
      
      Obtain the pri lock for PRI queue counters.
      
      Need to obtain the pri lock when calling pri_dump_info_str() to avoid a
      reentrancy problem when calculating the Q.921 Q count statistic.
      
      JIRA AST-484
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-01 00:07:30 +00:00
Richard Mudgett ecdbb3d1d9 Merged from revision 304341
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

..........
  r304341 | rmudgett | 2011-01-26 16:38:39 -0600 (Wed, 26 Jan 2011) | 7 lines

  Add connected line chan_dahdi.conf pricpndialplan option.

  * Added from_channel value to prilocaldialplan option.

  JIRA ABE-2731
  JIRA SWP-2842
..........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-27 00:06:27 +00:00
Richard Mudgett 7889af7cab Merged revisions 303771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r303771 | rmudgett | 2011-01-25 11:49:20 -0600 (Tue, 25 Jan 2011) | 54 lines
  
  Merged revisions 303769 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r303769 | rmudgett | 2011-01-25 11:42:42 -0600 (Tue, 25 Jan 2011) | 47 lines
    
    Merged revisions 303765 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r303765 | rmudgett | 2011-01-25 11:36:50 -0600 (Tue, 25 Jan 2011) | 40 lines
      
      Sending out unnecessary PROCEEDING messages breaks overlap dialing.
      
      Issue #16789 was a good idea.  Unfortunately, it breaks overlap dialing
      through Asterisk.  There is not enough information available at this point
      to know if dialing is complete.  The ast_exists_extension(),
      ast_matchmore_extension(), and ast_canmatch_extension() calls are not
      adequate to detect a dial through extension pattern of "_9!".
      
      Workaround is to use the dialplan Proceeding() application early in
      non-dial through extensions.
      
      * Effectively revert issue #16789.
      
      * Allow outgoing overlap dialing to hear dialtone and other early media.
      A PROGRESS "inband-information is now available" message is now sent after
      the SETUP_ACKNOWLEDGE message for non-digital calls.  An
      AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE
      messages for non-digital calls.
      
      * Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was
      inconsistent with the cause codes.
      
      * Added better protection from sending out of sequence messages by
      combining several flags into a single enum value representing call
      progress level.
      
      * Added diagnostic messages for deferred overlap digits handling corner
      cases.
      
      (closes issue #17085)
      Reported by: shawkris
      
      (closes issue #18509)
      Reported by: wimpy
      Patches:
            issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664)
            Expanded upon issue18509_early_media_v1.8_v3.patch to include analog
            and SS7 because of backporting requirements.
      Tested by: wimpy, rmudgett
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-25 17:58:00 +00:00
Richard Mudgett c69406f384 Merged revisions 301946 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r301946 | rmudgett | 2011-01-14 15:09:57 -0600 (Fri, 14 Jan 2011) | 13 lines
  
  Deadlock between dahdi_request() and pri_dchannel() processing an incomming call.
  
  The sig_pri_new_ast_channel() is called with the channel private lock held
  when pri_dchannel() calls it and no channel private lock held when
  dahdi_request() calls it.  The use of pri_grab() in
  sig_pri_new_ast_channel() could leave the channel private lock held when
  it returns if the lock was not held before calling it.
  
  Make sig_pri_new_ast_channel() just lock the PRI span lock instead of
  using pri_grab().  It is safe to do this because dahdi_request() does not
  have the channel private lock and the deadlock potential with the PRI span
  lock is only between pri_dchannel() and other threads.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-14 21:13:08 +00:00
Richard Mudgett 398d633ce0 Merged revisions 300714 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r300714 | rmudgett | 2011-01-05 14:54:21 -0600 (Wed, 05 Jan 2011) | 21 lines
  
  Merged revision 300711 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r300711 | rmudgett | 2011-01-05 13:43:55 -0600 (Wed, 05 Jan 2011) | 14 lines
  
    A call retrieved from hold may wind up with no audio.
  
    If the retrieved call is natively bridged then the call may not have any
    audio path.  The following warning message is given:
    "Failed to add <dfd> to conference <chan>/<chan>: Invalid argument".
  
    * Open the media on a B channel when pri_fixup_principle() moves the call
    from a no_b_channel channel to a real channel.
  
    * Added lock protection while pri_fixup_principle() moves a call from one
    private structure to another.
  
    * Made some pri_fixup_principle() messages more meaningful.
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-05 21:07:40 +00:00
Richard Mudgett 90177fe708 Optional HOLD/RETRIEVE signaling for PTMP TE when the bridge goes on and off hold.
Added the moh_signaling option to specify what to do when the channel's
bridged peer puts the ISDN channel on and off of hold.

Implemented as a FSM to control libpri ISDN signaling when the bridged
peer places the channel on and off of hold with the AST_CONTROL_HOLD and
AST_CONTROL_UNHOLD control frames.

JIRA SWP-2687
JIRA ABE-2691

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-04 16:38:28 +00:00
Richard Mudgett 17d2c0f787 Merged revisions 299405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r299405 | rmudgett | 2010-12-21 20:10:39 -0600 (Tue, 21 Dec 2010) | 17 lines
  
  Chan_dahdi sends an empty COLP on the bridged channel.
  
  Chan_dahdi always inserts a connected party IE when you call from one
  dahdi channel to another dahdi channel, even if no such information was
  received on the 2nd channel.  This clears the display of many phones.
  
  * Removed leftover artifact from before the valid flag was added.
  
  * Updated all of the channel's caller id information with the new
  connected line information instead of just the string parts.
  
  (closes issue #18508)
  Reported by: wimpy
  Patches:
        issue18508_trunk.patch uploaded by rmudgett (license 664)
  Tested by: wimpy, rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-22 02:12:01 +00:00
Richard Mudgett fe98e1bcd6 Post AMI hold events on PRI spans when the remote party HOLD/RETRIEVEs the call.
Part of JIRA SWP-2687/ABE-2691.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 22:10:40 +00:00
Richard Mudgett 7f29edd140 Merged revisions 298195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r298195 | rmudgett | 2010-12-13 11:11:43 -0600 (Mon, 13 Dec 2010) | 33 lines
  
  Merged revisions 298194 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r298194 | rmudgett | 2010-12-13 11:04:41 -0600 (Mon, 13 Dec 2010) | 26 lines
    
    Merged revisions 298193 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r298193 | rmudgett | 2010-12-13 10:56:07 -0600 (Mon, 13 Dec 2010) | 19 lines
      
      Outgoing PRI/BRI calls cannot do DTMF triggered transfers.
      
      Outgoing PRI/BRI calls cannot do DTMF triggered transfers if a PROCEEDING
      message is not received.  The debug output shows that the DTMF begin event
      is seen, but the DTMF end event is missing.  When the DTMF begin happens,
      the call is muted so we now have one way audio (until a DTMF end event is
      somehow seen).
      
      * Made set the proceeding flag when the PRI_EVENT_ANSWER event is
      received.
      
      * Made absorb the DTMF begin and DTMF end events if we are overlap dialing
      and have not seen a PROCEEDING message.
      
      * Added a debug message when absorbing a DTMF event.
      
      JIRA SWP-2690
      JIRA ABE-2697
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 17:18:17 +00:00
Richard Mudgett 5d1cd7863a Merged revisions 294823 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r294823 | rmudgett | 2010-11-11 20:45:22 -0600 (Thu, 11 Nov 2010) | 25 lines
  
  Merged revisions 294822 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r294822 | rmudgett | 2010-11-11 20:44:12 -0600 (Thu, 11 Nov 2010) | 18 lines
    
    Merged revisions 294821 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r294821 | rmudgett | 2010-11-11 20:41:13 -0600 (Thu, 11 Nov 2010) | 11 lines
      
      Asterisk is getting a "No D-channels available!" warning message every 4 seconds.
      
      Asterisk is just whining too much with this message: "No D-channels
      available!  Using Primary channel XXX as D-channel anyway!".
      
      Filtered the message so it only comes out once if there is no D channel
      available without an intervening D channel available period.
      
      (closes issue #17270)
      Reported by: jmls
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-12 02:46:03 +00:00
Richard Mudgett 3adb425b25 Merged revisions 294349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294349 | rmudgett | 2010-11-09 10:55:32 -0600 (Tue, 09 Nov 2010) | 17 lines
  
  Analog lines do not transfer CONNECTED LINE or execute the interception macros.
  
  Add connected line update for sig_analog transfers and simplify the
  corresponding sig_pri and chan_misdn transfer code.
  
  Note that if you create a three-way call in sig_analog before transferring
  the call, the distinction of the caller/callee interception macros make
  little sense.  The interception macro writer needs to be prepared for
  either caller/callee macro to be executed.  The current implementation
  swaps which caller/callee interception macro is executed after a three-way
  call is created.
  
  Review:	https://reviewboard.asterisk.org/r/996/
  
  JIRA ABE-2589
  JIRA SWP-2372
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 17:00:07 +00:00
Richard Mudgett f6cdefbc07 Merged revisions 293081 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r293081 | rmudgett | 2010-10-26 11:32:59 -0500 (Tue, 26 Oct 2010) | 1 line
  
  No need to define the struct if there are no users.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-26 16:33:50 +00:00
Richard Mudgett b6c5dde767 Merged revisions 293046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r293046 | rmudgett | 2010-10-26 10:53:58 -0500 (Tue, 26 Oct 2010) | 4 lines
  
  Allow the DAHDI driver to compile, even with a sufficiently older version of libpri.
  
  Fixes our Bamboo builds.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-26 16:01:08 +00:00
Tilghman Lesher f96d27b917 Merged revisions 292969 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292969 | tilghman | 2010-10-25 16:15:19 -0500 (Mon, 25 Oct 2010) | 2 lines
  
  Several more defines that need to be altered for compiling against an older version of libpri
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-25 21:16:25 +00:00
Tilghman Lesher 7bc278bd06 Merged revisions 292906 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292906 | tilghman | 2010-10-25 14:28:35 -0500 (Mon, 25 Oct 2010) | 4 lines
  
  Allow the DAHDI driver to compile, even with a sufficiently older version of libpri.
  
  Fixes our Bamboo builds.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-25 19:30:39 +00:00
Richard Mudgett 64845d73c7 Merged revisions 292704 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292704 | rmudgett | 2010-10-22 10:47:08 -0500 (Fri, 22 Oct 2010) | 19 lines
  
  Connected line is not updated when chan_dahdi/sig_pri or chan_misdn transfers a call.
  
  When a call is transfered by ECT or implicitly by disconnect in sig_pri or
  implicitly by disconnect in chan_misdn, the connected line information is
  not exchanged.  The connected line interception macros also need to be
  executed if defined.
  
  The CALLER interception macro is executed for the held call.
  The CALLEE interception macro is executed for the active/ringing call.
  
  JIRA ABE-2589
  JIRA SWP-2296
  
  Patches:
        abe_2589_c3bier.patch uploaded by rmudgett (license 664)
        abe_2589_v1.8_v2.patch uploaded by rmudgett (license 664)
  
  Review: https://reviewboard.asterisk.org/r/958/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 15:47:56 +00:00
Richard Mudgett 136b89e1bc Merged revisions 292489 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292489 | rmudgett | 2010-10-20 20:02:50 -0500 (Wed, 20 Oct 2010) | 7 lines
  
  Send CONNECT_ACKNOWLEDGE for CIS calls too.
  
  The originator of the Q.SIG call completion signaling link was not changed
  to the active state when the CONNECT message came in.  The T309 processing
  would immediately kill the signaling link because it was not in the active
  state.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-21 01:03:42 +00:00
Richard Mudgett 01eda62762 Merged revisions 289057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r289057 | rmudgett | 2010-09-27 20:04:37 -0500 (Mon, 27 Sep 2010) | 5 lines
  
  Avoid deadlock processing incoming AOC-E messages.
  
  Deadlock avoidance for the owner channel was not done when processing
  incoming AOC-E messages.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-28 01:10:25 +00:00
Richard Mudgett 1efb27a045 Merged revisions 286118 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r286118 | rmudgett | 2010-09-10 15:55:37 -0500 (Fri, 10 Sep 2010) | 25 lines
  
  Merged revisions 286116 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r286116 | rmudgett | 2010-09-10 15:42:44 -0500 (Fri, 10 Sep 2010) | 18 lines
    
    Merged revisions 286113 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r286113 | rmudgett | 2010-09-10 15:33:16 -0500 (Fri, 10 Sep 2010) | 11 lines
      
      An outgoing call may not get hung up if a pre-connect incoming ISDN call is disconnected.
      
      If the ISDN link a pre-connect incoming call is using fails or is reset,
      the outgoing leg may not hang up or be delayed in hanging up.  (Causes:
      PRI_CAUSE_NETWORK_OUT_OF_ORDER, PRI_CAUSE_DESTINATION_OUT_OF_ORDER, and
      PRI_CAUSE_NORMAL_TEMPORARY_FAILURE.)
      
      Just hang up the call if the incoming call leg hangs up before connecting
      for any reason.  It makes no sense to send a BUSY or CONGESTION control
      frame to the outgoing call leg under these circumstances.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-10 21:03:08 +00:00
Richard Mudgett 3403dbf374 Merged revisions 284779-284780 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284779 | rmudgett | 2010-09-02 15:59:12 -0500 (Thu, 02 Sep 2010) | 8 lines
  
  Made output libpri event names if pri debugging is enabled when sig_pri processes them.
  
  * Simplified CLI "pri debug xx span xx" command code and removed redundant
  debugging enabled messages.
  
  * Made CLI "pri debug xx span xx" command only close the debugging log
  file if it was opened.
........
  r284780 | rmudgett | 2010-09-02 16:02:54 -0500 (Thu, 02 Sep 2010) | 2 lines
  
  Simplified pri_dchannel() poll timeout duration code.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 21:08:41 +00:00
Richard Mudgett e91caf9b07 Merged revisions 283050 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r283050 | rmudgett | 2010-08-20 10:35:38 -0500 (Fri, 20 Aug 2010) | 36 lines
  
  Merged revisions 283049 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r283049 | rmudgett | 2010-08-20 10:31:03 -0500 (Fri, 20 Aug 2010) | 29 lines
    
    Merged revisions 283048 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r283048 | rmudgett | 2010-08-20 10:24:36 -0500 (Fri, 20 Aug 2010) | 22 lines
      
      Q931 - Sending PROGRESS after sending ALERTING is a protocol error
      
      The PRI layer in chan_dadhi will check if a PROGRESS message has already
      been sent, and not allow sending another (although that is technically
      allowed by the Q931 spec), however it does not protect against sending an
      ALERTING and then sending a PROGRESS message, which is a violation of the
      specification.
      
      Most switches don't seem to care too deeply about this, but some do, and
      will disconnect the call when receiving this invalid sequence.
      
      Protocol specification reference: T-REC-Q.931-199805-I page 223, "Figure
      A.5/Q.931 -- Overview protocol control (network side) point-point
      (sheet 3 of 8)"
      
      (closes issue #17874)
      Reported by: nic_bellamy
      Patches:
            asterisk-1.4-r282537_no-progress-after-alerting.patch uploaded by nic bellamy (license 299)
            asterisk-1.6.2-r282537_no-progress-after-alerting.patch uploaded by nic bellamy (license 299)
            asterisk-trunk-r282537_no-progress-after-alerting.patch uploaded by nic bellamy (license 299)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-20 15:39:25 +00:00
Tilghman Lesher d85f1bf713 Merged revisions 282608 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r282608 | tilghman | 2010-08-18 02:49:04 -0500 (Wed, 18 Aug 2010) | 16 lines
  
  Merged revisions 282607 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r282607 | tilghman | 2010-08-18 02:43:14 -0500 (Wed, 18 Aug 2010) | 9 lines
    
    Don't warn on callerid when completely text, instead of numeric with localdialplan prefixes.
    
    (closes issue #16770)
     Reported by: jamicque
     Patches: 
           20100413__issue16770.diff.txt uploaded by tilghman (license 14)
           20100811__issue16770.diff.txt uploaded by tilghman (license 14)
     Tested by: jamicque
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@282609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-18 07:50:07 +00:00
Sean Bright d5e83070b7 Merged revisions 280519 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r280519 | seanbright | 2010-07-29 15:47:16 -0400 (Thu, 29 Jul 2010) | 7 lines
  
  Fix compilation error in chan_dahdi (strdupa -> ast_strdupa).
  
  (closes issue #17751)
  Reported by: b11d
  Patches:
        strdupa_oops.diff uploaded by malcolmd (license 924)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-29 19:48:38 +00:00
Russell Bryant 538d044aca Merged revisions 279916 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r279916 | russell | 2010-07-27 14:50:56 -0500 (Tue, 27 Jul 2010) | 12 lines
  
  Fix inband DTMF detection on outgoing ISDN calls.
  
  This is a regression from the sig_pri split from chan_dahdi.  When a call is
  first initiated, the inband DTMF detector is not enabled if it's an outgoing
  ISDN call.  However, it needs to be turned on once the media path starts up.
  This handling was put back in the open_media() callback of chan_dahdi.  In
  sig_pri, open_media() calls were added to a few places where it was needed,
  including handling of PRI_EVENT_RINGING, PRI_EVENT_PROGRESS, and
  PRI_EVENT_PROCEEDING.
  
  Thanks to rmudgett for helping me with the patch!
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-27 19:55:40 +00:00
Richard Mudgett 301505c4c4 Rename sig_pri_pri to sig_pri_span. More descriptive of concept.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 15:41:44 +00:00
Richard Mudgett 7066a7f233 Reference correct struct member for unlikely event PRI_EVENT_CONFIG_ERR.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 22:38:13 +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
Richard Mudgett 30888f913d Merged revisions 272446 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r272446 | rmudgett | 2010-06-24 16:58:49 -0500 (Thu, 24 Jun 2010) | 10 lines
  
  ss_thread calls pri_grab without lock during overlap dial
  
  Recent changes to chan_dahdi with relation to overlap dialing call
  pri_grab without first obtaining a lock.
  
  (closes issue #17414)
  Reported by: pdf
  Patches:
        bug17414.patch uploaded by jpeeler (license 325)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-24 22:11:26 +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
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 0c5bce53ad Moved AOC request code out of the middle of code parsing the dialed number.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07 19:06:55 +00:00
Richard Mudgett 10e2c47c75 Incoming overlap dialing no longer works after sig_pri extraction.
The problem would manifest itself if your dialplan matching could accept
more digits to match than were actually dialed.  The time out waiting for
overlap digits disconnected the call instead of matching any accumulated
digits to the dialplan.

Accidental conversion of a break out of loop as a break out of switch.

(closes issue #17401)
Reported by: avalentin
Patches:
      issue17401_digit_timeout.patch uploaded by rmudgett (license 664)
Tested by: avalentin, rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-04 14:45:03 +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 0760f4e70a Add ETSI Malicious Call ID support.
Add the ability to report malicious callers as an AMI event in the call
event class.

Relevant specification: EN 300 180

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 22:28:58 +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 28264c52b9 Add ETSI Advice Of Charge (AOC) event reporting.
This feature generates AMI events in the new aoc event class from the
events passed up by libpri.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 17:13:53 +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
Richard Mudgett 9534f72cb0 Dialing an invalid extension causes incomplete hangup sequence.
Revision -r1489 of the libpri 1.4 branch corrected a deviation from Q.931
Section 5.3.2.  However, this resulted in an unexpected behaviour change
to the upper layer (Asterisk).

This change uses pri_hangup_fix_enable() to follow Q.931 Section 5.3.2
call hangup better if the version of libpri supports it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-11 23:18:53 +00:00
Jeff Peeler 356b090875 Fix deadlock in sig_pri when hanging up.
The pri_dchannel thread currently violates locking order by locking the private
and then attempting to queue a frame, which needs to lock the channel. Queueing
a frame is unneccesary though and is actually a regression since sig_pri.
All the places that currently use ast_softhangup_nolock now will just set the
softhangup value directly as before.

(closes issue #17216)
Reported by: lmsteffan
Patches: 
      bug17216.patch uploaded by jpeeler (license 325)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-07 15:33:52 +00:00
Richard Mudgett 6f03bf4a42 Some code optimizations.
* Made more places use pri_queue_control() instead of pri_queue_frame()
and a local frame variable.

* Made pri_queue_frame() use sig_pri_lock_owner().  pri_queue_frame() no
longer releases the libpri access lock unless it is required.

* Made the pri_queue_frame() and pri_queue_control() parameter list
similar to sig_pri_lock_owner().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-06 23:41:22 +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
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
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 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
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
Alec L Davis 98154867e6 overlap receiving: automatically send CALL PROCEEDING when dialplan starts
Following Q.931 5.2.4
When the user has determined that sufficient call information has been received the 
user shall stop T302 and send CALL PROCEEDING to the network.

Previously timeouts were possible if the dialplan took a long time to issue any
response back to the network.

Verified that our local TELCO also does the same.

(issue #16789)
Reported by: alecdavis
Patches: 
      overlap_receiving_trunk.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-27 22:49:51 +00:00
Alec L Davis c7be027151 Update CDR variables as pbx starts
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call,
by executing ast_cdr_update() early in __ast_pbx run.
Reverts sig_pri changes in trunk that are specific to isdn technology only.

(closes issue #16638)
Reported by: alecdavis
Patches: 
      cdr_update.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20 08:18:45 +00:00
Alec L Davis 800313cbd9 Update CDR variables before pbx starts (overlap dial)
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call.

(issue #16638)
Reported by: alecdavis
Patches: 
      cdr_update.diff2.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19 00:24:35 +00:00
Alec L Davis 12306debf2 Update CDR variables before pbx starts
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:00:24 +00:00
Richard Mudgett fcf4f438f1 Fix using the wrong pointer type in do_idle_thread().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07 21:24:06 +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 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
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 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
Richard Mudgett 63473616da Search for the subaddress only within the extension section of the dial string.
Dial(DAHDI/(g|G|r|R)<group#(0-63)>[c|r<cadance#>|d][/extension])


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 20:07:55 +00:00