]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agoast_str: Fix improper member access to struct ast_str members.
Richard Mudgett [Wed, 19 Nov 2014 16:56:30 +0000 (16:56 +0000)] 
ast_str: Fix improper member access to struct ast_str members.

Accessing members of struct ast_str outside of the string manipulation API
routines is invalid since struct ast_str is supposed to be treated as
opaque.

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

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

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

10 years agores_pjsip_refer: Ensure Refer-To is NULL terminated and parse it as a URI.
Joshua Colp [Wed, 19 Nov 2014 11:50:12 +0000 (11:50 +0000)] 
res_pjsip_refer: Ensure Refer-To is NULL terminated and parse it as a URI.

There is no guarantee that when we get a Refer-To that it will be NULL terminated.
As the URI parsing function requires it to be we now NULL terminate it.

Additionally parsing the Refer-To as a 'To' header is needless and it can
simply be done as a URI. This also fixes a problem where certain Refer-To headers
would not be parsed as a 'To' header causing the REFER to fail.

ASTERISK-24508 #close
Reported by: Beppo Mazzucato

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

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

10 years agoparking_tests.c: Add missing newline on a unit test message.
Richard Mudgett [Tue, 18 Nov 2014 18:54:03 +0000 (18:54 +0000)] 
parking_tests.c: Add missing newline on a unit test message.

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

10 years agochan_sip: Fix theoretical leak of p->refer.
Corey Farrell [Mon, 17 Nov 2014 15:59:04 +0000 (15:59 +0000)] 
chan_sip: Fix theoretical leak of p->refer.

If transmit_refer is called when p->refer is already allocated,
it leaks the previous allocation.  Updated code to always free
previous allocation during a new allocation.  Also instead of
checking if we have a previous allocation, always create a
clean record.

ASTERISK-15242 #close
Reported by: David Woolley
Review: https://reviewboard.asterisk.org/r/4160/
........

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

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

10 years agoapps/app_confbridge: Ensure 'normal' users hear message when last marked leaves
Matthew Jordan [Mon, 17 Nov 2014 15:27:03 +0000 (15:27 +0000)] 
apps/app_confbridge: Ensure 'normal' users hear message when last marked leaves

When r428077 was made for ASTERISK-24522, it failed to take into account users
who are neither wait_marked nor end_marked. These users are *also* supposed to
hear the 'leader has left the conference' message. Granted, this behaviour is
a bit odd; however, that is how it used to work... and behaviour changes are
not good.

This patch ensures that if there are any 'normal' users present when the last
marked user leaves the conference, the message will still be played to them.

Note that this regression was caught by the Asterisk Test Suite's
confbridge_nominal test, which has a quirky combination of users.
........

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

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

10 years agotests/test_cel: Fix CEL unit tests
Matthew Jordan [Mon, 17 Nov 2014 15:15:30 +0000 (15:15 +0000)] 
tests/test_cel: Fix CEL unit tests

This is a backport of the test_cel portion of r427870, which was not applied to
the 12 branch. This fixes the compilation issues with the CEL unit tests
introduced by the API changes needed to fix publication of blind transfer
messages.

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

10 years agoapp_confbridge: Don't play leader leaving prompt if no one will hear it
Matthew Jordan [Mon, 17 Nov 2014 03:06:31 +0000 (03:06 +0000)] 
app_confbridge: Don't play leader leaving prompt if no one will hear it

Consider the following:
- A marked user in a conference
- One or more end_marked only users in the conference

When the marked users leaves, we will be in the conf_state_multi_marked state.
This currently will traverse the users, kicking out any who have the end_marked
flags. When they are kicked, a full ast_bridge_remove is immediately called on
the channels. At this time, we also unilaterally set the need_prompt flag.

When the need_prompt flag is set, we then playback a sound to the bridge
informing everyone that the leader has left; however, no one is left in the
bridge. This causes some odd behaviour for the end_marked users - they are
stuck waiting for the bridge to be unlocked. This results in them waiting for
5 or 6 seconds of dead air before hearing that they've been kicked.

Unfortunately, we do have to keep the bridge locked while we're playing back
the 'leader-has-left' prompt. If there are any wait_marked users in the
conference, this behaviour can't be easily changed - but we do make the case
of the end_marked users better with this patch.

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

ASTERISK-24522 #close
Reported by: Matt Jordan
........

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

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

10 years agochan_pjsip: Remove AOR check when dialing and one is specified.
Joshua Colp [Sun, 16 Nov 2014 21:11:55 +0000 (21:11 +0000)] 
chan_pjsip: Remove AOR check when dialing and one is specified.

The AOR value may contain the name of an AOR or a full SIP URI.
Checking if the AOR exists can't be done as a result of this.

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

10 years agochan_pjsip: Add additional log message when an AOR is specified when dialing and...
Joshua Colp [Sat, 15 Nov 2014 21:35:12 +0000 (21:35 +0000)] 
chan_pjsip: Add additional log message when an AOR is specified when dialing and it does not exist.

ASTERISK-24499 #close
Reported by: Rusty Newton

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

10 years agochan_motif / chan_pjsip: Fix incorrect "No such module" messages when reloading.
Joshua Colp [Sat, 15 Nov 2014 18:59:47 +0000 (18:59 +0000)] 
chan_motif / chan_pjsip: Fix incorrect "No such module" messages when reloading.

For chan_motif the direct return value of the underlying config options framework
was passed back. This can relay various states which the module loader would not
interpet as success. It has been changed so only on errors will it report back
an error.

For chan_pjsip the code implemented a dummy reload function which always
returned an error. This has been removed as all configuration is held within
res_pjsip instead.

ASTERISK-23651 #close
Reported by: Rusty Newton

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

10 years agores_pjsip: Enforce requirements for session timer minimum expiration period and norma...
Joshua Colp [Sat, 15 Nov 2014 18:27:56 +0000 (18:27 +0000)] 
res_pjsip: Enforce requirements for session timer minimum expiration period and normal expiration period.

This change enforces the requirements in PJSIP for session timer configuration. The minimum
expiration period must be 90 seconds or higher and the normal expiration period can not
be lower than the minimum expiration period. If either of these were done the code would
assert at session setup time.

ASTERISK-24336 #close
Reported by: Leon Rowland

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

10 years agocel/cel_odbc: Provide microsecond precision in 'eventtime' column when possible
Matthew Jordan [Sat, 15 Nov 2014 16:56:20 +0000 (16:56 +0000)] 
cel/cel_odbc: Provide microsecond precision in 'eventtime' column when possible

This patch adds microsecond precision when inserting a CEL record into a table
with an "eventtime" column of type timestamp, instead of second precision. The
documentation (configs/cel_odbc.conf.sample) was already saying that the
eventtime column included microseconds precision, but that was not the case.

Also, without this patch, if you had a table with an "eventtime" column of
type varchar, you had millisecond precision. With this patch, you also get
microsecond precision in this case.

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

ASTERISK-24283 #close
Reported by: Etienne Lessard
patches:
  cel_odbc_time_precision.patch uploaded by Etienne Lessard (License 6394)
........

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

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

10 years agoDocumentation: Revise explanation of cdr.conf option 'Unanswered'
Jonathan Rose [Fri, 14 Nov 2014 17:41:54 +0000 (17:41 +0000)] 
Documentation: Revise explanation of cdr.conf option 'Unanswered'

ASTERISK-24279 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4109/

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

10 years agostun: correct attribute string padding to match rfc
Scott Griepentrog [Fri, 14 Nov 2014 15:49:32 +0000 (15:49 +0000)] 
stun: correct attribute string padding to match rfc

When sending the USERNAME attribute in an RTP STUN
response, the implementation in append_attr_string
passed the actual length, instead of padding it up
to a multiple of four bytes as required by the RFC
3489.  This change adds separate variables for the
string and padded attributed lengths, and performs
padding correctly.

Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/4139/
........

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

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

