]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agocore: Not the configured but granted number of possible file descriptors. 71/2971/3
Alexander Traud [Wed, 8 Jun 2016 12:20:26 +0000 (14:20 +0200)] 
core: Not the configured but granted number of possible file descriptors.

With CLI "core show settings", simply the parameter maxfiles of the file
asterisk.conf was shown. If that parameter was not set, nothing was displayed
although the environment might have set a default number itself. Or if maxfiles
were not granted (completely), still maxfiles was shown. Now, the maximum number
of possible file descriptors in the environment is shown.

ASTERISK-26097

Change-Id: I2df5c58863b5007b34b77adbe28b885dfcdf7e0b

9 years agores_srtp: Instead of libSRTP use OpenSSL as random source. 62/2962/1
Alexander Traud [Tue, 7 Jun 2016 10:45:34 +0000 (12:45 +0200)] 
res_srtp: Instead of libSRTP use OpenSSL as random source.

Since libSRTP 1.5, its Random Number Generator (RNG) is not maintained anymore.
Therefore, the symbol RAND_bytes is used instead of crypto_get_random.

ASTERISK-24436 #close

Change-Id: Iea0bae4d4e3c9aa0926ea442b6484b5159789d96

9 years agoMerge "Makefile: remove OSARCH check for init install" into 11
zuul [Mon, 23 May 2016 21:16:12 +0000 (16:16 -0500)] 
Merge "Makefile: remove OSARCH check for init install" into 11

9 years agoMakefile: remove OSARCH check for init install 95/2895/1
Tzafrir Cohen [Wed, 18 May 2016 15:58:20 +0000 (18:58 +0300)] 
Makefile: remove OSARCH check for init install

There are more specific checks for the platform.

Specifically this allows installing OS/X init scripts.

ASTERISK-26038 #close

Change-Id: If08933621145b10362a0cfe73c079301d9c13f50
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
9 years agofunc_curl: Don't trim response text on non-ASCII characters 93/2893/1
Ivan Poddubny [Sat, 21 May 2016 10:42:45 +0000 (13:42 +0300)] 
func_curl: Don't trim response text on non-ASCII characters

The characters 0x80-0xFF were trimmed as well as 0x00-0x20 because of
a signed comparison.

ASTERISK-25669 #close
Reported by: Jesper
patches:
  strings.curl.trim.patch submitted by Jesper (License 5518)

Change-Id: Ia51e169f24e3252a7ebbaab3728630138ec6f60a

9 years agoMerge "udptl: Don't eat sequence numbers until OK is received" into 11
zuul [Thu, 19 May 2016 09:32:29 +0000 (04:32 -0500)] 
Merge "udptl:  Don't eat sequence numbers until OK is received" into 11

9 years agoudptl: Don't eat sequence numbers until OK is received 69/2869/3
George Joseph [Wed, 18 May 2016 12:54:14 +0000 (06:54 -0600)] 
udptl:  Don't eat sequence numbers until OK is received

Scenario:
Local fax -> Asterisk w/ firewall -> Provider -> Remote fax

* Local fax starts rtp call to remote fax
* Remote fax starts t38 call back to local fax.
* Local fax sends t38 no-signal to Asterisk before sending an OK.
* udptl processes the frame and increments the expected sequence number.
* chan_sip drops the frame because the call isn't up so nothing goes out
  the external interface to open the port for incoming packets.
* Local fax sends OK and Asterisk sends OK to the remote fax.
* Remote fax sends t38 packets which are dropped by the firewall.
* Local fax re-sends t38 no-signal with the same sequence number.
* udptl drops the frame because it thinks it's a dup.
* Still no outgoing packets to open the firewall.
* t38 negotiation fails.

The patch drops frames t38 received before udptl sequence processing
when the call hasn't been answered yet.  The second no-signal frame
is then seen as new and is relayed out the external interface which
opens the port and allows negotiation to continue.

ASTERISK-26034 #close

Change-Id: I11744b39748bd2ecbbe8ea84cdb4f3c5943c5af9

9 years agochan_sip: Prevent extra Session-Expires headers from being added 54/2854/2
George Joseph [Tue, 17 May 2016 16:14:51 +0000 (10:14 -0600)] 
chan_sip:  Prevent extra Session-Expires headers from being added

When chan_sip does a re-INVITE to refresh a session and authentication
is required, the INVITE with the Authorization header containes a
second Session-Expires header without the ";refersher=" parameter.
This is causing some proxies to return a 400.  Also, when Asterisk is
the uas and the refresher, it is including the Session-Expires and
Min-SE headers in OPTIONS messages which is not allowed per RFC4028.

