Commit Graph

8121 Commits

Author SHA1 Message Date
Igor Goncharovskiy 9397e7af2a Implement functions handling keypress, display icons and text for i2004 KEM support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 08:57:14 +00:00
Corey Farrell 3cfa1c8826 chan_sip: prevent add_route from adding empty header.
Fix regression caused by ASTERISK-22582.  Empty Route
headers were added when the route had a single strict
hop.

(closes issue ASTERISK-23306)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3236/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21 16:49:03 +00:00
Matthew Jordan f001981862 chnan_sip: Set SIP_DEFER_BYE_ON_TRANSFER prior to calling bridge blind transfer
This patch moves setting SIP_DEFER_BY_ON_TRANSFER prior to calling
ast_bridge_transfer_blind. This prevents a BYE from being sent prior to the
NOTIFY request that informs the transferor if the transfer succeeded or failed.

This patch also clears said flag from the off nominal NOTIFY paths in the
local_attended_transfer code, as once we've sent the NOTIFY request it is safe
to send by the BYE request.

This was caught by the blind-transfer-accountcode test in the Asterisk Test
Suite.

(closes issue ASTERISK-23290)
Reported by: Matt Jordan

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

Merged revisions 408069 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 12:41:13 +00:00
Corey Farrell cb4e210773 chan_sip: Isolate code that manages struct sip_route.
* Move route code to sip/route.c + sip/include/route.h
* Rename functions to sip_route_*
* Replace ad-hoc list code with macro's from linkedlists.h
* Create sip_route_process_header() to processes Path and Record-Route headers
  (previously done with different code in build_route and build_path)
* Add use of const where possible
* Move struct uriparams, struct contact and contactliststruct from sip.h to
  reqresp_parser.h.  sip/route.c uses reqresp_parser.h but not sip.h, this was
  a problem.  These moved declares are not used outside of reqresp_parser.
* While modifying reqprep() the lack of {} caused me trouble.  I added them.
* Code outside route.c treats sip_route as an opaque structure, using macro's
  or procedures for all access.

(closes issue ASTERISK-22582)
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3173/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-10 18:28:35 +00:00
Richard Mudgett 67f84590e5 chan_iax2: Add some more iaxs[] NULL checks to a routine already full of them.
........

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

Merged revisions 407765 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407766 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 20:52:40 +00:00
Richard Mudgett 6f38887cb7 chan_iax2: Block unnecessary control frames to/from the wire.
Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

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

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

Merged revisions 407727 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407729 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 18:29:49 +00:00
Damien Wedhorn a744b29ab5 Skinny - Fix deadlock when pickup of no call.
Locking issues in skinny when picking up a call that doesn't exist. Cleaned 
up sub locking by fully removing and using the chan lock instead. Also
changed ast_call_pickup to check whether chan was masq'd.

(closes issue ASTERISK-23249)
Reported by: wedhorn
Tested by: snuffy, myself
Patches: 
    skinny-locking01.diff uploaded by wedhorn (license 5019)
........

Merged revisions 407197 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 02:07:18 +00:00
Damien Wedhorn e8eb6a9e30 Skinny: fix up possible double unlock of chan.
Return before chan is possibly unlocked a second time when hanging up
a channel in SUBSTATE_OFFHOOK.
........

Merged revisions 406987 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-31 05:31:45 +00:00
Kinsey Moore 0fbffdb3b2 chan_sip: Decline image streams on unsupported transports
This change allows chan_sip to decline individual image streams over
unsupported transports in the SDP of the 200 response. Previously,
an image stream offer with RTP/AVP as the transport would cause
chan_sip to respond with a 488.

(closes issue ASTERISK-22988)
Reported by: adomjan
Original patch by: adomjan
........

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

Merged revisions 406171 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 406172 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 18:34:13 +00:00
Kinsey Moore b2a682bae2 chan_mgcp: Enforce locking for oseq
This restricts direct usage of global oseq so that all accesses are
locked and threads are not racing to get oseq values that they did not
claim.

This also fixes a build error in res_pktccops under dev mode.

(closes issue ASTERISK-23100)
Reported by: adomjan
Patch by: adomjan
........

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

Merged revisions 406038 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 406049 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21 20:28:57 +00:00
Damien Wedhorn 4bc84b1b9f Skinny: fix up handling of fragmented packets.
Bad offset in reading second or more fragment of skinny packets. Fixed
to offset by char (single byte) rather than size of req.
........

Merged revisions 405982 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 23:25:38 +00:00
Richard Mudgett eddbe10f91 chan_dahdi/PRI: Suppress CONNECTED_LINE updates when nothing in the udpate is valid.
* Also simplified some subddress handling code.

(closes issue ASTERISK-23008)
Reported by: Michael Cargile
........

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

Merged revisions 405927 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405928 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 22:23:00 +00:00
Damien Wedhorn 1f401eed45 Skinny: fix up session logging.
Logging from the skinny session loop was providing some incorrect reasons
for exiting the loop. Cleaned up messages and handling so correct reason
displayed.
........

Merged revisions 405924 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 21:56:14 +00:00
Jonathan Rose 85fbbed45d chan_pjsip: Provide a means for tracking device state when holding/unholding
Previously PJSIP did not track hold/unhold and it would always simply be
'inuse'. This patch fixes that.

review: https://reviewboard.asterisk.org/r/3129/
........

Merged revisions 405908 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 18:18:25 +00:00
Damien Wedhorn fcc492645b Skinny: fix reversed device reset from CLI.
Existing code would do a full device restart when "skinny reset device"
was entered at the CLI and do a reset when "skinny reset device restart"
entered. 
........

Merged revisions 405893 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-19 00:01:31 +00:00
Sean Bright 778d74cacf Make sure the maxptime attribute is added to the correct offers.
........

Merged revisions 405877 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-17 22:09:09 +00:00
Rusty Newton f6647d2362 Documentation: doc fixes across various parts of the code for ASTERISK issues 23061,23028,23046,23027
Fixes typos of "transfered" instead of "transferred" in various code. Fixes incorrect gosub param help text for app_queue.
Fixes Asterisk man pages containing unquoted minus signs. Adds note about the "textsupport" option in sip.conf.sample.

(issue ASTERISK-23061)
(issue ASTERISK-23028)
(issue ASTERISK-23046)
(issue ASTERISK-23027)
(closes issue ASTERISK-23061)
(closes issue ASTERISK-23028)
(closes issue ASTERISK-23046)
(closes issue ASTERISK-23027)
Reported by: Eugene, Jeremy Laine, Denis Pantsyrev
Patches:
 transferred.patch uploaded by Jeremy Laine (license 6561)
 hyphen.patch uploaded by Jeremy Laine (license 6561)
 sip.conf.sample.patch uploaded by Eugene (license 6360)
........

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

Merged revisions 405792 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405829 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-17 17:16:14 +00:00
Kevin Harwell 3373a5332b chan_pjsip: initial device state on endpoints is INVALID
When endpoints get loaded their device state gets set to 'INVALID' because the
channel driver has not been loaded yet.  Fixed by updating the device state for
every endpoint upon load of the channel driver.

(closes issue ASTERISK-23065)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/3123/
........

Merged revisions 405643 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-16 16:46:00 +00:00
Kinsey Moore 7cbb6eab15 PJSIP: Add Path header support
This adds Path support to chan_pjsip in res_pjsip_path.c with minimal
additions in res_pjsip_registrar.c to store the path and additions in
res_pjsip_outbound_registration.c to enable advertisement of path
support to registrars and intervening proxies.

Path information is stored on contacts and is enabled via Address of
Record (AoRs) and Registration configuration sections.

While adding path support, it became necessary to be able to add SIP
supplements that handled messages outside of sessions, so a framework
for handling these types of hooks was added in parallel to the
already-existing session supplements and several senders of
out-of-dialog requests were refactored as a result.

(closes issue ASTERISK-21084)
Review: https://reviewboard.asterisk.org/r/3050/
........

Merged revisions 405565 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-15 13:16:10 +00:00
Scott Griepentrog 5516cda6af chan_sip: fix Local From tag on outbound register regression
In ASTERISK-12117, an improvement to insure consistant local from tags
on outbound registrations resulted in an undesirable behavior - caused
by leftover unexpired sip_pvt dialogs (with the previous cseq number),
resulting in many uncessary REGISTER requests.  Instead of significant
rework of transmit_register(), this change deletes the dialogs after a
200 OK response indiciating a successful registration, keeping the old
dialogs from interfering with normal operation.

(closes issue ASTERISK-22946)
Reported by: Stephan Eisvogel
Review: https://reviewboard.asterisk.org/r/3109/
........

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

Merged revisions 405434 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405435 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 18:15:13 +00:00
Damien Wedhorn 9ec4d15c8e Skinny: do not add call to missed calls list if answered elsewhere.
Patch updates skinny devices with a SKINNY_CONNECTED callstate if an
inbound ringing or callwaiting call is answered elsewhere.
........

Merged revisions 405367 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 03:27:47 +00:00
Damien Wedhorn de6563c618 Fix chan_dahdi copile issue in dev-mode.
Error "unused variable i in dahdi_create_channel_range" when compiling
in dev-mode. Small restructure to dahdi_create_channel_range to move 
the for(x) loop and int i,x to a block within the IFDEF.
........

Merged revisions 405268 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-09 23:50:07 +00:00
Kinsey Moore 522593f901 Add the missing part of r400140
When the patch to add retry-on-forbidden-response was committed, part
of the patch for chan_sip was not committed which caused the feature to
be entirely nonfunctional. This corrects the code in question.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874
........

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

Merged revisions 405081 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 405083 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-08 16:30:14 +00:00
Kevin Harwell 1ee4870a81 chan_dahdi: dahdi show channels slices PRI channel dnid on output
dahdi show channels output slices the callerid (which is dnid copied over on
PRI channels). If the channel naming structures look like:

 'DAHDI/i1/1408409XXXX-6'

then the output slices 1408409XXXX down to 1408409XXX. This patch just opens
it up to 15 chars so you can see the whole thing.

(closes issue ASTERISK-22918)
Reported by: outtolunc
Patches:
     svn_chan_dahdi.c.format12_15.diff.txt uploaded by outtolunc (license 5198)
........

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

Merged revisions 404785 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 404786 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03 19:02:25 +00:00
Kevin Harwell 821ab51381 res_pjsip: add 'set_var' support on endpoints
Added a new 'set_var' option for ast_sip_endpoint(s).  For each variable
specified that variable gets set upon creation of a pjsip channel involving
the endpoint.

(closes issue ASTERISK-22868)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/3095/
........

Merged revisions 404663 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-02 19:08:19 +00:00
Joshua Colp f720a9ac89 chan_pjsip: Handle hanging up before calling.
Channel creation in Asterisk is broken up into two steps: requesting and calling.
In some cases a channel may be requested but never called. This happens in the
ChanIsAvail dialplan application for determining if something is reachable or
not. The PJSIP channel driver did not take this situation into account and
attempted to end a session that was never called out on.

The code now checks the session state to determine if the session has been
called out on and if not terminates it instead of ending it.

(closes issue ASTERISK-23074)
Reported by: Kilburn
........

Merged revisions 404652 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-31 22:51:04 +00:00
Tzafrir Cohen 82eb03b915 chan_dahdi: enable ignore_failed_channels by default
If ignore_failed_channels is set to "true" for a channel, the channel
will continue to be configured even if configuring it has failed.

This allows Asterisk to start before all the DAHDI initialization is
done and thus not force the starting order dahdi -> asterisk.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-23 16:38:43 +00:00
Richard Mudgett 3ccd5dee18 udptl: Dead code elimination. ast_udptl_bridge was not used.
Removing dead code starting with ast_udptl_bridge() eliminated the code in
this change.

Note: This code has actually been dead since Asterisk v1.4 when it was
first put in.

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

Merged revisions 404354 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 17:13:53 +00:00
Richard Mudgett e4803bbd9e Voicemail: Remove mailbox identifier format (box@context) assumptions in the system.
This change is in preparation for external MWI support.

Removed code from the system for normal mailbox handling that appends
@default to the mailbox identifier if it does not have a context.  The
only exception is the legacy hasvoicemail users.conf option.  The legacy
option will only work for app_voicemail mailboxes.  The system cannot make
any assumptions about the format of the mailbox identifer used by
app_voicemail.

chan_sip and chan_dahdi/sig_pri had the most changes because they both
tried to interpret the mailbox identifier.  chan_sip just stored and
compared the two components.  chan_dahdi actually used the box
information.

The ISDN MWI support configuration options had to be reworked because
chan_dahdi was parsing the box@context format to get the box number.  As a
result the mwi_vm_boxes chan_dahdi.conf option was added and is documented
in the chan_dahdi.conf.sample file.

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

Merged revisions 404348 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 16:52:43 +00:00
Damien Wedhorn c2fd229fba Fixup some skinny bugs causing Fracks and ao2 cleanup issues.
Moved channel locking into setsubstate so that a process can complete
working on a sub before another starts changing it. The existing code
was causing some Fracks with schedule deletion.

Removed multiple rtp cleanup. Now only cleansup up once, fixing ao2 
object cleanup issues.
........

Merged revisions 404306 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 02:59:52 +00:00
Damien Wedhorn af723c6572 Fixup skinny registration following network issues.
On session registration, if device is already reporting that it is
connected to a device, an innocuous packet (update time) is sent to
the already connected device. If the tcp connection is down, the
device will be unregistered and the new connection allowed.

Without this patch, network issues can see a situation where a device
can not reregister until after 3*timeout.
........

Merged revisions 404292 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 00:32:00 +00:00
Kevin Harwell ed0c493222 chan_oss.c: channel being locked twice and unlocked once
Removed channel lock as it is now being down in ast_channel_alloc
........