10 years agoFix race condition that could result in ARI transfer messages not being sent.
Mark Michelson [Fri, 14 Nov 2014 15:00:45 +0000 (15:00 +0000)] 
Fix race condition that could result in ARI transfer messages not being sent.

From reviewboard:

"During blind transfer testing, it was noticed that tests were failing
occasionally because the ARI blind transfer event was not being sent.
After investigating, I detected a race condition in the blind transfer
code. When blind transferring a single channel, the actual transfer
operation (i.e. removing the transferee from the bridge and directing
them to the proper dialplan location) is queued onto the transferee
bridge channel. After queuing the transfer operation, the blind transfer
Stasis message is published. At the time of publication, snapshots of
the channels and bridge involved are created. The ARI subscriber to the
blind transfer Stasis message then attempts to determine if the bridge
or any of the involved channels are subscribed to by ARI applications.
If so, then the blind transfer message is sent to the applications. The
way that the ARI blind transfer message handler works is to first see
if the transferer channel is subscribed to. If not, then iterate over
all the channel IDs in the bridge snapshot and determine if any of
those are subscribed to. In the test we were running, the lone
transferee channel was subscribed to, so an ARI event should have been
sent to our application. Occasionally, though, the bridge snapshot did
not have any channels IDs on it at all. Why?

The problem is that since the blind transfer operation is handled by a
separate thread, it is possible that the transfer will have completed and
the channels removed from the bridge before we publish the blind transfer
Stasis message. Since the blind transfer has completed, the bridge on
which the transfer occurred no longer has any channels on it, so the
resulting bridge snapshot has no channels on it. Through investigation of
the code, I found that attended transfers can have this issue too for the
case where a transferee is transferred to an application."

The fix employed here is to decouple the creation of snapshots for the transfer
messages from the publication of the transfer messages. This way, snapshots
can be created to reflect what they are at the time of the transfer operation.

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

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

10 years agoapp_confbridge: Play "leader has left" sound even when musiconhold is enabled.
Joshua Colp [Fri, 14 Nov 2014 14:55:40 +0000 (14:55 +0000)] 
app_confbridge: Play "leader has left" sound even when musiconhold is enabled.

Currently if the leader of a conference bridge leaves any participant
that has musiconhold enabled will not hear the "leader has left" sound.
This is because musiconhold is started and THEN the sound is played.

This change makes it so that the sound is played and THEN musiconhold
is started. This provides a better experience for users as they may not
have known previously why they went back to musiconhold.

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

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

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

10 years agores_pjsip_pubsub: Add some casting so that it builds once again.
Joshua Colp [Fri, 14 Nov 2014 14:44:20 +0000 (14:44 +0000)] 
res_pjsip_pubsub: Add some casting so that it builds once again.

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

10 years agoFix a possible race condition where duplicate requests may be handled by separate...
Mark Michelson [Fri, 14 Nov 2014 14:21:55 +0000 (14:21 +0000)] 
Fix a possible race condition where duplicate requests may be handled by separate threads.

If an endpoint retransmits a request, it's possible due to temporary load
that Asterisk may end up processing both requests at the same time in separate
threads. One thread will successfully handle the request, while the other thread
fails to handle the request since the first thread already registered the
transaction with the PJSIP core.

The fix here is to detect the duplicated transaction failure and to silently
absorb the request since another thread should be properly handling the request.

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

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

10 years agores_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash
Kevin Harwell [Thu, 13 Nov 2014 21:56:26 +0000 (21:56 +0000)] 
res_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash

When using a non-default sorcery wizard (in this instance realtime) for
outbound registrations and after adding in an appropriate call to
ast_sorcery_apply_config() (since it is missing) Asterisk will crash after
a stack overflow occurs due to the code infinitely recursing.  The fix entails
removing the outbound registration state dependency from the outbound
registration sorcery object and instead keeping an in memory container that
can be used to lookup the state when needed.

ASTERISK-24514
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4164/

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

10 years agoStasis: Fix StasisEnd message ordering
Kinsey Moore [Thu, 13 Nov 2014 15:42:28 +0000 (15:42 +0000)] 
Stasis: Fix StasisEnd message ordering

This change corrects message ordering in cases where a channel-related
message can be received after a Stasis/ARI application has received the
StasisEnd message. The StasisEnd message was being passed to
applications directly without waiting for the channel topic to empty.

As a result of this fix, other bugs were also identified and fixed:
* StasisStart messages were also being sent directly to apps and are
  now routed through the stasis message bus properly
* Masquerade monitor datastores were being removed at the incorrect
  time in some cases and were causing StasisEnd messages to not be sent
* General refactoring where necessary for the above
* Unsubscription on StasisEnd timing changes to prevent additional
  messages from following the StasisEnd when they shouldn't

A channel sanitization function pointer was added to reduce processing
and AO2 lookups.

Review: https://reviewboard.asterisk.org/r/4163/
ASTERISK-24501 #close
Reported by: Matt Jordan

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

10 years agomain/rtp_engine: Fix crash when processing more than one RTCP report info block
Matthew Jordan [Wed, 12 Nov 2014 23:59:33 +0000 (23:59 +0000)] 
main/rtp_engine: Fix crash when processing more than one RTCP report info block

Asterisk - in res_rtp_asterisk - only understands a single RTCP report info
block. When the RTCP information was refactored in the RTP Engine to be pushed
over the Stasis message bus, I put in the hooks into the engine to handle
multiple RTCP report info blocks, in the hope that a future RTP implementation
would be able to provide that data. Unfortunately, res_rtp_asterisk has a
tendency to "lie":
(1) It will send RTCP reports with a reception_report_count greater than 1
    (which is pulled directly from the RTCP packet itself, so that part is
    correct)
(2) It will only provide a single report block

When the rtp_engine goes to convert this to a JSON blob, hilarity ensues as it
looks for a report block that doesn't exist.

This patch updates the rtp_engine to be a bit more skeptical about what it is
presented with. While this could also be fixed in res_rtp_asterisk, this patch
prefers to fix it in the engine for two reasons:
(1) The engine is designed to work with multiple RTP implementation, and hence
    having it be more robust is a good thing (tm)
(2) res_rtp_asterisk's handling of RTCP information is "fun". It should report
    the correct reception_report_count; ideally it should also be giving us all
    of the blocks - but it is *definitely* not designed to do that. Going down
    that road is a non-trivial effort.

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

ASTERISK-24489 #close
Reported by: Gregory Malsack
Tested by: Gregory Malsack

ASTERISK-24498 #close
Reported by: Beppo Mazzucato
Tested by: Beppo Maazucato

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

10 years agoFix leak in AMI Action Bridge
Corey Farrell [Wed, 12 Nov 2014 20:37:01 +0000 (20:37 +0000)] 
Fix leak in AMI Action Bridge

Add missing reference cleanup for newly created bridge.

ASTERISK-24281
Reported by: Stefan Engström
Review: https://reviewboard.asterisk.org/r/4154/

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

10 years agopbx: Fix off-nominal case where a freed extension may still be used.
Joshua Colp [Wed, 12 Nov 2014 16:11:37 +0000 (16:11 +0000)] 
pbx: Fix off-nominal case where a freed extension may still be used.

If during the operation of adding an extension a priority is added but
fails it is possible for the extension to be freed but still exist in
the PBX core. If this occurs subsequent lookups may try to access the
extension and end up in freed memory.

This change removes the extension from the PBX core when the priority
addition fails and then frees the extension.

ASTERISK-24444 #close
Reported by: Leandro Dardini

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

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

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

10 years agoFix compiler error when using ./configure --enable-dev-mode --enable-coverage
Corey Farrell [Wed, 12 Nov 2014 13:45:34 +0000 (13:45 +0000)] 
Fix compiler error when using ./configure --enable-dev-mode --enable-coverage

When DONT_OPTIMIZE is enabled with dev-mode, it causes a shadow compilation
to be done with output to /dev/null.  This can cause errors with coverage
when GCC attempts to write to /dev/null.gcno.  This change disables
coverage for the shadow compilation.