This patch (based on the reporter's) Checks to see if a Session-Expires
header is already in the message before adding another one.  It also
checks that the method is INVITE or UPDATE.

ASTERISK-26030 #close

Change-Id: I58a7b07bab5a3177748d8a7034fb8ad8e11ce1d9

9 years agoMerge "logger: Add PID to syslog messages." into 11
zuul [Sun, 15 May 2016 00:50:47 +0000 (19:50 -0500)] 
Merge "logger: Add PID to syslog messages." into 11

9 years agofollowme: delete the right recorded name file 29/2829/1
Tzafrir Cohen [Tue, 10 May 2016 13:17:29 +0000 (16:17 +0300)] 
followme: delete the right recorded name file

FollowMe with the option a records the name of the caller and plays it
to the callee. However it has failed to clean up that recorded file
as it tried to delete the file name without the '.sln' extension.

ASTERISK-26008 #close

Change-Id: I79d7b1be7d5cde57bf076d9389e2a8a4422776ec
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
9 years agologger: Add PID to syslog messages. 12/2812/1
Alexei Gradinari [Thu, 5 May 2016 21:41:21 +0000 (17:41 -0400)] 
logger: Add PID to syslog messages.

During refactoring of this support the addition of
the PID to messages was removed. This change adds it
back in.

ASTERISK-25538 #close

Change-Id: Ie2d43b0652e59b7ac319a7dba94501540d70ba36

9 years agores_fax/t38_gateway: Peer V.21 session is created on wrong channel 98/2798/1
Alexei Gradinari [Tue, 10 May 2016 14:20:54 +0000 (10:20 -0400)] 
res_fax/t38_gateway: Peer V.21 session is created on wrong channel

The channel and peer V.21 sessions are created on the same channel now.
The peer V.21 session should be created only on peer channel
when one of channel can handle T.38.

Also this patch enable debug for T.38 gateway session
if global fax debug enabled.

ASTERISK-25982

Change-Id: I78387156ea521a77eb0faf170179ddd37a50430e

9 years agoapp_voicemail: always copy dynamic struct to avoid race condition 46/2746/2
Andrew Nagy [Thu, 17 Mar 2016 19:29:38 +0000 (12:29 -0700)] 
app_voicemail: always copy dynamic struct to avoid race condition

Voicemail email addresses can be corrupt or voicemail
emails can end up being sent to the wrong email address if asterisk is
reading voicemail.conf during a reload and processing an email at the
same time. This patch always copies the struct that would otherwise only
be copied once.

ASTERISK-24463 #close
Reported by: John Campbell
Tested by: Etienne Lessard
Tested by: Andrew Nagy
Change-Id: I3a0643813116da84e2617291903d0d489b7425fb

9 years agoMerge "config: Fix ast_config_text_file_save writability check for missing files...
Joshua Colp [Wed, 27 Apr 2016 20:40:16 +0000 (15:40 -0500)] 
Merge "config:  Fix ast_config_text_file_save writability check for missing files" into 11

9 years agoMerge "Fix case sensitive actions in AMI QueueSummary and QueueStatus" into 11
zuul [Tue, 26 Apr 2016 00:10:37 +0000 (19:10 -0500)] 
Merge "Fix case sensitive actions in AMI QueueSummary and QueueStatus" into 11

9 years agoconfig: Fix ast_config_text_file_save writability check for missing files 93/2693/4
George Joseph [Mon, 25 Apr 2016 03:51:16 +0000 (21:51 -0600)] 
config:  Fix ast_config_text_file_save writability check for missing files

A patch I did back in 2014 modified ast_config_text_file_save to check the
writability of the main file and include files before truncating and re-writing
them.  An unintended side-effect of this was that if a file doesn't exist,
the check fails and the write is aborted.

This patch causes ast_config_text_file_save to check the writability of the
parent directory of missing files instead of checking the file itself.  This
allows missing files to be created again.  A unit test was also added to
test_config to test saving of config files.

The regression was discovered when app_voicemail's passwordlocation=spooldir
feature stopped working.

ASTERISK-25917 #close
Reported-by: Jonathan Rose
Change-Id: Ic4dbe58c277a47b674679e49daed5fc6de349f80

9 years agoFix case sensitive actions in AMI QueueSummary and QueueStatus 99/2699/1
DarkS [Mon, 25 Apr 2016 13:11:31 +0000 (15:11 +0200)] 
Fix case sensitive actions in AMI QueueSummary and QueueStatus

ASTERISK-25954 #close
Reported by: Javier Acosta

Change-Id: I00be83d45cc7e8385de2523012bd196aafeeb256
(cherry picked from commit c0688a6398f27296ff849848a2e416e036d794e3)

9 years agoapp_queue: queue members can receive multiple calls 79/2679/2
Kevin Harwell [Thu, 21 Apr 2016 20:35:26 +0000 (15:35 -0500)] 
app_queue: queue members can receive multiple calls

It was possible for a queue member that is a member of at least 2 or more
queues to receive mulitiple calls at the same time. This happened because
of a race between when a member was being rung and when the device state
notified the other queue(s) member object of the state change.

This patch makes it so when a queue member is being rung it gets added to
a global pool of queue members. If that same member is tried again, e.g.
from another queue, and it is found to already exist in the pending member
container then it will not ring that member.

ASTERISK-16115 #close

Change-Id: Ice45a1c95b9f6f15d8a9fa709c5e5c84ffd29780

9 years agolock.c: Check *lt before dereferencing it 75/2675/1
Diederik de Groot [Thu, 21 Apr 2016 13:26:47 +0000 (15:26 +0200)] 
lock.c: Check *lt before dereferencing it

*lt is NULL if t->tracking == 0

ASTERISK-25948 #close

Change-Id: I4a81af28f9c82a74aa82413d772a7dc8fa6f45ba

9 years agoMerge "app_queue: Frequent segfaults in function can_ring_entry()" into 11
Joshua Colp [Tue, 19 Apr 2016 14:49:22 +0000 (09:49 -0500)] 
Merge "app_queue: Frequent segfaults in function can_ring_entry()" into 11

9 years agochan_sip: Don't verify table if rtupdate=no 32/2632/2
Jaco Kroon [Sun, 17 Apr 2016 20:37:53 +0000 (22:37 +0200)] 
chan_sip: Don't verify table if rtupdate=no

If rtupdate=no do not verify sipregs/peers table has updatable fields.

ASTERISK-25934 #close

Change-Id: Iaa2c53037b93daccc7e7333c40d61861847b856d

9 years agoapp_queue: Frequent segfaults in function can_ring_entry() 34/2634/1
ibercom [Mon, 18 Apr 2016 09:53:14 +0000 (11:53 +0200)] 
app_queue: Frequent segfaults in function can_ring_entry()

ASTERISK-25888 #close

Change-Id: I007a2f2dd99823e04fb5be3ff01f02b0a2956117

9 years agoapp_voicemail/IMAP: function 'save_to_folder' creates wrong folder 17/2617/1
Alexei Gradinari [Thu, 7 Apr 2016 17:02:19 +0000 (13:02 -0400)] 
app_voicemail/IMAP: function 'save_to_folder' creates wrong folder

If try to move message to Cust1 (number 5)
the function 'save_to_folder' tries to create Greeting folder instead of Cust1.

This patch fixed it by setting GREETINGS_FOLDER = -1

ASTERISK-24927 #close

Change-Id: I03d1a761894bcc2d130ec9b003bbcddc28e25c51

9 years agoapp_voicemail: Fix test_voicemail_notify_endl test. 75/2575/1
Joshua Colp [Tue, 12 Apr 2016 14:10:45 +0000 (11:10 -0300)] 
app_voicemail: Fix test_voicemail_notify_endl test.

The test_voicemail_notify_endl test checks the end-of-line
characters of an email message to confirm that they are consistent.
The test wrongfully assumed that reading from the email message
into a buffer will always result in more than 1 character being
read. This is incorrect. If only 1 character was read the test
would go outside of the buffer and access other memory causing
a crash.

The test now checks to ensure that 2 or more characters are read
in ensuring the test stays within the buffer.

ASTERISK-25874 #close

Change-Id: Ic2c89cea6e90f2c0bc2d8138306ebbffd4f8b710

9 years agoMerge "chan_local: Fix hangupcauses not getting set on Local channels" into 11
zuul [Mon, 11 Apr 2016 23:18:15 +0000 (18:18 -0500)] 
Merge "chan_local: Fix hangupcauses not getting set on Local channels" into 11

9 years agochan_local: Fix hangupcauses not getting set on Local channels 68/2568/2
Jaco Kroon [Mon, 11 Apr 2016 19:02:36 +0000 (21:02 +0200)] 
chan_local: Fix hangupcauses not getting set on Local channels

ASTERISK-25912 #close

Change-Id: I9ec0d40bd0e8ff16ba9c3cfc4c1b52cc575f421b

9 years agoapp_voicemail/IMAP: IMAP access FATAL error: Out of memory 64/2564/1
Alexei Gradinari [Thu, 7 Apr 2016 16:37:43 +0000 (12:37 -0400)] 
app_voicemail/IMAP: IMAP access FATAL error: Out of memory

Sometimes uw-imap function 'mail_fetchbody' returns huge len
which then pass to uw-imap function 'rfc822_base64'.
uw-imap tries to allocate huge memory and abort() on fail.

This patch check the len.
If the len more than max size (128 Mbytes) log error.
This patch also set variables len, newlen to avoid uninizialezed len.
This patch also check pointer returned by rfc822_base64.

ASTERISK-25899 #close

Change-Id: I4a0e7d655f11abef6a5224e2169df6d5c1f1caca

9 years agoMerge "core/logging: Fix broken syslog levels on older glibc." into 11
zuul [Fri, 25 Mar 2016 18:38:40 +0000 (13:38 -0500)] 
Merge "core/logging: Fix broken syslog levels on older glibc." into 11

9 years agomusiconhold: Only warn if music class is not found in memory and database. 55/2455/1
Walter Doekes [Thu, 24 Mar 2016 12:36:39 +0000 (13:36 +0100)] 
musiconhold: Only warn if music class is not found in memory and database.

The log message when a MusicOnHold music class was not found was changed
from debug level to WARNING level in Asterisk 11.19 and 13.5.  For those
using realtime musiconhold, this message is wrong because it warns
before checking the database.

This changeset delays the warning until after the database has been
checked.

Reported-by: Conrad de Wet
ASTERISK-25444 #close

Change-Id: I6cfb2db2f9cfbd2bb3d30566ecae361c4abf6dbf

9 years agocore/logging: Fix broken syslog levels on older glibc. 51/2451/3
Walter Doekes [Thu, 24 Mar 2016 10:38:16 +0000 (11:38 +0100)] 
core/logging: Fix broken syslog levels on older glibc.

The fix to ASTERISK-25407 introduced the usage of LOG_MAKEPRI. However
this macro is broken in older glibc (< 2.17); it would left-shift the
facility a second time, causing the resultant priority to become
invalid.

The syslog manpage mentions nothing about LOG_MAKEPRI and suggests this:

    The priority argument is formed by ORing the facility and the level
    values [...].

ASTERISK-25510 #close
Reported by: Michael Newton

Change-Id: Ia89debe7fac5ad090c7ef595c0707f31bb1e3d03

9 years agochan_sip.c: Space after port causes unnecessary resolution attempt 48/2448/1
Francesco Castellano [Fri, 20 Nov 2015 14:02:48 +0000 (15:02 +0100)] 
chan_sip.c: Space after port causes unnecessary resolution attempt

check_via() already skips leading blanks where the sent-by address (with the
optional port) should be placed.

Since RFC 3261 allows for blanks between the port ant the Via parameters:
> https://tools.ietf.org/html/rfc3261#section-20.42
(actually it allows a lot of blanks more ;-)). I just switched from
ast_skip_blanks() to ast_strip() on the local copy of the string.