Merged revisions 404261 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 20:48:49 +00:00
Kevin Harwell 28c0cb28d0 channel locking: Add locking for channel snapshot creation
Original commit message by mmichelson (asterisk 12 r403311):

"This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such."

The above was initially committed and then reverted at r403398.  The problem
was found to be in core_local.c in the publish_local_bridge_message function.
The ast_unreal_lock_all function locks and adds a reference to the returned
channels and while they were being unlocked they were not being unreffed when
no longer needed.  Fixed by unreffing the channels.

Also in bridge.c a lock was obtained on "other->chan", but then an attempt was
made to unlock "other" and not the previously locked channel.  Fixed by
unlocking "other->chan"

(closes issue ASTERISK-22709)
Reported by: John Bigelow
........

Merged revisions 404237 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 20:33:37 +00:00
Joshua Colp e2630fcd51 channels: Return allocated channels locked.
This change makes ast_channel_alloc return allocated channels
locked. By doing so no other thread can acquire, lock, and manipulate
the channel before it is completely set up.

(closes issue AST-1256)

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

Merged revisions 404204 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 19:28:05 +00:00
Rusty Newton f7c60b8fb6 Several components: fixing Typos in comments and code, "avaliable" instead of "available"
(issue ASTERISK-23021)
(closes issue ASTERISK-23021)
Reported by: Jeremy Lainé
Tested by: Rusty Newton
Patches:
   available.patch uploaded by Jeremy Lainé (license 6561)
........

Merged revisions 404046 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-17 23:38:02 +00:00
Matthew Jordan 4ddf45fd24 pjsip/dialplan_functions: Use the right buffer length when printing URIs
While entertaining, sizeof(buflen) is not the same as buflen. Doh.
........

Merged revisions 403823 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-15 01:39:20 +00:00
Kevin Harwell 84e1790beb bridge_native_rtp: Deadlock during 4-way conference creation
The change contains a slightly adjusted patch that was on the issue
(submitted by kmoore).  A fix was made by adding in a bridge lock
while calling bridge_start/stop from the framehook callback.  Since
the framehook callback is not called from the bridging core the bridge
is not locked, but needs to be before calling bridge_start.

(closes issue ASTERISK-22749)
Reported by: Kinsey Moore
Review: https://reviewboard.asterisk.org/r/3066/
Patches:
     lock_inversion.diff uploaded by kmoore (license 6273)
........

Merged revisions 403767 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13 18:33:25 +00:00
Matthew Jordan fc8c0ef28f channels/Makefile: clean pjsip directory
........

Merged revisions 403736 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13 05:00:53 +00:00
Jonathan Rose 5583d2c629 chan_pjsip: Revert r403587
This patch was intended to eliminate a deadlock that occurs when
masquerades occur in pjsip channels, but has some potential side
effects. Mark Michelson is currently working on addressing this
problem from another angle.

(issue ASTERISK-22936)
Reported by: Jonathan Rose
........

Merged revisions 403705 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-12 19:18:06 +00:00
Russell Bryant 90108b15a0 Reset peer outboundproxy on sip.conf reload
If you set a peer's outboundproxy and then removed it from the config,
this would not get picked up in a config reload.  This patch fixes that
by resetting it in set_peer_defaults().

Closes ASTERISK-19454
Review: https://reviewboard.asterisk.org/r/3065/
........

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

Merged revisions 403635 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 403639 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-11 19:22:05 +00:00
Matthew Jordan ce423d2ea4 func_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip
This patch adds CHANNEL read support for chan_pjsip. This allows the dialplan
to use the CHANNEL function on a chan_pjsip channel to obtain run-time
information about the channel from the PJSIP channel driver and the PJSIP
stack. This includes:
 * RTP information, including source/destination media addresses, whether or
   not the media is secure, held, and other properties.
 * RTCP information. This includes sets of parseable information, as well as
   individual statistic attriutes.
 * PJSIP information. This includes URIs, local/remote signalling addresses,
   whether or not the signalling is secure, and other properties.
 * The endpoint name. This can be used in conjunction with the PJSIP_ENDPOINT
   function to obtain more detailed endpoint information.

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

Merged revisions 403618 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-11 13:06:30 +00:00
Jonathan Rose 905a7de52b chan_pjsip: Fix a sticking channel lock caused by channel masquerades
(closes issue ASTERISK-22936)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/3042/
........

Merged revisions 403587 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-09 22:59:14 +00:00
David M. Lee 1212906351 Reverting r403311. It's causing ARI tests to hang.
........

Merged revisions 403398 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-05 22:10:20 +00:00
Mark Michelson 8e8b329e14 Add channel locking for channel snapshot creation.
This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such.
........

Merged revisions 403311 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03 17:07:29 +00:00
Kinsey Moore 95bc7626aa chan_dahdi: Fix crash during caller ID read
Asterisk will sometimes core dump during caller id read on analog
channels due to a negative return value from the read() in
my_get_callerid that slips through as a negative length argument to
callerid_feed() if the errno returned by DAHDI is ELAST. This change
ensures that the negative return is treated properly even when it is
ELAST.

(closes issue ASTERISK-22746)
Reported by: Michael Walton
Patches:
    chan_dahdi_cid_crash_fix.r401410.patch uploaded by Michael Walton (License 6502)
........

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

Merged revisions 402709 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402710 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-12 15:03:18 +00:00
Scott Griepentrog 094db82a73 chan_sip: keep same local (from) tag for outgoing register requests
For outbound register requests the tag on the From line was
updated every 20 seconds prior to a successful registration
and also once for each registration renewal.  That behavior
can possibly cause the registration to be denied because of
the different tag, and is not aligned with the intention of
RFC 3261 8.1.3.5 "... request constitutes a new transaction
and SHOULD have the same value of the Call-ID, To, and From
of the previous request...".  This updates chan_sip to have
a field to keep the local tag in the registration structure
and use that tag for registration requests where the callid
is also unchanged.

(closes issue ASTERISK-12117)
Reported by: Pawel Pierscionek
Review: https://reviewboard.asterisk.org/r/2988/
........

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

Merged revisions 402605 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402606 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-08 23:07:50 +00:00
Matthew Jordan 029ce1e962 chan_sip: Use AST_AF* defined constant when calling ast_get_ip
While the structure passed to ast_get_ip should be set memset to 0, thus
initializing the ss_family member to 0, explicitly setting it to AST_AF_UNSPEC
is more portable.
........

Merged revisions 402507 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-05 21:17:30 +00:00
Matthew Jordan f6bd22b0fd chan_iax2: Fix incorrect usage of ast_get_ip involving uninitialized struct
This started off as a fix for the failing IAX2 acl_call test in the Asterisk
Test Suite. When inspecting why that test was failing, it became clear that all
attempts to bind to any local loopback address was failing:

[Nov  2 15:56:28] VERBOSE[15787] chan_iax2.c:   == Binding IAX2 to address
                                 127.0.0.1:4569
[Nov  2 15:56:28] DEBUG[15787] netsock2.c: Splitting '127.0.0.1' into...
[Nov  2 15:56:28] DEBUG[15787] netsock2.c: ...host '127.0.0.1' and port ''.
[Nov  2 15:56:28] ERROR[15787] netsock2.c: getaddrinfo("127.0.0.1", "(null)",
                               ...): ai_family not supported
[Nov  2 15:56:28] WARNING[15787] acl.c: Unable to lookup '127.0.0.1'

While there's conceivably other ways for getaddrino to return EAI_FAMILY, the
most common way is if AF_INET, AF_INET6, or AF_UNSPEC is not provided as the
desired family. The culprit was the call to ast_get_ip, defined in acl.h. This
function uses the family from the passed in addr object (which it will also
populate when it returns!) when it eventually calls getaddrinfo.

This patch fixes the use of ast_get_ip that were not specifying the family in
chan_iax2. This prevents uninitialized use of the structure, so that the
addresses resolve correctly.

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

Merged revisions 402505 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-05 21:14:42 +00:00
Kevin Harwell fe47684b43 chan_sip: notify dialog info ignores presentation indicator in callerid
The presentation indicator in a callerid (e.g. set by dialplan function
Set(CALLERID(name-pres)= ...)) is not checked when SIP Dialog Info Notifies
are generated during extension monitoring.  Added a check to make sure the
name and/or number presentations on the callee (remote identity) are set to
allow.  If they are restricted then "anonymous" is used instead.

(closes issue AST-1175)
Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/2976/
........

Merged revisions 402450 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402452 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-04 21:02:18 +00:00
Kinsey Moore 98dea21bc1 chan_sip: Fix RTCP port for SRFLX ICE candidates
This corrects one-way audio between Asterisk and Chrome/jssip as a
result of Asterisk inserting the incorrect RTCP port into RTCP SRFLX
ICE candidates. This also exposes an ICE component enumeration to
extract further details from candidates.

(closes issue ASTERISK-21383)
Reported by: Shaun Clark
Review: https://reviewboard.asterisk.org/r/2967/
........

Merged revisions 402345 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402348 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-01 12:40:40 +00:00
Kevin Harwell 4746c068dc pjsip_messaging: Added debug for in dialog messaging
(issue ASTERISK-22777)
Reported by: Matt Jordan
........

Merged revisions 402265 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-30 17:54:26 +00:00
Michael L. Young 230141d677 chan_sip: Clarify 'Forcerport' Setting Displayed When Running "sip show peers"
While looking at ASTERISK-22236, Walter Doekes pointed out that when running
"sip show peers", the setting being displayed can be confusing.  The display of
"N" used to mean NAT (i.e. yes).  The NAT setting has gone through many
different changes resulting in the display of different characters to try and
convey what the current setting is for 'Forcerport' (A for Auto and Forcerport
is currently on, a for Auto but Forcerport is off, Y for yes, and N for no).
During the initial code review to try and clarify these settings (especially
since "N" no longer meant what it used to mean in prior versions of Asterisk),
Mark Michelson suggested using the full space available to display the settings
which helped to make the settings very clear.  That was a great suggestion.

Therefore, this patch does the following:

* The column for 'Forcerport' now will show: Auto (Yes), Auto (No), Yes, or No.

* A column for the 'Comedia' setting has been added.  It too will display the
  setting in a non-cryptic way: Auto (Yes), Auto (No), Yes, or No.

* UPGRADE.txt has been updated to document this change.

(closes issue ASTERISK-22728)
Reported by: Walter Doekes
Tested by: Michael L. Young
Patches:
    asterisk-forcerport-display-clarification_v3.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 402111 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402112 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-28 14:59:16 +00:00
Joshua Colp 26914adc00 chan_pjsip: Fix a crash when direct media is enabled and an ACK is received after the channel is hung up.
(closes issue ASTERISK-22731)
Reported by: Kinsey Moore
........

Merged revisions 402064 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-26 12:56:08 +00:00
Kevin Harwell 9ba7742431 chan_sip: Allow a sip peer to accept both AVP and AVPF calls
Adapts the behaviour of avpf to only impact the format of outgoing calls. For
inbound calls, both AVP and AVPF calls will be accepted regardless of the value
of avpf in the configuration.

(closes issue ASTERISK-22005)
Reported by: Torrey Searle
Patches:
     optional_avpf_trunk.patch uploaded by tsearle (license 5334)
........

Merged revisions 401884 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401885 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 16:09:05 +00:00
Jonathan Rose 4ca0f222e8 memory leaks: Memory leak cleanup patch by Corey Farrell (second set)
Also covers ast_app_parse_timelen-fail-zero-length.patch, but the patch was
replaced with one of my own.

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    chan_dahdi-cleanup_push.patch uploaded by coreyfarrell (license 5909)
    clicompat-r2.patch uploaded by coreyfarrell (license 5909)
    codecs-ilbc-doCPLC.patch uploaded by coreyfarrell (license 5909)
    data-cleanup-test-registration.patch uploaded by coreyfarrell (license 5909)
    main-asterisk-kill-listener.patch uploaded by coreyfarrell (license 5909)
........

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

Merged revisions 401705 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401706 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-24 17:00:27 +00:00
Jonathan Rose beb5cdbef5 memory leaks: Memory leak cleanup patch by Corey Farrell (first set)
(issue ASTERSIK-22467)
Reported by: Corey Farrell
Patches:
    chan_sip-parse_contact_header_test-free-contacts.patch uploaded by coreyfarrell (license 5909)
    cli-filename-completion-leak.patch uploaded by coreyfarrell (license 5909)
    func_math.patch uploaded by corefarrell (license 5909)
    main-test-cleanup.patch uploaded by coreyfarrell (license 5909)
    test_dlinklists.patch uploaded by coreyfarrell (license 5909)
........

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

Merged revisions 401661 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401662 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 20:10:30 +00:00
Kinsey Moore dfd3f4ef46 chan_mgcp: Properly handle malformed media lines
This corrects a situation in which a media line was not parsed properly
and resulted in a crash.

(closes issue ASTERISK-21190)
Reported by: adomjan
Patches:
    chan_mgcp.c-sscnaf_fix uploaded by adomjan (License 5448)
........

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

Merged revisions 401538 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401539 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 15:23:58 +00:00
Joshua Colp f4e028a765 chan_sip: Fix an issue where an incompatible audio format may be added to SDP.
If preferred codecs included any non-audio format the code would
mistakenly add the audio format, even if it was not a joint capability
with the remote side.

(closes issue ASTERISK-21131)
Reported by: nbougues
Patches:
	patch_unsupported_codec_1.8.patch uploaded by nbougues (license 6470)
........

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

Merged revisions 401498 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401499 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 11:16:44 +00:00
Michael L. Young 4ca92e3b8a chan_iax2: Fix Binding To Multiple Addresses Again
When reworking chan_iax2 for IPv6, the ability to bind to multiple addresses
was removed by mistake.  This patch restores this functionality and adds notes
about IPv6 addresses in the sample config.