ASTERISK-24502 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4151/
........

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

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

10 years agomanager: Fix HTTP connection reference leaks.
Corey Farrell [Sun, 9 Nov 2014 07:58:36 +0000 (07:58 +0000)] 
manager: Fix HTTP connection reference leaks.

Fix reference leak that happens if (session && !blastaway).

ASTERISK-24505 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4153/
........

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

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

10 years agoBlocked revisions 427617
Matthew Jordan [Sun, 9 Nov 2014 01:00:01 +0000 (01:00 +0000)] 
Blocked revisions 427617

........
configs/features.conf: Add documentation noting potential chan_agent conflict

In chan_agent, a '*' is used by default to terminate a bridge with a caller.
This can lead to all sorts of problems if '*' is used by a feature in
features.conf, as the chan_agent disconnect '*' may be detected first.

This patch adds a documentation snippet to features.conf so that users who
attempt to use features with agents know of the potential conflict.

ASTERISK-20402 #close
Reported by: Matt Riddell
patches:
  features.conf.diff uploaded by Matt Riddell (License 5023)

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

10 years agochannels/chan_mgcp: Fix regression which causes gateways to be skipped
Matthew Jordan [Sun, 9 Nov 2014 00:37:25 +0000 (00:37 +0000)] 
channels/chan_mgcp: Fix regression which causes gateways to be skipped

In r227276, a while loop was turned into a for loop. Unfortunately, a portion
of the while loop was left in the code such that, when a static gateway is
encountered in the list of MGCP gateways, the next gateway would be skipped.
At best, we would simply flip past a gateway; at worst, this could lead to a
crash.

ASTERISK-24500 #close
Reported by: Xavier Hienne
patches:
  chan_mgcp.patch uploaded by Xavier Hienne (License 6657)
........

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

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

10 years agoaddons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages
Matthew Jordan [Sun, 9 Nov 2014 00:25:18 +0000 (00:25 +0000)] 
addons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages

When UCS2 character encoding is used, one symbol in national language can be
expanded to 4 bytes. The current buffer used for receiving message in
do_monitor_phone is 256 bytes, which is not large enough for incoming messages.

For example:
* AT+CMGR phone response prefix
  '+CMGR: "REC UNREAD","+7**********",,"14/10/29,13:31:39+12"\r\n' - 60 bytes
* SMS body with UCS2 encoding (max) - 280 bytes
* AT+CMGR phone response suffix '\r\n\r\nOK\r\n' - 8 bytes
* Terminating null character - 1 byte

This results in a needed buffer size of 349 bytes. Hence, this patch opts for a
350 byte buffer.

ASTERISK-24468 #close
Reported by: Dmitriy Bubnov
patches:
  chan_mobile-1_8.diff uploaded by Dmitriy Bubnov (License 6651)
  chan_mobile-trunk.diff uploaded by Dmitry Bubnov (License 6651)
........

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

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

10 years agobridge_native_rtp: Fix T.38 issues with remote bridges
Matthew Jordan [Sun, 9 Nov 2014 00:00:09 +0000 (00:00 +0000)] 
bridge_native_rtp: Fix T.38 issues with remote bridges

After r425242 the fax/sip/directmedia_reinvite_t38 test started failing due to
the surviving channel not being re-INVITEd back from T.38 to audio. This patch
fixes that bug - a deeper explanation of what happened follows.

When two RTP channels are in a native bridge, the bridging layer will
investigate each via the get_rtp_info glue callback. This callback returns the
native bridge preference of the channel *at that moment in time* (that part is
key). At different points during the bridging, the native bridging layer will
inform the RTP capable channels of the status of the bridge via the update_peer
glue callback.

In a T.38 scenario with audio direct media, the sequence of events will often
look like the following:
 * SIP/A and SIP/B both have audio and enter a native bridge.
 * Asterisk re-INVITEs audio between SIP/A and SIP/B directly (via an
   update_peer callback).
 * SIP/A sends a re-INVITE to T.38, which causes Asterisk to send a re-INVITE
   to T.38 to SIP/B. Assuming everyone 200 OKs the process, the UDPTL stack
   receives UDPTL packets in Asterisk from both endpoints. From the perspective
   of the channels, we are now in a local bridge for T.38, even though we are
   technically still in a remote bridge in bridge_native_rtp. (YAY!)
 * When one side hangs up, bridge_native_rtp is told to stop bridging. It then
   re-evaluates the channels and asks them how they are bridged - and since
   T.38 is enabled, they reply with a Local bridge (which is correct), but is
   wrong because the audio portion is still technically in a remote bridge.
 * Asterisk releases the surviving channel, whose audio is *not* re-INVITED
   back to Asterisk as bridge_native_rtp incorrectly assumes that it was in a
   local bridge.

Ironically, prior to r425242, this used to work mostly due to a fluke in the
bridging layer.

The purpose of the get_rtp_info callback shouldn't be modified: it should tell
the bridging layer what kind of bridge the channel prefers at that moment in
time. If you have T.38 enabled, that *must* be a local bridge, as the UDPTPL
stack must be in the media path. As such, this patch does not modify that
part of the code.

However, we have to tell the channels to re-evaluate themselves when they come
out of a native bridge, since we can no longer trust the get_rtp_info callbacks
when the native bridge is being stopped. Something else may have changed in the
channels, and they may now be lying to us. As such, this patch makes it so that
we unilaterally tell the channels that they are no longer bridged via the
update_peer callback. This is actually what the channels expect anyway: code in
both chan_sip and chan_pjsip's callbacks look at the T.38 state and - if they
were in T.38 - send a re-INVITE to get the audio back to Asterisk.

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

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

10 years agochan_console: Fix reference leaks to pvt.
Corey Farrell [Sat, 8 Nov 2014 17:30:06 +0000 (17:30 +0000)] 
chan_console: Fix reference leaks to pvt.

Fix a bunch of calls to get_active_pvt
where the reference is never released.

ASTERISK-24504 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4152/
........

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

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

10 years agoapp_agent_pool: Made agent alert interruptable by DTMF.
Richard Mudgett [Thu, 6 Nov 2014 19:21:26 +0000 (19:21 +0000)] 
app_agent_pool: Made agent alert interruptable by DTMF.

Made agent able to interrupt the alerting beep playback with DTMF.  Any
digit can interrupt if the call does not need to be acknowledged.  Only
the first digit of the acknowledgement can interrupt if the call needs to
be acknowledged.  The agent interrupting the alerting playback builds on
the ASTERISK-24447 patch because it knows what digit interrupted the
playback and needs to be able to pass that digit to the DTMF hook digit
collection code.

ASTERISK-24257 #close
Reported by: Steve Pitts

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

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

10 years agoBridge DTMF hooks: Made audio pass from the bridge while waiting for more matching...
Richard Mudgett [Thu, 6 Nov 2014 18:55:15 +0000 (18:55 +0000)] 
Bridge DTMF hooks: Made audio pass from the bridge while waiting for more matching digits.

* Made collecting DTMF digits for the DTMF feature hooks pass frames from
the bridge.

* Made collecting DTMF digits possible by other bridge hooks if there is a
need.

ASTERISK-24447 #close
Reported by: Richard Mudgett

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

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

10 years agores_pjsip: Ensure in-dialog responses have an endpoint associated.
Joshua Colp [Thu, 6 Nov 2014 18:20:12 +0000 (18:20 +0000)] 
res_pjsip: Ensure in-dialog responses have an endpoint associated.

When handling incoming messages we determine if it is associated with
a dialog. If so we use that to determine what serializer and endpoint
to use for the message. Previously this would pass the endpoint to the
endpoint lookup module to actually place the endpoint completely on the
message. For in-dialog responses, however, this did not occur as
dialog processing took over and the endpoint lookup did not occur.

This change just places the endpoint in the expected spot immediately
instead of relying on the endpoint lookup module. In-dialog responses
thus have the expected endpoint.

AST-1459 #close

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

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