ASTERISK-21301 #close

Change-Id: Ie5b8fe5a07067b7c0dc9bcdd1707e99b23b02b06

9 years agoconfig: fix flags in uint option handler 44/2444/1
Gianluca Merlo [Sat, 19 Mar 2016 12:34:26 +0000 (13:34 +0100)] 
config: fix flags in uint option handler

The configuration unsigned integer option handler sets flags for the
parser as if the option should be a signed integer (PARSE_INT32),
leading to errors on "out of range" values. Fix flags (PARSE_UINT32).

ASTERISK-25612 #close

Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e

9 years agofunc_aes: fix misuse of strlen on binary data 38/2438/1
Gianluca Merlo [Sat, 19 Mar 2016 01:32:51 +0000 (02:32 +0100)] 
func_aes: fix misuse of strlen on binary data

The encryption code for AES_ENCRYPT evaluates the length of the data to
be encoded in base64 using strlen. The data is binary, thus the length
of it can be underestimated at the first NULL character.
Reuse the write pointer offset to evaluate it, instead.

ASTERISK-25857 #close

Change-Id: If686b5d570473eb926693c73461177b35b13b186

9 years agoMerge "chan_sip.c: Simplify sip_pvt destructor call levels." into 11
zuul [Wed, 16 Mar 2016 17:14:20 +0000 (12:14 -0500)] 
Merge "chan_sip.c: Simplify sip_pvt destructor call levels." into 11

9 years agochan_sip.c: Simplify sip_pvt destructor call levels. 88/2388/1
Richard Mudgett [Tue, 8 Mar 2016 00:56:05 +0000 (18:56 -0600)] 
chan_sip.c: Simplify sip_pvt destructor call levels.

Remove destructor calling destroy_it calling really_destroy_it
for no benefit.  Just make the destructor the really_destroy_it
function.

Change-Id: Idea0d47b27dd74f2488db75bcc7f353d8fdc614a

9 years agochan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full(). 86/2386/1
Richard Mudgett [Sat, 5 Mar 2016 00:25:21 +0000 (18:25 -0600)] 
chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().

Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12

9 years agoapp_chanspy: Fix occasional deadlock with ChanSpy and Local channels. 74/2374/3
Walter Doekes [Fri, 11 Mar 2016 21:57:30 +0000 (22:57 +0100)] 
app_chanspy: Fix occasional deadlock with ChanSpy and Local channels.

Channel masquerading had a conflict with autochannel locking.

When locking autochannel->channel, the channel is fetched from the
autochannel and then locked. During the fetch, the autochannel -- which
has no locks itself -- can be modified by someone who owns the channel
lock. That means that the value of autochan->channel cannot be trusted
until you hold the lock.

In practice, this caused problems with Local channels getting
masqueraded away while the ChanSpy attempted to get info from that
channel. The old channel which was about to get removed got locked, but
the new (replaced) channel got unlocked (no-op). Because the replaced
channel was now locked (and would never get unlocked), it couldn't get
removed from the channel list in a timely manner, and would now cause
deadlocks when iterating over the channel list.

This change checks the autochannel after locking the channel for changes
to the autochannel. If the channel had been changed, the lock is
reobtained on the new channel.

In theory it seems possible that after this fix, the lock attempt on the
old (wrong) channel can be on an already destroyed lock, maybe causing
a crash. But that hasn't been observed in the wild and is harder induce
than the current deadlock.

Thanks go to Filip Frank for suggesting a fix similar to this and
especially to IRC user hexanol for pointing out why this deadlock was
possible and testing this fix. And to Richard for catching my rookie
while loop mistake ;)

ASTERISK-25321 #close

Change-Id: I293ae0014e531cd0e675c3f02d1d118a98683def

9 years agoMerge "chan_sip.c: Suppress T.38 SDP c= line if addr is the same." into 11
zuul [Thu, 25 Feb 2016 00:40:16 +0000 (18:40 -0600)] 
Merge "chan_sip.c: Suppress T.38 SDP c= line if addr is the same." into 11