(closes issue ASTERISK-22741)
Reported by: Joshua Colp
Tested by: Michael L. Young
Patches:
    asterisk-22741-fix-binding-multiple-addr.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 401488 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 02:36:01 +00:00
Kinsey Moore 3407f27c88 Fix IAX2 incoming call address lookups
This fixes address lookup for incoming calls without a peer definition.
The address family was unset instead of being set to AST_AF_UNSPEC
which was causing lookup failures on "127.0.0.1". This is one of the
causes of the current failure of the app_page integration test.

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

Merged revisions 401291 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-19 21:57:07 +00:00
Michael L. Young 32d758ed32 Remove Port Restriction When Checking For NAT
When trying to determine if a peer is behind NAT, we should not be using the
ports when comparing addresses.

This patch removes the port from being checked and just useds the addresses
now.

(closes issue ASTERISK-22729)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
    asterisk-remove-using-port-for-nat-check.diff
                                     uploaded by Michael L. Young (license 5026)

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

Merged revisions 401182 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401183 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-18 15:14:36 +00:00
Michael L. Young 42f3cae1fd Fix Setting A chan_sip Dialog's SIP_NAT_FORCE_RPORT Flag
A condition was added in a commit to fix ASTERISK-21374, that, if the
SIP_PAGE3_NAT_AUTO_RPORT flag was set, to then copy a peer's SIP_NAT_FORCE_RPORT
flag to the dialog.  This condition should not have been there since it assumed
that if Asterisk is in an environment where NAT is involved, that the auto_* nat
settings or force_rport setting would be on in the global settings.  If the nat
setting in the global setting is set to 'nat=no' and then turned on for peers
(which is not quite the recommended way, although it is allowed) this flag is
never copied to the dialog resulting in problems like, REGISTER replies going
to the wrong port.

This patch removes this conditional check and will now always use the peer's
flag which by this point in the code the checks on whether the peer is behind
NAT or not (if using auto_force_rport) have already been run.

(closes issue ASTERISK-22236)
Reported by: Filip Frank
Tested by: Michael L. Young
Patches:
    asterisk-2236-always-set-rport.diff uploaded
                                              by Michael L. Young (license 5026)

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

Merged revisions 401167 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401168 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-17 20:39:29 +00:00
Richard Mudgett 66e7dc041d bridge_native_dahdi: Return channel join failure if could not make the channels compatible.
........

Merged revisions 401030 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15 20:26:13 +00:00
Richard Mudgett 3208058831 chan_iax2: Fix channel left locked in off nominal code path.
........

Merged revisions 401016 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 401017 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15 20:05:47 +00:00
Mark Michelson 2c927b871f Prevent chan_sip from sending duplicate BYEs.
When a 200 OK for an initial INVITE is received, we were doing
the right thing by ACKing and sending an immediate BYE. However,
we also were doing the wrong thing and queuing an answer frame,
thus causing the call to be answered. This would cause the call
to be hung up by the channel thread, thus resulting in a second
BYE being sent out.

In this fix, I also have set the hangupcause to be correct since
the initial BYE being sent by Asterisk had an unknown hangup
cause. I have changed to using "Bearer capabilty not available"
since the call was hung up due to an SDP offer/answer error.

(closes issue ASTERISK-22621)
reported by Kinsey Moore
........

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

Merged revisions 400971 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400984 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15 15:26:06 +00:00
Richard Mudgett 2127848d6c chan_dahdi: Add config support for hwgain settings.
* Add hwtxgain and hwrxgain config options to chan_dahdi.conf with
documentation in chan_dahdi.conf.sample.

(closes issue ASTERISK-22429)
Reported by: Jaco Kroon
Patches:
      jira_asterisk_22429_hwgain_trunk.patch (license #5621) patch uploaded by rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-14 22:52:42 +00:00
Richard Mudgett edb437ee6c chan_dahdi: Reflect the set software gain in the CLI "dahdi show channel" output.
* Remember the swgain setting from CLI "dahdi set swgain" command so the
CLI "dahdi show channel" output will reflect the current setting.

* Updated CLI "dahdi set hwgain" and "dahdi set swgain" documentation.

(issue ASTERISK-22429)
Reported by: Jaco Kroon
Patches:
      jira_asterisk_22429_v1.8_v2.patch (license #5621) patch uploaded by rmudgett
........

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

Merged revisions 400909 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400911 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-14 22:06:01 +00:00
Mark Michelson 47e910bfe6 chan_sip: Do not increment the SDP version between 183 and 200 responses.
Bumping the SDP version number can cause interoperability problems
since receivers of the responses will expect that a 200 SDP will
be identical to a previous 183 SDP.

(closes issue ASTERISK-21204)
reported by NITESH BANSAL

Patches:
	dont-increment-session-version-in-2xx-after-183.patch uploaded by NITESH BANSAL (License #6418)
........

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

Merged revisions 400908 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400910 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-14 22:03:22 +00:00
Richard Mudgett e2a0a6ed19 chan_iax2: Fix compile error.
........

Merged revisions 400588 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-05 00:59:17 +00:00
Michael L. Young 2af53640c8 Add IPv6 Support To chan_iax2
This patch adds IPv6 support to chan_iax2.  Yay!

(closes issue ASTERISK-22025)
Patches:
  iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026)

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

Merged revisions 400567 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 21:41:58 +00:00
Jonathan Rose d35b5c9cb0 chan_sip: Don't ignore expires value in contact header if it lacks semicolon
(closes issue ASTERISK-22574)
Reported by: Filip Jenicek
Patches:
    chan_sip_expires.patch uploaded by Filip Jenicek (license 6277)
........

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

Merged revisions 400470 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400471 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 23:20:00 +00:00
Richard Mudgett e3d69a5628 chan_vpb: Make compile again.
........

Merged revisions 400373 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 16:28:35 +00:00
Mark Michelson ee21eee7e0 Cache string values of formats on ast_format_cap() to save processing.
Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

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

Merged revisions 400356 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:58:16 +00:00
Mark Michelson addbf276f5 Multiple revisions 400318-400319
........
  r400318 | mmichelson | 2013-10-02 17:08:49 -0500 (Wed, 02 Oct 2013) | 12 lines
  
  Remove unnecessary waits from stasis.
  
  Since caches are updated on publisher threads, there is no need
  to wait for the cache updates to occur after a stasis message
  is published.
  
  In the case of chan_pjsip device state changes, this set of
  changes caused an improvement to performance.
  
  Review: https://reviewboard.asterisk.org/r/2890
........
  r400319 | mmichelson | 2013-10-02 17:10:54 -0500 (Wed, 02 Oct 2013) | 3 lines
  
  Remove svn:mergeinfo property.
........

Merged revisions 400318-400319 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:22:17 +00:00
Michael L. Young e4ed9886e6 Cast Integer Argument To Unsigned Char
The member reg in the peercnt structure is an unsigned char and peercnt_modify()
is expecting an unsigned char argument which gets assigned to peercnt->reg.

This patch fixes that by casting the integer argument being passed to
peercnt_modify to unsigned char.
........

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

Merged revisions 400315 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400316 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 21:33:42 +00:00
Richard Mudgett d14869bcad sig_ss7: Fix compiler warnings.
........

Merged revisions 400268 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:10:39 +00:00
Joshua Colp c1235f2639 Reduce channel snapshot creation and publishing by up to 50%.
This change introduces the ability to stage channel snapshot
creation and publishing by suppressing the implicit creation
and publishing that some functions have. Once all operations
are executed the staging is marked as done and a single snapshot
is created and published.

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

Merged revisions 400265 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 16:23:34 +00:00
Richard Mudgett 7d17d5fb04 chan_dahdi: Fix analog parking using flash-hook.
Transferring an analog call using a flash-hook to parking would fail to
park the call and result in an invalid ao2 object unref.

* Park the correct bridged channel.
........

Merged revisions 400236 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 21:19:13 +00:00
David M. Lee 2de42c2a25 Multiple revisions 399887,400138,400178,400180-400181
........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
  
  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
  
  Stasis performance improvements
  
  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.
  
  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().
  
  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.
  
  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.
  
  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.
  
  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
  
  Taskprocessor optimization; switch Stasis to use taskprocessors
  
  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.
  
  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.
  
  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.
  
  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).
  
  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.
  
  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Optimize how Stasis forwards are dispatched
  
  This patch optimizes how forwards are dispatched in Stasis.
  
  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.
  
  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.
  
  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).
  
  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)
  
  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.
  
  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Remove dispatch object allocation from Stasis publishing
  
  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.
  
  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.
  
  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.
  
  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.
  
  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.
  
  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.
  
  Review: https://reviewboard.asterisk.org/r/2884/
........

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
Kinsey Moore b44ce141e5 chan_sip: Allow Asterisk to retry after 403 on register
This adds a global option in chan_sip to allow it to continue
attempting registration if a 403 is received, clearing the cached nonce
and treating it as a non-fatal response. Normally, this would cause
registration attempts to that endpoint to stop.

This also adds a similar per-outbound-registration option to chan_pjsip
which allows the retry interval to be altered for 403 responses to
REGISTER requests.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874/
Reported by: Rudi
........

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

Merged revisions 400140 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400141 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 15:57:11 +00:00
Richard Mudgett 9f19d096e3 chan_sip: Increase some scratch buffer sizes dealing with caller id.
* Eliminated an unnecessary initialization in check_user_full().

(closes issue ASTERISK-22477)
Reported by: Michael Shepelev
........

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

Merged revisions 400014 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 400015 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 21:44:42 +00:00
Jonathan Rose 7e2a72771d chan_sip: Reject calls on 200 OKs if no SDP has been received
When Asterisk receives a 200 OK in response to an invite, that peer should have
sent an SDP at some point by then. If the channel has never received an SDP,
media won't have been set and the remote address won't be known. Endpoints in
general should not be doing this. This patch makes it so that Asterisk will
simply hang up a call if it sends a 200 OK at this point. So far this odd
behavior for endpoints has only been observed in tests which involved manually
created SIP transactions in SIPp.

(closes issue ASTERISK-22424)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2827/
........

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

Merged revisions 399962 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399976 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 17:46:16 +00:00
Richard Mudgett 4ed7ab3f2e chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.
The PRI and SS7 link control threads are not stopped correctly when the
chan_dahdi.so module is unloaded.  The link control threads pri_dchannel()
and ss7_linkset() are not awakened from a poll() to cancel the thread.

* Added a SIGURG signal after requesting the thread cancel to break the
link control thread poll() immediately.

For SS7 it was slightly worse, the link poll() timeout would always be
whatever was the last libss7 scheduled event time used.  If no libss7
scheduled event was pending, the thread could run more often than
necessary.

* Set nextms to 60 seconds for the ss7_linkset() poll() if there is no
other libss7 scheduled event.
........

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

Merged revisions 399834 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399842 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25 20:38:24 +00:00
Michael L. Young 1468246e5c chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok
1st Issue
When a realtime peer sends an un-REGISTER request, Asterisk
un-registers the peer but the database table record still has regseconds and
fullcontact for the peer.  This results in calls attempting to be routed to the
peer which is no longer registered.  The expected behavior is to get
busy/congested when attempting to call an un-registered peer through the
dialplan.

What was discovered is that we are clearing out the peer's registration in the
database in parse_register_contact() when calling expire_register() but then
upon returning from parse_register_contact(), update_peer() is run which stores
back in the database table regseconds and fullcontact.

2nd Issue
The reporter pointed out that the 200 ok being returned by Asterisk
after un-registering a peer contains a Contact header with ;expires= and the
Expires header is not set to 0.  This is actually a regression.

Tests were created for this second issue (ASTERISK-22548).  The tests have been
reviewed and a Ship It! was received on those tests.

This patch does the following:

* Do not ignore the Expires header value even when it is set to 0.  The patch
  sets the pvt->expiry earlier on in the function so that it is set properly and
  used.

* If pvt->expiry is 0, do not call update_peer since that means the peer has
  already been un-registered and there is no need to update the database record
  again since nothing has changed.

(closes issue ASTERISK-22428)
Reported by: Ben Smithurst
Tested by: Ben Smithurst, Michael L. Young
Patches:
  asterisk-22428-rt-peer-update-and-expires-header.diff
                                              by Michael L. Young (license 5026)

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

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

Merged revisions 399795 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399796 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25 19:29:38 +00:00
Richard Mudgett b916eaad4c chan_iax2: Prevent some needless breaking of the native IAX2 bridge.
* Clean up some twisted code in the iax2_bridge() loop.

* Add AST_CONTROL_VIDUPDATE and AST_CONTROL_SRCCHANGE to a list of frames
to prevent the native bridge loop from breaking.

* Passing the AST_CONTROL_T38_PARAMETERS frame should also allow FAX over
a native IAX2 bridge.

(issue ABE-2912)

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

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

Merged revisions 399708 from http://svn.asterisk.org/svn/asterisk/branches/11

For v12 and above this is really just documentation until IAX2 native
bridging is restored.
........

Merged revisions 399736 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-24 20:37:32 +00:00
Joshua Colp d4a026a0ee Add a missing session supplement unregistration in chan_pjsip for ACKs.
(closes issue ASTERISK-22453)
Reported by: Corey Farrell
Patches:
	chan_pjsip_session_unregister_supplement.patch uploaded by Corey Farrell (license 5909)
........

Merged revisions 399531 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-20 16:18:42 +00:00
Jonathan Rose e89e19c479 chan_sip: Make direct media reinvites for T38 put Asterisk in the media path
Prior to this patch, Asterisk would incorrectly use the previous endpoint
addresses in SDP in spite of providing its own port. T38 is never meant to
be done through directmedia and Asterisk should always be in the media path
for these streams.

(closes issue ASTERISK-17273)
Reported by: Kevin Stewart

(closes issue ASTERISK-18706)
Reported by: Jeremy Kister

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

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