10 years agomain/file.c: fix possible extra ast_module_unref to format modules.
Corey Farrell [Thu, 6 Nov 2014 12:12:47 +0000 (12:12 +0000)] 
main/file.c: fix possible extra ast_module_unref to format modules.

fn_wrapper only adds a reference to the format's module if the file
was able to be opened.  If not this causes an unmatched
ast_module_unref in filestream_destructor.  Move ast_module_ref to
get_stream.

ASTERISK-24492 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4149/
........

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

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

10 years agores_hep: fix major leak that occurs when config is missing or enabled=no.
Corey Farrell [Thu, 6 Nov 2014 09:22:28 +0000 (09:22 +0000)] 
res_hep: fix major leak that occurs when config is missing or enabled=no.

Add missing unreference in hepv3_send_packet.

ASTERISK-24491 #close
Reported by: Zane Conkle
Tested by: Zane Conkle
Review: https://reviewboard.asterisk.org/r/4150/

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

10 years agoFix unintential memory retention in stringfields.
Corey Farrell [Thu, 6 Nov 2014 09:15:15 +0000 (09:15 +0000)] 
Fix unintential memory retention in stringfields.

* Fix missing / unreachable calls to __ast_string_field_release_active.
* Reset pool->used to zero when the current pool->active reaches zero.

ASTERISK-24307 #close
Reported by: Etienne Lessard
Tested by: ibercom, Etienne Lessard
Review: https://reviewboard.asterisk.org/r/4114/
........

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

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

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

10 years agotest_strings: Remove string tests that exercise asserts.
George Joseph [Thu, 6 Nov 2014 02:34:17 +0000 (02:34 +0000)] 
test_strings:  Remove string tests that exercise asserts.

Since unit tests are run with DO_CRASH, those tests were causing
the test to fail.

Tested-by: George Joseph
........

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

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

10 years agoRecorded merge of revisions 427328 from http://svn.asterisk.org/svn/asterisk/branches/11
George Joseph [Wed, 5 Nov 2014 15:05:00 +0000 (15:05 +0000)] 
Recorded merge of revisions 427328 from http://svn.asterisk.org/svn/asterisk/branches/11

........
config: Make text_file_save and 'dialplan save' escape semicolons in values.

When a config file is read, an unescaped semicolon signals comments which are
stripped from the value before it's stored.  Escaped semicolons are then
unescaped and become part of the value.  Both of these behaviors are normal
and expected.  When the config is serialized either by 'dialplan save' or
AMI/UpdateConfig however, the now unescaped semicolons are written as-is.
If you actually reload the file just saved, the unescaped semicolons are
now treated as start of comments.

Since true comments are stripped on read, any semicolons in
ast_variable.value must have been escaped originally.  This patch
re-escapes semicolons in ast_variable.values before they're written to
file either by 'dialplan save' or config/ast_config_text_file_save which
is called by AMI/UpdateConfig. I also fixed a few pre-existing formatting
issues nearby in pbx_config.c

Tested-by: George Joseph
ASTERISK-20127 #close

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

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

10 years agores_pjsip_multihomed: Add logging during startup to aid debugging if local DNS is...
Joshua Colp [Wed, 5 Nov 2014 12:16:54 +0000 (12:16 +0000)] 
res_pjsip_multihomed: Add logging during startup to aid debugging if local DNS is misbehaving.

This change adds a bit of logging so if the local DNS is misbehaving it is easier
to track down what is going on and where Asterisk may be hanging.

ASTERISK-24438 #close
Reported by: Melissa Shepherd

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

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

10 years agoconfig: Make text_file_save and 'dialplan save' escape semicolons in values.
George Joseph [Wed, 5 Nov 2014 00:11:45 +0000 (00:11 +0000)] 
config: Make text_file_save and 'dialplan save' escape semicolons in values.

When a config file is read, an unescaped semicolon signals comments which are
stripped from the value before it's stored.  Escaped semicolons are then
unescaped and become part of the value.  Both of these behaviors are normal
and expected.  When the config is serialized either by 'dialplan save' or
AMI/UpdateConfig however, the now unescaped semicolons are written as-is.
If you actually reload the file just saved, the unescaped semicolons are
now treated as start of comments.

Since true comments are stripped on read, any semicolons in
ast_variable.value must have been escaped originally.  This patch
re-escapes semicolons in ast_variable.values before they're written to
file either by 'dialplan save' or config/ast_config_text_file_save which
is called by AMI/UpdateConfig. I also fixed a few pre-existing formatting
issues nearby in pbx_config.c

Tested-by: George Joseph
ASTERISK-20127 #close

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

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

10 years agoconfig: BUG: Restore ability for non-templ to be used as base objs in config.
George Joseph [Tue, 4 Nov 2014 20:47:30 +0000 (20:47 +0000)] 
config: BUG: Restore ability for non-templ to be used as base objs in config.

My recent refactor of config.c accidentally removed the capability for an
object to inherit from a non-template object.

This patch restores the capability to inherit from both template and
non-template objects.

Tested-by: George Joseph
Reported-by: Scott Griepentrog
ASTERISK-24487 #close

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

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

10 years agofunc_talkdetect: Fix stasis message leak in audiohook callback.
Corey Farrell [Tue, 4 Nov 2014 19:37:10 +0000 (19:37 +0000)] 
func_talkdetect: Fix stasis message leak in audiohook callback.

ASTERISK-24482 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4142/

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

10 years agores_http_websockets: Fix extra unref of module
Corey Farrell [Tue, 4 Nov 2014 19:30:43 +0000 (19:30 +0000)] 
res_http_websockets: Fix extra unref of module

In websocket_add_protocol_internal is used to add the "echo"
protocol, but ast_websocket_remove_protocol is used to remove
it.  This causes an extra call to ast_module_unref.

ASTERISK-24480 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4140/

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

10 years agores_pjsip: Add disable_tcp_switch option.
Richard Mudgett [Mon, 3 Nov 2014 17:54:20 +0000 (17:54 +0000)] 
res_pjsip: Add disable_tcp_switch option.

When a packet exceeds the MTU, pjproject will switch from UDP to TCP.  In
some circumstances (on some networks), this can cause some issues with
messages not getting sent to the correct destination - and can also cause
connections to get dropped due to quirks in pjproject deciding to
terminate TCP connections with no messages.

While fixing the routing/messaging issues is important, having a
configuration option in Asterisk that tells pjproject to not switch over
to TCP would be useful.  That way, if some glitch is discovered on some
other network/site, we can at least disable the behavior until a fix is
put into place.

AFS-197 #close

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

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

10 years agoFix compile error caused by review 4138
Corey Farrell [Mon, 3 Nov 2014 02:33:17 +0000 (02:33 +0000)] 
Fix compile error caused by review 4138

There is no procedure called ast_closeframe, fix code to use
ast_closestream.

Reported By: Matt Jordan
........

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

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

10 years agoFix ast_writestream leaks
Corey Farrell [Sun, 2 Nov 2014 08:05:00 +0000 (08:05 +0000)] 
Fix ast_writestream leaks

Fix cleanup in __ast_play_and_record where others[x] may be leaked.
This was caught where prepend != NULL && outmsg != NULL, once
realfile[x] == NULL any further others[x] would be leaked. A cleanup
block was also added for prepend != NULL && outmsg == NULL.

11+: Fix leak of ast_writestream recording_fs in
app_voicemail:leave_voicemail.

ASTERISK-24476 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4138/
........

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

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

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

10 years agofunc_jitterbuffer: fix frame leaks.
Corey Farrell [Sun, 2 Nov 2014 07:38:14 +0000 (07:38 +0000)] 
func_jitterbuffer: fix frame leaks.

Fix code paths where it is possible for frames to leak.
Fix uninitialized variable in jb_get_fixed and jb_get_adaptive.

ASTERISK-22409 #related
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4128/
........

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

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