9 years agochan_sip.c: Suppress T.38 SDP c= line if addr is the same. 86/2286/1
Richard Mudgett [Tue, 23 Feb 2016 20:57:42 +0000 (14:57 -0600)] 
chan_sip.c: Suppress T.38 SDP c= line if addr is the same.

Use the correct comparison function since we only care if the address
without the port is the same.

Change-Id: Ibf6c485f843a1be6dee58a47b33d81a7a8cbe3b0

9 years agores_config_sqlite3: Fix crashes when reading peers from sqlite3 tables 84/2284/1
Christof Lauber [Tue, 16 Feb 2016 14:14:15 +0000 (15:14 +0100)] 
res_config_sqlite3: Fix crashes when reading peers from sqlite3 tables

Introduced realloaction of ast_str buf in sqlite3_escape functions in case
the returned buffer from threadstorage was actually too small.

Change-Id: I3c5eb43aaade93ee457943daddc651781954c445

9 years agoMerge "app_queue: fix Calculate talktime when is first call answered" into 11
Joshua Colp [Thu, 18 Feb 2016 19:38:22 +0000 (13:38 -0600)] 
Merge "app_queue: fix Calculate talktime when is first call answered" into 11

9 years agoapp_queue: fix Calculate talktime when is first call answered 69/2269/1
Rodrigo Ramírez Norambuena [Wed, 17 Feb 2016 05:37:43 +0000 (02:37 -0300)] 
app_queue: fix Calculate talktime when is first call answered

Fix calculate of average time for talktime is wrong when is completed the
first call beacuse the time for talked would be that call.

ASTERISK-25800 #close

Change-Id: I94f79028935913cd9174b090b52bb300b91b9492

9 years agocel.c: Fix mismatch in ast_cel_track_event() return type. 65/2265/1
Richard Mudgett [Wed, 17 Feb 2016 19:30:06 +0000 (13:30 -0600)] 
cel.c: Fix mismatch in ast_cel_track_event() return type.

The return type of ast_cel_track_event() is not large enough to return all
64 potential bits of the event enable mask.  Fortunately, the defined CEL
events do not really need all 64 bits and the return value is only used to
determine if the requested CEL event is enabled.

* Made the ast_cel_track_event() return 0 or 1 only so the return value
can fit inside an int type instead of zero or a truncated 64 bit non-zero
value.

Change-Id: I783d932320db11a95c7bf7636a72b6fe2566904c

9 years agomain/asterisk.c: Reverse #if statement in listener() to fix code folding. 44/2244/1
Corey Farrell [Sat, 21 Feb 2015 02:51:35 +0000 (02:51 +0000)] 
main/asterisk.c: Reverse #if statement in listener() to fix code folding.

