]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
12 years agoRemove leading spaces from the CLI command before parsing
Kinsey Moore [Thu, 15 Aug 2013 16:21:20 +0000 (16:21 +0000)] 
Remove leading spaces from the CLI command before parsing

If you've mistakenly put a space before typing in a command, the
leading space will be included as part of the command, and the command
parser will not find the corresponding command. This patch rectifies
that situation by stripping the leading spaces on commands.

Review: https://reviewboard.asterisk.org/r/2709/
Patch-by: Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396745 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoTweak comment for why usleep is used.
Joshua Colp [Wed, 14 Aug 2013 19:05:41 +0000 (19:05 +0000)] 
Tweak comment for why usleep is used.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396656 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoTweak test_hashtab_thrash test to allow the critical threads to execute.
Joshua Colp [Wed, 14 Aug 2013 18:07:37 +0000 (18:07 +0000)] 
Tweak test_hashtab_thrash test to allow the critical threads to execute.

Depending on certain conditions it was possible for the hashtab counting thread
to starve other threads, preventing them from executing in the expected fashion.
This change adds a sleep to allow the others to do what they need to do. While
this doesn't thrash the hashtab as much as previously, it at least works.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396619 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_sip: Convert 'just did sched_add waitid...' from warning to debug message.
Walter Doekes [Tue, 13 Aug 2013 18:44:21 +0000 (18:44 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396582 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_sip: Fix IP-addr in warning when rejecting a contact ACL.
Walter Doekes [Tue, 13 Aug 2013 18:32:32 +0000 (18:32 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396579 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoConsistent memory allocation by ast_bt_get_symbols.
Walter Doekes [Thu, 8 Aug 2013 20:14:27 +0000 (20:14 +0000)] 
Consistent memory allocation by ast_bt_get_symbols.

Always use ast_alloc/ast_free. This is handled differently in trunk (r391012).

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396427 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCheck result of ast_var_assign() calls for memory allocation failure.
Walter Doekes [Tue, 6 Aug 2013 08:14:59 +0000 (08:14 +0000)] 
Check result of ast_var_assign() calls for memory allocation failure.

We try to keep the system running even when all available memory is
spent.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396279 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix Registration Failure When A Peer And TLS Are Used
Michael L. Young [Mon, 5 Aug 2013 20:17:44 +0000 (20:17 +0000)] 
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396240 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoRestore Extra Line Break Between Peers When Running AMI Action SIPPeers
Michael L. Young [Mon, 5 Aug 2013 19:45:49 +0000 (19:45 +0000)] 
Restore Extra Line Break Between Peers When Running AMI Action SIPPeers

The commit (r387133) for fixing ASTERISK-21466 accidentally removed an extra
line break between the peers returned by the AMI action SIPPeers.  This
results in some parsers breaking because they expect this extra line break.

This patch restores that extra line break.

(closes issue ASTERISK-22239)
Reported by: Jacek Konieczny
Tested by: Jacek Konieczny, Michael L. Young
Patches:
    asterisk-ami_sippeers_separator.patch by Jacek Konieczny (license 6298)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396236 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdding a note to UPGRADE.txt about a change made to res_agi in order to
Michael L. Young [Mon, 5 Aug 2013 18:40:13 +0000 (18:40 +0000)] 
Adding a note to UPGRADE.txt about a change made to res_agi in order to
indicate when streaming an audio file fails like it is done in other parts
of the code to indicate an error.

Note was requested by Paul Belanger:
http://lists.digium.com/pipermail/asterisk-dev/2013-July/061420.html

(related to issue ASTERISK-21903)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396196 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate copyright year to 2013 in asterisk.c; some whitespace fixes
Matthew Jordan [Mon, 22 Jul 2013 13:49:00 +0000 (13:49 +0000)] 
Update copyright year to 2013 in asterisk.c; some whitespace fixes

(closes issue ASTERISK-22179)
Reported by: Malcolm Davenport

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@395032 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClean up documentation
Matthew Jordan [Sun, 21 Jul 2013 22:02:41 +0000 (22:02 +0000)] 
Clean up documentation

This patch cleans up documentation in func_channel for the following items:
* rtpsource
* secure_signaling
* secure_media

(closes issue ASTERISK-20969)
Reported by: snuffy
patches:
  func_chan-update.diff uploaded by snuffy (License 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394980 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoProvide proper ring tone in indications.conf for Malaysia
Matthew Jordan [Sun, 21 Jul 2013 18:15:57 +0000 (18:15 +0000)] 
Provide proper ring tone in indications.conf for Malaysia

The ring tone provided in the sample indications.conf was incorrect. This patch
modifies the sample ring tone to be what it should:
  ring = 425/400,0/200,425/400,0/2000

This brings it in line with the tone definition in DAHDI 2.7.0. (zonedata.c)

(closes issue ASTERISK-21997)
Reported by: Filip Jenicek
patches:
  malaysia_ring.patch uploaded by phill (License 6277)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394940 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoTolerate presence of RFC2965 Cookie2 header by ignoring it
Matthew Jordan [Sun, 21 Jul 2013 03:09:16 +0000 (03:09 +0000)] 
Tolerate presence of RFC2965 Cookie2 header by ignoring it

This patch modifies parsing of cookies in Asterisk's http server by doing an
explicit comparison of the "Cookie" header instead of looking at the first
6 characters to determine if the header is a cookie header. This avoids
parsing "Cookie2" headers and overwriting the previously parsed "Cookie"
header.

Note that we probably should be appending the cookies in each "Cookie"
header to the parsed results; however, while clients can send multiple
cookie headers they never really do. While this patch doesn't improve
Asterisk's behavior in that regard, it shouldn't make it any worse either.

Note that the solution in this patch was pointed out on the issue by the
issue reporter, Stuart Henderson.

(closes issue ASTERISK-21789)
Reported by: Stuart Henderson
Tested by: mjordan, Stuart Henderson

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394899 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate PostgreSQL realtime scripts with schema for queue_log table
Matthew Jordan [Sun, 21 Jul 2013 02:38:09 +0000 (02:38 +0000)] 
Update PostgreSQL realtime scripts with schema for queue_log table

This patch updates the realtime SQL scripts with an entry that will create the
queue_log table. This brings the PostgreSQL scripts inline with the MySQL
scripts, with respect to what tables they will create.

(closes issue ASTERISK-21021)
Reported by: Eugene
patches:
  queue_log.sql uploaded by varnav (license 6360)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394896 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDocument connectedline parameter for chan_iax2
Matthew Jordan [Sun, 21 Jul 2013 02:19:21 +0000 (02:19 +0000)] 
Document connectedline parameter for chan_iax2

The connectedline parameter for a chan_iax2 peer was undocumented. This patch
documents the options in the sample configuration file.

(closes issue ASTERISK-21953)
Reported by: Birger "WIMPy" Harzenetter

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394886 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoProperly indicate failure to open an audio stream in res_agi
Michael L. Young [Thu, 18 Jul 2013 12:51:22 +0000 (12:51 +0000)] 
Properly indicate failure to open an audio stream in res_agi

If there is an error streaming an audio file, the current return status makes it
difficult for an AGI script to determine that there was an error with the audio
file.

This patches changes the result to return -1 and the function returns
RESULT_FAILURE instead of RESULT_SUCCESS.  From looking at other parts of
res_agi, this would appear to be the proper way to handle an error.

(closes issue ASTERISK-21903)
Reported by: Ariel Wainer
Tested by: Ariel Wainer
Patches:
asterisk-21903-return-stream-res_1.8.diff
by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClarify documentation for function PASSTHRU
Matthew Jordan [Sun, 14 Jul 2013 01:53:15 +0000 (01:53 +0000)] 
Clarify documentation for function PASSTHRU

It is not apparent to the average user that the PASSTHRU function should not
be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions
which take a variable name and not its contents.

This patch clarifies the behavior in the documentation and provides an example.

(closes issue ASTERISK-21717)
Reported by: Richard Miller
patches:
  func_strings.diff uploaded by Richard Miller (license 5685)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394302 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix a longstanding issue with MFC-R2 configuration that prevented users
Moises Silva [Thu, 11 Jul 2013 16:25:39 +0000 (16:25 +0000)] 
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394106 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoastobj2-ify the SLA code
Russell Bryant [Wed, 10 Jul 2013 01:41:42 +0000 (01:41 +0000)] 
astobj2-ify the SLA code

The SLA code within app_meetme was written before asotbj2 had been
merged into Asterisk.  Worse, support for reloads did not exist at first
and was added later as a bolt-on feature.  I knew at the time that
reloading was not safe at all while SLA was in use, so the reload would
be queued up to execute when the system was idle.  Unfortunately, this
approach was still prone to errors beyond the fact that this was the
only place in Asterisk where configuration was not reloaded
instantly when requested.

This patch converts various SLA objects to be reference counted objects
using astobj2.  This allows reloads to be processed while the system is
in use.  The code ensures that the objects will not disappear while one
of the other threads is using them.  However, they will be immediately
removed from the global trunk and station containers so no new calls
will use them if removed from configuration.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@393928 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_dahdi: Fix segfault reloading chan_dahdi when round robin is used.
Richard Mudgett [Wed, 3 Jul 2013 23:27:52 +0000 (23:27 +0000)] 
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@393627 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoapp_mixmonitor: Fix crashes caused by unloading app_mixmonitor
Jonathan Rose [Fri, 14 Jun 2013 16:14:48 +0000 (16:14 +0000)] 
app_mixmonitor: Fix crashes caused by unloading app_mixmonitor

Unloading app_mixmonitor while active mixmonitors were running would
cause a segfault. This patch fixes that by making it impossible to
unload app_mixmonitor while mixmonitors are active.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391778 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix memory leak while loading priority modules
Matthew Jordan [Wed, 12 Jun 2013 02:19:52 +0000 (02:19 +0000)] 
Fix memory leak while loading priority modules

When we load a module with the LOAD_PRIORITY flag, we remove its entry from
the load order list. Unfortunately, we don't free the memory associated with
entry in the list. This patch corrects that and properly frees the memory for
the module in the list.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391489 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoIAX2: Transfer Reject: Lock bridgecallno before touching it, refactor
Alec L Davis [Tue, 11 Jun 2013 08:03:38 +0000 (08:03 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391333 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd announce-to-first-user option for app_queue
Matthew Jordan [Mon, 10 Jun 2013 14:15:19 +0000 (14:15 +0000)] 
Add announce-to-first-user option for app_queue

In r386792, the ability to play prompts to the first caller in a call queue was
added. While this is arguably a bug fix for those who expect the first caller
to continue receiving prompts while the agent is dialed, it has the side effect
of preventing the first caller from hearing the agent immediately upon
bridging. This may not be a problem for those who really want this option, but
for those who didn't care whether or not the first caller in queue heard their
position, it was an issue.

This patch disables the ability for the first caller in the queue to hear
prompts and adds a new option, announce-to-first-user, to queues.conf. Those
who the behavior can enable it by setting this value to True.

Note that if we ever implement the ability to have the prompts be stopped
upon bridging, this option can be removed.

(closes issue ASTERISK-21782)
Reported by: Remi Quezada

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391215 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_iax2: nativebridge refactor, missed unlock bridgecallno
Alec L Davis [Mon, 10 Jun 2013 09:30:11 +0000 (09:30 +0000)] 
chan_iax2: nativebridge refactor, missed unlock bridgecallno

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391143 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agofix bad edit after conflict resolution
Alec L Davis [Mon, 10 Jun 2013 08:32:34 +0000 (08:32 +0000)] 
fix bad edit after conflict resolution

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391107 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoIAX2: refactor nativebridge transfer
Alec L Davis [Mon, 10 Jun 2013 07:56:49 +0000 (07:56 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391065 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoIAX2: fix race condition with nativebridge transfers.
Alec L Davis [Mon, 10 Jun 2013 07:30:35 +0000 (07:30 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391062 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoreject call attempts when gatekeeper is configured but not registered
Alexandr Anikin [Fri, 31 May 2013 08:10:30 +0000 (08:10 +0000)] 
reject call attempts when gatekeeper is configured but not registered

(closes issue ASTERISK-21800)
Reported by: Dmitry Melekhov
Patches:
        ASTERISK-21800-1.patch
Tested by: Dmitry Melekhov

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@390181 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix segfault when dealing with chan_agent channels.
Richard Mudgett [Wed, 29 May 2013 20:10:04 +0000 (20:10 +0000)] 
Fix segfault when dealing with chan_agent channels.

Check the returned bridged pointer for NULL to avoid a crash.  It looks
like chan_agent is returning a NULL pointer when it probably should be
returning a pointer to the channel the Agent channel is pretending to be.

(closes issue ASTERISK-21793)
Reported by: Rodrigo P. Telles
Patches:
      jira_asterisk_21793_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Rodrigo P. Telles

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@390044 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix a memory copying bug in slinfactory which was causing mixmonitor issues.
Jonathan Rose [Tue, 28 May 2013 17:35:12 +0000 (17:35 +0000)] 
Fix a memory copying bug in slinfactory which was causing mixmonitor issues.

Reported by: Michael Walton
Tested by: Jonathan Rose
Patches:
    slinfactory.c.ASTERISK-21799.patch uploaded by Michael Walton (license 6502)
(closes issue ASTERISK-21799)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389895 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoPrint all logger messages on shutdown
Matthew Jordan [Fri, 24 May 2013 11:42:38 +0000 (11:42 +0000)] 
Print all logger messages on shutdown

When Asterisk shuts down and shuts down the loggin gsubsystem, any
messages currently in flight will not get logged. This patch prevents the
loop writing messages from breaking out prematurely, such that all of the
messages are logged.

(closes issue ASTERISK-21716)
Reported by: Corey Farrell
patches:
  logger-process-all-messages.patch uploaded by Corey Farrell (license 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389676 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd doxygen.log to svn:ignore property.
Jason Parker [Mon, 20 May 2013 17:43:07 +0000 (17:43 +0000)] 
Add doxygen.log to svn:ignore property.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389244 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
Kevin Harwell [Wed, 15 May 2013 15:54:50 +0000 (15:54 +0000)] 
Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS

If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying
to access a possible NULL t->track object.  A NULL check has been added before
trying to access the memory.

(closes issue ASTERISK-21724)
Reported by: Corey Farrell
Fixed by: Corey Farrell
Patches:
ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUse srtp_shutdown when available
Kinsey Moore [Wed, 15 May 2013 12:37:29 +0000 (12:37 +0000)] 
Use srtp_shutdown when available

This allows the SRTP library to be shut down properly when the
functionality is offered by libsrtp.

Review: https://reviewboard.asterisk.org/r/2538/
(closes issue ASTERISK-21719)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388768 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoRevert r388529 for now
Kinsey Moore [Mon, 13 May 2013 20:34:36 +0000 (20:34 +0000)] 
Revert r388529 for now

Adding the cleanup function needs some deeper thought since it
apparently doesn't exist for all variants of libsrtp.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agopbx: Fix lack of cleanup on macrolock and context_table
Jonathan Rose [Mon, 13 May 2013 18:16:21 +0000 (18:16 +0000)] 
pbx: Fix lack of cleanup on macrolock and context_table

(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388532 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClose libsrtp properly
Kinsey Moore [Mon, 13 May 2013 18:05:11 +0000 (18:05 +0000)] 
Close libsrtp properly

Ensure that libsrtp is shutdown properly when res_srtp is unloaded.

(closes issue ASTERISK-21719)
Reported by: Corey Farrell
Patches:
    res_srtp-library-shutdown.patch uploaded by Corey Farrell

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388529 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix SendText AMI action to never return non-zero.
Richard Mudgett [Mon, 13 May 2013 14:24:47 +0000 (14:24 +0000)] 
Fix SendText AMI action to never return non-zero.

AMI actions must never return non-zero unless they intend to close the AMI
connection.  (Which is almost never.)

(closes issue ASTERISK-21779)
Reported by: Paul Goldbaum

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388477 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAllow mISDN to send PROGRESS messsage.
Richard Mudgett [Fri, 10 May 2013 22:09:32 +0000 (22:09 +0000)] 
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388425 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd version.c to list of ignored files in the utils directory.
Richard Mudgett [Fri, 10 May 2013 21:40:59 +0000 (21:40 +0000)] 
Add version.c to list of ignored files in the utils directory.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388423 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix memory leak in pbx_dundi
Mark Michelson [Fri, 10 May 2013 20:28:29 +0000 (20:28 +0000)] 
Fix memory leak in pbx_dundi

pbx_dundi added an io context without removing
it. This caused a memory leak when the module was
unloaded.

(closes ASTERISK-21718)
Reported by Corey Farrell
Patches:
pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388376 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix The Payload Being Set On CN Packets And Do Not Set Marker Bit
Michael L. Young [Thu, 9 May 2013 03:58:42 +0000 (03:58 +0000)] 
Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit

When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388111 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries...
Alec L Davis [Wed, 8 May 2013 07:17:17 +0000 (07:17 +0000)] 
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: Dan Martens, David Brillert, alecdavis
alecdavis (license 585)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387875 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMake SLA reload more paranoid.
Russell Bryant [Mon, 6 May 2013 15:52:16 +0000 (15:52 +0000)] 
Make SLA reload more paranoid.

Reload support was originally not included for SLA.  It was added later,
but in a fairly non-traditional way.  It basically sets a flag
indicating that a reload is pending, and then waits for a time where it
thinks everything SLA related is idle and unused, and *then* executes
the reload.  It does this because the reload process is destructive.  It
starts by throwing everything away and starting over.

There are a number of problems with this approach.  One of them is that
the check to see if anything in use was incomplete.  This patch makes it
more complete and thus less likely for a crash to occur during reload
processing.  However, this approach still has problems so some much more
significant reworking of this code will need to come in as a next step.

Patch credit and testing by CoreDial, LLC.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387688 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate utils Makefile to handle r387294
Matthew Jordan [Thu, 2 May 2013 17:11:20 +0000 (17:11 +0000)] 
Update utils Makefile to handle r387294

Alec's patch that added the Asterisk version to 'core show locks' angered the
items in utils, as they exist somewhat outside of the Asterisk build system.
Some day, this Makefile should get nuked from high orbit, but for now, include
version.c in its list of stuff to pile in.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval...
Alec L Davis [Thu, 2 May 2013 07:53:55 +0000 (07:53 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387344 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk...
Alec L Davis [Thu, 2 May 2013 07:20:54 +0000 (07:20 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387312 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_dahdi: fix lower bound check with -ve integer conversion from a float
Alec L Davis [Thu, 2 May 2013 06:51:53 +0000 (06:51 +0000)] 
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd Asterisk Version to core show locks
Alec L Davis [Thu, 2 May 2013 06:43:24 +0000 (06:43 +0000)] 
Add Asterisk Version to core show locks

Assist with reporting 'core show locks' when submitting bug reports.

Example below:

===========================
== SVN-branch-1.8-...
== Currently Held Locks
===========================

(closes issue ASTERISK-21743)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387294 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClear the DTMF sending digit tracking on off nominal paths
Matthew Jordan [Wed, 1 May 2013 21:15:46 +0000 (21:15 +0000)] 
Clear the DTMF sending digit tracking on off nominal paths

In certain situations, when the RTP engine goes to send a DTMF end digit
it may be in a situation where the remote address is no longer available,
or the digit that was supposed to be sent is invalid. In such cases, we
need to clear the RTP counters appropriately. Otherwise, when the RTP
source is set again, we'll continue to think that we're in the middle of
sending a DTMF digit, which can confuse the remote party (signficantly).

(closes issue ASTERISK-21522)
Reported by: Corey Farrell
patches:
  rtp_dtmf_process_end.patch uploaded by Corey Farrell (License 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387213 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoPrevent crash in 'sip show peers' when the number of peers on a system is large
Matthew Jordan [Wed, 1 May 2013 18:34:44 +0000 (18:34 +0000)] 
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387133 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix CDR not being created during an externally initiated blind transfer
Matthew Jordan [Tue, 30 Apr 2013 22:34:05 +0000 (22:34 +0000)] 
Fix CDR not being created during an externally initiated blind transfer

Way back when in the dark days of Asterisk 1.8.9, blind transferring a call
in a context that included the 'h' extension would inadvertently execute the
hangup code logic on the transferred channel. This was a "bad thing". The fix
was to properly check for the softhangup flags on the channel and only execute
the 'h' extension logic (and, in later versions, hangup handler logic) if the
channel was well and truly dead (Jim).

Unfortunately, CDRs are fickle. Setting the softhangup flag when we detected
that the channel was leaving the bridge (but not to die) caused some crucial
snippet of CDR code, lying in ambush in the middle of the bridging code, to
not get executed. This had the effect of blowing away one of the CDRs that is
typically created during a blind transfer.

While we live and die by the adage "don't touch CDRs in release branches", this
was our bad. The attached patch restores the CDR behavior, and still manages to
not run the 'h' extension during a blind transfer (at least not when it's
supposed to).

Thanks to Steve Davies for diagnosing this and providing a fix.

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

(closes issue ASTERISK-21394)
Reported by: Ishfaq Malik
Tested by: Ishfaq Malik, mjordan
patches:
  fix_missing_blindXfer_cdr2 uploaded by one47 (License 5012)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387036 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUse the proper lower bound when doing saturation arithmetic.
Sean Bright [Tue, 30 Apr 2013 13:45:40 +0000 (13:45 +0000)] 
Use the proper lower bound when doing saturation arithmetic.

16 bit signed integers have a range of [-32768, 32768).  The existing code
was using the interval (-32768, 32768) instead.  This patch fixes that.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386929 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoModifying sounds/Makefile to pull down 1.4.24 core sounds
Rusty Newton [Mon, 29 Apr 2013 23:34:11 +0000 (23:34 +0000)] 
Modifying sounds/Makefile to pull down 1.4.24 core sounds

1.4.24 core sounds includes a full set of Italian prompts for core sounds and a fix for the missing voicemail prompts in the Russian language.

(closes issue ASTERISK-19431)
(closes issue ASTERISK-19721)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386877 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoPlay periodic prompst for first call in a call queue
Olle Johansson [Mon, 29 Apr 2013 08:36:15 +0000 (08:36 +0000)] 
Play periodic prompst for first call in a call queue

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386792 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClean up memory leak in config file on off nominal paths when glob is allowed
Matthew Jordan [Fri, 26 Apr 2013 21:26:39 +0000 (21:26 +0000)] 
Clean up memory leak in config file on off nominal paths when glob is allowed

If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.

This patch properly calls globfree in those off nominal paths.

(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
  config_glob_leak.patch uploaded by Corey Farrell (license 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386672 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoClean up resources in features on exit
Matthew Jordan [Fri, 26 Apr 2013 21:11:33 +0000 (21:11 +0000)] 
Clean up resources in features on exit

This patch cleans up two things features:
* It properly unregisters the CLI commands that features registered
* It cancels and performs a pthread_join on the created parking thread. This
  not only properly joins a non-detached thread, but also prevents disposing
  of the parking lots prior to the parking thread completely exiting.

(closes issue ASTERISK-21407)
Reported by: Corey Farrell
patches:
  features_shutdown-r2.patch uploaded by Corey Farrell (License 5909)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386641 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoChange Case On Forcerport For Consistency
Michael L. Young [Thu, 25 Apr 2013 02:43:03 +0000 (02:43 +0000)] 
Change Case On Forcerport For Consistency

* Change "ForcerPort" to "Forcerport" to match everywhere else it is displayed

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386483 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix crash when AMI redirect action redirects two channels out of a bridge.
Richard Mudgett [Mon, 22 Apr 2013 16:10:29 +0000 (16:10 +0000)] 
Fix crash when AMI redirect action redirects two channels out of a bridge.

The two party bridging loops were changing the bridge peer pointers
without the channel locks held.  Thus when ast_channel_massquerade()
tested and used the pointer there is a small window of opportunity for the
pointers to become NULL even though the masquerade code has the channels
locked.

(closes issue ASTERISK-21356)
Reported by: William luke
Patches:
      jira_asterisk_21356_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: William luke

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386256 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoPrevent res_timing_pthread from blocking callers
Matthew Jordan [Fri, 19 Apr 2013 15:59:25 +0000 (15:59 +0000)] 
Prevent res_timing_pthread from blocking callers

There were several reports of deadlock when using
res_timing_pthread. Backtraces indicated that one thread was blocked
waiting for the write to the pipe to complete and this thread held
the container lock for the timers.  Therefore any thread that wanted
to create a new timer or read an existing timer would block waiting
for either the timer lock or the container lock and deadlock ensued.

This patch changes the way the pipe is used to eliminate this source
of deadlocks:

1) The pipe is placed in non-blocking mode so that it would never
block even if the following changes someone fail...

2) Instead of writing bytes into the pipe for each "tick" that's
fired the pipe now has two states--signaled and unsignaled. If
signaled, the pipe is hot and any pollers of the read side
filedescriptor will be woken up. If unsigned the pipe is idle. This
eliminates even the chance of filling up the pipe and reduces the
potential overhead of calling unnecessary writes.

3) Since we're tracking the signaled / unsignaled state, we can
eliminate the exta poll system call for every firing because we know
that there is data to be read.

(closes issue ASTERISK-21389)
Reported by: Matt Jordan
Tested by: Shaun Ruffell, Matt Jordan, Tony Lewis
patches:
  0001-res_timing_pthread-Reduce-probability-of-deadlocking.patch uploaded by sruffell (License 5417)

(closes issue ASTERISK-19754)
Reported by: Nikola Ciprich

(closes issue ASTERISK-20577)
Reported by: Kien Kennedy

(closes issue ASTERISK-17436)
Reported by: Henry Fernandes

(closes issue ASTERISK-17467)
Reported by: isrl

(closes issue ASTERISK-17458)
Reported by: isrl

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386109 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agocli.c: Properly initialize debug_modules and verbose_modules.
David M. Lee [Fri, 19 Apr 2013 05:18:13 +0000 (05:18 +0000)] 
cli.c: Properly initialize debug_modules and verbose_modules.

This avoids some lock errors on the core set {debug,verbose} commands.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@386049 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDistributed Device State broken at sites using res_xmpp or res_jabber where Secuity...
Alec L Davis [Tue, 16 Apr 2013 23:11:46 +0000 (23:11 +0000)] 
Distributed Device State broken at sites using res_xmpp or res_jabber where Secuity Advisory AST-2012-015 is inplace

res_jabber/res_xmpp were not adding AST_EVENT_IE_CACHABLE to the event as each message came in,
then devstate_change_collector_cb() was unable to find AST_EVENT_IE_CACHABLE in the event,
so defaulted incorrectly to AST_DEVSTATE_NOT_CACHABLE.

(issue ASTERISK-20175)
(closes issue ASTERISK-21429)
(closes issue ASTERISK-21069)
(closes issue ASTERISK-21164)

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385916 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDon't unnecessarily rebuild things on every run of 'make'.
Jason Parker [Mon, 15 Apr 2013 17:07:45 +0000 (17:07 +0000)] 
Don't unnecessarily rebuild things on every run of 'make'.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385745 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix the svn:keywords property on several files.
David M. Lee [Mon, 15 Apr 2013 14:38:24 +0000 (14:38 +0000)] 
Fix the svn:keywords property on several files.

Normally I think keyword expansion is silly, but the one time it would have
been good, it didn't work because the property had quotes in it. This patch
fixes obviously busted svn:keywords properties.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385683 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCalculate the timestamp for outbound RTP if we don't have timing information
Matthew Jordan [Sun, 14 Apr 2013 02:58:57 +0000 (02:58 +0000)] 
Calculate the timestamp for outbound RTP if we don't have timing information

This patch calculates the timestamp for outbound RTP when we don't have timing
information. This uses the same approach in res_rtp_asterisk. Thanks to both
Pietro and Tzafrir for providing patches.

(closes issue ASTERISK-19883)
Reported by: Giacomo Trovato
Tested by: Pietro Bertera, Tzafrir Cohen
patches:
  rtp-timestamp-1.8.patch uploaded by tzafrir (License 5035)
  rtp-timestamp.patch uploaded by pbertera (License 5943)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385636 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDon't attempt to create a voice frame on a read error
Matthew Jordan [Sun, 14 Apr 2013 02:21:30 +0000 (02:21 +0000)] 
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385633 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix Manager Segfault When app_queue Is Unloaded
Michael L. Young [Fri, 12 Apr 2013 22:34:46 +0000 (22:34 +0000)] 
Fix Manager Segfault When app_queue Is Unloaded

When app_queue is unloaded, some manager commands are not being unregistered
which result in a segfault.  This patch corrects this.

(closes issue ASTERISK-21397)
Reported by: Peter Katzmann, Corey Farrell
Tested by: Corey Farrell
Patches:
    asterisk-21397-missing-unreg-manager-cmd_1.8.diff
                                                 Michael L. Young (license 5026)
    asterisk-21397-missing-unreg-manager-cmd_11.diff
                                                 Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385593 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix app_voicemail Segfault And A Few Memory Leaks
Michael L. Young [Fri, 12 Apr 2013 22:14:31 +0000 (22:14 +0000)] 
Fix app_voicemail Segfault And A Few Memory Leaks

The original report was that app_voicemail would crash.  This was caused by
ast_config_load() returning CONFIG_STATUS_FILEINVALID but no checks being
performed for that return status.  After adding the initial patch to fix this
issue, Jaco Kroon (jkroon) added some fixes to memory leaks he had discovered.

During review, Walter Doekes (wdoekes) suggested adding a helper function in
order to determine if we had a valid configuration or not.

This patch does the following:

* Creates a helper function to check if the configuration is valid

* Adds calls to the new helper function where appropiate

* Fixes memory leaks where the code returned without running
  ast_config_destroy() on the configuration that was loaded

(closes issue ASTERISK-21302)
Reported by: Jaco Kroon
Tested by: Jaco Kroon, Michael L. Young
Patches:
    asterisk-11.3.0-app_voicemail-ast_config-fixes.patch
                                                       Jaco Kroon (license 5671)
    asterisk-21302-valid_cfg_and_mem_leaks_v3-1.8.diff
                                                 Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385551 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoIAX2 defer_full_frames fail to get sent
Alec L Davis [Fri, 12 Apr 2013 08:46:19 +0000 (08:46 +0000)] 
IAX2 defer_full_frames fail to get sent

Ensure iax2_process_thread is signalled when a deferred frame is queued to it.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385429 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoIAX2, prevent network thread starting before all helper threads are ready
Alec L Davis [Fri, 12 Apr 2013 08:14:20 +0000 (08:14 +0000)] 
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385402 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUse LDAP memory management functions instead of Asterisk's
Matthew Jordan [Wed, 10 Apr 2013 14:22:45 +0000 (14:22 +0000)] 
Use LDAP memory management functions instead of Asterisk's

When MALLOC_DEBUG is enabled with res_config_ldap, issues (munmap_chunk:
invalid pointer errors) can occur as the memory is being allocated with
Asterisk's wrappers around malloc/calloc/free/strdup, as opposed to the
LDAP library's wrappers.

This patch uses the LDAP library's wrappers where appropriate, so that
compiling with MALLOC_DEBUG doesn't cause more problems than it solves.

Note that the patch listed below was modified slightly for this commit
to account for some additional memory allocation/deallocations.

(closes issue ASTERISK-17386)
Reported by: John Covert
Tested by: Andrew Latham
patches:
  issue18789-1.8-r316873.patch uploaded by seanbright (License 5060)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385190 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix crash in chan_sip when a core initiated op occurs at the same time as a BYE
Matthew Jordan [Wed, 10 Apr 2013 14:03:05 +0000 (14:03 +0000)] 
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoModified the list of keys for the driver backends for sake of sample clarity
Rusty Newton [Mon, 8 Apr 2013 23:34:59 +0000 (23:34 +0000)] 
Modified the list of keys for the driver backends for sake of sample clarity

Added a line showing the mapping of "mysql" to res_config_mysql available in add-ons. We used "mysql" as an example driver key in the sample, but didn't show what module it mapped too. Also added a subtitle above the list of keys for driver backends.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385047 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix For Not Overriding The Default Settings In chan_sip
Michael L. Young [Mon, 8 Apr 2013 19:55:34 +0000 (19:55 +0000)] 
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.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@385008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoBackport Appropiate NAT Setting Cleanup
Michael L. Young [Thu, 4 Apr 2013 19:31:40 +0000 (19:31 +0000)] 
Backport Appropiate NAT Setting Cleanup

In ASTERISK-20904, the focus was around the changes to NAT that took place in
Asterisk 11.  Since the report stated that 1.8 was fine, we didn't take a look
at 1.8 at the time.

While working on ASTERISK-21225, I could see that 1.8 would benefit from having
some of those changes applied to it.

This patch does the following:

* The important part of this patch is that it sets the peer's flags earlier in
  build_peer so that the code properly uses the peer's flags based on the peer's
  configuration.
* constify req parameter in check_via()
* update realtime schemas under the contrib directory to handle properly the NAT
  settings available in 1.8 as well as to handle the changes made in 11 to make
  upgrading easier when installing newer versions of Asterisk

(closes issue ASTERISK-21243)
Reported by: Michael L. Young
Patches:
    asterisk-20904-changes_for_1.8.diff Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384779 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_dahdi: Add inband_on_proceeding compatibility option.
Richard Mudgett [Wed, 3 Apr 2013 20:13:18 +0000 (20:13 +0000)] 
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384685 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate documentation for CHANNEL function
Matthew Jordan [Wed, 3 Apr 2013 17:05:55 +0000 (17:05 +0000)] 
Update documentation for CHANNEL function

Document that you can read/write the 'accountcode' and 'amaflags' on a channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFixed spurious rebuilds of func_version.
David M. Lee [Tue, 2 Apr 2013 17:33:53 +0000 (17:33 +0000)] 
Fixed spurious rebuilds of func_version.

func_version.so was being rebuilt every time, because build.h was
changing every build, because of the cleantest dependency that was
added in r384410 to fix parallel make bugs.

Now build.h will only be created if it does not exist, which was the
original behavior of the Makefile.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384544 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix parallel make problems.
David M. Lee [Mon, 1 Apr 2013 13:18:15 +0000 (13:18 +0000)] 
Fix parallel make problems.

Occasionally, make -j would fail due to missing includes, or other
unusual errors.

This was due to the 'cleantest' target, which was designed to force a
make clean when some change in the code would cause the typical
depedency checking to fail. Several targets in the main Makefile did
not depend upon cleantest, hence would run in parallel to it. By
adding the dependency, make -j runs happily now.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384410 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoapp_voicemail: Add blank argument to externnotify if no context argument
Jonathan Rose [Fri, 29 Mar 2013 16:23:03 +0000 (16:23 +0000)] 
app_voicemail: Add blank argument to externnotify if no context argument

At least one call to run_externnotify provides a NULL context parameter and
because the snprintf statement doesn't account for a NULL context parameter,
it simply writes '(null)' to the arguments string instead. This patch makes
it write two quotes back to back for that argument instead in the event of
a NULL context.

(closes issue ASTERISK-18207)
Reported by: Barry L. Kline
Patches:
modified from patch-20130306 uploaded by Karsten Wemheuer (License 5930)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384325 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAddress uninitialized conditional that valgrind found
Kinsey Moore [Wed, 27 Mar 2013 19:50:19 +0000 (19:50 +0000)] 
Address uninitialized conditional that valgrind found

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384162 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix a file descriptor leak in off nominal path
Matthew Jordan [Wed, 27 Mar 2013 18:49:17 +0000 (18:49 +0000)] 
Fix a file descriptor leak in off nominal path

While looking at the security vulnerability in ASTERISK-20967, Walter noticed
a file descriptor leak and some other issues in off nominal code paths. This
patch corrects them.

Note that this patch is not related to the vulnerability in ASTERISK-20967,
but the patch was placed on that issue.

(closes issue ASTERISK-20967)
Reported by: wdoekes
patches:
  issueA20967_file_leak_and_unused_wkspace.patch uploaded by wdoekes (License 5674)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384118 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix white noise on SRTP decryption
Kinsey Moore [Wed, 27 Mar 2013 17:02:32 +0000 (17:02 +0000)] 
Fix white noise on SRTP decryption

When res_rtp_asterisk.c was altered to avoid attempting to apply
unprotect algorithms to non-audio RTP packets, the test used was
incorrect. This caused the audio packets to not be decrypted and
resulted in loud white noise on the other endpoint (or both endpoints
depending on the call legs involved). The test now properly checks the
version field in the RTP header to ensure that RTP and RTCP are
decrypted while other types of packets are not.

(closes issue ASTERISK-21323)
Reported by: andrea
Tested by: Kinsey Moore, andrea, John Bigelow
Patches:
    whitenoise_fix.diff uploaded by Kinsey Moore

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@384048 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAST-2013-003: Prevent username disclosure in SIP channel driver
Matthew Jordan [Wed, 27 Mar 2013 14:53:13 +0000 (14:53 +0000)] 
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383981 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAST-2013-002: Prevent denial of service in HTTP server
Matthew Jordan [Wed, 27 Mar 2013 14:35:11 +0000 (14:35 +0000)] 
AST-2013-002: Prevent denial of service in HTTP server

AST-2012-014, fixed in January of this year, contained a fix for Asterisk's
HTTP server for a remotely-triggered crash. While the fix put in place fixed
the possibility for the crash to be triggered, a denial of service vector still
exists with that solution if an attacker sends one or more HTTP POST requests
with very large Content-Length values. This patch resolves this by capping
the Content-Length at 1024 bytes. Any attempt to send an HTTP POST with
Content-Length greater than this cap will not result in any memory allocation.
The POST will be responded to with an HTTP 413 "Request Entity Too Large"
response.

This issue was reported by Christoph Hebeisen of TELUS Security Labs

(closes issue ASTERISK-20967)
Reported by: Christoph Hebeisen
patches:
  AST-2013-002-1.8.diff uploaded by mmichelson (License 5049)
  AST-2013-002-10.diff uploaded by mmichelson (License 5049)
  AST-2013-002-11.diff uploaded by mmichelson (License 5049)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383976 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoResolve deadlock between SIP registration and channel based functions
Matthew Jordan [Tue, 26 Mar 2013 02:23:01 +0000 (02:23 +0000)] 
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.
 * Holding the privat elock 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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383863 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoResolve deadlock between pending CDR and batch CDR locks
Matthew Jordan [Tue, 26 Mar 2013 01:50:28 +0000 (01:50 +0000)] 
Resolve deadlock between pending CDR and batch CDR locks

r375757 attempted to resolve a race condition between multiple submissions of
CDRs while in batch mode from attempting to destroy the scheduled batch
submission by extending the batch CDR lock. Unfortunately, this causes a
deadlock between the pending CDR lock and the batch CDR lock. This patch
resolves the intent of r375757 by simply providing a new lock that protects
the scheduling of the batches. The original batch CDR lock is kept to protect
manipulation of the batch CDR settings, but has been placed such that it
is not held when the pending lock is held.

Thanks to Chase Venters for providing lock analysis on the issue.

(issue ASTERISK-21162)
Reported by: Chase Venters

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383839 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix multi-station answer race condition.
Russell Bryant [Tue, 26 Mar 2013 01:32:27 +0000 (01:32 +0000)] 
Fix multi-station answer race condition.

When an SLA trunk is ringing (inbound call on the trunk) Asterisk will
make outbound calls to the stations that have that trunk.  If more than
one station answers the call at the same time, all channels other than
the first one to answer are left in a bad state.  The channel gets
leaked, is not connected to anything, and there's no way to get rid of
it.

We now properly clean up these losing channels by hanging up on them.
Since they lost the race, as we process their answer, there is no
ringing trunk for them to answer.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383835 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoSet the CALLERID(dnid-num-plan) for incoming ISDN calls.
Richard Mudgett [Mon, 25 Mar 2013 23:19:06 +0000 (23:19 +0000)] 
Set the CALLERID(dnid-num-plan) for incoming ISDN calls.

The CALLEDTON channel variable is set for incoming ISDN calls to the lower
7 bits of the Q.931 type-of-number/numbering-plan octet.  The
CALLERID(dnid-num-plan) should have the same value.

(closes issue ASTERISK-21248)
Reported by: rmudgett

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383796 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoProperly delimit post data in res_config_curl.
Sean Bright [Mon, 25 Mar 2013 12:35:13 +0000 (12:35 +0000)] 
Properly delimit post data in res_config_curl.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383667 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoHave func_curl log a warning when a curl request fails.
Walter Doekes [Wed, 20 Mar 2013 20:22:40 +0000 (20:22 +0000)] 
Have func_curl log a warning when a curl request fails.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383460 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoRemoved codecs/g722/*.i on make clean
David M. Lee [Tue, 19 Mar 2013 15:50:05 +0000 (15:50 +0000)] 
Removed codecs/g722/*.i on make clean

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383340 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agotcptls: Prevent unsupported options from being set
Kinsey Moore [Fri, 15 Mar 2013 12:49:59 +0000 (12:49 +0000)] 
tcptls: Prevent unsupported options from being set

AMI, HTTP, and chan_sip all support TLS in some way, but none of them
support all the options that Asterisk's TLS core is capable of
interpreting. This prevents consumers of the TLS/SSL layer from setting
TLS/SSL options that they do not support.

This also gets tlsverifyclient closer to a working state by requesting
the client certificate when tlsverifyclient is set. Currently, there is
no consumer of main/tcptls.c in Asterisk that supports this feature and
so it can not be properly tested.

Review: https://reviewboard.asterisk.org/r/2370/
Reported-by: John Bigelow
Patch-by: Kinsey Moore
(closes issue AST-1093)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383165 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoWhen a session timer expires during a T.38 call, re-invite with correct SDP
Matthew Jordan [Fri, 15 Mar 2013 01:32:06 +0000 (01:32 +0000)] 
When a session timer expires during a T.38 call, re-invite with correct SDP

When a session timer expires during a dialog that has re-negotiated to T.38
and Asterisk is the refresher, Asterisk will send a re-INVITE with an SDP
containing audio media only. This causes some hilarity with the poor fax
session under weigh.

This patch corrects that by sending T.38 parameters if we are in the middle of
a T.38 session.

(closes issue ASTERISK-21232)
Reported by: Nitesh Bansal
patches:
  dont-send-audio-reinvite-for-sess-timer-in-t38-call.patch uploaded by nbansal (License 6418)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix processing of call files when using KQueue on OS X
Matthew Jordan [Fri, 15 Mar 2013 01:21:55 +0000 (01:21 +0000)] 
Fix processing of call files when using KQueue on OS X

In certain situations, call files are not processed when using KQueue with
pbx_spool. Asterisk was sending an invalid timeout value when the spool
directory is empty, causing the call to kevent to error immediately. This
can create a tight loop, increasing the CPU load on the system.

(closes issue ASTERISK-21176)
Reported by: Carlton O'Riley
patches:
  kqueue_osx.patch uploaded by coriley (License 6473)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383120 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix whitespace in AST_EXT_LIB_CHECK macro.
Jason Parker [Thu, 14 Mar 2013 16:56:22 +0000 (16:56 +0000)] 
Fix whitespace in AST_EXT_LIB_CHECK macro.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383061 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix Sorting Order For Parking Lots Stored In Static Realtime
Michael L. Young [Tue, 12 Mar 2013 21:15:52 +0000 (21:15 +0000)] 
Fix Sorting Order For Parking Lots Stored In Static Realtime

When retrieving the parking lots from a MySQL database table, the current order
is "filename, cat_metric desc, var_metric asc, category".  If there are multiple
parking lots with the same cat_metric but different categories, everything is
being sorted on cat_metric first resulting in errors when loading the parking
lots.

This patch fixes the problem by sorting on the category field first, then the
cat_metric field.

(closes issue ASTERISK-21035)
Reported by: Alex Epshteyn
Patches:
  asterisk-21035-orderby.diff Michael L. Young (license 5026)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@382942 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate Contributed Realtime Schema Files - IPv6 Addresses
Michael L. Young [Tue, 12 Mar 2013 20:37:12 +0000 (20:37 +0000)] 
Update Contributed Realtime Schema Files - IPv6 Addresses

This commit updates some fields in the contributed realtime schema files to
handle IPv6 addresses.

(closes issue ASTERISK-21173)
Reported by: Torrey Searle
Patches:
  realtime_sql.patch Torrey Searle (license 5334)
  asterisk-21173-update-ip-fields.diff Michael L. Young (license 5026)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@382939 65c4cc65-6c06-0410-ace0-fbb531ad65f3