10 years agores/res_stasis: Fix crash on module unload while performing operation
Matthew Jordan [Sun, 2 Nov 2014 01:01:15 +0000 (01:01 +0000)] 
res/res_stasis: Fix crash on module unload while performing operation

When the res_stasis module is unloaded, it will dispose of the apps_registry
container. This is a problem if an ARI operation is in flight that attempts
to use the registry, as the shutdown occurs in a separate thread. This patch
adds some sanity checks to the various routines that access the registry which
cause the operations to fail if the apps_registry does not exist.

Crash caught by the Asterisk Test Suite.

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

10 years agoinstall init.d files on GNU/kFreeBSD
Tzafrir Cohen [Fri, 31 Oct 2014 16:46:34 +0000 (16:46 +0000)] 
install init.d files on GNU/kFreeBSD

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

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

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

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

10 years agopjsip: clarify tls cert and key file usage
Scott Griepentrog [Fri, 31 Oct 2014 16:33:44 +0000 (16:33 +0000)] 
pjsip: clarify tls cert and key file usage

A question arose as to whether a .pem file
could be provided in place of the .crt and
.key files in a PJSIP TLS configuration. I
tested this and discovered that although a
cert will be read from the pem file, a key
will not, and thus the priv_key_file entry
is still required. This update to the fine
documentation clarifies the option usage.

AST-1448 #close
Review: https://reviewboard.asterisk.org/r/4129/
Reported by: John Bigelow

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

10 years agopjsip: Handle outbound unregister correctly
Scott Griepentrog [Fri, 31 Oct 2014 16:21:01 +0000 (16:21 +0000)] 
pjsip: Handle outbound unregister correctly

This updates the status of the outbound registration
to reflect when it has been unregistered.  Since the
registration is unregistered but is not stopped, the
registration schedule remains active as before.  The
patch also updates the documentation of both the AMI
and CLI commands.

ASTERISK-24411 #close
Review: https://reviewboard.asterisk.org/r/4119/
Reported by: John Bigelow
patches:
  unregister-patch1.txt uploaded by John Bigelow (License 5091)

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

10 years agochannels/sip/reqresp_parser: Fix unit tests for r426594
Matthew Jordan [Fri, 31 Oct 2014 03:25:39 +0000 (03:25 +0000)] 
channels/sip/reqresp_parser: Fix unit tests for r426594

When r426594 was made, it did not take into account a unit test that verified
that the function properly populated the unsupported buffer. The function
would previously memset the buffer if it detected it had any contents; since
this function can now be called iteratively on successive headers, the unit
tests would now fail. This patch updates the unit tests to reset the buffer
themselves between successive calls, and updates the documentation of the
function to note that this is now required.
........

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

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

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

10 years agoREF_DEBUG: Install refcounter.py to $(ASTDATADIR)/scripts
Corey Farrell [Fri, 31 Oct 2014 03:06:51 +0000 (03:06 +0000)] 
REF_DEBUG: Install refcounter.py to $(ASTDATADIR)/scripts

This change ensures refcounter.py is installed to a place where it
can be found by the Asterisk testsuite if REF_DEBUG is enabled.

ASTERISK-24432 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4094/
........

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

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

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

10 years agoapp_queue: fix a couple leaks to struct call_queue in set_member_value
Corey Farrell [Thu, 30 Oct 2014 23:54:36 +0000 (23:54 +0000)] 
app_queue: fix a couple leaks to struct call_queue in set_member_value

set_member_value has a couple leaks to references in the variable q
found through testsuite tests/queues/set_penalty.  Also remove the
REF_DEBUG_ONLY_QUEUES compiler declaration, this is no longer possible
with the updated REF_DEBUG code.

ASTERISK-24466 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4125/
........

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

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

10 years agores_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash
Kevin Harwell [Thu, 30 Oct 2014 21:12:25 +0000 (21:12 +0000)] 
res_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash

Currently, it is possible for some subscriptions to get into a NULL state. When
this occurs and the PJSIPShowSubscriptionsInbound ami action is issued and a
device is subscribed for extension state then the associated subscription state
object can't be located.  The code then attempts to dereference a NULL object.
Added a NULL check to avoid the problem.

Reported by: John Bigelow

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

10 years agores_pjsip: incorrect qualify statistics after disabling for contact
Kevin Harwell [Thu, 30 Oct 2014 17:16:28 +0000 (17:16 +0000)] 
res_pjsip: incorrect qualify statistics after disabling for contact

When removing the qualify_frequency from an AoR or a contact the statistics
shown when issuing "pjsip show aors" from the CLI are incorrect. This patch
deletes the contact's status object from sorcery, disassociating it from the
contact, if the qualify_freqency is removed from configuration.

ASTERISK-24462 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4116/

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

10 years agoapp_voicemail: Fix unchecked bounds of myArray in IMAP_STORAGE.
Walter Doekes [Thu, 30 Oct 2014 09:18:52 +0000 (09:18 +0000)] 
app_voicemail: Fix unchecked bounds of myArray in IMAP_STORAGE.

In update_messages_by_imapuser(), messages were appended to a finite
array which resulted in a crash when an IMAP mailbox contained more
than 256 entries. This memory is now dynamically increased as needed.

Observe that this patch adds a bunch of XXX's to questionable code. See
the review (url below) for more information.

ASTERISK-24190 #close
Reported by: Nick Adams
Tested by: Nick Adams

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

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

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

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

10 years agoAdd additional checks for NULL pointers to fix several crashes reported.
Igor Goncharovskiy [Thu, 30 Oct 2014 06:02:10 +0000 (06:02 +0000)] 
Add additional checks for NULL pointers to fix several crashes reported.

ASTERISK-24304 #close
Reported by: dhanapathy sathya
........

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

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

10 years agochannels/chan_sip: Add improved support for 4xx error codes
Matthew Jordan [Thu, 30 Oct 2014 01:58:33 +0000 (01:58 +0000)] 
channels/chan_sip: Add improved support for 4xx error codes

This patch adds support for 414, 493, 479, and a stray 400 response in REGISTER
response handling. This helps interoperability in a number of scenarios.

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

patches:
  rb3437.patch uploaded by oej (License 5267)
........

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

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

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

10 years agochannels/chan_sip: Support mutltiple Supported and Required headers
Matthew Jordan [Thu, 30 Oct 2014 01:46:55 +0000 (01:46 +0000)] 
channels/chan_sip: Support mutltiple Supported and Required headers

A SIP request may contain multiple Supported: and Required: headers. Currently,
chan_sip only parses the first Supported/Required header it finds. This patch
adds support for multiple Supported/Required headers for INVITE requests.

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

ASTERISK-21721 #close
Reported by: Olle Johansson
patches:
  rb2478.patch uploaded by oej (License 5267)
........

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

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

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

10 years agobridge_builtin_features: Add missing channel locks around ast_get_chan_features_gener...
Richard Mudgett [Tue, 28 Oct 2014 21:16:21 +0000 (21:16 +0000)] 
bridge_builtin_features: Add missing channel locks around ast_get_chan_features_general_config().

The feature_automonitor() and feature_automixmonitor() functions were not
locking the channel around ast_get_chan_features_general_config().
Accessing the channel datastore list without the channel locked is a good
way to corrupt the list or follow the pointer chain into oblivion.

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

10 years agores_fax: Resolve T38 gateway frame leak.
Corey Farrell [Tue, 28 Oct 2014 20:55:04 +0000 (20:55 +0000)] 
res_fax: Resolve T38 gateway frame leak.

When frames are translated by a fax gateway they need to be freed.  The
existing call to ast_frfree was unreachable.  This change reorganizes
fax_gateway_framehook to ensure that ast_frfree is called when needed.

ASTERISK-24457 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4115/
........

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

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

10 years agomanager: Unsubscribe from acl_change_sub at shutdown.
Corey Farrell [Tue, 28 Oct 2014 20:40:54 +0000 (20:40 +0000)] 
manager: Unsubscribe from acl_change_sub at shutdown.

ASTERISK-24453 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4110/

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