listener() opens the same code block in two places (#if and #else).  This
confuses some folding editors causing it to think that an extra code block
was opened.  Folding in 'geany' causes all code after listener() to be
folded as if it were part of that procedure.

ASTERISK-24813 #close

Change-Id: I4b8c766e6c91e327dd445e8c18f8a6f268acd961

9 years agofunc_iconv: Ensure output strings are properly terminated. 38/2238/1
Sean Bright [Thu, 11 Feb 2016 17:21:42 +0000 (12:21 -0500)] 
func_iconv: Ensure output strings are properly terminated.

ASTERISK-25272 #close
Reported by: Etienne Lessard
patches:
 AST-25272.patch submitted by Etienne Lessard (license #6394)

Change-Id: Id75ad202300960a1e91afe15e319d992936ecc17

9 years agoMerge "Build: Fix menuselect USAN conflicts" into 11
zuul [Wed, 10 Feb 2016 20:32:07 +0000 (14:32 -0600)] 
Merge "Build: Fix menuselect USAN conflicts" into 11

9 years agoBuild: Added testing compiler to support the system sanitizes 34/2234/1
Badalyan Vyacheslav [Wed, 10 Feb 2016 05:40:32 +0000 (05:40 +0000)] 
Build: Added testing compiler to support the system sanitizes

In older versions of the compiler was not sanitizes.
Compilers other than GCC can not support the Usan and TSAN
or have other options for *FLAGS.

ASTERISK-25767 #close
Reported by: Badalyan Vyacheslav
Tested by: Badalyan Vyacheslav

Change-Id: Iefce6608221fa87884b82ae3cb5649b7b1804916

9 years agoBuild: Fix menuselect USAN conflicts 29/2229/2
Badalyan Vyacheslav [Wed, 10 Feb 2016 02:57:38 +0000 (02:57 +0000)] 
Build: Fix menuselect USAN conflicts

USAN can be used together with other sanitizers.

Reported by: Badalyan Vyacheslav
Tested by: Badalyan Vyacheslav

Change-Id: I3bffa350d70965c3026651dba3a12414d0aaa45f

9 years agoSimplify and fix conditional in FD_SET. 20/2220/1
Corey Farrell [Tue, 9 Feb 2016 20:21:05 +0000 (15:21 -0500)] 
Simplify and fix conditional in FD_SET.

FD_SET contains a conditional statement to protect against buffer
overruns.  The statement was overly complicated and prevented use
of the last array element of ast_fdset.  We now just verify the fd
is less than ast_FDMAX.

Change-Id: I41895c0b497b052aef5bf49d75c817c48b326f40

9 years agochan_misdn: Fix a few issues causing compile errors 10/2210/2
George Joseph [Fri, 5 Feb 2016 16:29:00 +0000 (09:29 -0700)] 
chan_misdn: Fix a few issues causing compile errors

Change-Id: I54b48c24d7ca88ed80496fdfd142d08772a7ab98

9 years agoMerge topic 'ASTERISK-20987' into 11
Joshua Colp [Fri, 5 Feb 2016 17:49:04 +0000 (11:49 -0600)] 
Merge topic 'ASTERISK-20987' into 11

* changes:
  app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.
  app_confbridge: Make non-admin users join a muted conference muted.

9 years agoCheck for OpenSSL defines before trying to use them. 03/2203/1
Mark Michelson [Thu, 4 Feb 2016 22:17:55 +0000 (16:17 -0600)] 
Check for OpenSSL defines before trying to use them.

The SSL_OP_NO_TLSv1_1 and SSL_OP_NO_TLSv1_2 defines did not exist prior
to OpenSSL version 1.0.1. A recent commit attempts to, by default, set
these options, which can cause problems on systems with older OpenSSL
installations.

This commit adds a configure script check for those defines and will not
attempt to make use of those if they do not exist. We will print a
warning urging the user to upgrade their OpenSSL installation if those
defines are not present.

Change-Id: I6a2eb9a43fd0738b404d8f6f2cf4b5c22d9d752d

9 years agoMerge "res_xmpp: Does not connect in component mode" into 11
Joshua Colp [Thu, 4 Feb 2016 18:26:41 +0000 (12:26 -0600)] 
Merge "res_xmpp: Does not connect in component mode" into 11

9 years agoMerge "AST-2016-003 udptl.c: Fix uninitialized values." into 11
Kevin Harwell [Wed, 3 Feb 2016 21:19:01 +0000 (15:19 -0600)] 
Merge "AST-2016-003 udptl.c: Fix uninitialized values." into 11

9 years agoMerge "AST-2016-002 chan_sip.c: Fix retransmission timeout integer overflow." into 11
Kevin Harwell [Wed, 3 Feb 2016 21:16:29 +0000 (15:16 -0600)] 
Merge "AST-2016-002 chan_sip.c: Fix retransmission timeout integer overflow." into 11

9 years agoAST-2016-001 http: Provide greater control of TLS and set modern defaults. 60/2160/3
Joshua Colp [Wed, 3 Feb 2016 18:02:01 +0000 (14:02 -0400)] 
AST-2016-001 http: Provide greater control of TLS and set modern defaults.

This change exposes the configuration of various aspects of the TLS
support and sets the default to the modern standards.

The TLS cipher is now set to the best values according to the
Mozilla OpSec team, different TLS versions can now be disabled, and
the cipher order can be forced to be that of the server instead of
the client.

ASTERISK-24972 #close

Change-Id: I7485bc48585979a93a131b01d435e54e6e7d5b97

9 years agoAST-2016-003 udptl.c: Fix uninitialized values. 77/2177/2
Richard Mudgett [Mon, 7 Dec 2015 18:46:53 +0000 (12:46 -0600)] 
AST-2016-003 udptl.c: Fix uninitialized values.

Sending UDPTL packets to Asterisk with the right amount of missing
sequence numbers and enough redundant 0-length IFP packets, can make
Asterisk crash.

ASTERISK-25603 #close
Reported by: Walter Doekes

ASTERISK-25742 #close
Reported by: Torrey Searle

Change-Id: I97df8375041be986f3f266ac1946a538023a5255

9 years agoAST-2016-002 chan_sip.c: Fix retransmission timeout integer overflow. 69/2169/2
Richard Mudgett [Mon, 28 Sep 2015 22:07:42 +0000 (17:07 -0500)] 
AST-2016-002 chan_sip.c: Fix retransmission timeout integer overflow.

Setting the sip.conf timert1 value to a value higher than 1245 can cause
an integer overflow and result in large retransmit timeout times.  These
large timeout times hold system file descriptors hostage and can cause the
system to run out of file descriptors.

NOTE: The default sip.conf timert1 value is 500 which does not expose the
vulnerability.

* The overflow is now detected and the previous timeout time is
calculated.

ASTERISK-25397 #close
Reported by: Alexander Traud

Change-Id: Ia7231f2f415af1cbf90b923e001b9219cff46290

9 years agores_xmpp: Does not connect in component mode 41/2141/2
Karsten Wemheuer [Tue, 2 Feb 2016 10:05:15 +0000 (11:05 +0100)] 
res_xmpp: Does not connect in component mode

The module res_xmpp does not accept usernames in the form used in component
mode (XEP-0114). In component mode there is no @something in the name.
In component mode the connection is now not dropped anymore.

If the xmpp server sends out a "stream" tag before handshake is finished,
the connection gets dropped in res_xmpp. Now this tag will be ignored and
the connection will be established.

After connecting there will be an exchange of presence states. This does
not work as expected in component mode. The responsible function
"xmpp_pak_presence" is left before the states get sent out. Sending
presence states in component mode is now moved to the top of the function.

ASTERISK-25735 #close

Change-Id: I70e036f931c3124ebb2ad1e56f93ed35cfdd9d5c

9 years agochan_sip.c: AMI & CLI notify methods get different values of asterisk's own ip. 28/2128/2
StefanEng86 [Fri, 29 Jan 2016 13:39:06 +0000 (14:39 +0100)] 
chan_sip.c: AMI & CLI notify methods get different values of asterisk's own ip.

When I ask asterisk to send a SIP NOTIFY message to a sip peer using either a)
AMI action: SIPnotify or b) cli command: sip notify <cmd> <peer>, I expect
asterisk to include the same value for its own ip in both cases a) and b),
but it seems a) produces a contact header like Contact:
<sip:asterisk@192.168.1.227:8060> whereas b) produces a contact header like
<sip:asterisk@127.0.0.1:8060>. 0.0.0.0:8060 is my udpbindaddr in sip.conf

My guess is that manager_sipnotify should call
ast_sip_ouraddrfor(&p->sa, &p->ourip, p) the same way sip_cli_notify does,
because after applying this patch, both cases a) and b) produce
the contact header that I expect: <sip:asterisk@192.168.1.227:8060>

Reported by: Stefan Engström
Tested by: Stefan Engström

Change-Id: I86af5e209db64aab82c25417de6c768fb645f476

9 years agobuild_system: Prevent goals needing makeopts from running when it's missing 00/2100/1
George Joseph [Wed, 27 Jan 2016 16:29:13 +0000 (09:29 -0700)] 
build_system: Prevent goals needing makeopts from running when it's missing

The Makefile only optionally includes makeopts so when goals like uninstall that
dont depend on anything else are run after a distclean, rules like
'rm -f "$(DESTDIR)$(ASTMODDIR)/"*' get run as 'rm -f ""/*' which attempts
to remove everything in the root directory.

Although there's a rule defined for makeopts which prints a message and does
an 'exit 1', since '-include makepopts' was specified (with the -), the exit
was ignored letting the rest of the rules run.

This patch makes makeopts required unless the goal has the string 'clean' in it.

ASTERISK-25730 #close
Reported-by: George Joseph
Change-Id: I1bce59a7ea4f48e7a468e22b2abbb13c63417ac7

9 years agoapp_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation. 06/2106/1
Richard Mudgett [Tue, 26 Jan 2016 23:59:28 +0000 (17:59 -0600)] 
app_confbridge.c: Update CONFBRIDGE and CONFBRIDGE_INFO documentation.

Change-Id: Ic1f9e22ba1f2ff3b3f5cb017c5ddcd9bd48eccc7

9 years agoapp_confbridge: Make non-admin users join a muted conference muted. 05/2105/1
Richard Mudgett [Mon, 25 Jan 2016 21:48:04 +0000 (15:48 -0600)] 
app_confbridge: Make non-admin users join a muted conference muted.

ASTERISK-20987 #close
Reported by: hristo

Change-Id: Ic61a2b524ab3a4cfadf227fc6b3506527bc03f38

9 years agosounds/Makefile: Incremented core and extra sounds versions to 1.5 93/2093/2
Rusty Newton [Mon, 25 Jan 2016 22:56:04 +0000 (16:56 -0600)] 
sounds/Makefile: Incremented core and extra sounds versions to 1.5

Core and extra sounds 1.5 was recently released! The tarballs contain
change descriptions however I figure more people will see this one so
I'll try to be a bit detailed. Approximately 60 sounds were moved from Extra
to Core for en, en_GB, fr and added for languages that didn't already
have Extra sound sets (it,ja,ru).