Merged revisions 399457 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399458 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-19 17:01:09 +00:00
Richard Mudgett 819359dcfd chan_iax2: Fix saving the wrong expiry time in astdb.
When a new IAX2 client registers, the astdb database is updated with the
value of minregexpire defined in iax.conf instead of using the expiry time
that is provided by the client.  The provided expiry time of the client is
updated after inserting the astdb entry.  As a consequence, restarting or
reloading asterisk creates clients whose registration may expire before
they reregister.  The clients are therefore unavailable after minregexpire
seconds until they reregister.

* Move updating of the expiry time to before inserting into the astdb.

(closes issue ASTERISK-22504)
Reported by: Stefan Wachtler
Patches:
      chan_iax2.c.patch (license #6533) patch uploaded by Stefan Wachtler
........

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

Merged revisions 399159 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399160 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-16 16:50:02 +00:00
Richard Mudgett 2a371cd80b Restore Dial, Queue, and FollowMe 'I' option support.
The Dial, Queue, and FollowMe applications need to inhibit the bridging
initial connected line exchange in order to support the 'I' option.

* Replaced the pass_reference flag on ast_bridge_join() with a flags
parameter to pass other flags defined by enum ast_bridge_join_flags.

* Replaced the independent flag on ast_bridge_impart() with a flags
parameter to pass other flags defined by enum ast_bridge_impart_flags.

* Since the Dial, Queue, and FollowMe applications are now the only
callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the
calling contract to require the initial COLP exchange to already have been
done by the caller.

* Made all callers of ast_bridge_impart() check the return value.  It is
important.  As a precaution, I also made the compiler complain now if it
is not checked.

* Did some cleanup in parking_tests.c as a result of checking the
ast_bridge_impart() return value.

An independent, but associated change is:
* Reduce stack usage in ast_indicate_data() and add a dropping redundant
connected line verbose message.

(closes issue ASTERISK-22072)
Reported by: Joshua Colp

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

Merged revisions 399136 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 22:19:23 +00:00
Jonathan Rose 039030f245 chan_sip: Revert r398835 due to failing tests involving originate
(issue ASTERISK-22424)
Reported by: Jonathan Rose
........

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

Merged revisions 398986 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398991 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 20:27:56 +00:00
Jonathan Rose 187802eeb2 chan_sip: Reject calls without prior SDP on 200 OK
If we receive a 200 OK without SDP, we will now check to see if
the remote address has been established for that channel's RTP
session and if the to tag for that channel has changed from
the most recent to tag in a response less than 200.
If either a change has been made since the last to-tag was
received or the remote address is unset, then we will drop
the call.

(closes issue ASTERISK-22424)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2827/diff/#index_header
........

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

Merged revisions 398836 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398837 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-11 20:03:19 +00:00
Kevin Harwell 4d35941891 pjsip: reinvite for connected line updates occurs when it should not
Connected line updates are now only sent out if an actual update needs to occur.
This happens under the following conditions:

1. The endpoint we are sending to is trusted.
2. Either a P-Asserted-Identity or Remote Party-ID header needs to be added/sent.
3. The connected id's number and name are valid.

Also added an SDP when an update is sent out.

(closes issue AST-1212)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2831/
........

Merged revisions 398806 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-11 14:23:28 +00:00
Kinsey Moore 5a3c17f91f Fix chan_h323 compilation
This fixes the things in chan_h323 that were missed or ignored in the
great channel opaquification and gets chan_h323 back into a compiling
state.

(closes issue ASTERISK-22365)
Reported by: Dmitry Melekhov
Patches:
    chan_h323.patch uploaded by Dmitry Melekhov
........

Merged revisions 398510 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398511 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06 16:01:05 +00:00
Richard Mudgett 778d174126 chan_iax2: Reduce indentation in __attempt_transmit().
* Reduce indentation in __attempt_transmit().

* Don't update the static last error time variable every time in
__schedule_action() and socket_read().
........

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

Merged revisions 398457 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398458 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05 19:18:10 +00:00
Richard Mudgett 5954da694e chan_iax2: Fix stray reference to worker thread idle_list.
* Fix stray reference to idle_list in cleanup_thread_list().  This may be
the reason for the note in iax2_process_thread() about threads not being
removed from the task lists.

* Move cleanup_thread_list(&idle_list) to after the other lists are
cleaned up.
........

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

Merged revisions 398417 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398418 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05 17:31:29 +00:00
Richard Mudgett bdb0121769 chan_iax2: Fix bridgecallno deadlock avoidance.
* Fix bridgecallno deadlock avoidance.  When doing deadlock avoidance, you
need to retest the status of values for each loop to see if you still need
the lock for bridgecallno.

* As a safety check, after acquiring the bridgecallno lock you should
check if iaxs[bridgecallno] is NULL just like the current callno checks.

* Move setting thread->iostate to IAX_IOSTATE_IDLE to after processing any
deferred frames to ensure that the iostate is IDLE when it is placed back
into the idle list.  defer_full_frame() tries to ensure
iax2_process_thread() wakes up to process the frame.
........

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

Merged revisions 398380 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398381 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05 17:17:53 +00:00
Richard Mudgett 586a825325 chan_iax2: Add missing control frame names to debug frame decode output.
........

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

Merged revisions 398302 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398303 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-04 23:07:41 +00:00
Richard Mudgett 2ce0c9f4a0 chan_misdn: Fix misdn debug output printed with arbitrary verbose levels.
Fix the misdn debug output to remote consoles.  chan_misdn uses
ast_console_puts() which doesn't know about verbose levels.  Better to use
ast_verbose() instead.  Without this patch the misdn debug messages are
appended to the verbose level which ever was set by the message sent to
the console before, i.e.  any undefined level.

(closes issue AST-1218)
Reported by: Guenther Kelleter
Patches:
      misdnlog.patch (license #6372) patch uploaded by Guenther Kelleter
........

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

Merged revisions 398236 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398237 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-04 16:03:14 +00:00
Kevin Harwell 16b8d0cb5a Fix various memory leaks
main/config.c - cleanup cache fie includes
res/res_security_log.c - unregister logger level
channesl/chan_sip.c - cleanup io context and notify_types
main/translator.c - cleanup at shutdown
main/named_acl.c - cleanup cli commands
main/indications.c - ast_get_indication_tone() unref default_tone_zone if used

(closes issues ASTERISK-22378)
Reported by: Corey Farrell
Patches:
     config_shutdown.patch uploaded by coreyfarrell (license 5909)
     res_security_log.patch uploaded by coreyfarrell (license 5909)
     chan_sip-11.patch uploaded by coreyfarrell (license 5909)
     indications_refleak.patch uploaded by coreyfarrell (license 5909)
     named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909)
     translate_shutdown.patch uploaded by coreyfarrell (license 5909)

........

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

Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 19:22:59 +00:00
David M. Lee 9bed50db41 optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].

This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.

For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.

Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)

The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.

Other changes made as a part of this patch:
 * The stubs for http_websocket that wrap system calls set errno to
   ENOSYS.

 * res_http_websocket now properly increments module use count.

 * In loader.c, the while() wrappers around dlclose() were removed. The
   while(!dlclose()) is actually an anti-pattern, which can lead to
   infinite loops if the module you're attempting to unload exports a
   symbol that was directly linked to.

 * The special handling of nonoptreq on systems without weak symbol
   support was removed, since we no longer rely on weak symbols for
   optional_api.

 [1]: https://wiki.asterisk.org/wiki/x/wACUAQ