10 years agoASTERISK-23512, correct inaccurate comment in manager.conf.sample
Malcolm Davenport [Tue, 28 Oct 2014 18:08:54 +0000 (18:08 +0000)] 
ASTERISK-23512, correct inaccurate comment in manager.conf.sample

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

10 years agomain/bridge: Destroy features struct on off nominal path during bridge impart
Matthew Jordan [Tue, 28 Oct 2014 16:40:33 +0000 (16:40 +0000)] 
main/bridge: Destroy features struct on off nominal path during bridge impart

When a channel is imparted to a bridge, the invocation of the function may
provide an ast_bridge_features struct. Upon passing this to ast_bridge_impart,
the caller must assume that ownership has passed to the function, as in all
paths the function destroys the struct prior to returning (as its purpose is
to configure the behavior of the channel while in the bridge). On one off
nominal path - where the channel already has a PBX thread - the struct was not
being destroyed.

This patch fixes that glitch.

ASTERISK-24437 #close
Reported by: Scott Griepentrog

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

10 years agomain/manager: Fix typo in AMI event documentation of "OriginateResponse"
Matthew Jordan [Tue, 28 Oct 2014 14:59:06 +0000 (14:59 +0000)] 
main/manager: Fix typo in AMI event documentation of "OriginateResponse"

The parameter name is "Response", not "Resonse".

ASTERISK-24430 #close
Reported by: Dafi Ni
........

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

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

10 years agoASTERISK-24323, fix bug in documentation of AGI STREAM FILE CONTROL
Malcolm Davenport [Tue, 28 Oct 2014 14:56:22 +0000 (14:56 +0000)] 
ASTERISK-24323, fix bug in documentation of AGI STREAM FILE CONTROL

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

10 years agoASTERISK-24419, fix incorrect syntax for setting language in extensions.conf.sample
Malcolm Davenport [Tue, 28 Oct 2014 13:12:32 +0000 (13:12 +0000)] 
ASTERISK-24419, fix incorrect syntax for setting language in extensions.conf.sample

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

10 years agoapp_queue: Cleanup ao2_iterator
Corey Farrell [Tue, 28 Oct 2014 11:19:02 +0000 (11:19 +0000)] 
app_queue: Cleanup ao2_iterator

Clean ao2_iterator, resolving reference leak to queue members.

ASTERISK-24454 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4111/
........

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

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

10 years agores/res_http_websocket: Fix minor nits found by wdoekes on r409681
Matthew Jordan [Mon, 27 Oct 2014 02:45:57 +0000 (02:45 +0000)] 
res/res_http_websocket: Fix minor nits found by wdoekes on r409681

When Moises committed the fixes for WSS (which was a great patch), wdoekes had
a few style nits that were on the review that got missed. This patch resolves
what I *think* were all of the ones that were still on the review.

Thanks to both moy for the patch, and wdoekes for the reviews.

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

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

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

10 years agores/res_phoneprov: Fix crash on shutdown caused by container cleanup
Matthew Jordan [Mon, 27 Oct 2014 02:27:03 +0000 (02:27 +0000)] 
res/res_phoneprov: Fix crash on shutdown caused by container cleanup

In res_phoneprov, unloading the module first destroys the http_routes
container, followed by the users. However, users may have a route in
the http_routes container; the validity of this container is not checked
in the users destructor. Hence, we hit an assert as the container has already
been set to NULL.

This patch does two things:
(1) It adds a sanity check in the user destructor (because why not)
(2) It switches the order of destruction, so that users are disposed of prior
    to the HTTP routes they may hold a reference to.

Note that this crash was caught by the Test Suite (go go testing!)

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

10 years agores/res_srtp: Fix include issue for libsrtp 1.5.0
Matthew Jordan [Mon, 27 Oct 2014 01:46:47 +0000 (01:46 +0000)] 
res/res_srtp: Fix include issue for libsrtp 1.5.0

In libsrtp 1.5.0, crypto_get_random is no longer resolved simply by including
srtp.h. Now, one must include crypto_kernel.h as well. As it turns out, this
header file has been provided by the library since 2006, so this is a
relatively benign change.

ASTERISK-24436 #close
Reported by: Patrick Laimbock
........

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

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

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

10 years agoAST-2014-011: Fix POODLE security issues
Matthew Jordan [Mon, 20 Oct 2014 14:10:49 +0000 (14:10 +0000)] 
AST-2014-011: Fix POODLE security issues

There are two aspects to the vulnerability:
(1) res_jabber/res_xmpp use SSLv3 only. This patch updates the module to use
    TLSv1+. At this time, it does not refactor res_jabber/res_xmpp to use the
    TCP/TLS core, which should be done as an improvement at a latter date.
(2) The TCP/TLS core, when tlsclientmethod/sslclientmethod is left unspecified,
    will default to the OpenSSL SSLv23_method. This method allows for all
    encryption methods, including SSLv2/SSLv3. A MITM can exploit this by
    forcing a fallback to SSLv3, which leaves the server vulnerable to POODLE.
    This patch adds WARNINGS if a user uses SSLv2/SSLv3 in their configuration,
    and explicitly disables SSLv2/SSLv3 if using SSLv23_method.

For TLS clients, Asterisk will default to TLSv1+ and WARN if SSLv2 or SSLv3 is
explicitly chosen. For TLS servers, Asterisk will no longer support SSLv2 or
SSLv3.

Much thanks to abelbeck for reporting the vulnerability and providing a patch
for the res_jabber/res_xmpp modules.

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

ASTERISK-24425 #close
Reported by: abelbeck
Tested by: abelbeck, opsmonitor, gtjoseph
patches:
  asterisk-1.8-jabber-tls.patch uploaded by abelbeck (License 5903)
  asterisk-11-jabber-xmpp-tls.patch uploaded by abelbeck (License 5903)
  AST-2014-011-1.8.diff uploaded by mjordan (License 6283)
  AST-2014-011-11.diff uploaded by mjordan (License 6283)

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

10 years agobuild: Force -fsigned-char on platforms where the default for char is unsigned
George Joseph [Sun, 19 Oct 2014 17:03:49 +0000 (17:03 +0000)] 
build: Force -fsigned-char on platforms where the default for char is unsigned

gcc on the ARM platform defaults 'char' to 'unsigned char' whereas Intel and
SPARC default to 'signed char'.  This is only an issue in the rare cases where
negative values are assigned to a 'char' but this this patch insures
compatibility by detecting platforms that default to 'unsigned' and adding an
'-fsigned-char' flag to _ASTCFLAGS.

If compiling for ARM (native or cross-compile) be sure to run ./bootstrap.sh
and ./configure to regenerate the build files.  You shouldn't have to do this
for Intel or SPARC.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4091/

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

10 years agores/res_pjsip_sdp_rtp: Undo 425921
Matthew Jordan [Sun, 19 Oct 2014 03:58:16 +0000 (03:58 +0000)] 
res/res_pjsip_sdp_rtp: Undo 425921

This patch for r425921 introduced a different bug, wherein sending an INVITE
request with no SDP would cause Asterisk to not send an SDP Offer in the 200
OK. The current structure of res_pjsip_sdp_rtp is a bit hard to deal with
to fix this, particularly in 12:
(1) The format capabilities structures and how they are used are a bit harder
    to manipulate than they are in 13
(2) create_outgoing_sdp has no knowledge of whether or not it is creating an
    SDP as a new Offer or an Answer. This is something of an oversight in the
    callback definition, as the caller of it does have this information.

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

10 years agores/res_pjsip_sdp_rtp: Check joint caps when looking to decline outgoing media
Matthew Jordan [Sun, 19 Oct 2014 00:49:10 +0000 (00:49 +0000)] 
res/res_pjsip_sdp_rtp: Check joint caps when looking to decline outgoing media