In addition all of the English and Russian sounds have been completely
re-recorded.

Sounds moved and added:
activated,added,all-circuits-busy-now,astcc-followed-by-pound
at-tone-time-exactly,call-forwarding,call-fwd-no-ans,call-fwd-on-busy
,call-fwd-unconditional,calling,call-waiting,cancelled,
cannot-complete-as-dialed,check-number-dial-again,conf-full,de-activated
,disabled,do-not-disturb,enabled,enter-num-blacklist,entr-num-rmv-blklist
,extension,feature-not-avail-line,for,from-unknown-caller,goodbye,hello
,if-correct-press,im-sorry,info-about-last-call,is,is-in-use,is-set-to
,location,number,number-not-answering,num-was-successfully,one-moment-please
,please-try-again,pls-hold-while-try,pls-try-call-later,pm-invalid-option
,privacy-to-blacklist-last-caller,removed,simul-call-limit-reached
,something-terribly-wrong,sorry,sorry-youre-having-problems,speed-dial
,speed-dial-empty,telephone-number,time,to-call-this-number,to-extension
,to-listen-to-it,to-rerecord-it,unidentified-no-callback,with,you-entered
,your

There were also a few random fixes here and there to file names for a few
of the languages.

ASTERISK-25068 #close

Change-Id: I2b594344ec585d7dfd922b40c1af43b1508828b3

9 years agochan_sip: Fix buffer overrun in sip_sipredirect. 80/2080/1
Corey Farrell [Mon, 25 Jan 2016 17:03:21 +0000 (12:03 -0500)] 
chan_sip: Fix buffer overrun in sip_sipredirect.

sip_sipredirect uses sscanf to copy up to 256 characters to a stacked buffer
of 256 characters.  This patch reduces the copy to 255 characters to leave
room for the string null terminator.

ASTERISK-25722 #close

Change-Id: Id6c3a629a609e94153287512c59aa1923e8a03ab

9 years agologger.c: Fix buffer overrun found by address sanitizer. 69/2069/1
Richard Mudgett [Fri, 22 Jan 2016 17:48:24 +0000 (11:48 -0600)] 
logger.c: Fix buffer overrun found by address sanitizer.

The null terminator of the tail struct member was not being allocated
when no logger.conf config file is installed.

ASTERISK-25714 #close
Reported by: Badalian Vyacheslav

Change-Id: I45770fdd08af39506a3bc33ba279c4f16e047a30

9 years agomain/asterisk.c: ast_el_read_char 59/2059/1
Diederik de Groot [Mon, 18 Jan 2016 09:49:48 +0000 (10:49 +0100)] 
main/asterisk.c: ast_el_read_char

Make sure buf[res] is not accessed at res=-1 (buffer underrun).
Address Sanitizer will complain about this quite loudly.

ASTERISK-24801 #close

Change-Id: Ifcd7f691310815a31756b76067c56fba299d3ae9

9 years agotaskprocessor.c: Fix endless loop in CLI "core show taskprocessor" 33/2033/1
Richard Mudgett [Mon, 18 Jan 2016 22:38:12 +0000 (16:38 -0600)] 
taskprocessor.c: Fix endless loop in CLI "core show taskprocessor"

Revert 48dd99d2b4d6938b528f9f6aca98d36b60c5513b which caused an infinite
loop only in v11.

ASTERISK-25701 #close
Reported by: ibercom

Change-Id: I0d9103f4dc03fa31bb8d5e7a7a73b467bbac5349

9 years agomain/config: Clean config maps on shutdown. 26/2026/1
Corey Farrell [Sat, 16 Jan 2016 01:52:26 +0000 (20:52 -0500)] 
main/config: Clean config maps on shutdown.

ASTERISK-25700 #close

Change-Id: I096da84f9c62c6095f68bcf98eac4b7c7868e808

9 years agoastmm.c: Add more stats to CLI "memory show" commands. 21/2021/1
Richard Mudgett [Thu, 14 Jan 2016 00:20:57 +0000 (18:20 -0600)] 
astmm.c: Add more stats to CLI "memory show" commands.

* Add freed regions totals to allocations and summary.

* Add totals for all allocations and not just the selected allocations.

Change-Id: I61d5a5112617b0733097f2545a3006a344b4032a

9 years agoapp: Queue hangup if channel is hung up during sub or macro execution. 97/1997/2
Joshua Colp [Tue, 12 Jan 2016 17:14:29 +0000 (13:14 -0400)] 
app: Queue hangup if channel is hung up during sub or macro execution.

This issue was exposed when executing a connected line subroutine.
When connected or redirected subroutines or macros are executed it is
expected that the underlying applications and logic invoked are fast
and do not consume frames. In practice this constraint is not enforced
and if not adhered to will cause channels to continue when they shouldn't.
This is because each caller of the connected or redirected logic does not
check whether the channel has been hung up on return. As a result the
the hung up channel continues.

This change makes it so when the API to execute a subroutine or
macro is invoked the channel is checked to determine if it has hung up.
If it has then a hangup is queued again so the caller will see it
and stop.

ASTERISK-25690 #close

Change-Id: I1f9a8ceb1487df0389f0d346ce0f6dcbcaf476ea

9 years agores_musiconhold: Prevent multiple simultaneous reloads. 00/2000/3
Sean Bright [Wed, 13 Jan 2016 13:20:24 +0000 (08:20 -0500)] 
res_musiconhold: Prevent multiple simultaneous reloads.

There are two ways in which the reload() function in res_musiconhold can be
called from the CLI:

  * module reload res_musiconhold.so
  * moh reload

In the former case, the module loader holds a lock that prevents multiple
concurrent calls, but in the latter there is no such protection.

This patch changes the 'moh reload' CLI command to invoke the module loader
directly, rather than call reload() explicitly.

ASTERISK-25687 #close

Change-Id: I408968b4c8932864411b7f9ad88cfdc7b9ba711c

9 years agoMerge topic 'update_taskprocessor_commands' into 11
Joshua Colp [Tue, 12 Jan 2016 19:18:42 +0000 (13:18 -0600)] 
Merge topic 'update_taskprocessor_commands' into 11

* changes:
  taskprocessor.c: Fix CLI "core show taskprocessors" unref.
  taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.

9 years agoMerge "ccss.c: Replace space in taskprocessor name." into 11
Joshua Colp [Tue, 12 Jan 2016 19:17:40 +0000 (13:17 -0600)] 
Merge "ccss.c: Replace space in taskprocessor name." into 11

9 years agoMerge "app_queue: Add member flag "in_call" to prevent reading wrong lastcall time...
Joshua Colp [Tue, 12 Jan 2016 12:05:16 +0000 (06:05 -0600)] 
Merge "app_queue: Add member flag "in_call" to prevent reading wrong lastcall time" into 11

