Commit Graph

21454 Commits

Author SHA1 Message Date
Richard Mudgett
7361deae1b Check if a channel was created before using the pointer in sig_ss7_new_ast_channel().
Fixes the crash in ASTERISK-17955 gdb-11918.txt backtrace.

* Added some missing libss7 access lock protection.

* Prevent cancelling the ss7_linkset() thread at inoportune times just
like the pri_dchannel() thread.

(issue ASTERISK-17955)
Reported by: Ian M Sherman
Patches:
      jira_asterisk_17955_v1.8.patch (license #5621) patch uploaded by rmudgett
      (attached to related ASTERISK-17966)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 19:10:30 +00:00
Richard Mudgett
b48984e2fb Fix deadlock from not releasing SS7 linkset lock.
sig_ss7_hangup() failed to release the SS7 linkset lock if the call had
the alreadyhungup flag set.

* Made unlock the SS7 linkset lock in sig_ss7_hangup() if the
alreadyhungup flag is set.

* Made ss7_start_call() not hold any locks while creating the channel for
an incoming call to prevent deadlock.

* Made ss7_grab() a void function, since it could never fail, to simplify
calling code.

* Made obtain the channel lock to do softhangup in some places.

Patches:
      jira_ast_668_v1.8.patch (license #5621) patch uploaded by rmudgett

JIRA AST-668


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 18:12:17 +00:00
Russell Bryant
df4d47dff4 Fix crashes in ast_rtcp_write().
This patch addresses crashes related to RTCP handling.  The backtraces just
show a crash in ast_rtcp_write() where it appears that the RTP instance is no
longer valid.  There is a race condition with scheduled RTCP transmissions and
the destruction of the RTP instance.  This patch utilizes the fact that
ast_rtp_instance is a reference counted object and ensures that it will not get
destroyed while a reference is still around due to scheduled RTCP
transmissions.

RTCP transmissions are scheduled and executed from the chan_sip scheduler
context.  This scheduler context is processed in the SIP monitor thread.  The
destruction of an RTP instance occurs when the associated sip_pvt gets
destroyed (which happens when the sip_pvt reference count reaches 0).  However,
the SIP monitor thread is not the only thread that can cause a sip_pvt to get
destroyed.  The sip_hangup function, executed from a channel thread, also
decrements the reference count on a sip_pvt and could cause it to get
destroyed.

While this is being changed anyway, the patch also removes calling
ast_sched_del() from within the RTCP scheduler callback.  It's not helpful.
Simply returning 0 prevents the callback from being rescheduled.

(closes issue ASTERISK-18570)

Related issues that look like they are the same problem:

(issue ASTERISK-17560)
(issue ASTERISK-15406)
(issue ASTERISK-15257)
(issue ASTERISK-13334)
(issue ASTERISK-9977)
(issue ASTERISK-9716)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 00:56:20 +00:00
Terry Wilson
0628cce193 Don't interfere with T.38 reinvites
This is an update to the fix for ASTERISK-18340 and ASTERISK-17725


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 22:07:58 +00:00
Tilghman Lesher
02795f190e Various changes to allow 1.8 to compile on Mac OS X Lion (10.7)
* Makefile workaround for 10.6 extended to work on 10.7 and later.
* Now uses the 'weak' symbol for Lion systems, which no longer support
  'weak_import'

Closes ASTERISK-17612.
Closes ASTERISK-18213.

Tested by: tilghman, oej.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 20:27:03 +00:00
Jonathan Rose
32c717b97c Document applications that play audio and do not answer unanswered calls.
This patch is part of an effort to document early media and its usage. If you are
interested in contributing to this documentation effort, there are probably other
applications worth documenting as well as an Asterisk wiki article at
https://wiki.asterisk.org/wiki/display/AST/Early+Media+and+the+Progress+Application


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 20:07:36 +00:00
Richard Mudgett
07a3a611a9 Made Dial d and H options no longer immediately auto-answer the calling leg.
The Dial d and H options break DTMF attended transfer atxferdropcall
option.

1) Party A calls party B.
2) Party B does a DTMF attended transfer to Party C.