(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........

Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:40:27 +00:00
Kevin Harwell d7b9a702d8 Verbose logging discrepancies
Refactored cases where a combination of ast_verbose/options_verbose were
present.  Also in general tried to eliminate, in as many places as possible,
where the options_verbose global variable was being used.  Refactored the way
local and remote consoles handle verbose message logging in an attempt to
solve the various discrepancies that sometimes would show between the two.

(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2798/
........

Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 397958 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 22:49:24 +00:00
Matthew Jordan c32f8a5ca9 AST-2013-005: Fix crash caused by invalid SDP
If the SIP channel driver processes an invalid SDP that defines media
descriptions before connection information, it may attempt to reference
the socket address information even though that information has not yet
been set. This will cause a crash.

This patch adds checks when handling the various media descriptions that
ensures the media descriptions are handled only if we have connection
information suitable for that media.

Thanks to Walter Doekes, OSSO B.V., for reporting, testing, and providing
the solution to this problem.

(closes issue ASTERISK-22007)
Reported by: wdoekes
Tested by: wdoekes
patches:
  issueA22007_sdp_without_c_death.patch uploaded by wdoekes (License 5674)
........

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

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

Merged revisions 397758 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 397759 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27 18:10:40 +00:00
Matthew Jordan 0472e14dee AST-2013-004: Fix crash when handling ACK on dialog that has no channel
A remote exploitable crash vulnerability exists in the SIP channel driver if an
ACK with SDP is received after the channel has been terminated. The handling
code incorrectly assumed that the channel would always be present.

This patch adds a check such that the SDP will only be parsed and applied if
Asterisk has a channel present that is associated with the dialog.

Note that the patch being applied was modified only slightly from the patch
provided by Walter Doekes of OSSO B.V.

(closes issue ASTERISK-21064)
Reported by: Colin Cuthbertson
Tested by: wdoekes, Colin Cutherbertson
patches:
  issueA21064_fix.patch uploaded by wdoekes (License 5674)
........

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

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

Merged revisions 397712 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 397713 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27 17:35:20 +00:00
Richard Mudgett 868be02a2f Fix uninitialized value in struct ast_control_pvt_cause_code usage.
........

Merged revisions 397744 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 397745 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27 16:51:08 +00:00
Richard Mudgett 13dbdd1ae7 chan_dahdi: Add some missing build cleanup.
........

Merged revisions 397643 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-26 16:15:02 +00:00
Richard Mudgett 46b9e5450f Fix memory corruption when trying to get "core show locks".
Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch
in memory pools but had a math error determining the buffer size and
didn't address other similar memory pool mismatches.

* Effectively reverted the previous patch to go in the same direction as
trunk for the returned memory pool of ast_bt_get_symbols().

* Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is
defined.

* Fixed some formatting in ast_bt_get_symbols().

* Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is
enabled.

* Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when
MALLOC_DEBUG is enabled.

* Moved __dump_backtrace() because of compile issues with the utils
directory.

(closes issue ASTERISK-22221)
Reported by: Matt Jordan

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

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

Merged revisions 397528 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 18:07:40 +00:00
Matthew Jordan 4d348e853c Add pass through support for Opus and VP8; Opus format attribute negotiation
This patch adds pass through support for Opus and VP8. That includes:

* Format attribute negotiation for Opus. Note that unlike some other codecs,
  the draft RFC specifies having spaces delimiting the attributes in addition
  to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in
  chan_sip, so a small tweak was also included in this patch for that.

* A format attribute negotiation module for Opus, res_format_attr_opus

* Fast picture update for VP8. Since VP8 uses a different RTCP packet number
  than FIR, this really is specific to VP8 at this time.

Note that the format attribute negotiation in res_pjsip_sdp_rtp was written
by mjordan. The rest of this patch was written completely by Lorenzo Miniero.

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

(closes issue ASTERISK-21981)
Reported by: Tzafrir Cohen
patches:
  asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 15:42:27 +00:00
Joshua Colp b2a13e83dc Fix crash when answering after a transport error occurs.
If a response to an initial incoming INVITE results in a transport error
the INVITE transaction is removed from the INVITE session. Any attempts
to answer the INVITE session after this results in a crash as it requires
the INVITE transaction to exist. This change explicitly locks the dialog
and checks to ensure that the INVITE transaction exists before answering.

(closes issue AST-1203)
Reported by: John Bigelow


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 13:58:08 +00:00
Mark Michelson 25e38dfc9b Prevent a crash on outbound SIP MESSAGE requests.
If a From header on an outbound out-of-call SIP MESSAGE were
malformed, the result could crash Asterisk.

In addition, if a From header on an incoming out-of-call SIP
MESSAGE request were malformed, the message was happily accepted
rather than being rejected up front. The incoming message path
would not result in a crash, but the behavior was bad nonetheless.

(closes issue ASTERISK-22185)
reported by Zhang Lei
........

Merged revisions 397254 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21 14:39:17 +00:00
Matthew Jordan e85dd76945 Allow the SIP_CODEC family of variables to specify more than one codec
The SIP_CODEC family of variables let you set the preferred codec to be
offered on an outbound INVITE request. However, for video calls, you need to
be able to set both the audio and video codecs to be offered. This patch lets
the SIP_CODEC variables accept a comma delineated list of codecs. The first
codec in the list is set as the preferred codec; additional codecs are still
offered however.

This lets a dialplan writer set both audio and video codecs, e.g.,
Set(SIP_CODEC=ulaw,h264)

Note that this feature was written by both Dennis Guse and Frank Haase

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

(closes issue ASTERISK-21976)
Reported by: Denis Guse
Tested by: mjordan, sysreq
patches:
  patch-channels-chan__sip.c-393919 uploaded by dennis.guse (license 6513)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21 13:41:05 +00:00
Michael L. Young c7c8eb5ea4 Fix Not Storing Current Incoming Recv Address
In 1.8, r384779 introduced a regression by retrieving an old dialog and keeping
the old recv address since recv was already set.  This has caused a problem when
a proxy is involved since responses to incoming requests from the proxy server,
after an outbound call is established, are never sent to the correct recv
address.

In 11, r382322 introduced this regression.

The fix is to revert that change and always store the recv address on incoming
requests.

Thank you Walter Doekes for helping to point out this error and Mark Michelson
for your input/review of the fix.

(closes issue ASTERISK-22071)
Reported by: Alex Zarubin
Tested by: Alex Zarubin, Karsten Wemheuer
Patches:
    asterisk-22071-store-recvd-address.diff by Michael L. Young (license 5026)
........

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

Merged revisions 397205 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21 02:15:16 +00:00
Mark Michelson b6faaf85e3 Remove REF_DEBUG definition.
........

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

Merged revisions 397157 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20 17:42:11 +00:00
Mark Michelson 7db2985186 Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts.
(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
	test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)
........

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

Merged revisions 397133 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20 16:25:33 +00:00
Matthew Jordan 1cb1d04679 Whitespace cleanup
Remove some extraneous blobs


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-19 14:53:49 +00:00
Kinsey Moore 124f45a625 Update chan_mgcp to the modified parking API
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-18 03:05:23 +00:00
Kinsey Moore 56aea1c030 Allow res_parking to be unloadable
This change protects accesses of res_parking such that it can unload
safely once transient uses of its registered functions are complete.
The parking API has been restructured such that its consumers do not
have access to the vtable exposed by the parking provider, but instead
route through stubs to prevent consumers from holding on to function
pointers.

This adds calls to all the parking unload functions and moves
application loading and unloading into functions in
parking_applications.c similar to the rest of the parts of res_parking.

Review: https://reviewboard.asterisk.org/r/2763/
(closes issue ASTERISK-22142)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 15:01:54 +00:00
Kinsey Moore 59753b1ea1 Strip down the old event system
This removes unused code, event types, IE pltypes, and event IE types
where possible and makes several functions private that were once
public. This includes a renumbering of the remaining event and IE types
which breaks binary compatibility with previous versions. The last
remaining consumers of the old event system (or parts thereof) are
main/security_events.c, res/res_security_log.c, tests/test_cel.c,
tests/test_event.c, main/cel.c, and the CEL backends.

Review: https://reviewboard.asterisk.org/r/2703/
(closes issue ASTERISK-22139)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 14:39:27 +00:00
Richard Mudgett e47d3db365 Doxygen comment tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16 17:33:21 +00:00
Richard Mudgett 6d24165dee Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15 15:12:16 +00:00
Kinsey Moore 3f46d461bf Fix deadlocks in chan_sip in REFER and BYE handling
This resolves several deadlocks in chan_sip relating to usage of
ast_channel_bridge_peer and improves accessibility of lock debugging
function calls.

Review: https://reviewboard.asterisk.org/r/2756/
(closes issue ASTERISK-22215)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15 12:12:26 +00:00
Richard Mudgett 62c2b80487 Remove unsupported channel technology callbacks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15 00:16:39 +00:00
Richard Mudgett 42a2cc685f chan_vpb: Effectively remove native support. Left enough bread crumbs to be able to convert later if needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14 23:35:08 +00:00
Richard Mudgett 04885c2ca0 chan_iax2: Conditionally remove native support for now.
(issue ASTERISK-21944)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14 23:20:02 +00:00
Richard Mudgett 92d0a2e1ee chan_misdn: Effectively remove native support. Left enough bread crumbs to be able to convert later if needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14 22:53:27 +00:00
Walter Doekes 29945cf238 chan_sip: Convert 'just did sched_add waitid...' from warning to debug message.
Patches:
    reviewboard-2377.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2377/
........

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

Merged revisions 396583 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-13 18:47:58 +00:00
Walter Doekes 235aa06b8d chan_sip: Fix IP-addr in warning when rejecting a contact ACL.
Patches:
    reviewboard-2155.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2155/
........

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

Merged revisions 396580 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-13 18:36:27 +00:00
Jonathan Rose b3813c8bc5 pbx: Make originate threads indicate dial status when synchronous
This makes it so that we can detect failures to originate as with
earlier versions of Asterisk, which restores the Asterisk 11 behavior
for the originate manager action. This was causing the ACL tests for
SIP and IAX2 to fail since those tests expected originate failures
when ACLs would cause rejections. Also, this patch fixes crashes in
chan_sip when ACLs rejected peers during registration verification.

(closes issue ASTERISK-22212)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-09 17:28:15 +00:00
Tzafrir Cohen 39af081784 chan_dahdi: create channels at run-time
This code adds chan_dahdi the command 'dahdi create channels <range>'
(where <range> is a single <n>-<m> or 'new') and updates 'dahdi destroy
channel' with a similar 'dahdi destroy channels'. It allows DAHDI
channels and spans to be added after the initial channel load
(without destroying all other channels as in 'dahdi restart').

It also includes some fixes to the D-Channel / span destruction code
(r394552).

This change is intended to provide a hook for a script running from
udev once a span has been assigned ("registered") / unassigned
("unregistered") for its channels. The udev hook configures the span's
channels with dahdi_cfg -S, and can then ask Asterisk to create ethe
channels. See the scripts added to DAHDI-tools in 2.7.0.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-08 22:09:07 +00:00
Matthew Jordan 33e7b76d1d Hide the Surrogate channels from external consumers; kill Masquerade events
This patch does three things:
1. It provides a Surrogate channel technology with a consolidated
   "implementation detail flag" on the channel technology. This tells
   consumers of Stasis that the creation of this channel is an implementation
   detail in Asterisk and can be ignored (if they so choose). This
   consolidates the conference recorder/announcer flags as well - these flags
   had no additional meaning beyond "ignore this channel please".

2. It modifies allocation of a channel in two ways:
   (a) If a channel technology can be determined from the name, we set it
       directly in the allocation routine. This prevents the initial
       publication of the message from going out with a NULL channel technology
       where possible. This lets Stasis consumers get the right channel
       technology on the first publication.
   (b) It reorganizes allocation to make use of the 'finalized' property on the
       channel. This was already used to know that a channel had completely
       finished its construction in the masquerade routine; now we also use it
       to know whether or not the setting of certain channel properties is
       occurring during or post construction. The various set routines were
       modified accordingly as well.

3. The masquerade event is now dead, Jim. It no longer served any purpose
   whatsoever - if you perform a call pickup you'll get a Pickup event;
   if you perform an attended transfer you will still get those events; if you
   steal a channel to put it elsewhere you'll get the corresponding NewExten or
   BridgeEnter events.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-08 14:13:05 +00:00
Igor Goncharovskiy 70309f24c2 - Fix different issues with call transfer cancel. In case 3rd party busy or congestion call was not returned.
- Fix displaying soft button 'Redial' in case of no redial number exists
........

Merged revisions 396377 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-08 07:05:54 +00:00
Michael L. Young c0f302e1e1 Fix Registration Failure When A Peer And TLS Are Used
If a peer is used in a register line and TLS is defined as the transport, the
registration fails since the transport on the dialog is never set properly
resulting in UDP being used instead of TLS.

This patch sets the dialog's transport based on the transport that was defined
in the register line.  If the register line does not specify a transport, the
parsing function for the register line always defaults back to UDP.

(closes issue ASTERISK-21964)
Reported by: Doug Bailey
Tested by: Doug Bailey
Patches:
    asterisk-21964-set-reg-dialog-transport.diff
					by Michael L. Young (license 5026)
........

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

Merged revisions 396248 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 20:20:41 +00:00
Mark Michelson ab6fc47d95 And get rid of another ast_bridged_channel()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 17:50:40 +00:00
Mark Michelson f8622e7c5c Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.
This commit is smaller than the initial review placed on review board. This is because
a change to allow for channel drivers to access parking functionality externally was
committed and invalidated quite a few of the changes initially made.

(closes issue ASTERISK-22039)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 14:05:07 +00:00
David M. Lee 4f07502000 Fixed chan_dahdi compilation failure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 04:48:12 +00:00
Matthew Jordan 0d86021842 Add pickup.h include lines for chan_dahdi and chan_mgcp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 02:51:33 +00:00
Matthew Jordan 38236e54a8 Remove dead code from features.c; refactor pickup code into pickup.c
This patch does the following:
 * It moves the pickup code out of features.c and into pickup.c
 * It removes the vast majority of dead code out of features.c. In particular,
   this includes the parking code.

(issue ASTERISK-22134)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 02:32:44 +00:00
Matthew Jordan 5c4b482471 Support externally initiated parking requests; remove some dead code
This patch does the following:
 * It adds support for externally initiated parking requests. In particular,
   chan_skinny has a protocol level message that initiates a call park.
   This patch now supports that option, as well as the protocol specific
   mechanisms in chan_dahdi/sig_analog and chan_mgcp.
 * A parking bridge features virtual table has been added that provides
   access to the parking functionality that the Bridging API needs. This
   includes requests to park an entire 'call' (with little or no additional
   information, thank you chan_skinny), perform a blind transfer to a parking
   extension, determine if an extension is a parking extension, as well as the
   actual "do the parking" request from the Bridging API.
 * Refactoring in chan_mgcp, chan_skinny, and chan_dahdi to make use of the new
   functions
 * The removal of some - but not all - dead parking code from features.c

This also fixed blind transferring a multi-party bridge to a parking lot (which
was implemented, but had at least one code path where using the parking features
kK might not have worked)

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

(closes issue ASTERISK-22134)
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 20:55:17 +00:00
Kinsey Moore 03090a88ba Fix documentation replication issues
This prevents XML documentation duplication by expanding channel and
bridge snapshot tags into channel and bridge snapshot parameter sets
with a given prefix or defaulting to no prefix. This also prevents
documentation from becoming fractured and out of date by keeping all
variations of the documentation in template form such that it only
needs to be updated once and keeps maintenance to a minimum.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 17:07:52 +00:00
David M. Lee 88d6c366d1 Fixed compile errors introduced in r395954.
Just a merge error due to a file rename. Grrr...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 15:31:03 +00:00
David M. Lee e1b959ccbb Split caching out from the stasis_caching_topic.
In working with res_stasis, I discovered a significant limitation to
the current structure of stasis_caching_topics: you cannot subscribe
to cache updates for a single channel/bridge/endpoint/etc.

To address this, this patch splits the cache away from the
stasis_caching_topic, making it a first class object. The stasis_cache
object is shared amongst individual stasis_caching_topics that are
created per channel/endpoint/etc. These are still forwarded to global
whatever_all_cached topics, so their use from most of the code does
not change.

In making these changes, I noticed that we frequently used a similar
pattern for bridges, endpoints and channels:

     single_topic  ---------------->  all_topic
           ^
           |
     single_topic_cached  ----+---->  all_topic_cached
                              |
                              +---->  cache

This pattern was extracted as the 'Stasis Caching Pattern', defined in
stasis_caching_pattern.h. This avoids a lot of duplicate code between
the different domain objects.

Since the cache is now disassociated from its upstream caching topics,
this also necessitated a change to how the 'guaranteed' flag worked
for retrieving from a cache. The code for handling the caching
guarantee was extracted into a 'stasis_topic_wait' function, which
works for any stasis_topic.

(closes issue ASTERISK-22002)
Review: https://reviewboard.asterisk.org/r/2672/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 13:49:34 +00:00
Matthew Jordan 0a29f85f87 Raise Registry AMI events on registration failures
This patch makes it so that all registration attempts that fail that
also permanently modify the registration state will raise an appropriate
AMI event.

Note that this patch was forward ported to trunk and the Stasis Core
message bus by mjordan.

(closes issue ASTERISK-21368)
Reported by: Dmitriy Serov
patches:
  chan_sip.c.diff uploaded by Demon (license 6479)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 00:07:59 +00:00
Kinsey Moore f6c7e6355e Fix remnants of the pjsip renaming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-31 13:31:55 +00:00
Mark Michelson 735b30ad71 The large GULP->PJSIP renaming effort.
The general gist is to have a clear boundary between old SIP stuff
and new SIP stuff by having the word "SIP" for old stuff and "PJSIP"
for new stuff. Here's a brief rundown of the changes:

* The word "Gulp" in dialstrings, functions, and CLI commands is now
  "PJSIP"
* chan_gulp.c is now chan_pjsip.c
* Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*"
* All files that were "res_sip*" are now "res_pjsip*"
* The "res_sip" directory is now "res_pjsip"
* Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*"
* The configuration file is now "pjsip.conf" instead of "res_sip.conf"
* The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP"
* CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as
the starting word instead of "sip"



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-30 18:14:50 +00:00
Mark Michelson 895c8e0d2c Reorganize the ast_sip_endpoint structure into substructures.
(closes issue ASTERISK-22135)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-30 15:17:56 +00:00
Joshua Colp 7fded33789 Add support for T.38 fax to chan_pjsip.
Review: https://reviewboard.asterisk.org/r/2692/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-30 14:16:41 +00:00
Matthew Jordan cafc115896 A great big renaming patch
This patch renames the bridging* files to bridge*. This may seem pedantic
and silly, but it fits better in line with current Asterisk naming conventions:
* channel is not "channeling"
* monitor is not "monitoring"
etc.

A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is
the act of using a bridge on a set of channels - and the API that fulfills that
role is more than just the action.

(closes issue ASTERISK-22130)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 04:06:32 +00:00
Joshua Colp 71609d58aa Improve initial INVITE handling and fix crash due to rapidly arriving CANCEL.
(closes issue ASTERISK-22150)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 00:44:24 +00:00
Joshua Colp 2598219adb Drop the reference count on the correct object.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 18:41:29 +00:00
Richard Mudgett e26d4ec83a Reinclude sys/stat.h in chan_dahdi.c and remove redundant include in utils.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 18:41:18 +00:00
Richard Mudgett b4dd4ffbc4 Some chan_dahdi protected function renaming.
analog_lib_handles --> dahdi_analog_lib_handles
enable_dtmf_detect --> dahdi_dtmf_detect_enable
disable_dtmf_detect --> dahdi_dtmf_detect_disable
dahdi_enable_ec --> dahdi_ec_enable
dahdi_disable_ec --> dahdi_ec_disable
update_conf --> dahdi_conf_update
dahdi_link --> dahdi_master_slave_link
dahdi_unlink --> dahdi_master_slave_unlink

(closes issue ASTERISK-22129)
Reported by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 16:26:36 +00:00
Richard Mudgett 83a871ea35 Restore chan_dahdi native bridging and PRI tromboned call elimination.
Created a native_dahdi bridging technology for use with the new bridging
API.

The new bridging technology is part of the chan_dahdi channel driver
because it is very specific to that driver.  Rather than include the new
code directly into chan_dahdi.c the new bridge technology is in its own
file and linked into chan_dahdi.so.  A large part of this change is the
mechanical process of moving declarations around so chan_dahdi.c can be
split up into more files later.

* Changed the bridging core to pass NULL frames into the channel
technologies instead of discarding them.  The channel technologies may
need the proding to determine if their configuration is still valid.

(closes issue ASTERISK-21886)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 15:59:32 +00:00
Kinsey Moore 98504fec8e Add DTLS-SRTP support to chan_pjsip
This patch introduces DTLS-SRTP support to chan_pjsip and the options
necessary to configure it including an option to allow choosing between
32 and 80 byte SRTP tag lengths.

During the implementation and testing of this patch, three other bugs
were found and their fixes are included with this patch. The two in
chan_sip were a segfault relating to DTLS setup and mistaken call
rejection. The third bug fix prevents chan_pjsip from attempting to
perform bridge optimization between two endpoints if either of them is
running any form of SRTP.

Review: https://reviewboard.asterisk.org/r/2683/
(closes issue ASTERISK-21419)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 13:52:06 +00:00
Joshua Colp 16885ffda5 Expose the chan_pjsip implementation pvt and session in a defined manner.
This allows modules outside of chan_pjsip itself to get the session given
only an Asterisk channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 12:27:03 +00:00
Matthew Jordan e502d0095b Add additional control frame types to the IAX2 parser for debug messages
This patch adds some of the more recent control frame types to the IAX2
parser. When IAX2 debugging is enabled, it will now show more of the control
frame types.

(closes issue ASTERISK-22120)
Reported by: Birger "WIMPy" Harzenetter
patches:
  iaxcmds.diff uploaded by wimpy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 02:30:58 +00:00
Kinsey Moore 684c83b29b Add transfer support to CEL
This adds CEL support for blind and attended transfers and call pickup.
During the course of adding this functionality I noticed that
CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly
useless without a bridge identifier, so I added that as well.

This adds tests for blind transfers, several types of attended
transfers, and call pickup.

The extra field in CEL records now consists of a JSON blob whose fields
are defined on a per-event basis.

Review: https://reviewboard.asterisk.org/r/2658/
(closes issue ASTERISK-21565)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-20 13:10:22 +00:00
Jonathan Rose 17c546173f ARI: Bridge Playback, Bridge Record
Adds a new channel driver for creating channels for specific purposes
in bridges, primarily to act as either recorders or announcers. Adds
ARI commands for playing announcements to ever participant in a bridge
as well as for recording a bridge. This patch also includes some
documentation/reponse fixes to related ARI models such as playback
controls.

(closes issue ASTERISK-21592)
Reported by: Matt Jordan

(closes issue ASTERISK-21593)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-19 19:35:21 +00:00
Kinsey Moore 0b83761f9a Fix crash when using temporary peers
Temporary peers do not have an associated Stasis endpoint and quite a
bit of code in chan_sip assumes that all peers have a Stasis endpoint.
All endpoint accesses in chan_sip are now wrapped in an endpoint
NULL-check.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-19 18:09:43 +00:00
Mark Michelson c47787feab Add a bunch of options from sip.conf to res_sip.conf
For a complete list of the options added, see the review linked
at the bottom of this commit message.

(closes issue ASTERISK-21506)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-18 19:25:51 +00:00
Tzafrir Cohen 109f527eb9 Left over spacing issues of review 726.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-17 17:49:54 +00:00
Tzafrir Cohen b10bb8fa7b handle DAHDI_EVENT_REMOVED on a pri D-Channel
When a DAHDI device is removed at run-time it sends the event
DAHDI_EVENT_REMOVED on each channel. This is intended to signal the
userspace program to close the respective file handle, as the driver of
the device will need all of them closed to properly clean-up.

This event has long since been handled in chan_dahdi (chan_zap at the
time). However the event that is sent on a D-Channel of a "PRI" (ISDN)
span simply gets ignored.

This commit adds handling for closing the file descriptor (and shutting
down the span, while we're at it).

It also adds a CLI command 'pri destroy span <N>' to destroy the span
and its DAHDI channels.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-17 16:56:14 +00:00
Richard Mudgett 3f9be54d91 chan_gulp: Fix gulp_indicate() handling of AST_CONTROL_PVT_CAUSE_CODE.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-16 20:00:25 +00:00
Richard Mudgett 6ba25dd3f2 Remove some dead code dealing with old bridging method.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-16 18:49:26 +00:00
Richard Mudgett d43b17a872 Replace chan_agent with app_agent_pool.
The ill conceived chan_agent is no more.  It is now replaced by
app_agent_pool.

Agents login using the AgentLogin() application as before.  The
AgentLogin() application no longer does any authentication.
Authentication is now the responsibility of the dialplan.  (Besides, the
authentication done by chan_agent did not match what the voice prompts
asked for.)

Sample extensions.conf
[login]
; Sample agent 1001 login
; Set COLP for in between calls so the agent does not see the last caller COLP.
exten => 1001,1,Set(CONNECTEDLINE(all)="Agent Waiting" <1001>)
; Give the agent DTMF transfer and disconnect features when connected to a caller.
same => n,Set(CHANNEL(dtmf-features)=TX)
same => n,AgentLogin(1001)
same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
same => n,Hangup()

[caller]
; Sample caller direct connect to agent 1001
exten => 800,1,AgentRequest(1001)
same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS})
same => n,Hangup()

; Sample caller going through a Queue to agent 1001
exten => 900,1,Queue(agent_q)
same => n,Hangup()

Sample queues.conf
[agent_q]
member => Local/800@caller,,SuperAgent,Agent:1001

Under the hood operation overview:
1) Logged in agents wait for callers in an agents holding bridge.
2) Caller requests an agent using AgentRequest()
3) A basic bridge is created, the agent is notified, and caller joins the
   basic bridge to wait for the agent.