9 years agoMerge "pbx: Deadlock between contexts container and context_merge locks" into 11
Joshua Colp [Mon, 11 Jan 2016 23:37:05 +0000 (17:37 -0600)] 
Merge "pbx: Deadlock between contexts container and context_merge locks" into 11

9 years agoMerge "pbx_dundi: Run cleanup on failed load." into 11
Joshua Colp [Mon, 11 Jan 2016 22:55:03 +0000 (16:55 -0600)] 
Merge "pbx_dundi: Run cleanup on failed load." into 11

9 years agoMerge "res_crypto: Perform cleanup at shutdown." into 11
Joshua Colp [Mon, 11 Jan 2016 22:35:23 +0000 (16:35 -0600)] 
Merge "res_crypto: Perform cleanup at shutdown." into 11

9 years agoMerge "res_calendar: Cleanup scheduler context at unload." into 11
Joshua Colp [Mon, 11 Jan 2016 20:35:45 +0000 (14:35 -0600)] 
Merge "res_calendar: Cleanup scheduler context at unload." into 11

9 years agoMerge "manager: Cleanup manager_channelvars during shutdown." into 11
Joshua Colp [Mon, 11 Jan 2016 20:35:29 +0000 (14:35 -0600)] 
Merge "manager: Cleanup manager_channelvars during shutdown." into 11

9 years agopbx: Deadlock between contexts container and context_merge locks 60/1960/2
Kevin Harwell [Wed, 6 Jan 2016 19:03:28 +0000 (13:03 -0600)] 
pbx: Deadlock between contexts container and context_merge locks

Recent changes (ASTERISK-25394 commit 2bd27d12223fe33b58c453965ed5c6ed3af7c4f5)
introduced the possibility of a deadlock. Due to the mentioned modifications
ast_change_hints now needs to keep both merge/delete and state callbacks from
occurring while it executes. Unfortunately, sometimes ast_change_hints can be
called with the contexts container locked. When this happens it's possible for
another thread to grab the context_merge_lock before the thread calling into
ast_change_hints does and then try to obtain the contexts container lock. This
of course causes a deadlock between the two threads. The thread calling into
ast_change_hints waits for the other thread to release context_merge_lock and
the other thread is waiting on that one to release the contexts container lock.

Unfortunately, there is not a great way to fix this problem. When hints change,
the subsequent state callbacks cannot run at the same time as a merge/delete,
nor when the usual state callbacks do. This patch alleviates the problem by
having those particular callbacks (the ones run after a hint change) occur in a
serialized task. By moving the context_merge_lock to a task it can now safely be
attempted or held without a deadlock occurring.

ASTERISK-25640 #close
Reported by: Krzysztof Trempala

Change-Id: If2210ea241afd1585dc2594c16faff84579bf302

9 years agodevicestate: Cleanup engine thread during graceful shutdown. 85/1985/1
Corey Farrell [Sun, 10 Jan 2016 23:08:16 +0000 (18:08 -0500)] 
devicestate: Cleanup engine thread during graceful shutdown.

ASTERISK-25681 #close

Change-Id: I64337c70f0ebd8c77f70792042684607c950c8f1

9 years agomanager: Cleanup manager_channelvars during shutdown. 81/1981/1
Corey Farrell [Sun, 10 Jan 2016 19:40:11 +0000 (14:40 -0500)] 
manager: Cleanup manager_channelvars during shutdown.

ASTERISK-25680 #close

Change-Id: I3251d781cbc3f48a6a7e1b969ac4983f552b2446

9 years agores_calendar: Cleanup scheduler context at unload. 78/1978/1
Corey Farrell [Sun, 10 Jan 2016 19:27:57 +0000 (14:27 -0500)] 
res_calendar: Cleanup scheduler context at unload.

ASTERISK-25679 #close

Change-Id: I839159bf6882cccc1b23494c7aa2bc2a2624613f

9 years agopbx_dundi: Run cleanup on failed load. 70/1970/1
Corey Farrell [Sun, 10 Jan 2016 00:04:34 +0000 (19:04 -0500)] 
pbx_dundi: Run cleanup on failed load.

During failed startup of pbx_dundi no cleanup was performed.  Add a call
to unload_module before returning AST_MODULE_LOAD_DECLINE.

ASTERISK-25677 #close

Change-Id: I8ffa226fda4365ee7068ac1f464473f1a4ebbb29

9 years agores_crypto: Perform cleanup at shutdown. 67/1967/1
Corey Farrell [Sat, 9 Jan 2016 19:28:31 +0000 (14:28 -0500)] 
res_crypto: Perform cleanup at shutdown.

This change causes res_crypto to unregister CLI at shutdown while still
preventing the module from being unloaded.

ASTERISK-25673 #close

Change-Id: Ie5d57338dc2752abfc0dd05d0eec86413f2304fc

9 years agoinclude/asterisk/time.h: Renamed global declaration:tv 35/1935/1
Diederik de Groot [Thu, 7 Jan 2016 09:21:03 +0000 (10:21 +0100)] 
include/asterisk/time.h: Renamed global declaration:tv

Renamed global declaration:tv to dummy_tv_var_for_types,
which would oltherwise cause 'shadow' warnings when 'tv'
was declared as a local variable elsewhere.

Added comment to note that dummy_tv_var_for_types is never
really exported and only used as a place holder.

ASTERISK-25627 #close

Change-Id: I9a6e17995006584f3627efe8988e3f8aa0f5dc28

9 years agotaskprocessor.c: Fix CLI "core show taskprocessors" unref. 40/1940/1
Richard Mudgett [Fri, 8 Jan 2016 03:07:49 +0000 (21:07 -0600)] 
taskprocessor.c: Fix CLI "core show taskprocessors" unref.

Change-Id: I1d9f4e532caa6dfabe034745dd16d06134efdce5

9 years agoccss.c: Replace space in taskprocessor name. 38/1938/1
Richard Mudgett [Thu, 7 Jan 2016 01:00:27 +0000 (19:00 -0600)] 
ccss.c: Replace space in taskprocessor name.

The CLI "core ping taskprocessor" command does not work very
well with taskprocessor names that have spaces in them.  You
have to put quotes around the name so using tab completion
becomes awkward.

Change-Id: I29e806dd0a8a0256f4e2e0a7ab88c9e19ab0eda0

9 years agotaskprocessor.c: Add CLI "core ping taskprocessor" missing unlock. 39/1939/1
Richard Mudgett [Tue, 5 Jan 2016 22:54:06 +0000 (16:54 -0600)] 
taskprocessor.c: Add CLI "core ping taskprocessor" missing unlock.

Change-Id: I78247e0faf978bf850b5ba4e9f4933ab3c59d17b

9 years agoMerge "cel/cel_radius: Fix wrong pointer." into 11
Joshua Colp [Wed, 6 Jan 2016 18:02:52 +0000 (12:02 -0600)] 
Merge "cel/cel_radius: Fix wrong pointer." into 11