If the dialplan uses the Dial d or H options to call Party C then the Dial
application answers the call immediately before initiating the call leg to
Party C.  The premature answer causes the transfer code to not invoke the
atxferdropcall=no behavior for a blonde transfer since Party C has
"answered".  The transfer code thinks that Party B has "consulted" with
Party C when Party B hangs up and completes the transfer to Party A.
Party A now hears ringback until Party C actually answers.

ASTERISK-13294 Dial d option.
ASTERISK-11067 Dial H option to disconnect before answer.

The referenced issues made Dial answer with the d and H options because
many SIP and ISDN phones cannot send DTMF before the call is connected.

* Made require the dialplan to control when or if the call needs to be
answered to use the Dial application d and H options.  (The call is no
longer surprise answered when using the Dial d or H options.)

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

JIRA AST-623
JIRA AST-666


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 18:46:40 +00:00
Jason Parker
a7b1c2eafb Remove weird mergeinfo props that make merges annoying sometimes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 16:21:03 +00:00
Leif Madsen
83e8f9b91c Update get_ilbc_source.sh script to work again.
Recently iLBC support in Asterisk has changed after the acquisition of GIPS
by Google. More information about how this may affect you is available in a
blog post at:

  http://blogs.asterisk.org/2011/09/19/ilbc-support-in-asterisk-after-googles-acquisition-of-gips/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 15:41:16 +00:00
Richard Mudgett
9eb7ccef76 Rework sig_pri_hangup() to be simpler and clearer.
JIRA AST-675


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 15:25:34 +00:00
Olle Johansson
535817fe71 Add diversion header to a 302 redirect response if we have diversion data
(closes issue ASTERISK-18143)
	patch by oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 13:33:50 +00:00
Gregory Nietsky
aa50191685 A long time ago in a galaxy far far away a IPv6 update was made,
chan_h323 was not updated causeing all to flee to chan_ooh323.

the brave Jedi [asterisk developers] pondered this miscarrige of justice
and restored order to the force for the sake of closing out 2 old issues.

(closes issue ASTERISK-17278)
(closes issue ASTERISK-17500)
Reported by: dread, sybasesql
Tested by: irroot
Reviewed by: IRC (russellb, kpfleming)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 13:27:52 +00:00
Olle Johansson
02a28f4afe Make sure manager_debug option is reset at reload
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 12:06:48 +00:00
Olle Johansson
309e3fe7fa Revert accidental change that fixes OS/X Lion support
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 10:02:07 +00:00
Olle Johansson
7a2e489631 Add missing unlock at MWI message sending time
(closes issue ASTERISK-18573)