When constructing an outgoing media stream for an SDP offer/answer, the current
code checks the override preferences (set by the PJSIP_MEDIA_OFFER function) as
well as what is configured on the endpoint to determine if a codec is available
for the media stream. Unfortunately, this isn't good enough: we must also look
at the negotiated (joint) format capabilities. Otherwise, we'll construct a
media stream offer/answer with no codecs.

Note that this isn't an issue in 13, which already looks at the joint
capabilities thanks to the media re-work done there.

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

10 years agores_pjsip_session/res_pjsip_sdp_rtp: Be more tolerant of offers
Matthew Jordan [Fri, 17 Oct 2014 13:32:05 +0000 (13:32 +0000)] 
res_pjsip_session/res_pjsip_sdp_rtp: Be more tolerant of offers

When an inbound SDP offer is received, Asterisk currently makes a few
incorrection assumptions:

(1) If the offer contains more than a single audio/video stream, Asterisk will
    reject the entire stream with a 488. This is an overly strict response;
    generally, Asterisk should accept the media streams that it can accept and
    decline the others.
(2) If the offer contains a declined media stream, Asterisk will attempt to
    process it anyway. This can result in attempting to match format
    capabilities on a declined media stream, leading to a 488. Asterisk should
    simply ignore declined media streams.
(3) Asterisk will currently attempt to handle offers with AVPF with
    use_avpf=No/AVP with use_avpf=Yes. This mismatch results in invalid SDP
    answers being sent in response. If there is a mismatch between the media
    type being offered and the configuration, Asterisk must reject the offer
    with a 488.

This patch does the following:
* Asterisk will accept SDP offers with at least one media stream that it can
  use. Some WARNING messages have been dropped to NOTICEs as a result.
* Asterisk will not accept an offer with a media type that doesn't match its
  configuration.
* Asterisk will ignore declined media streams properly.

#SIPit31

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

ASTERISK-24122 #close
Reported by: James Van Vleet

ASTERISK-24381 #close
Reported by: Matt Jordan

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

10 years agochannels/chan_sip: Respect outboundproxy setting when sending qualify requests
Matthew Jordan [Fri, 17 Oct 2014 13:10:08 +0000 (13:10 +0000)] 
channels/chan_sip: Respect outboundproxy setting when sending qualify requests

The outboundproxy setting is currently ignored when sending OPTIONS requests
as a result of the qualify setting. This means that if an Asterisk server is
unable to send the packet directly to a peer, it is unable to qualify any
non-inbound registered peer (e.g. a peer SIP Trunk).

This patch grabs the outboundproxy information for a peer when a qualify
attempt is being constructed and, if it finds the information, uses it
when sending the OPTIONS request.

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

ASTERISK-24063 #close
Reported by: Damian Ivereigh
patches:
  outboundproxy-dai.patch uploaded by Damian Ivereigh (License 6632)
........

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

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

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

10 years agoAMI: Add missing VarSet events when a channel inherits variables.
Richard Mudgett [Fri, 17 Oct 2014 02:32:37 +0000 (02:32 +0000)] 
AMI: Add missing VarSet events when a channel inherits variables.

There should be AMI VarSet events when channel variables are inherited by
an outgoing channel.  Also local;2 should generate VarSet events when it
gets all of its channel variables from channel local;1.

ASTERISK-24415 #close
Reported by: Richard Mudgett
Patches:
      jira_asterisk_24415_v12.patch (license #5621) patch uploaded by Richard Mudgett

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

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

10 years agobridge_native_rtp: Fix audio issues when moving from remote bridge to softmix
Matthew Jordan [Fri, 17 Oct 2014 01:55:31 +0000 (01:55 +0000)] 
bridge_native_rtp: Fix audio issues when moving from remote bridge to softmix

When a native RTP bridge that is remotely bridging its participants switches
to a softmix bridge, it may not properly re-INVITE the media for one or both
participants back to Asterisk. This is due to the current bridge_native_rtp
code only re-INVITEs if it believes the channel will survive the bridge
operation. Currently, that code is failing, as it expects the channels to
have a soft hangup flag set on it indicating that a redirect has occurred
or that the channel is going to leave the bridge. (The code did not take into
account a smart bridge operation).

This patch also renames a few things to be more reflective of the underlying
types.

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

ASTERISK-24327 #close

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

10 years agotest_cel: Update pickup test to expect CANCEL instead of ANSWSER
Matthew Jordan [Fri, 17 Oct 2014 01:45:06 +0000 (01:45 +0000)] 
test_cel: Update pickup test to expect CANCEL instead of ANSWSER

The CEL pickup test previously looked for a disposition of ANSWER between the
original caller/peer when the call is picked up. This is actually incorrect:
the disposition should, at the very least, not be ANSWER as the call was
never ANSWERed. The disposition is now CANCEL; this patch updates the test
accordingly.

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

10 years agomain/cdr: Use 'time' when rescheduling batched CDRs as opposed to 'size'
Matthew Jordan [Thu, 16 Oct 2014 21:13:08 +0000 (21:13 +0000)] 
main/cdr: Use 'time' when rescheduling batched CDRs as opposed to 'size'

When refactoring CDRs to use the configuration framework, a 'whoops' was
introduced where the CDR batch size was used when rescheduling a batch,
as opposed to the time duration. This patch corrects that obvious mistake.

ASTERISK-24426 #close
Reported by: Shane Blaser

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

10 years agoconfig: Fix inf loop using ast_category_browse and ast_variable_retrieve
George Joseph [Thu, 16 Oct 2014 17:29:58 +0000 (17:29 +0000)] 
config: Fix inf loop using ast_category_browse and ast_variable_retrieve

Fix infinite loop when calling ast_variable_retrieve inside an
ast_category_browse loop when there is more than 1 category with
the same name.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4089/

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

10 years agoPJSIP: Enforce module load dependencies
Kinsey Moore [Thu, 16 Oct 2014 14:24:55 +0000 (14:24 +0000)] 
PJSIP: Enforce module load dependencies

This enforces that res_pjsip, res_pjsip_session, and res_pjsip_pubsub
have loaded properly before attempting to load any modules that depend
on them since the module loader system is not currently capable of
resolving module dependencies on its own.

ASTERISK-24312 #close
Reported by: Dafi Ni
Review: https://reviewboard.asterisk.org/r/4062/

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

10 years agoFix loss of voice after second call drops (on a second line) in case using multiple...
Igor Goncharovskiy [Thu, 16 Oct 2014 06:07:18 +0000 (06:07 +0000)] 
Fix loss of voice after second call drops (on a second line) in case using multiple lines on unistim phones. There is regression was introduced in r391379.

Reported by: Rustam Khankishyiev
(closes issue ASTERISK-23846)
........

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

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

10 years agores_rtp_asterisk: Fix a bug where ICE state would get reset when it shouldn't.
Joshua Colp [Thu, 16 Oct 2014 01:25:09 +0000 (01:25 +0000)] 
res_rtp_asterisk: Fix a bug where ICE state would get reset when it shouldn't.

In the case where the ICE negotiation had not yet started current state would
get wiped when it shouldn't.

This also removes channel binding as in practice this does not work well with
other implementations.
........

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

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

10 years agochan_ooh323: fix rtptimeout general value checking
Alexandr Anikin [Wed, 15 Oct 2014 09:45:53 +0000 (09:45 +0000)] 
chan_ooh323: fix rtptimeout general value checking

correct condition to check rtptimeout in [general] config section

ASTERISK-24393 #close
Reported by:  Dmitry Melekhov
Tested by:  Dmitry Melekhov
Patches:
  ASTERISK-24393.patch
........

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

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

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

10 years agoconfig: Fix SEGV in unit test with MALLOC_DEBUG
George Joseph [Tue, 14 Oct 2014 20:45:53 +0000 (20:45 +0000)] 
config: Fix SEGV in unit test with MALLOC_DEBUG

With MALLOC_DEBUG the /main/config config_basic_ops test was causing a
SEGV while doing an ast_category_delete in an ast_category_browse loop.
Apparently this never worked but was also never tested.  I removed the
test, added 2 notes to config.h indicating that it's not supported and
added a few lines of code to ast_category_delete to prevent the SEGV
should someone attempt it in the future.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4078/

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

10 years agoScheduler: Fix a nasty scheduler caching bug which makes new tasks not execute
Jonathan Rose [Tue, 14 Oct 2014 18:49:25 +0000 (18:49 +0000)] 
Scheduler: Fix a nasty scheduler caching bug which makes new tasks not execute

Tasks that were marked for pending deletion in the scheduler would be moved to
the cache for later reuse, but after being recycled the deleted mark wouldn't
be removed resulting in fresh tasks being deleted without reason... and
immediately moved back into the cache where they could be reused again. This
could cause horrendous things to happen in just about anything that used a
scheduler.

ASTERISK-24321 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4071/

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

10 years agores_phoneprov: Create accessor for ast_phoneprov_std_variable_lookup
George Joseph [Tue, 14 Oct 2014 18:11:38 +0000 (18:11 +0000)] 
res_phoneprov: Create accessor for ast_phoneprov_std_variable_lookup

Based on feedback from Richard, I created an accessor for
res_phoneprov/ast_phoneprov_std_variable_lookup and added
load priority to AST_MODULE_INFO.

Tested-by: George Joseph
Tested-by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/4076/

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

10 years agores_fax: Fix reference leak caused by gateway sessions
Corey Farrell [Tue, 14 Oct 2014 16:45:14 +0000 (16:45 +0000)] 
res_fax: Fix reference leak caused by gateway sessions

Fax gateway session objects can be re-used, causing the
same gateway session to be added to faxregistry.container
more than once.  This change causes fax_session_new to
remove the reserved session from the container before
it's id is changed, ensuring it's possible for the
session to be freed.

ASTERISK-24392 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4049/
........

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

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

10 years agostasis_channels.c: Resolve unfinished Dials when doing masquerades (Part 2)
Richard Mudgett [Tue, 14 Oct 2014 16:24:32 +0000 (16:24 +0000)] 
stasis_channels.c: Resolve unfinished Dials when doing masquerades (Part 2)

Masquerades into and out of channels that are involved in a dial operation
don't create the expected dial end event.  The missing dial end event goes
against the model for things like CDRs and generating Dial end manager
actions and such.

There are four cases:

1) A channel masquerades into the caller channel.  The case happens when
performing a blonde transfer using the channel driver's protocol.