9 years agocel/cel_radius: Fix wrong pointer. 22/1922/1
Aaron An [Mon, 4 Jan 2016 10:26:55 +0000 (18:26 +0800)] 
cel/cel_radius: Fix wrong pointer.

The macro ADD_VENDOR_CODE defined in the cel_radius.c should use the parameter
y not the address of y.

I capture the radius UDP packet via tcpdump, and the AV pairs are not correct,
then i review the source code and compare it with cdr/cdr_radius.c. Fix it and
 it works.

ASTERISK-25647 #close
Reported by: Aaron An
Tested by: Aaron An

Change-Id: I72889bccd8fde120d47aa659edc0e7e6d4d019f0

9 years agoasterisk.h: Add ASTERISK_REGISTER_FILE macro 19/1919/1
George Joseph [Tue, 5 Jan 2016 20:52:16 +0000 (13:52 -0700)] 
asterisk.h: Add ASTERISK_REGISTER_FILE macro

The 11/13 branches and master use 2 different file version macros. 11/13
uses ASTERISK_FILE_VERSION but master uses ASTERISK_REGISTER_FILE. This
means a new file added to 11/13 can't just be cherry-picked to master
because the macro has to be changed.

To make cherry-picking possible, ASTERISK_REGISTER_FILE was added
to asterisk.h as a simple alias for ASTERISK_FILE_VERSION(__FILE__, NULL)
The "$Revision$" tag doesn't do anything since Asterisk moved to git so
just passing NULL as the verison works fine.  asterisk.h was also
annotated to deprecate ASTERISK_FILE_VERSION and suggest using
ASTERISK_REGISTER_FILE for all new files.

Change-Id: I5867ed898818d26ee49bb6e5c7d4c1a45d4789a5

9 years agoapp_queue: Add member flag "in_call" to prevent reading wrong lastcall time 81/1881/3
Martin Tomec [Tue, 29 Dec 2015 11:44:29 +0000 (12:44 +0100)] 
app_queue: Add member flag "in_call" to prevent reading wrong lastcall time

Member lastcall time is updated later than member status. There was chance to
check wrapuptime for available member with wrong (old) lastcall time.
New boolean flag "in_call" is set to true right before connecting call, and
reset to false after update of lastcall time. Members with "in_call" set to true
are treat as unavailable.

ASTERISK-19820 #close

Change-Id: I1923230cf9859ee51563a8ed420a0628b4d2e500

9 years agoapp_dial: Immediately exit dial if the caller is already hung up. 02/1902/1
Richard Mudgett [Fri, 4 Dec 2015 23:22:29 +0000 (17:22 -0600)] 
app_dial: Immediately exit dial if the caller is already hung up.

If a caller hangs up before dial is executed within an AGI then the AGI
has likely eaten all queued frames before executing the dial in DeadAGI
mode.  With the caller hung up and no pending frames from the caller's
read queue, dial would not know that the call has hung up until a called
channel answers.  It is rather annoying to whoever just answered the
non-existent call.

Dial should not continue execution in DeadAGI mode, hangup handlers, or
the h exten.

* Added a check early in dial to abort dialing if the caller has hungup.

ASTERISK-25307 #close
Reported by: David Cunningham

Change-Id: Icd1bc0764726ef8c809f76743ca008d0f102f418

9 years agoMerge "res_http_websocket.c: prevent avoidable disconnections caused by write errors...
Joshua Colp [Thu, 31 Dec 2015 00:43:28 +0000 (18:43 -0600)] 
Merge "res_http_websocket.c: prevent avoidable disconnections caused by write errors" into 11

9 years agotest_time: Provide a timeout when waiting. 75/1875/1
Joshua Colp [Mon, 28 Dec 2015 20:02:19 +0000 (16:02 -0400)] 
test_time: Provide a timeout when waiting.

The test_timezone_watch unit test is written to expect a
condition to be signaled when the inotify daemon thread runs.
There exists a small window where the test_timezone_watch
thread can signal the inotify daemon thread while it is not
reading on the underlying file descriptor. If this occurs
the test_timezone_watch thread will wait indefinitely for a
signal that will never arrive.

This change adds a timeout to the condition so it will return
regardless after a period of time.

Change-Id: Ifed981879df6de3d93acd3ee0a70f92546517390

9 years agores_http_websocket.c: prevent avoidable disconnections caused by write errors 63/1863/2
Dade Brandon [Fri, 25 Dec 2015 04:19:59 +0000 (20:19 -0800)] 
res_http_websocket.c: prevent avoidable disconnections caused by write errors

Updated ast_websocket_write to encode the entire frame in to one
write operation, to ensure that we don't end up with a situation
where the websocket header has been sent, while the body can not
be written.

Previous to August's patch in commit b9bd3c14, certain network
conditions could cause the header to be written, and then the
sub-sequent body to fail - which would cause the next successful
write to contain a new header, and a new body (resulting in
the peer receiving two headers - the second of which would be
read as part of the body for the first header).

This was patched to have both write operations individually fail
by closing the websocket.

In a case available to the submitter of this patch, the same
body which would consistently fail to write, would succeed
if written at the same time as the header.

This update merges the two operations in to one, adds debug messages
indicating the reason for a websocket connection being closed during
a write operation, and clarifies some variable names for code legibility.

Change-Id: I4db7a586af1c7a57184c31d3d55bf146f1a40598

9 years agochan_sip.c: fix websocket_write_timeout default value 68/1868/1
Dade Brandon [Fri, 25 Dec 2015 15:56:44 +0000 (07:56 -0800)] 
chan_sip.c: fix websocket_write_timeout default value

websocket_write_timeout was not being set to its default value
during sip config reload, which meant that prior to this commit,
1) the default value of 100 was not used, unless an invalid value
(or 1) was specified in sip.conf for websocket_write_timeout, and
2) if the websocket_write_timeout directive was removed from sip.conf
without a full restart of asterisk, then the previous value would
continue to be used indefinitely.

This essentially lead to a 0ms write timeout (the first write attempt
in ast_careful_fwrite must have succeeded) in websocket write requests
from chan_sip, unless websocket_write_timeout was explicitely set in sip.conf.

Changes to websocket_write_timeout still only apply to new websocket
sessions, after the sip reload -- timeouts on existing sessions are
not adjusted during sip reload.

Change-Id: Ibed3816ed29cc354af6564c5ab3e75eab72cb953

9 years agores_rtp_asterisk: rtp->ice check not wrapped in USE_PJPROJECT ifdef 50/1850/2
Kevin Harwell [Thu, 24 Dec 2015 16:10:53 +0000 (10:10 -0600)] 
res_rtp_asterisk: rtp->ice check not wrapped in USE_PJPROJECT ifdef

Change-Id: I19b49112e1b630bd04e859f14ccf96f8ebd6b151