Patches:
   sip_mwi_lock.patch (license #5041) by Gregory Hinton Nietsky

Thanks to irrot for the reminder, to Gregory for the patch!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 09:40:44 +00:00
Terry Wilson
928de8c08a Whitespace fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:10:56 +00:00
Terry Wilson
19992c7246 Add missing frame types to func_frame_trace
Also casts control frames to the proper enum so that the compile will catch
new additions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:04:25 +00:00
Jonathan Rose
21714a05b6 Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
break when starting a call with directmedia. This patch queues a new type of control frame
so that our RTP bridge loop can properly detect when these situations occur and check to see
if peers need to be updated in order to send their media to the proper location.

(Closes issue ASTERISK-18340)
Reported by: Thomas Arimont
(Closes issue ASTERISK-17725)
Reported by: kwk
Tested by: twilson, jrose


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 19:53:40 +00:00
Sean Bright
ea573b112f Make a note that inotify won't work with an NFS mounted spooler directory.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 19:06:27 +00:00
Gregory Nietsky
bbc088b9fc The round robin routing routine in chan_misdn.c is broken.
it rotates between ports but never checks the channels in the ports.

i have extensivly tested it and verified it works on 1 upto 4 ports.
before the patch only 1 out of each port was used now all are used as
expected.

(closes issue ASTERISK-18413)
Reported by: irroot
Tested by: irroot
Reviewed by: irroot
    
Review: https://reviewboard.asterisk.org/r/1410/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 10:09:17 +00:00
Gregory Nietsky
f94fa3dba3 Locking order in app_queue.c causes deadlocks.
a channel lock must never be held with the queues container lock held.

the deadlock occured on masquerade.

the queues container lock is a relic of the past the old queue module lock.
with ao2 there is no need to hold this lock when dealing with members this
patch removes unneeded locks.

(closes issue ASTERISK-18101)
(closes issue ASTERISK-18487)
Reported by: Paul Rolfe, Jason Legault
Tested by: irroot, Jason Legault, Paul Rolfe
Reviewed by: Matthew Nicholson

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-15 15:46:21 +00:00
Gregory Nietsky
46e2968917 lock the channel before calling ast_bridged_channel() to prevent a seg fault.
AMI agents list called on shutdown causes a segfault, introducing proper locking
will prevent this.

(closes issue ASTERISK-18092)

Reported by: agustina
Patches: chan_agent.patch (License #5041) patch uploaded by irroot



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-15 08:15:22 +00:00
Richard Mudgett
9910558356 Remove unnecessary libpri dependency checks in the configure script.
Using the --with-pri option with the configure script generated an error
about not having PRI_L2_PERSISTENCE if you did not have the absolute
latest libpri SVN checkout installed.

The AST_EXT_LIB_SETUP_DEPENDENT macro in the configure.ac script seems to
be for libraries that are dependent upon other libraries and not
necessarily for optional/added features within a library.

(closes issue ASTERISK-18535)
Reported by: Michael Keuter


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-14 18:21:35 +00:00
Richard Mudgett
b695a91265 Fixed cut-n-paste regression using the wrong variable.
Fixes the missing DAHDI channels when using the newer chan_dahdi.conf
sections for channel configuration.

(closes issue ASTERISK-18496)
Reported by: Sean Darcy
Patches:
      jira_asterisk_18496_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Sean Darcy, rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-14 15:53:25 +00:00
Matthew Nicholson
454969d783 The tech and data members of fast_originate_helper are not string fields.
ASTERISK-17709


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-14 13:28:16 +00:00
Richard Mudgett
5c5122d104 Remove obsolete todo comment about PICKUPRESULT.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 22:10:15 +00:00
Tzafrir Cohen
42840a2ef9 do parse defaultlanguage from asterisk.conf
Do parse the option "defaultlanguage" from the [options] section of
asterisk.conf, as in the sample config file. Otherwise the build-time
default language (normally "en") is always the default one.

Review: https://reviewboard.asterisk.org/r/1342/
Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen@xorcom.com>

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 21:33:20 +00:00
Paul Belanger
28952b7ea5 Meetme should have 'core' support level
(closes issue ASTERISK-18542)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 21:30:18 +00:00
Tilghman Lesher
28a4975127 Move mandatory checks closer to the beginning of the file.
If these are going to fail, they should fail as quickly as possible.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 18:52:38 +00:00
Matthew Nicholson
ebb6110a13 Don't limit the size of appdata for manager originate actions.
ASTERISK-17709
Patch by: tilghman (with modifications)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 18:20:52 +00:00
Russell Bryant
5f1882731a Fix a crash in res_ais.
This patch resolves a crash observed in a load testing environment that
involved the use of the res_ais module.  I observed some crashes where
the event delivery callback would get called, but the length parameter
incidcating how much data there was to read was 0.  The code assumed
(with good reason I would think) that if this callback got called, there
was an event available to read.  However, if the rare case that there's
nothing there, catch it and return instead of blowing up.

More specifically, the change always ensure that the size of the received
event in the cluster is always big enough to be a real ast_event.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 07:11:36 +00:00
Matthew Nicholson
1aeb6f1242 Properly set caller_warning and callee_warning before we try to use them.
ASTERISK-18199
Patch by: elguero
Testing by: rtang


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 15:54:41 +00:00
Matthew Nicholson
828a733f58 Prevent a race condition when the bridge technology changes. This change was
ported from asterisk 10.

ASTERISK-18155


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 15:49:24 +00:00
Kinsey Moore
263a410438 Ensure frames are not written to dialed channel if ringback is requested
When a single channel was dialed and there was media to be forwarded to the
calling channel, the media was written without regard for ringback causing
silence to be heard in some circumstances.  This regression was introduced
when the meaning of "single" changed to mean only the number of channels
dialed.

(closes issue ASTERISK-18083)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 14:21:17 +00:00
Kinsey Moore
b1b865d7b2 Prevent IAX2 from getting IPv6 addresses via DNS
IAX2 does not support IPv6 and getting such addresses from DNS can cause error
messages on the remote end involving bad IPv4 address casts in the presence of
IPv6/IPv4 tunnels.  This patch ensures that IAX2 will not encounter IPv6
addresses via DNS queries.

(closes issue ASTERISK-18090)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 13:25:42 +00:00
Olle Johansson
c0ab1f3281 Lock the peer->mvipvt to avoid crashes with SIP history enabled
After the launch of 1.6 event-based MWI we have two threads handling the peer->mwipvt,
which cause issues with SIP history additions in combination with the max limit for
number of history entries.

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

(closes issue ASTERISK-18288)

Thanks to irrot for peer review. Work with this bug funded by IPvision AS


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 13:25:30 +00:00
Stefan Schmidt
22b30eb82c build_peer doesnt unlink a peer object from peers_by_ip container which leads to a wrong refcounter value.
adding an ao2_unlink from the peers_by_ip container fix it.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 11:09:19 +00:00
Matthew Jordan
7dc49195d8 Updated SIP 484 handling; added Incomplete control frame
When a SIP phone uses the dial application and receives a 484 Address 
Incomplete response, if overlapped dialing is enabled for SIP, then
the 484 Address Incomplete is forwarded back to the SIP phone and the
HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
application dialplan logic was automatically triggered; now, explicit
dialplan usage of the application is required.

Additionally, this patch adds a new AST_CONTOL_FRAME type called
AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
it is an indication that the dialplan expects more digits back from the
device.  If the device supports overlap dialing it should attempt to 
notify the device that the dialplan is waiting for more digits; otherwise,
it can handle the frame in a manner appropriate to the channel driver.

(closes issue ASTERISK-17288)
Reported by: Mikael Carlsson
Tested by: Matthew Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:09:09 +00:00
Richard Mudgett
2fb25c3aea Fix crash with res_fax when MALLOC_DEBUG and "core stop gracefully" are used.
Asterisk crashes if MALLOC_DEBUG is enabled when res_fax tries to
unregister its logger level.

* Make ast_logger_unregister_level() use ast_free() instead of free().
When MALLOC_DEBUG is enabled, ast_free() does not degenerate into a call
to free().  Therefore, if you allocated memory with a form of ast_malloc
you must free it with ast_free.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-08 22:27:40 +00:00
Paul Belanger
f105f3e579 Cleanup chan_iax2.c log messages
Review: https://code.asterisk.org/code/cru/CR-AST-11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 19:35:52 +00:00
Richard Mudgett
c6e7f17a68 Fix AMI action Park crash.
* Made AMI action Park not say anything to the parker channel (AMI header
Channel2) since the AMI action is a third party parking the call.  (This
is a change in behavior that cannot be preserved without a lot of effort.)

* Made not play pbx-parkingfailed if the Park 's' option is used.

JIRA AST-660


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 19:31:44 +00:00
Stefan Schmidt
687e413fd8 Adding the Feature to sent a Reason Header in a SIP Cancel message by set the flag AST_FLAG_ANSWERED_ELSEWHERE before doing a masquerade in the pickup function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 13:26:50 +00:00
Alec L Davis
74f9e66b41 peroid typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 08:12:49 +00:00
Alec L Davis
71f3dc01da Prevent segfault if call arrives before Asterisk is fully booted.
Prevent ast_pbx_start and ast_run_start from starting a new thread unless asterisk
is fully booted.
 
alecdavis (license 585)
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1407/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 07:33:39 +00:00
Gregory Nietsky
4b1398a82d Make SQL query in app_voicemail.c portable LIMIT is not portable.
Regression from r312212

(closes issue ASTERISK-18255)
Reported by: Leif Madsen
Tested by: Leif Madsen

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




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-06 13:48:03 +00:00
Richard Mudgett
34919315ab MusicOnHold has extra unref which may lead to memory corruption and crash.
The problem happens when a call is disconnected and you had started a MOH 
class that does not use the files mode.  If you define REF_DEBUG and 
recreate the problem, it will announce itself with the following warning: 
Attempt to unref mohclass 0xb70722e0 (default) when only 1 ref remained, 
and class is still in a container!  

* Fixed moh_alloc() and moh_release() functions not handling the
state->class reference consistently.

(closes issue ASTERISK-18346)
Reported by: Mark Murawski
Patches:
      jira_asterisk_18346_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett, Mark Murawski

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-02 20:59:49 +00:00
Richard Mudgett
6d49117675 Fix potential memory allocation failure crashes in config.c.
* Added required checks to the returned memory allocation pointers to
prevent crashes.

* Made ast_include_rename() create a replacement ast_variable list node if
the new filename is longer than the available space.  Fixes potential
crash and memory leak.

* Factored out ast_variable_move() from ast_variable_update() so
ast_include_rename() can also use it when creating a replacement
ast_variable list node.

* Made the filename stuffed at the end of the struct a minimum allocated
size in ast_variable_new() in case ast_include_rename() changes the stored
filename.

* Constify struct char pointers pointing to strings stuffed at the end of
the struct for: ast_variable, cache_file_mtime, and ast_config_map.

* Factored out cfmtime_new() to remove inlined code and allow some struct
pointers to become const.

* Removed the list lock from struct cache_file_mtime that was never used.

* Added doxygen comments to several structure elements and better
documented what strings are stuffed at the struct end char array.

* Reworked ast_config_text_file_save() and set_fn() to handle allocation
failure of the include file scratch pad object tracking blank lines.

* Made ast_config_text_file_save() fn[] declared with PATH_MAX to ensure
it is long enough for any filename with path.  Also reduced the number of
container fileset buckets from a rediculus 180,000 to 1023.

JIRA AST-618

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-02 17:10:58 +00:00
Tilghman Lesher
b178214e07 Remove 1.6 compatibility documentation from 1.8, as it no longer applies.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-01 17:38:33 +00:00
Tilghman Lesher
7db9485aa8 Create a local alias for ast_odbc_clear_cache.
As a function pointer, the reference has to be resolved at load time
irrespective of the RTLD_LAZY flag.  Creating a local alias solves
this problem, because the structure is initialized with that local
function pointer, while the actual function can remain lazily linked
until runtime.

The reason why this is important is because we lazily load function
references during the module loading process, in order to obtain
priority values for each module, ensuring that modules are loaded in
the correct order.  Previous to this change, when this module was
initially loaded, the module loader would emit a symbol resolution
error, because of the above requirement.

Closes ASTERISK-18399 (reported by Mikael Carlsson, fix suggested by
Walter Doekes, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-01 17:28:09 +00:00
Matthew Nicholson
dac29dd12a Disable T.38 when we get a invite with image media port set to 0
ASTERISK-17678


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-31 18:50:33 +00:00