4) The agent is either automatically connected to the caller or must ack
   the call to connect.
5) The agent is moved from the agents holding bridge to the basic bridge.
6) The agent and caller talk.
7) The connection is ended by either party.
8) The agent goes back to the agents holding bridge.

To avoid some locking issues with the agent holding bridge, I needed to
make some changes to the after bridge callback support.  The after bridge
callback is now a list of requested callbacks with the last to be added
the only active callback.  The after bridge callback for failed callbacks
will always happen in the channel thread when the channel leaves the
bridging system or is destroyed.

(closes issue ASTERISK-21554)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-15 23:20:55 +00:00
Matthew Jordan c3c0315693 Pretty up a debug message if the referred-by-uri isn't available
Instead of formatting a NULL pointer into a "%s" format string (which is
usually not a good thing to do), we instead print "Unknown".


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-13 22:14:04 +00:00
Moises Silva d92b2f3754 Fix a longstanding issue with MFC-R2 configuration that prevented users
from mixing different variants or general MFC-R2 settings within the same E1 line.

Most users do not have a problem with this since MFC-R2 lines are usually fractional E1s, or
the whole E1 has the same country variant and R2 settings.

In Venezuela however is common to have inbound MFC-R2 and outbound DTMF-R2 within the same E1.

This fix now properly parses the chan_dahdi.conf file to generate a new openr2 context every
time a new channel => section is found and the configuration was changed.

(closes issue ASTERISK-21117)
Reported by: Rafael Angulo
Related Elastix issue: http://bugs.elastix.org/view.php?id=1612
........

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

Merged revisions 394173 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-12 22:35:50 +00:00
Jason Parker b700dc6641 Fix a compiler warning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-12 19:35:08 +00:00
David M. Lee 043a71ee76 Fixed chan_skinny for systems were pthread_t isn't an int.
I'm looking at you, OS X.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-11 20:59:10 +00:00
Damien Wedhorn 6a2b3af90c Refactor and cleanup of skinny session handling.
Major changes are to pull all packet reading functions into skinny_session 
and move timeout handling to scheduling arrangements. Thread cancelling is 
now undertaken directly rather than waiting for the read to timeout 
(cleanup is popped on thread cancel). Also added some keepalive timings in 
debugging messages.

Keepalive timeout has been increased from 1.1 by keepalive to 3 times 
keepalive. This seems to align (after keepalives stabilise) with when 
devices reset after not receiving keepalives. Probably needs more work, 
especially around the first and/or second keepalives that vary 
significantly by device and firmware version.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-11 20:17:53 +00:00
Mark Michelson 0e25d8036e Use correct function for getting bridged peer when doing direct media checks.
(closes issue ASTERISK-21947)
reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-09 20:07:21 +00:00
Jason Parker 7422581b6d Move channel driver Registry manager events to core.
This also shuffles the stasis system topic and related handling.

(closes issue ASTERISK-21488)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-08 14:42:57 +00:00
Matthew Jordan d0a55fa52d Refactor RTCP events over to Stasis; associate with channels
This patch does the following:

* It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel
  information in the RTCP events. Because Stasis provides a cache, Jaco's
  patch was modified to pass the channel uniqueid to the RTP layer as
  opposed to a pointer to the channel. This has the following benefits:
  (1) It keeps the RTP engine 'clean' of references back to channels
  (2) It prevents circular dependencies and other potential ref counting issues
* The RTP engine now allows any RTP implementation to raise RTCP messages.
  Potentially, other implementations (such as res_rtp_multicast) could also
  raise RTCP information. The engine provides structs to represent RTCP headers
  and RTCP SR/RR reports.
* Some general refactoring in res_rtp_asterisk was done to try and tame the
  RTCP code. It isn't perfect - that's *way* beyond the scope of this work -
  but it does feel marginally better.
* A few random bugs were fixed in the RTCP statistics. (Example: performing an
  assignment of a = a is probably not correct)
* We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't
  raise an event when we sent a RR report.

Note that this work will be of use to others who want to monitor call quality
or build modules that report call quality statistics. Since the events are now
moving across the Stasis message bus, this is far easier to accomplish. It is
also a first step (though by no means the last step) towards getting Olle's
pinefrog work incorporated.

Again: note that the patch by Jaco Kroon was modified slightly for this work;
however, he did all of the hard work in finding the right places to set the
channel in the RTP engine across the channel drivers. Much thanks goes to Jaco
for his hard work here.

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

(closes issue ASTERISK-20574)
Reported by: Jaco Kroon
patches:
  asterisk-rtcp-channel.patch uploaded by jkroon (License 5671)

(closes issue ASTERISK-21471)
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-05 17:33:33 +00:00
Richard Mudgett 02f55a36a0 Revert accidental overcommit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 23:57:37 +00:00
Richard Mudgett b4e9a3fc2f Add BUGBUG note for ASTERISK-22009
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 23:55:53 +00:00
Richard Mudgett c841c34aae chan_dahdi: Fix segfault reloading chan_dahdi when round robin is used.
* Clear round_robin[] in dahdi_restart().

(closes issue ASTERISK-21847)
Reported by: Ivo Andonov
Patches:
      jira_asterisk_21847_v1.8.patch (license #5621) patch uploaded by rmudgett
........

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

Merged revisions 393628 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 23:34:19 +00:00
Richard Mudgett 96fed373e9 Fix chan_gtalk.c compile error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02 20:43:10 +00:00
Igor Goncharovskiy f7624718f8 Fix issue with inability to cancell call transfer made by on-sceen menus.
Reported by: Igor Olhovskiy
........

Merged revisions 393395 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-02 10:16:27 +00:00
Kinsey Moore 909ee4bfb9 Refactor extraneous channel events
This change removes JitterBufStats, ChannelReload, and ChannelUpdate
and refactors the following events to travel over Stasis-Core:
* LocalBridge
* DAHDIChannel
* AlarmClear
* SpanAlarmClear
* Alarm
* SpanAlarm
* DNDState
* MCID
* SIPQualifyPeerDone
* SessionTimeout

Review: https://reviewboard.asterisk.org/r/2627/
(closes issue ASTERISK-21476)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01 13:16:09 +00:00
Mark Michelson 6d624eb008 Add stasis publications for blind and attended transfers.
This creates stasis messages that are sent during a blind or
attended transfer. The stasis messages also are converted to
AMI events.

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

(closes issue ASTERISK-21337)
Reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-28 18:42:24 +00:00
Richard Mudgett a022379107 Fix incorrect calls to ast_bridge_impart().
There was a misunderstanding about ast_bridge_impart()'s handling of the
imparted channel's reference.  The channel reference is passed by the
caller unless ast_bridge_impart() returns an error.

* Fixed a memory leak in conf_announce_channel_push() if the impart
failed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-26 01:46:30 +00:00
Matthew Jordan 13b470d704 Fix memory/ref counting leaks in a variety of locations
This patch fixes the following memory leaks:
 * http.c: The structure containing the addresses to bind to was not being
   deallocated when no longer used
 * named_acl.c: The global configuration information was not disposed of
 * config_options.c: An invalid read was occurring for certain option types.
 * res_calendar.c: The loaded calendars on module unload were not being
   properly disposed of.
 * chan_motif.c: The format capabilities needed to be disposed of on module
   unload. In addition, this now specifies the default options for the
   maxpayloads and maxicecandidates in such a way that it doesn't cause the
   invalid read in config_options.c to occur.

(issue ASTERISK-21906)
Reported by: John Hardin
patches:
  http.patch uploaded by jhardin (license 6512)
  named_acl.patch uploaded by jhardin (license 6512)
  config_options.patch uploaded by jhardin (license 6512)
  res_calendar.patch uploaded by jhardin (license 6512)
  chan_motif.patch uploaded by jhardin (license 6512)
........

Merged revisions 392810 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-25 01:12:58 +00:00
Joshua Colp 77002bc377 Merge in current pimp_my_sip work, including:
1. Security events
2. Websocket support
3. Diversion header + redirecting support
4. An anonymous endpoint identifier
5. Inbound extension state subscription support
6. PIDF notify generation
7. One touch recording support (special thanks Sean Bright!)
8. Blind and attended transfer support
9. Automatic inbound registration expiration
10. SRTP support
11. Media offer control dialplan function
12. Connected line support
13. SendText() support
14. Qualify support
15. Inband DTMF detection
16. Call and pickup groups
17. Messaging support

Thanks everyone!

Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-22 14:03:22 +00:00
Joshua Colp 94ec267888 Migrate PeerStatus events to stasis, add stasis endpoints, and add chan_pjsip device state.
(closes issue ASTERISK-21489)
(closes issue ASTERISK-21503)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-22 12:40:16 +00:00
Matthew Jordan c14cdede12 Add BUGBUG for broken direct media in chan_gulp
(issue ASTERISK-21947)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-21 21:22:07 +00:00
Mark Michelson e3a89a0a18 Change chan_unistim to use core transfer API.
Review: https://reviewboard.asterisk.org/r/2553

(closes issue ASTERISK-21527)
Reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-21 18:05:56 +00:00
Richard Mudgett 291711f85f chan_vpb: Fix compile error and __ast_channel_alloc() prototype const inconsistency.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 18:37:27 +00:00
Richard Mudgett c9e04e70ca chan_misdn: Fix compile error after CDR merge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 18:16:23 +00:00
Matthew Jordan 6258bbe7bd Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:00:38 +00:00
Igor Goncharovskiy 2053fc3159 Fix issue with no sound in both way in case of previous call to chan_unistim phone was canceled.
(related to ASTERISK-20183)
........

Merged revisions 391379 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11 10:24:04 +00:00
Alec L Davis b0143074fa IAX2: Transfer Reject: Lock bridgecallno before touching it, refactor
1). When touching the bridgecallno, we need to lock it.