2) A channel masquerades into a callee channel.  The case happens when
performing a directed call pickup.

3) The caller channel masquerades out of dial.  The case happens when
using the Bridge application on the caller channel.

4) A callee channel masquerades out of dial.  The case happens when using
the Bridge application on a peer channel.

As it turned out, all four cases need to be handled instead of just the
first one.

ASTERISK-24237
Reported by: Richard Mudgett

ASTERISK-24394 #close
Reported by: Richard Mudgett

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

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

10 years agores_fax: Resolve module reference leak caused by reserved sessions
Corey Farrell [Tue, 14 Oct 2014 16:18:46 +0000 (16:18 +0000)] 
res_fax: Resolve module reference leak caused by reserved sessions

Remove reference to module providing reserved session after
adding a reference to the final module.  This re-reference
is done to ensure that module references are correct even
if the final session selects a different module than the
reserved session.

ASTERISK-18923 #close
Reported by: Grigoriy Puzankin
Review: https://reviewboard.asterisk.org/r/4048/
........

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

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

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

10 years agomanager/config: Support templates and non-unique category names via AMI
George Joseph [Mon, 13 Oct 2014 16:07:56 +0000 (16:07 +0000)] 
manager/config: Support templates and non-unique category names via AMI

This patch provides the capability to manipulate templates and categories
with non-unique names via AMI.

Summary of changes:

GetConfig and GetConfigJSON: Added "Filter" parameter:  A comma separated list
of name_regex=value_regex expressions which will cause only categories whose
variables match all expressions to be considered.  The special variable name
TEMPLATES can be used to control whether templates are included.  Passing
'include' as the value will include templates along with normal categories.
Passing 'restrict' as the value will restrict the operation to ONLY templates.
Not specifying a TEMPLATES expression results in the current default behavior
which is to not include templates.

UpdateConfig: NewCat now includes options for allowing duplicate category
names, indicating if the category should be created as a template, and
specifying templates the category should inherit from.  The rest of the
actions now accept a filter string as defined above.  If there are non-unique
category names, you can now update specific ones based on variable values.

To facilitate the new capabilities in manager, corresponding changes had to be
made to config, most notably the addition of filter criteria to many of the
APIs.  In some cases it was easy to change the references to use the new
prototype but others would have required touching too many files for this
patch so a wrapper with the original prototype was created.  Macros couldn't
be used in this case because it would break binary compatibility with modules
such as res_digium_phone that are linked to real symbols.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4033/

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

10 years agores_rtp_asterisk: Make the ICE transport check case insensitive as some implementatio...
Joshua Colp [Sun, 12 Oct 2014 21:08:45 +0000 (21:08 +0000)] 
res_rtp_asterisk: Make the ICE transport check case insensitive as some implementations use 'udp'.
........

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

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

10 years agochan_sip: Fix so asterisk won't send reINVITE after a BYE.
Walter Doekes [Sun, 12 Oct 2014 08:14:04 +0000 (08:14 +0000)] 
chan_sip: Fix so asterisk won't send reINVITE after a BYE.

After a reINVITE glare situation, Asterisk would re-send the reINVITE
even though the call had been hung up in the mean time.  This patch
unschedules the reinvite when handling the BYE.

ASTERISK-22791 #close
Reported by: Paolo Compagnini
Tested by: Paolo Compagnini

Review: https://reviewboard.asterisk.org/r/4056/
(testcase is in review r4055)
........

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

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

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

10 years agobuild: Relax badshell tilde test to allow for ~ in middle of DESTDIR.
Walter Doekes [Sun, 12 Oct 2014 07:52:58 +0000 (07:52 +0000)] 
build: Relax badshell tilde test to allow for ~ in middle of DESTDIR.

The main Makefile has a target test called 'badshell' that tests if
DESTDIR does not happen to have an an-expanded tilde (~).  This might
be the case if you run: make install DESTDIR=~/somewhere/

That test also disallowed valid tildes in directory names. The test is
now changed to only trigger on a tilde at the start of the path.

ASTERISK-13797 #close
Reported by: Tzafrir Cohen

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

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

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

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

10 years agores_calendar_ews: Relax neon version check to work with 0.30 too.
Walter Doekes [Sun, 12 Oct 2014 07:43:12 +0000 (07:43 +0000)] 
res_calendar_ews: Relax neon version check to work with 0.30 too.

Allow res_calendar_ews to work not only with libneon-0.29 but also
with 0.30.

ASTERISK-24325 #close
Reported by: Tzafrir Cohen

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

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

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

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

10 years agores_phoneprov: Cleanup module load error handling
George Joseph [Sat, 11 Oct 2014 21:07:36 +0000 (21:07 +0000)] 
res_phoneprov: Cleanup module load error handling

Tested module load/reload interaction between res_phoneprov and
res_pjsip_phoneprov_provider in cases where res_phoneprov didn't
load correctly (usually misconfiguration or missing phoneprov.conf)

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4069/

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

10 years agobridge: During a smart bridge operation provide a more complete bridge to the old...
Joshua Colp [Fri, 10 Oct 2014 20:47:21 +0000 (20:47 +0000)] 
bridge: During a smart bridge operation provide a more complete bridge to the old technology.

When a smart bridge operation occurs and a bridge transitions from one
technology to another the old technology is provided the channels formerly
in it and told that they are leaving. Unfortunately the bridge provided
along with them is incomplete. The bridge, despite there being channels in it,
contains none. This forces technology implementations to have additional
logic when channels are leaving or to store their own duplicated
state.

This change makes the bridge more complete so it contains the expected
channels. Now that the bridge is complete special logic within
bridge_native_rtp is no longer needed and has been removed.

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

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