Commit Graph

406 Commits

Author SHA1 Message Date
Damien Wedhorn f4d1b7ab12 Rewrite of skinny debugging.
Debugging messages and associated controls only compiled in if configured with --enable-dev-mode. Debug messages provide more detail (including thread id) and are grouped so the user/dev can limit the type of messages displayed. Functionally no real change to chan_skinny.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 21:58:01 +00:00
Damien Wedhorn 3d38998b70 Various small chan_skinny fixes and cleanup
Added test to skinny_register to only allow device to register against
a device that is not already registered.

Addback l->device test for skinny_show_lines. Fixes segfault if a line
is configured but not configured to a device. Reverses part of r368680.

Removed redundant l->device tests in subsubstate and dumpsub. l->device
will always be valid if these routines are called. Reverses 368948 -
discussed with mjordan on irc.

Some indentation cleanup.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 21:18:56 +00:00
Matthew Jordan 1efe727ed8 AST-2012-009: Fix crash in chan_skinny due to Key Pad Button Message handling
AST-2012-008 (r367844) fixed a denial of service attack exploitable in the
Skinny channel driver that occurred when certain messages are sent after a
previously registered station sends an Off Hook message.  Unresolved in that
patch is an issue in the Asterisk 10 releases, wherein, if a Station Key
Pad Button Message is processed after an Off Hook message, the channel driver
will inappropriately dereference a NULL pointer.

This patch fixes those places where the message handling or the channel
callback functions would attempt to dereference the line's pointer to the
device.

(issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Christoph Hebeisen
Patches:
  AST-2012-009-10.diff uploaded by mjordan (license 6283)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 17:34:10 +00:00
Damien Wedhorn d979399071 Skinny cleanup (mwi_event_cb).
Original was testing for d->session, setting and testing again (all nested).

Removed duplicate testing and restructured function to test/return and then
the main code.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-07 21:44:15 +00:00
Damien Wedhorn 0271734f2e Skinny cleanup.
Removed d->registered which was mirroring d->session. Changed relevant
references to use d->session instead.

Moved setting and unsetting of l->device from session register to device 
configuration. As such, l->device will always be valid unless it is has not
been configured to a device. Revised various test where checking if a device
is registered to use l->device->session.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-07 21:23:42 +00:00
Mark Michelson 14a985560e Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:26:12 +00:00
Matthew Jordan 94187aafc0 AST-2012-008: Fix remote crash vulnerability in chan_skinny
When a skinny session is unregistered, the corresponding device pointer is set
to NULL in the channel private data.  If the client was not in the on-hook state
at the time the connection was closed, the device pointer can later be
dereferened if a message or channel event attempts to use a line's pointer to
said device.

The patches prevent this from occurring by checking the line's pointer in
message handlers and channel callbacks that can fire after an unregistration
attempt.

(closes issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Damien Wedhorn
Patches:
  AST-2012-008-1.8.diff uploaded by mjordan (license 6283)
  AST-2012-008-10.diff uploaded by mjordan (licesen 6283)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-29 18:40:26 +00:00
Kinsey Moore b5a6de76fc Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.

This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.

Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +00:00
Matthew Jordan c37c7b4a2c AST-2012-005: Fix remotely exploitable heap overflow in keypad button handling
When handling a keypad button message event, the received digit is placed into
a fixed length buffer that acts as a queue.  When a new message event is
received, the length of that buffer is not checked before placing the new digit
on the end of the queue.  The situation exists where sufficient keypad button
message events would occur that would cause the buffer to be overrun.  This
patch explicitly checks that there is sufficient room in the buffer before
appending a new digit.

(closes issue ASTERISK-19592)
Reported by: Russell Bryant
........

Merged revisions 363100 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23 13:53:24 +00:00
Sean Bright 99bd5b1e2e Eliminate a bunch of shadow warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-08 17:02:52 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Sean Bright 51c24c88a1 Prefer ast_set_qos() over ast_netsock_set_qos()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 14:13:58 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +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
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +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
Damien Wedhorn 843c7ef088 Allow softkey reject while device onhook.
Fixes up softkey endcall. Previous code was a copy of onhook, now
allows for endcall softkey to be used while device is still onhook.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-29 22:33:08 +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
Damien Wedhorn 48f9a8f668 Fix segfault on answer.
Only update/change RTP source if RTP has already been started and 
connected to the subchannel.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 21:12:57 +00:00
Damien Wedhorn 5952117559 Fix segfault on answer.
Fix a segfault if an attempt to answer a call is made between when
the inbound call gives up (and the channel is removed) and when the
device is notified and removes the call from the device.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-08 06:59:01 +00:00
Tilghman Lesher 77b670c4ab Allow each logging destination and console to have its own notion of the verbosity level.
Review: https://reviewboard.asterisk.org/r/1599


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29 18:43:16 +00:00
Richard Mudgett 7d9ba4875b Fix calls to ast_get_ip() not initializing the address family.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 23:03:32 +00:00
Damien Wedhorn 899df042f5 Fix simple switch to not progress a call when call already progressed.
If a simple switch was started on a device and then a specific call
made (such as redial or speed dial), on timeout of the simple switch
the call would be attempted again. This patch only allows the simple
switch to make a call if the substate is still in the collecting
digits mode.

Also added small debug message to dialAndAactivate sub. 

Tested by snuff and myself.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-14 21:15:33 +00:00
Damien Wedhorn 7cb2ac8664 Add skinny version 17 protocol support.
Added some data to skinny packet structures to make compatible
with v17. Added protocolversion to device, set on registration
based on the version provided by device.

v17 includes some increased ip space for ip6. This patch increases
ip space in the packets but still only uses ip4. Some packet
structures duplicated (ip4 and ip6 types). ip4 type used unless
version is greater or equal to 17.

Tested by snuff and myself on 7961 with recent 8.5 firmware. Also
tested compatible with old 7960 and older 30VIPs.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 00:57:06 +00:00
Damien Wedhorn c5546e2bd7 Increase SKINNY_MAX_PACKET and add some logging.
Increase SKINNY_MAX_PACKET to 2000 bytes to handle some messages
in v17 that are greater than the old 1000 bytes. Also add some
useful logging regarding packet and session handling.

A device (with protocol v17) was sending a packet with length 
greater than 1000 which resulted in the TCP session being
destroyed and registration being retryed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 00:36:02 +00:00
Damien Wedhorn 0ac40dc255 Merged revisions 340031 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r340031 | wedhorn | 2011-10-10 09:18:27 +1100 (Mon, 10 Oct 2011) | 8 lines
  
  Return -1 to skinny_session if register rejected.
  
  If device registration is rejected, return -1 so that the session is
  destroyed immediately. Previously, a segfault would occur on a 
  graceful shutdown if a register is rejected and the skinny_session
  has not yet timed out.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-09 22:21:42 +00:00
Damien Wedhorn b90964eda5 Merged revisions 339992 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r339992 | wedhorn | 2011-10-10 08:09:12 +1100 (Mon, 10 Oct 2011) | 9 lines
  
  Remove log message on traverse session list.
  
  On destroying a session, a list of sessions is traversed to find the 
  matching session. For each session not matching, skinny erroneously
  logged that the session was not matched. While technically correct
  the message was misleading, and tended to indicate errors that 
  were not there.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@339993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-09 21:15:09 +00:00
Damien Wedhorn d59bb319fc Fixed segfault on core stop gracefully.
There was an issue that the cap and confcap pointers for each line and device
were being memcpy'd so they all pointed to the same ast_format_cap. On
destroying, a segfault occured on the second call to the same struct.

skinny reload now works again as well.

Tested by snuff and myself. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@339680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-06 20:18:45 +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
Damien Wedhorn a0573368a1 Add SLA to skinny.
Adds sublines to skinny lines. Each subline can be attached to an 
SLA station/trunk combo. Includes the following functionality:

Callid is persistent for both in/out calls on all skinny devices.
Can join, hold, resume.
All sublines appear under a single line button.

See: https://wiki.asterisk.org/wiki/display/~wedhorn/Skinny+SLA for doc.

(closes issue ASTERISK-17947)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-15 08:19:46 +00:00
Richard Mudgett 145c174565 Merged revisions 328329 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

........
  r328329 | rmudgett | 2011-07-14 19:19:32 -0500 (Thu, 14 Jul 2011) | 2 lines
  
  Make hint watcher callback take const strings for context and exten parameters.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-15 00:23:14 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Damien Wedhorn 7df5d0d416 Add autoanswer to skinny.
Autoanswer added to skinny based on incoming chan var SKINNY_AUTOANSWER.
Initial value must be the time to autoanswer in ms, then optionally :BEEP
to play a tone when answered and :MUTE to mute the mic when answering. 
eg 3000:MUTE:BEEP will ring for 3 secs, then answer, mute the mic, and 
play a beep. just 3000 would answer afer 3 secs of ringing with no 
beep and full two way audio. 



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-09 11:05:07 +00:00
Damien Wedhorn 9598e5bc2f Remove skinny do_monitor and use ast_sched_start instead
The do_monitor seemed to be there for task scheduling and network monitoring. However, the network monitoring has a dedicated thread so the ast_io_wait was basically just a usleep as it didn't actually seem to be monitoring anything.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-08 11:38:56 +00:00
Damien Wedhorn 0bb90a372e Remove extraneous line variables.
The vars were either explicitly or implicitly not used.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-17 21:59:55 +00:00
Damien Wedhorn 069b70c522 Fix up skinny hints.
Probably haven't been working for a couple of years. May still need
some more love, but they are now working, both as a hint device and
monitoring a hint. Changes centre around the long ago change
to remove the requirement for a device name in a skinny line, and 
changes to the transmit_* functions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-16 21:39:33 +00:00
Damien Wedhorn 969a317d81 Add activatesub and dialandactivate sub.
When called, activatesub first cleans up the active sub and then
handles the sub passed. dialandactivatesub first sets sub->exten
and then calls activatesub. Revise handle_offhook to utilise the
callid sent to chan_skinny. Some other minor fixes especially around
d->hookstate (which still needs some more work).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@319024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-15 23:17:57 +00:00
Damien Wedhorn 54bb8a0ca8 Move exten used for dialing from device to subchannel.
There were some issues where if a simple switch was cancelled and a
new switch started before the first had timed out where the d->exten
would be used for both subchannels. This was bad leading to possible
invalid extensions if some digits had been entered in the abandoned
simple switch and the second one was completed before the first timed
out, or the second would be cancelled because d->exten would be set to
nothing on the time out of the first.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-13 08:33:35 +00:00
Damien Wedhorn c37c017781 Consolidate setsubstate_* into setsubstate and use a switch.
Consolidate the functions and add some debugging info. Allows to be
able to set a substate without explicitly knowing what the state is. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-12 20:44:21 +00:00
Damien Wedhorn bdbb3a506f Add setsubstate_onhook.
Add the setsubstate_onhook to complete the initial substate handling
procedures. Added dumpsub(sub, forcehangup) which is the common way of
calling setsubstate_onhook. Dumpsub attempts to activate another sub
after setting the current one onhook.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-12 07:25:52 +00:00
Damien Wedhorn 7002adcb3e Add setsubstate_callwait.
If a call is made to a line that already has a call and the device is
offhook (ie activeish call), the call is set to CALLWAIT rather than RINGIN. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-09 07:40:40 +00:00
Damien Wedhorn 8c0b1115cd Only allow voicemail if substate is OFFHOOK or no channel active (UNSET).
(closes issue #17901)
Reported by: salecha


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 23:07:55 +00:00
Damien Wedhorn a9beb8323e Rename sub->parent to sub->line.
Improve readability of code, eg, (sub->parent == d->activeline) becomes
(sub->line == d->activeline).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 22:32:45 +00:00
Damien Wedhorn bc61836c1b Move the hookstate from line to device.
Long time coming, finally moving the hookstate from line to device.
This may fix some issues where a device has multiple lines. Previously
we had to run through all lines on a device to see if it was actually
onhook or not.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 22:24:08 +00:00
Russell Bryant 0938974902 Merged revisions 317478 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317478 | russell | 2011-05-05 17:53:45 -0500 (Thu, 05 May 2011) | 12 lines
  
  Fix some consistency issues with jitterbuffer config.
  
  Store the defaults noted in the sample config files in the jitterbuffer config
  data structure.  This makes the CLI commands that output these settings show
  the right thing.  Also only show the settings that are relevant in the settings
  CLI commands, based on which jitterbuffer is selected and whether it's enabled.
  
  (closes issue #19083)
  Reported by: rgagnon
  Patches:
        issue-19083-trunk-r313139.diff uploaded by rgagnon (license 1202)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 22:55:09 +00:00
Damien Wedhorn e98ac1f0f4 Move hold stuff to the setsubstate arrangement.
skinny_hold moved to setsubstate_hold and skinny_unhold integrated into
setsubstate_connected. Removed sub->onhold and replaced with 
SUBSTATE_HOLD.

Also fixed inbound call answering by queueing an AST_CONTROL_ANSWER on
answering a SUBSTATE_RINGIN sub (was a typo).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 20:46:49 +00:00
Damien Wedhorn 2ae06c3e6d Add setsubstate_congestion and setsubstate_progress.
Move handling of both state handling from skinny_indicate to it's own sub.
Also, modified behaviour to not hangup the sub and let the dialplan
have a chance in doing what it wants for congestion. Added various states to
substate2str and added these states where applicable for other set_substate_
procs.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 09:03:32 +00:00