2). Remove magic number '0' and replace with TRANSFER_NONE.

3). Exit early if no bridgecallno.

4). Reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 391334 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11 08:13:39 +00:00
Damien Wedhorn 75e7c3a8fa Change chan_skinny to use core transfer API.
Changes for both attended and blind transfers in chan_skinny to use the new transfer API instead of masquerade.

(closes issue ASTERISK-21526)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2557/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 21:04:43 +00:00
Alec L Davis 0cec7dcdcd chan_iax2: nativebridge refactor, missed unlock bridgecallno
........

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

Merged revisions 391148 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 09:33:56 +00:00
Alec L Davis a6ab25a004 fix bad edit after conflict resolution
........

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

Merged revisions 391111 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 08:38:03 +00:00
Alec L Davis d264518524 IAX2: refactor nativebridge transfer
remove triple checking of iaxs[fr->callno]->transferring

reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 391084 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 08:30:31 +00:00
Alec L Davis 1c8c91b63a IAX2: fix race condition with nativebridge transfers.
1). When touching the bridgecallno, we need to lock it.

2). stop_stuff() which calls iax2_destroy_helper()
    Assumes the lock on the pvt is already held, when iax2_destroy_helper() is called.
    Thus we need to lock the bridgecallno pvt before we call stop_stuff(iaxs[fr->callno]->bridgecallno);

3).   When evaluating the state of 'callno->transferring' of the current leg,
    we can't change it to READY unless the bridgecallno is locked.
      Why, if we are interrupted by the other call leg before 'transferring = TRANSFER_RELEASED',
    the interrupt will find that it is READY and that the bridgecallno is also READY so Releases the legs.

(closes issue ASTERISK-21409)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 391063 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 07:35:06 +00:00
Richard Mudgett 6114166237 Refactor chan_dahdi/sig_analog/sig_pri and chan_misdn to use the common transfer functions.
(closes issue ASTERISK-21523)
Reported by: Matt Jordan

(closes issue ASTERISK-21524)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07 01:06:49 +00:00
Mark Michelson 2dc8a06006 Refactor the features configuration scheme.
Features configuration is handled in its own API in
features_config.h and features_config.c. This way, features
configuration is accessible to anything that needs it.

In addition, features configuration has been altered to
be more channel-oriented. Most callers of features API
code will be supplying a channel so that the individual
channel's settings will be acquired rather than the global
setting.

Missing from this commit is XML documentation for the
features configuration. That will be handled in a separate
commit.

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

(issue ASTERISK-21542)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-06 21:40:35 +00:00
Richard Mudgett 8e3f37adef Add a BUGBUG note.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-06 01:52:05 +00:00
Mark Michelson cfe32ec1da Add attended transfer support for chan_sip.c
This now uses the core API for performing attended transfers.

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

(Closes issue ASTERISK-21520)
reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-28 15:26:15 +00:00
Mark Michelson fac3839e68 Adds support for a core attended transfer function plus adds some hiding of masquerades.
The attended transfer API call can complete the attended transfer in a number of ways
depending on the current bridged states of the channels involved.

The hiding of masquerades is done in some bridging-related functions, such as the manager
Bridge action and the Bridge dialplan application. In addition, call pickup was edited
to "move" a channel rather than masquerade it.

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

(closes issue ASTERISK-21334)
Reported by Matt Jordan

(closes issue Asterisk-21336)
Reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-28 14:45:31 +00:00
Jason Parker 154fbf8cae Split Hold event into Hold/Unhold, and move it into core.
(closes issue ASTERISK-21487)
Review: https://reviewboard.asterisk.org/r/2565/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 21:21:25 +00:00
Matthew Jordan 06be8463b6 Migrate a large number of AMI events over to Stasis-Core
This patch moves a number of AMI events over to the Stasis-Core message bus.
This includes:
 * ChanSpyStart/Stop
 * MonitorStart/Stop
 * MusicOnHoldStart/Stop
 * FullyBooted/Reload
 * All Voicemail/MWI related events

In addition, it adds some Stasis-Core and AMI support for generic AMI messages,
refactors the message router in AMI to use a single router with topic
forwarding for the topics that AMI cares about, and refactors MWI message
types and topics to be more name compliant.

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

(closes issue ASTERISK-21462)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 20:44:07 +00:00
Igor Goncharovskiy 1fb6f365ec Fix several problems caused by multiple line usage with i2004 phones.
Reported by: Daniel Bohling, MihaiMircea

(closes issue ASTERISK-21061)
(closes issue ASTERISK-21120)
........

