]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
12 years agoConsistent memory allocation by ast_bt_get_symbols.
Walter Doekes [Thu, 8 Aug 2013 20:21:52 +0000 (20:21 +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/
........

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

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

12 years ago - Fix different issues with call transfer cancel. In case 3rd party busy or congesti...
Igor Goncharovskiy [Thu, 8 Aug 2013 07:03:50 +0000 (07:03 +0000)] 
 - Fix different issues with call transfer cancel. In case 3rd party busy or congestion call was not returned.
 - Fix displaying soft button 'Redial' in case of no redial number exists

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

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

Missed a spot in the previous commit.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396310 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:19:42 +0000 (08:19 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396287 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:19:41 +0000 (20:19 +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)
........

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

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

12 years agoBlocked revisions 396236
Michael L. Young [Mon, 5 Aug 2013 19:48:22 +0000 (19:48 +0000)] 
Blocked revisions 396236

........
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/11@396237 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoChange "from" to "From".
Michael L. Young [Mon, 5 Aug 2013 18:48:31 +0000 (18:48 +0000)] 
Change "from" to "From".

(related to issue ASTERISK-21903)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396199 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:42:58 +0000 (18:42 +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)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396197 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:50:54 +0000 (13:50 +0000)] 
Update copyright year to 2013 in asterisk.c; some whitespace fixes

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

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

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

12 years agoAdd an upgrade note for libuuid dependency; remove note in CHANGES
Matthew Jordan [Sun, 21 Jul 2013 22:51:58 +0000 (22:51 +0000)] 
Add an upgrade note for libuuid dependency; remove note in CHANGES

This patch notes that libuuid is now a dependency for res_rtp_asterisk; this
was introduced in between 11.4.0 and 11.5.0 to resolve a dependency for
pjproject, which res_rtp_asterisk uses for ICE/STUN/TURN support.

It also removes a conflicting note from CHANGES. While support for playing
prompts to the first participant was added for app_queue, it was disabled
by default and an option added to enable it. That was properly noted in the
UPGRADE.txt file.

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

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

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

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

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

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

12 years agoProvide proper ring tone in indications.conf for Malaysia
Matthew Jordan [Sun, 21 Jul 2013 18:16:36 +0000 (18:16 +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)
........

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

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

12 years agoTolerate presence of RFC2965 Cookie2 header by ignoring it
Matthew Jordan [Sun, 21 Jul 2013 03:09:59 +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
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@394900 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:43 +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)
........

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

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

12 years agoDocument connectedline parameter for chan_iax2
Matthew Jordan [Sun, 21 Jul 2013 02:20:36 +0000 (02:20 +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
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@394890 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:52:33 +0000 (12:52 +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/
........

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

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

12 years agoProvide error message for QUEUE_MEMBER when member is not in queue
Matthew Jordan [Sun, 14 Jul 2013 02:34:43 +0000 (02:34 +0000)] 
Provide error message for QUEUE_MEMBER when member is not in queue

When QUEUE_MEMBER is used and the member specified is not in the queue,
Asterisk provides an ERROR message that indicates that the option specified
is not valid. This patch now properly displays an ERROR message that the
member is not in the queue if an interface is specified.

(closes issue ASTERISK-21980)
Reported by: Avraam David

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

12 years agoClarify documentation for function PASSTHRU
Matthew Jordan [Sun, 14 Jul 2013 01:59:19 +0000 (01:59 +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)
........

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

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

12 years agoFix a longstanding issue with MFC-R2 configuration that prevented users
Moises Silva [Thu, 11 Jul 2013 21:28:07 +0000 (21:28 +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
........

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

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

12 years agoastobj2-ify the SLA code
Russell Bryant [Wed, 10 Jul 2013 01:49:41 +0000 (01:49 +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/
........

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

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

12 years agoMixMonitor: Fix refleak in manager_stop_mixmonitor() if could not stop monitoring.
Richard Mudgett [Wed, 3 Jul 2013 23:52:04 +0000 (23:52 +0000)] 
MixMonitor: Fix refleak in manager_stop_mixmonitor() if could not stop monitoring.

........

Merged revisions 393490 from http://svn.asterisk.org/svn/asterisk/trunk

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@393630 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:30:20 +0000 (23:30 +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
........

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

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

12 years agoFix issue with inability to cancell call transfer made by on-sceen menus.
Igor Goncharovskiy [Tue, 2 Jul 2013 10:14:09 +0000 (10:14 +0000)] 
Fix issue with inability to cancell call transfer made by on-sceen menus.

Reported by: Igor Olhovskiy

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

12 years agoFix memory/ref counting leaks in a variety of locations
Matthew Jordan [Tue, 25 Jun 2013 01:07:29 +0000 (01:07 +0000)] 
Fix memory/ref counting leaks in a variety of locations

This patch fixes the following memory leaks:
 * http.c: The structure containing the addresses to bind to was not being
   deallocated when no longer used
 * named_acl.c: The global configuration information was not disposed of
 * config_options.c: An invalid read was occurring for certain option types.
 * res_calendar.c: The loaded calendars on module unload were not being
   properly disposed of.
 * chan_motif.c: The format capabilities needed to be disposed of on module
   unload. In addition, this now specifies the default options for the
   maxpayloads and maxicecandidates in such a way that it doesn't cause the
   invalid read in config_options.c to occur.

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

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

12 years agoapp_mixmonitor: Fix crashes caused by unloading app_mixmonitor
Jonathan Rose [Fri, 14 Jun 2013 16:21:41 +0000 (16:21 +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/
........

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

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

12 years agoapp_confbridge: Fix memory leak on reload.
Richard Mudgett [Thu, 13 Jun 2013 18:47:48 +0000 (18:47 +0000)] 
app_confbridge: Fix memory leak on reload.

The config framework options should not be registered multiple times.
Instead the configuration just needs to be reprocessed by the config
framework.

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

12 years agoFix segfault for certain invalid WebSocket input.
David M. Lee [Wed, 12 Jun 2013 21:00:38 +0000 (21:00 +0000)] 
Fix segfault for certain invalid WebSocket input.

The WebSocket code would allocate, on the stack, a string large enough
to hold a key provided by the client, and the WEBSOCKET_GUID. If the key
is NULL, this causes a segfault. If the key is too large, it could
overflow the stack.

This patch checks the key for NULL and checks the length of the key to
avoid stack smashing nastiness.

(closes issue ASTERISK-21825)
Reported by: Alfred Farrugia
Tested by: Alfred Farrugia, David M. Lee
Patches:
    issueA21825_check_if_key_is_sent.patch uploaded by Walter Doekes (license 5674)

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

12 years agoFix memory leak while loading priority modules and adding formats
Matthew Jordan [Wed, 12 Jun 2013 02:25:23 +0000 (02:25 +0000)] 
Fix memory leak while loading priority modules and adding formats

This patch fixes two memory leaks:
 * 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.

 * When adding a custom format (such as SILK or CELT), the routine for adding
   the format was leaking a reference. RAII_VAR cleans this up properly.

........

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

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

12 years agoFix issue with no sound in both way in case of previous call to chan_unistim phone...
Igor Goncharovskiy [Tue, 11 Jun 2013 10:22:00 +0000 (10:22 +0000)] 
Fix issue with no sound in both way in case of previous call to chan_unistim phone was canceled.

(related to ASTERISK-20183)

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

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

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

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

12 years agoAdd announce-to-first-user option for app_queue
Matthew Jordan [Mon, 10 Jun 2013 14:25:23 +0000 (14:25 +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
........

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

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

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

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

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

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

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

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

12 years agoIAX2: refactor nativebridge transfer
Alec L Davis [Mon, 10 Jun 2013 08:23:52 +0000 (08:23 +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/
........

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

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

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

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

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

12 years agoremove unnecessary declarations
Alexandr Anikin [Fri, 31 May 2013 10:34:20 +0000 (10:34 +0000)] 
remove unnecessary declarations
(issue ASTERISK-21800)

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

12 years agoreject call attempts when gatekeeper is configured but not registered
Alexandr Anikin [Fri, 31 May 2013 10:19:52 +0000 (10:19 +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
........

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

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

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

12 years agoFix segfault when dealing with chan_agent channels.
Richard Mudgett [Wed, 29 May 2013 20:18:01 +0000 (20:18 +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
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@390047 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:43:23 +0000 (17:43 +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)
........

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

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

12 years agoPrint all logger messages on shutdown
Matthew Jordan [Fri, 24 May 2013 11:49:08 +0000 (11:49 +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)
........

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

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

12 years agoFix several problems caused by multiple line usage with i2004 phones.
Igor Goncharovskiy [Fri, 24 May 2013 10:12:01 +0000 (10:12 +0000)] 
Fix several problems caused by multiple line usage with i2004 phones.
Reported by: Daniel Bohling, MihaiMircea

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

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

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

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

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

12 years agoFix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
Kevin Harwell [Wed, 15 May 2013 15:57:25 +0000 (15:57 +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)
........

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

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

12 years agoFix VM snapshot handling for combined INBOX.
Jason Parker [Wed, 15 May 2013 14:25:35 +0000 (14:25 +0000)] 
Fix VM snapshot handling for combined INBOX.

The snapshot API contains an option that allow for combining of new
and old messages within a single snapshot. New messages, however,
include options beyond just 'INBOX' - it also includes the Urgent
folder. A previous patch that combined INBOX and Urgent accidentally
impacted snapshots that attempted to gain messages from just the Old
folder. This patch fixes the snapshot gathering such that the API
returns the appropriate messages for the folder selected, with and
without the combine option.

This should make it more clear about what's happening.

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

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

12 years agoUse srtp_shutdown when available
Kinsey Moore [Wed, 15 May 2013 12:39:55 +0000 (12:39 +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)
........

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

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

12 years agoMake ao2 global objects not always use the debug version of the ao2_ref() calls.
Richard Mudgett [Tue, 14 May 2013 18:55:57 +0000 (18:55 +0000)] 
Make ao2 global objects not always use the debug version of the ao2_ref() calls.

The debug versions of ao2_ref() should only be used if REF_DEBUG is
enabled so nothing is written to /tmp/refs unexpectedly.

(closes issue ASTERISK-21785)
Reported by: abelbeck
Patches:
      jira_asterisk_21785_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: abelbeck

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

12 years agoFix Missing CALL-ID When Logging Through Syslog
Michael L. Young [Mon, 13 May 2013 21:17:44 +0000 (21:17 +0000)] 
Fix Missing CALL-ID When Logging Through Syslog

The CALL-ID (ie [C-00000074]) is missing when logging to syslog.  This was just
an oversight when this feature was added.

* Add CALL-IDs when using syslog

(closes issue ASTERISK-21430)
Reported by: Nikola Ciprich
Tested by: Nikola Ciprich, Michael L. Young
Patches:
    asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026)

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

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

12 years agoFix Crash Caused By One-way Audio With auto_* NAT Settings Fix
Michael L. Young [Mon, 13 May 2013 21:05:38 +0000 (21:05 +0000)] 
Fix Crash Caused By One-way Audio With auto_* NAT Settings Fix

The prior code committed, r385473, failed to take into consideration that not
all outgoing calls will be to a peer.  My fault.

This patch does the following:

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

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

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

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

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

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

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

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

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

12 years agopbx: Fix lack of cleanup on macrolock and context_table
Jonathan Rose [Mon, 13 May 2013 19:24:59 +0000 (19:24 +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)
........

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

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

12 years agoClose libsrtp properly
Kinsey Moore [Mon, 13 May 2013 18:09:21 +0000 (18:09 +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
........

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

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

12 years agoFix SendText AMI action to never return non-zero.
Richard Mudgett [Mon, 13 May 2013 14:26:57 +0000 (14:26 +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
........

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@388426 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:49:27 +0000 (21:49 +0000)] 
Add version.c to list of ignored files in the utils directory.
........

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

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

12 years agoFix memory leak in pbx_dundi
Mark Michelson [Fri, 10 May 2013 20:41:44 +0000 (20:41 +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)
........

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

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

12 years agoFix copy/paste error in one-touch-recording implementation.
Sean Bright [Fri, 10 May 2013 11:46:00 +0000 (11:46 +0000)] 
Fix copy/paste error in one-touch-recording implementation.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@388253 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 04:10:27 +0000 (04:10 +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/
........

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

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

12 years agoFix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime
Michael L. Young [Thu, 9 May 2013 03:30:49 +0000 (03:30 +0000)] 
Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime

When the "ignorebusy" setting was deprecated, we added some code to allow us to
be compatible with older setups that are still using the "ignorebusy" setting
instead of "ringinuse".  We set a char *variable with the column name to use,
which helps the realtime functions to use the correct column in their SQL
queries.  When "persistentmembers" is enabled, we are not setting this variable
before the realtime functions were called to load members.  This results in the
variable being NULL and therefore causing a segfault when loading members during
the module's process of loading.

The solution was to move the code that sets that variable to be before these
realtime functions are called during the loading of the module.

(closes issue ASTERISK-21738)
Reported by: JoshE
Tested by: JoshE
Patches:
    asterisk-21738-rt-ringinuse-field-not-set.diff
                                     uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@388108 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:19:11 +0000 (07:19 +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/
........

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

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

12 years agoMinor fixups to Doxygen comments.
David M. Lee [Tue, 7 May 2013 18:29:30 +0000 (18:29 +0000)] 
Minor fixups to Doxygen comments.

The \example tags marks an entire file as an example, not a code snippet.

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

12 years agoMake SLA reload more paranoid.
Russell Bryant [Mon, 6 May 2013 15:55:27 +0000 (15:55 +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.
........

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

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

12 years agoUpdate utils Makefile to handle r387294
Matthew Jordan [Thu, 2 May 2013 17:15:04 +0000 (17:15 +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.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@387422 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 08:09:59 +0000 (08:09 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@387345 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:22:59 +0000 (07:22 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@387319 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:54:05 +0000 (06:54 +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)
........

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

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

12 years agoAdd Asterisk Version to core show locks
Alec L Davis [Thu, 2 May 2013 06:45:31 +0000 (06:45 +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)
........

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

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

12 years agoClear the DTMF sending digit tracking on off nominal paths
Matthew Jordan [Wed, 1 May 2013 21:17:38 +0000 (21:17 +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)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@387216 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:35:46 +0000 (18:35 +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/11@387134 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:46:16 +0000 (22:46 +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)
........

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

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

12 years agoAdd forgotten event types to event_names array
Jonathan Rose [Tue, 30 Apr 2013 22:15:51 +0000 (22:15 +0000)] 
Add forgotten event types to event_names array

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

12 years agoUse the proper lower bound when doing saturation arithmetic.
Sean Bright [Tue, 30 Apr 2013 13:46:53 +0000 (13:46 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@386930 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:35:51 +0000 (23:35 +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)
........

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

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@386794 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:27:32 +0000 (21:27 +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)
........

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

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

12 years agoClean up resources in features on exit
Matthew Jordan [Fri, 26 Apr 2013 21:13:36 +0000 (21:13 +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)
........

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

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

12 years agoFix Displaying Symmetric RTP Global Setting
Michael L. Young [Thu, 25 Apr 2013 03:02:30 +0000 (03:02 +0000)] 
Fix Displaying Symmetric RTP Global Setting

* Use comedia_string() to display correctly the symmetric rtp setting when
  running "sip show settings"

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@386484 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:30:53 +0000 (16:30 +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
........

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

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

12 years agoPrevent res_timing_pthread from blocking callers
Matthew Jordan [Fri, 19 Apr 2013 22:25:49 +0000 (22:25 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@386159 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:54 +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.
........

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

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

12 years agoFix lock errors on startup.
David M. Lee [Thu, 18 Apr 2013 16:07:03 +0000 (16:07 +0000)] 
Fix lock errors on startup.

In messages.c, there are several places in the code where we create a
tmp_tech_holder and pass that into an ao2_find call. Unfortunately, we
weren't initializing the rwlock on the tmp_tech_holder, which the hash
function was locking. It's apparently harmless, but still not the best
code.

This patch extracts all that copy/pasted code into two functions,
msg_find_by_tech and msg_find_by_tech_name, which properly initialize
and destroy the rwlock on the tmp_tech_holder.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@386006 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:27:51 +0000 (23:27 +0000)] 
Distributed Device State broken at sites using res_xmpp or res_jabber where Secuity Advisory AST-2012-015 is inplace

res_xmpp was 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/11@385938 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:13:58 +0000 (23:13 +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/
........

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

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

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

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

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

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

12 years agoFix the svn:keywords property on several files.
David M. Lee [Mon, 15 Apr 2013 15:18:54 +0000 (15:18 +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.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385689 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 03:00:27 +0000 (03:00 +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)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385637 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:30:19 +0000 (02:30 +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)
........

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

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

12 years agoFix Manager Segfault When app_queue Is Unloaded
Michael L. Young [Fri, 12 Apr 2013 22:37:46 +0000 (22:37 +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/
........

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

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

12 years agoAllow codec_resample to be unloaded
Kinsey Moore [Fri, 12 Apr 2013 22:25:38 +0000 (22:25 +0000)] 
Allow codec_resample to be unloaded

Ensure that trans_size is correct to prevent uninitialized entries from
preventing reload.

(closes issue ASTERISK-21401)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    codec_resample-unload.patch uploaded by Corey Farrell

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

12 years agoFix app_voicemail Segfault And A Few Memory Leaks
Michael L. Young [Fri, 12 Apr 2013 22:18:42 +0000 (22:18 +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/
........

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

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

12 years agoFix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX
Michael L. Young [Fri, 12 Apr 2013 15:01:39 +0000 (15:01 +0000)] 
Fix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX

When we reload Asterisk or chan_sip, the flags force_rport and comedia that are
turned on and off when using the auto_force_rport and auto_comedia nat settings
go back to the default setting off.  These flags are turned on when needed or
off when not needed at the time that a peer registers, re-registers or initiates
a call.  This would apply even when only the default global setting
"nat=auto_force_rport" is being used, which in this case would only affect the
force_rport flag.

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

This patch does the following:

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

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

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

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

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

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

12 years agoIAX2 defer_full_frames fail to get sent
Alec L Davis [Fri, 12 Apr 2013 08:50:53 +0000 (08:50 +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/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385430 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:16:15 +0000 (08:16 +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/
........

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

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

12 years agoAdd dependency on libuuid, for res_rtp_asterisk
Jason Parker [Thu, 11 Apr 2013 19:59:35 +0000 (19:59 +0000)] 
Add dependency on libuuid, for res_rtp_asterisk

pjproject is what actually requires libuuid.

(closes issue ASTERISK-21125)
reported by Private Name

(Ed. note: Really?  Private Name?  I am rolling my eyes so hard right now.)

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

12 years agoFix 'pri intense debug span' alias.
Richard Mudgett [Thu, 11 Apr 2013 16:52:41 +0000 (16:52 +0000)] 
Fix 'pri intense debug span' alias.

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

12 years agoUse LDAP memory management functions instead of Asterisk's
Matthew Jordan [Wed, 10 Apr 2013 14:25:44 +0000 (14:25 +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)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385199 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:05:07 +0000 (14:05 +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
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385173 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:36:32 +0000 (23:36 +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.
........

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

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

12 years agoBlocked revisions 385008
Michael L. Young [Mon, 8 Apr 2013 19:56:45 +0000 (19:56 +0000)] 
Blocked revisions 385008

........
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/11@385009 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix For Not Overriding The Default Settings In chan_sip
Michael L. Young [Fri, 5 Apr 2013 20:34:16 +0000 (20:34 +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.

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

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

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

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