Commit Graph

25959 Commits

Author SHA1 Message Date
Kevin Harwell 49b7a1cbaf 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/
........

Merged revisions 427814 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427815 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-13 22:26:56 +00:00
Kinsey Moore 74e706878b 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
........

Merged revisions 427788 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427789 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-13 15:46:48 +00:00
Matthew Jordan cc4c396647 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
........

Merged revisions 427762 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427763 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-13 00:23:20 +00:00
Corey Farrell ec1a7654f3 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/
........

Merged revisions 427736 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427737 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-12 20:40:59 +00:00
Joshua Colp dbb8f0a935 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
........

Merged revisions 427710 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427711 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-12 16:13:15 +00:00
Corey Farrell 9f89b83269 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
........

Merged revisions 427683 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427684 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-12 13:47:30 +00:00
Corey Farrell 21c41e4542 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
........

Merged revisions 427642 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427643 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09 08:01:18 +00:00
Matthew Jordan f4392c4b6d 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
........

Merged revisions 427614 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427615 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09 00:38:41 +00:00
Matthew Jordan d773f9d03e 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
........

Merged revisions 427610 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427611 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09 00:26:57 +00:00
Matthew Jordan 08d773532b app_voicemail: Fix enhancement that allowed multiple recipients in To: header
An issue existed in r420577, which added multiple recipients to voicemail
emails. The patch, when looking at the intended recipients, looked ahead for
the '|' character inside a while loop which already had pulled out the
appropriate field parsing on the '|' character. This would cause it to skip
the recipients.

This patch fixes it such that it relies completely on the while loop to parse
through the e-mail fields.

Note that the original author of the patch looked at this fix and approved it.

ASTERISK-24250 #close
Reported by: abelbeck
patches:
  voicemail-420577-to-comma-fix.diff uploaded by abelbeck (License 5903)
........

Merged revisions 427585 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09 00:14:56 +00:00
Matthew Jordan 9a1ab5d548 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/
........

Merged revisions 427582 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427583 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-09 00:04:30 +00:00
Corey Farrell d4fd0774f4 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
........

Merged revisions 427555 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427557 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-08 18:20:43 +00:00
Richard Mudgett 7571bae5ab 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/
........

Merged revisions 427508 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427512 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 19:26:08 +00:00
Richard Mudgett a68baad74f 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/
........

Merged revisions 427493 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427494 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 19:12:18 +00:00
Joshua Colp 47074f4bfd 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/
........

Merged revisions 427490 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427491 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 18:21:12 +00:00
Corey Farrell 4d80f223af 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
........

Merged revisions 427465 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427466 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 12:15:54 +00:00
Corey Farrell c46664305a 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/
........

Merged revisions 427400 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427405 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 09:24:26 +00:00
Corey Farrell 7e2369310c 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
........

Merged revisions 427382 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427384 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 09:18:48 +00:00
George Joseph 362dde2229 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
........

Merged revisions 427355 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427356 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-06 02:41:17 +00:00
Mark Michelson 69f29e627f Make the disable_tcp_switch PJSIP system object enabled by default.
Testing has shown repeatedly that PJSIP's default behavior of switching
automatically to TCP for large messages can cause issues. The most common
issues are that devices that we are communicating with do not handle the
switch to TCP gracefully, thus causing situations such as broken calls or
broken subscriptions. Now, in order to have this behavior happen, you must
opt into it. The sample file has been updated to warn that enabling the
TCP switch behavior may cause issues for you, so use at your own risk.
........

Merged revisions 427334 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-05 19:53:29 +00:00
Joshua Colp b06078880b 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/
........

Merged revisions 427300 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427303 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-05 12:19:09 +00:00
George Joseph d5de94201e 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/
........

Merged revisions 427275 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427276 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-05 00:17:10 +00:00
Joshua Colp c77a71ad2f res_pjsip: Apply the 'user_eq_phone' setting to the To header as well.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 22:51:32 +00:00
Joshua Colp 5e43d68717 res_pjsip: Allow + at the beginning of a phone number when user_eq_phone is enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 22:31:16 +00:00
George Joseph bd42a09d7f 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/
........