Merged revisions 389661 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 10:23:48 +00:00
Richard Mudgett 3d63833bd6 Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked.  A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21 18:00:22 +00:00
Damien Wedhorn 8d6b0c9f3b Add transfer softkey to ringout state to enable blond transfers.
(closes issue ASTERISK-21327)
Reported by: wedhorn
Tested by: myself
Patches: 
    skinny-blindxfer01.diff uploaded by wedhorn (license 5019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-19 19:45:14 +00:00
Damien Wedhorn 01d6e8dbc9 Add call forward no answer to skinny and cleanup general callfwd handling.
CallforwardNoAnswer uses a sched to determine when to forward the call. 
Defaults to 20secs but configurable in skinny.conf.

Adds dialType to each subchannel structure to be used to differentiate
between normal dials that result in a call being placed (default) and
other uses for the skinny_dialer (such as cfwd digit collection).
Restructured all cfwd handling to use this new arrangement.

(closes issue ASTERISK-21292)
Reported by: wedhorn
Tested by: myself
Patches: 
    skinny-callfwdnoans03.diff uploaded by wedhorn (license 5019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-18 23:20:53 +00:00
David M. Lee b97c71bb11 Fix shutdown assertions in stasis-core
In r388005, macros were introduced to consistently define message
types. This added an assert if a message type was used either before
it was initialized or after it had been cleaned up. It turns out that
this assertion fires during shutdown.

This actually exposed a hidden shutdown ordering problem. Since
unsubscribing is asynchronous, it's possible that the message types
used by the subscription could be freed before the final message of
the subscription was processed.

This patch adds stasis_subscription_join(), which blocks until the
last message has been processed by the subscription. Since joining was
most commonly done right after an unsubscribe, a
stasis_unsubscribe_and_join() convenience function was also added.

Similar functions were also added to the stasis_caching_topic and
stasis_message_router, since they wrap subscriptions and have similar
problems.

Other code in trunk was refactored to join() where appropriate, or at
least verify that the subscription was complete before being
destroyed.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 21:10:32 +00:00
Michael L. Young 91bab76422 Remove Character Limit On "inkeys" For IAX2
Currently, the buffer for processing "inkeys" is limited to 256 characters.  If
the user has many keys and the names of those key files are long, the 256
character limit is not enough.

* Change inkeys buffer to be dynamic

(closes issue ASTERISK-21398)
Reported by: Pavel Kopchyk
Tested by: Pavel Kopchyk, Michael L. Young
Patches:
    asterisk-21398-iax2-inkeys-dynamic-buffer_v3.diff
					by Michael L. Young (license 5026)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 20:24:56 +00:00
Jonathan Rose b90bba7a30 Stasis: Update security events to use Stasis
Also moves ACL messages to the security topic and gets rid of the
ACL topic

(closes issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2496/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 17:36:10 +00:00
Michael L. Young 4ff6e61808 Fix Crash Caused By One-way Audio With auto_* NAT Settings Fix
The prior code committed, r385473, failed to take into consideration that not
all outgoing calls will be to a peer.  My fault.

This patch does the following:

* Check if there is a related peer involved.  If there is, check and set NAT 
  settings according to the peer's settings.

* Fix a problem with realtime peers.  If the global setting has auto_force_rport
  set and we issued a "sip reload" while a peer is still registered, the peer's
  flags for NAT are reset to off.  When this happens, we were always setting the
  contact address of the peer to that of the full contact info that we had.

(closes issue ASTERISK-21374)
Reported by: jmls
Tested by: Michael L. Young
Patches:
   asterisk-21374-fix-crash-and-rt-peers.diff by Michael L. Young (license 5026)

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

Merged revisions 388601 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 21:07:02 +00:00
Jonathan Rose f2ba7c04fb chan_gulp: Minor readability Improvements to chan_gulp
(closes issue ASTERISK-21670)
Reported by: Snuffy
Review: https://reviewboard.asterisk.org/r/2473/
Patches:
    gulp-coding-guide.diff uploaded by snuffy (license 5024)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 17:20:33 +00:00
Richard Mudgett 785be439f9 Allow mISDN to send PROGRESS messsage.
* Made isdn_msg_parser.c build a progress message with the mandatory
progress indicator IE.  (The mISDNuser NT state machine rejected sending
the incomplete message.)

Note: The associated mISDN and mISDNuser patches respectively are viewable
here:
http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
http://svnview.digium.com/svn/thirdparty?view=rev&rev=201

(closes issue AST-1153)
Reported by: Guenther Kelleter
Patches:
      progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
      progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
      progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter
........

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

Merged revisions 388426 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 22:12:52 +00:00
Sean Bright 2cfedc12ad Fix copy/paste error in one-touch-recording implementation.
........

Merged revisions 388253 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 11:47:04 +00:00
David M. Lee e06e519a90 Initial support for endpoints.
An endpoint is an external device/system that may offer/accept
channels to/from Asterisk. While this is a very useful concept for end
users, it is surprisingly not a core concept within Asterisk itself.

This patch defines ast_endpoint as a separate object, which channel
drivers may use to expose their concept of an endpoint. As the channel
driver creates channels, it can use ast_endpoint_add_channel() to
associate channels to the endpoint. This updated the endpoint
appropriately, and forwards all of the channel's events to the
endpoint's topic.

In order to avoid excessive locking on the endpoint object itself, the
mutable state is not accessible via getters. Instead, you can create a
snapshot using ast_endpoint_snapshot_create() to get a consistent
snapshot of the internal state.

This patch also includes a set of topics and messages associated with
endpoints, and implementations of the endpoint-related RESTful
API. chan_sip was updated to create endpoints with SIP peers, but the
state of the endpoints is not updated with the state of the peer.

Along for the ride in this patch is a Stasis test API. This is a
stasis_message_sink object, which can be subscribed to a Stasis
topic. It has functions for blocking while waiting for conditions in
the message sink to be fulfilled.

(closes issue ASTERISK-21421)
Review: https://reviewboard.asterisk.org/r/2492/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 13:39:08 +00:00
Alec L Davis efd28c676a chan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries fail
RFC6665 4.2.2: ... after a failed State NOTIFY transaction remove the subscription

The problem is that the State Notify requests rely on the 200OK reponse for pacing control
and to not confuse the notify susbsystem.
The issue is, the pendinginvite isn't cleared if a response isn't received,
thus further notify's are never sent.

The solution, follow RFC 6665 4.2.2's 'SHOULD' and remove the subscription after failure.
  
(closes issue ASTERISK-21677)

Reported by: Dan Martens
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 387880 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 07:21:09 +00:00
Richard Mudgett cc855cf9d8 Make a log NOTICE more explicit that the event comes from DAHDI and not PRI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-06 17:09:50 +00:00
Jonathan Rose 1eac5a7988 Stasis: Convert network change events into network change stasis messages
(issue ASTERISK-21103)
Review: https://reviewboard.asterisk.org/r/2490/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-03 18:03:26 +00:00
Joshua Colp e236c2ea36 Use the configured formats for Gulp sessions if there are no joint formats between requested formats and configured formats.
(closes issue ASTERISK-21756)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-03 11:35:14 +00:00
Alec L Davis f7f58b7bc2 chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher
RFC 4028 Section 10
	if the side not performing refreshes does not receive a
	session refresh request before the session expiration, it SHOULD send
	a BYE to terminate the session, slightly before the session
	expiration.  The minimum of 32 seconds and one third of the session
	interval is RECOMMENDED.

Prior to this asterisk would refresh at 1/2 the Session-Expires interval,
or if the remote device was the refresher, asterisk would timeout at interval end.

Now, when not refresher, timeout as per RFC noted above.

(closes issue ASTERISK-21742)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 387345 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 08:24:31 +00:00
Alec L Davis 7f0f53958b chan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher.
RFC 4028 Section 7.2
 "UACs MUST be prepared to receive a Session-Expires header field in a
 response, even if none were present in the request." 

What changed
  After ASTERISK-20787, inbound calls to asterisk with no Session-Expires in the INVITE are now are offered
  a Session-Expires (1800 asterisk default) in the response, with asterisk as the refresher.

Symptom:
  After 900 seconds (asterisk default refresher period 1800), asterisk RE-INVITEs the device, the device
   may respond with a much lower Session-Expires (180 in our case) value that it is now using.

  Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE.

  After 180 seconds the device times out and sends BYE (hangs up), asterisk is still working with the
  refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response.
 
Fix:
	handle_response_invite() when 200OK, remove check for outbound and reinvite.
  
(closes issue ASTERISK-21664)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 387319 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 07:25:33 +00:00
Alec L Davis 0b020e8c0b chan_dahdi: fix lower bound check with -ve integer conversion from a float
Lower bound of a 16bit signed int is -32768 not -32767

(closes issue ASTERISK-21744)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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

Merged revisions 387298 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 06:57:04 +00:00
Richard Mudgett eea6df46d5 Simplify chan_local.c:manager_optimize_away() using ao2_find().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 21:55:53 +00:00
Richard Mudgett e4db1903a2 Cleanup chan_local.c:local_new().
* Remove t and ama local variables.  There is no way they could be
anything other than default because p->owner can only be NULL at this
point.

* Rename tmp and tmp2 to owner and chan respectively.

* Remove redundant initialization of channel context, exten, priority.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 21:35:53 +00:00
Richard Mudgett a2a8afe07a Trivial changes. Comments, parentheses, spelling, wording.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 21:09:14 +00:00
Richard Mudgett e6f7de360d Make chan_local locals container an explicit list container.
Pretending that chan_local locals container can have more than one bucket
is silly.  The container has no key to help search.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:59:29 +00:00
Richard Mudgett 3992df6d41 Whitespace changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:53:30 +00:00
Richard Mudgett 5fec9b8d1f Remove some unnecessary calls to ast_bridged_channel() in chan_unistim.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:01:43 +00:00
Richard Mudgett 213834ffd4 Remove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:01:27 +00:00
Richard Mudgett 30cf1a590c Remove some unnecessary calls to ast_bridged_channel() in chan_skinny.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:01:10 +00:00
Richard Mudgett b050778ce8 Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:00:53 +00:00
Richard Mudgett 5ab5715646 Remove some unnecessary calls to ast_bridged_channel() in chan_dahdi.c/sig_analog.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:00:31 +00:00
Matthew Jordan b693a72378 Prevent crash in 'sip show peers' when the number of peers on a system is large
When you have lots of SIP peers (according to the issue reporter, around 3500),
the 'sip show peers' CLI command or AMI action can crash due to a poorly placed
string duplication that occurs on the stack. This patch refactors the command
to not allocate the string on the stack, and handles the formatting of a single
peer in a separate function call.

(closes issue ASTERISK-21466)
Reported by: Guillaume Knispel
patches:
  fix_sip_show_peers_stack_overflow_asterisk_11.3.0-v2.patch uploaded by gknispel (License 6492)
........

Merged revisions 387134 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 18:38:40 +00:00
Richard Mudgett 3a5a0f3f26 Move some annoying chan_dahdi debug messages to level 5.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 17:15:26 +00:00
Jonathan Rose 8e257fe819 Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus
(issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2481/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 22:37:24 +00:00
Jason Parker cc9b4d8da4 Fix a log message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 18:12:36 +00:00
Mark Michelson 74f2318051 Merge the pimp_my_sip branch into trunk.
The pimp_my_sip branch is being merged at this point because
it offers basic functionality, and from an API standpoint, things
are complete.

SIP work is *not* feature-complete; however, with the completion
of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
been created, and thus it is possible for developers to attempt
to create new SIP work.

API documentation can be found in the doxygen in the code, but
usability documentation is still lacking.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 18:25:31 +00:00
Michael L. Young b4c881c86e Fix Displaying Symmetric RTP Global Setting
* Use comedia_string() to display correctly the symmetric rtp setting when
  running "sip show settings"
........

Merged revisions 386486 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 03:04:21 +00:00
Michael L. Young 735026ccf6 Change Case On Forcerport For Consistency
* Change "ForcerPort" to "Forcerport" to match everywhere else it is displayed
........

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

Merged revisions 386484 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 02:48:44 +00:00
Matthew Jordan 5111744214 Don't attempt to create a voice frame on a read error
Prior to this patch, a read error in snd_pcm_readi would still be treated as a
nominal result when constructing a voice frame from the expected data. Since
the value returned is negative, as opposed to the number of samples read,
this could result in a crash. With this patch, we now return a null frame
when a read error is detected.

Note that the patch on ASTERISK-21329 was modified slightly for this commit,
in that we bail immediately on detecting the read error, rather than bypassing
the construction of the voice frame.

(closes issue ASTERISK-21329)
Reported by: Keiichiro Kawasaki
patches:
  chan_alsa.diff uploaded by kawasaki (License 6489)
........

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

Merged revisions 385634 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-14 02:35:04 +00:00
Michael L. Young fcbb9f0c8d Fix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX
When we reload Asterisk or chan_sip, the flags force_rport and comedia that are
turned on and off when using the auto_force_rport and auto_comedia nat settings
go back to the default setting off.  These flags are turned on when needed or
off when not needed at the time that a peer registers, re-registers or initiates
a call.  This would apply even when only the default global setting
"nat=auto_force_rport" is being used, which in this case would only affect the
force_rport flag.

Everything is good except for the following:  The nat setting is set to
auto_force_rport and auto_comedia.  We reload Asterisk and the peer's
registration has not expired.  We load in the settings for the peer which turns
force_rport and comedia back to off.  Since the peer has not re-registered or
placed a call yet, those flags remain off.  We then initiate a call to the peer
from the PBX.  The force_rport and comedia flags stay off.  If NAT is involved,
we end up with one-way audio since we never checked to see if the peer is behind
NAT or not.

This patch does the following:

* Moves the checking of whether a peer is behind NAT into its own function

* Create a function to set the peer's NAT flags if they are using the auto_* NAT
  settings

* Adds calls in sip_request_call() to these new functions in order to setup the
  dialog according to the peer's settings

(closes issue ASTERISK-21374)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
    asterisk-21374-auto-nat-outgoing-fix_v2.diff Michael L. Young (license 5026)

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

Merged revisions 385473 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 15:06:09 +00:00
Alec L Davis e5b0de5535 IAX2 defer_full_frames fail to get sent
Ensure iax2_process_thread is signalled when a deferred frame is queued to it.

(closes issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 385430 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 08:52:44 +00:00
Alec L Davis 3959535615 IAX2, prevent network thread starting before all helper threads are ready
On startup, it's possible for a frame to arrive before the processing threads were ready.

In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive
before we are at ast_cond_wait, the signal will be ignored.
The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued.  

Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled
after each thread is started.
 
(issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 385403 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 08:18:20 +00:00
Matthew Jordan caf4a5f605 Fix crash in chan_sip when a core initiated op occurs at the same time as a BYE
When a BYE request is processed in chan_sip, the current SIP dialog is detached
from its associated Asterisk channel structure. The tech_pvt pointer in the
channel object is set to NULL, and the dialog persists for an RFC mandated
period of time to handle re-transmits.

While this process occurs, the channel is locked (which is good).
Unfortunately, operations that are initiated externally have no way of knowing
that the channel they've just obtained (which is still valid) and that they are
attempting to lock is about to have its tech_pvt pointer removed. By the time
they obtain the channel lock and call the channel technology callback, the
tech_pvt is NULL.

This patch adds a few checks to some channel callbacks that make sure the
tech_pvt isn't NULL before using it. Prime offenders were the DTMF digit
callbacks, which would crash if AMI initiated a DTMF on the channel at the
same time as a BYE was received from the UA. This patch also adds checks on
sip_transfer (as AMI can also cause a callback into this function), as well
as sip_indicate (as lots of things can queue an indication onto a channel).

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

(closes issue ASTERISK-20225)
Reported by: Jeff Hoppe
........

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

Merged revisions 385173 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10 14:07:27 +00:00
Michael L. Young 03286cf23f Fix For Not Overriding The Default Settings In chan_sip
The initial report was that the "nat" setting in the [general] section was not
having any effect in overriding the default setting.  Upon confirming that this
was happening and looking into what was causing this, it was discovered that
other default settings would not be overriden as well.

This patch works similar to what occurs in build_peer().  We create a temporary
ast_flags structure and using a mask, we override the default settings with
whatever is set in the [general] section.

In the bug report, the reporter who helped to test this patch noted that the
directmedia settings were being overriden properly as well as the nat settings.

This issue is also present in Asterisk 1.8 and a separate patch will be applied
to it.

(issue ASTERISK-21225)
Reported by: Alexandre Vezina
Tested by: Alexandre Vezina, Michael L. Young
Patches:
  asterisk-21225-handle-options-default-prob_v4.diff
						Michael L. Young (license 5026)

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

Merged revisions 384827 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-05 20:41:27 +00:00
Richard Mudgett 6a25d49296 chan_dahdi: Change inband_on_proceeding option default to no/disabled.
(issue ASTERISK-21151)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 20:27:11 +00:00
Richard Mudgett 79818112fd chan_dahdi: Add inband_on_proceeding compatibility option.
The new inband_on_proceeding option causes Asterisk to assume inband audio
may be present when a PROCEEDING message is received.

Q.931 Section 5.1.2 says the network cannot assume that the CPE side has
attached to the B channel at this time without explicitly sending the
progress indicator ie informing the CPE side to attach to the B channel
for audio.  However, some non-compliant ISDN switches send a PROCEEDING
without the progress indicator ie indicating inband audio is available and
assume that the CPE device has connected the media path for listening to
ringback and other messages.

ASTERISK-17834 which causes this issue was dealing with a non-compliant
network switch.

(closes issue ASTERISK-21151)
Reported by: Gianluca Merlo
Tested by: rmudgett
........

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

Merged revisions 384689 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 20:20:09 +00:00
Kinsey Moore 1a2a4578d2 Convert MWI state message type to the new stasis naming convention
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 22:42:06 +00:00
Kinsey Moore 72bccf69c3 Address uninitialized conditional that valgrind found
........

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

Merged revisions 384163 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 19:52:19 +00:00
Matthew Jordan 0ffce56f1b AST-2013-003: Prevent username disclosure in SIP channel driver
When authenticating a SIP request with alwaysauthreject enabled, allowguest
disabled, and autocreatepeer disabled, Asterisk discloses whether a user
exists for INVITE, SUBSCRIBE, and REGISTER transactions in multiple ways. The
information is disclosed when:
 * A "407 Proxy Authentication Required" response is sent instead of a
   "401 Unauthorized" response
 * The presence or absence of additional tags occurs at the end of "403
   Forbidden" (such as "(Bad Auth)")
 * A "401 Unauthorized" response is sent instead of "403 Forbidden" response
   after a retransmission
 * Retransmission are sent when a matching peer did not exist, but not when a
   matching peer did exist.

This patch resolves these various vectors by ensuring that the responses sent
in all scenarios is the same, regardless of the presence of a matching peer.

This issue was reported by Walter Doekes, OSSO B.V. A substantial portion of
the testing and the solution to this problem was done by Walter as well - a
huge thanks to his tireless efforts in finding all the ways in which this
setting didn't work, providing automated tests, and working with Kinsey on
getting this fixed.

(closes issue ASTERISK-21013)
Reported by: wdoekes
Tested by: wdoekes, kmoore
patches:
  AST-2013-003-1.8 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-10 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-11 uploaded by kmoore, wdoekes (License 6273, 5674)
........

Merged revisions 384003 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 15:27:31 +00:00
Damien Wedhorn 63a4da4eba Fix skinny encall button to not blind xfer.
The softbutton endcall should not turn a transfer into a blind transfer but
hangup the exten being called and leave the original call on hold. This does
that.

(closes issue ASTERISK-21321)
Reported by: wedhorn
Tested by: snuffy, myself
Patches: 
    skinny-xferendcall01.diff uploaded by wedhorn (license 5019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-27 07:24:37 +00:00
Matthew Jordan 58ee2b7d11 Resolve deadlock between SIP registration and channel based functions
In r373424, several reentrancy problems in chan_sip were addressed. As a
result, the SIP channel driver is now properly locking the channel driver
private information in certain operations that it wasn't previously. This
exposed two latent problems either in register_verify or by functions called
by register_verify. This includes:
 * Holding the private lock while calling sip_send_mwi_to_peer. This can create
   a new sip_pvt via sip_alloc, which will obtain the channel container lock.
   This is a locking inversion, as any channel related lock must be obtained
   prior to obtaining the SIP channel technology private lock.

   Note that this issue was already fixed in Asterisk 11.

 * Holding the private lock while calling sip_poke_peer. In the same vein as
   sip_send_mwi_to_peer, sip_poke_peer can create a new SIP private, causing
   the same locking inversion.

Note that this locking inversion typically occured when CLI commands were run
while a SIP REGISTER request was being processed, as many CLI commands (such
as 'sip show channels', 'core show channels', etc.) have to obtain the channel
container lock.

(issue ASTERISK-21068)
Reported by: Nicolas Bouliane

(issue ASTERISK-20550)
Reported by: David Brillert

(issue ASTERISK-21314)
Reported by: Badalian Vyacheslav

(issue ASTERISK-21296)
Reported by: Gabriel Birke
........

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

Merged revisions 383878 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-26 02:30:10 +00:00