Merged revisions 427227 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427228 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 20:49:14 +00:00
Corey Farrell 97e1c7f3a9 func_talkdetect: Fix stasis message leak in audiohook callback.
ASTERISK-24482 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4142/
........

Merged revisions 427203 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427204 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 19:46:33 +00:00
Corey Farrell 9f2874639d 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/
........

Merged revisions 427200 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427201 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 19:33:21 +00:00
Corey Farrell bdc35c77b9 Fix crash caused by merge error on review 4138
When merging from 12 to 13 there were conflicts,
I mistakenly had the loop run ast_closestream(others[0])
when it should be ast_closestream(others[x]).
........

Merged revisions 427181 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 14:11:54 +00:00
Joshua Colp d159885e50 res_pjsip_outbound_registration: Add virtual line support.
Virtual line support establishes a relationship between messages
related to an outbound registration and a local endpoint. This is
accomplished by attaching a parameter to the Contact of the outbound
registration and looking for it on any received requests. If the
parameter exists and can be matched to an outbound registration
the configured endpoint is associated with the request.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 12:03:35 +00:00
Richard Mudgett 33f0251b6c 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/
........

Merged revisions 427129 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427130 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 18:22:59 +00:00
Joshua Colp b9aeff9580 chan_pjsip: Update CHANGES file to include 'moh_passthrough' setting
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 15:03:38 +00:00
Joshua Colp ac091d4184 chan_pjsip: Add support for passing hold and unhold requests through.
This change adds an option, moh_passthrough, that when enabled will pass
hold and unhold requests through using a SIP re-invite. When placing on
hold a re-invite with sendonly will be sent and when taking off hold a
re-invite with sendrecv will be sent. This allows remote servers to handle
the musiconhold instead of the local Asterisk instance being responsible.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 14:45:01 +00:00
Corey Farrell 285be15aaf 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
........

Merged revisions 427088 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427089 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-03 02:36:46 +00:00
Corey Farrell 509c04ef38 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
........

Merged revisions 427025 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427026 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02 08:13:52 +00:00
Corey Farrell 85c1822a9d 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
........

Merged revisions 427020 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 427021 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02 07:40:57 +00:00
Matthew Jordan 5db1c978e3 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.
........

Merged revisions 426995 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426996 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02 01:01:52 +00:00
Tzafrir Cohen 4219c40775 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
........

Merged revisions 426933 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426934 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 16:52:42 +00:00
Scott Griepentrog 28173ddf05 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
........

Merged revisions 426928 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426930 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 16:41:06 +00:00
Scott Griepentrog f59db388a7 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)
........

Merged revisions 426923 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426924 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 16:24:00 +00:00
Matthew Jordan d88282af40 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
........

Merged revisions 426863 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426865 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 03:26:28 +00:00
Corey Farrell bf684b63a3 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
........

Merged revisions 426832 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426833 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-31 03:09:48 +00:00
Corey Farrell e4374a3abe 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
........

Merged revisions 426806 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426807 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 23:56:39 +00:00
Corey Farrell ced81afff2 audiohooks: Clean references to formats
Cleanup references to in_translate[x].format and
out_translate[x].format in ast_audiohook_detach_list.

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

Merged revisions 426803 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 23:45:25 +00:00
Kevin Harwell a537e314d1 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
........

Merged revisions 426779 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426780 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 21:14:01 +00:00
Kevin Harwell cd52456ea1 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/
........

Merged revisions 426755 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426757 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 17:18:47 +00:00
Walter Doekes 5d8d90c402 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
........

Merged revisions 426696 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426702 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 09:21:42 +00:00
Igor Goncharovskiy c866ced76b 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
........

Merged revisions 426667 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426668 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 06:15:14 +00:00
Matthew Jordan 0ddc3bde24 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
........

Merged revisions 426601 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426602 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 01:59:39 +00:00
Matthew Jordan ff83ff564c 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
........

Merged revisions 426596 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426597 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 01:48:00 +00:00
Tzafrir Cohen 8a69aedd17 Fix building chan_phone on big endian systems
A left over from the formats conversion (Corey Farrell).

ASTERISK-24458 #close
Review: https://reviewboard.asterisk.org/r/4117/

........

Merged revisions 426570 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-29 13:02:27 +00:00