Commit Graph

25469 Commits

Author SHA1 Message Date
Russell Bryant
5f22c3ae65 moh: fix a refcount error with realtime MOH
I observed a crash in res_musiconhold on an Asterisk 11 system using realtime
MOH.  Investigation of the backtrace showed a corrupt mohclass, implying that
it got destroyed before the code expected it to.  I went looking for reference
counting errors that could have caused this crash and this patch this result.
It contains 2 changes.

1) Remove a usless block of code that was impossible to reach.  There was even
a comment indicating that it was impossible to reach.  The conditional includes
"!ast_test_flag(global_flags, MOH_CACHERTCLASSES)" and it's inside of an if
block with the opposite check "ast_test_flag(global_flags,
MOH_CACHERTCLASSES)".  There's no good reason to keep it around.

2) A similar block to #1 contained a reference counting error.  It stores
state->class in the local variable mohclass without increasing its reference
count.  The reference count on mohclass is decremented at the end of the
function.  This block of code probably very rarely runs, which would help
explain why this system was working fine for many months before experiencing a
crash.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 23:40:42 +00:00
Richard Mudgett
b4865a4b53 sorcery.c: Fix off-nominal path ref and memory leak in ast_sorcery_objectset_json_create().
* Made exit a loop early on error in ast_sorcery_objectset_json_create().

* Removed some dead code in ast_sorcery_objectset_create2().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 23:35:33 +00:00
Jonathan Rose
3cdbf978d1 pjsip configuration: Make transport TOS values consistent with endpoints
Transport TOS values were interpreted as DSCP values without being documented
as such. Endpoint TOS values (tos_audio/tos_video) behaved normally as TOS
values have historically. This patch makes the transport TOS values behave as
TOS values and makes all TOS values readable as string values (e.g. AF11).
In addition, alembic scripts have been updated to use the proper field types
for all TOS/COS values.

(issue ASTERISK-23235)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3304/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 18:50:44 +00:00
Joshua Colp
b7326c2be7 res_stasis_recording: Add a "target_uri" field to recording events.
This change adds a target_uri field to the live recording object. It
contains the URI of what is being recorded.

(closes issue ASTERISK-23258)
Reported by: Ben Merrills

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 18:18:16 +00:00
Mark Michelson
5ac921edc3 Don't attempt to link in an aggregate MWI subscription if an endpoint does not aggregate MWI.
Attempting to link a NULL object into an ao2 container had been benign previously, but since
enabling DO_CRASH in the testsuite, this is now causing a crash. It's better to be right
here anyway.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 15:43:43 +00:00
George Joseph
2bad4d070d sorcery: Create AST_SORCERY dialplan function.
This patch creates the AST_SORCERY dialplan function which allows someone to
retrieve any value from a sorcery-based config file.  It's similar to 
AST_CONFIG.

The creation of the function itself was fairly straightforward but it required
changes to the underlying sorcery infrastructure that rippled into individual
sorcery objects.  The changes stemmed from inconsistencies in how sorcery
created ast_variable objectsets from sorcery objects and the inconsistency
in how individual objects used that feature especially when it came to
parameters that can be specified multiple times like contact in aor and match
in identify.  You can read more here...
http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html

So, what this patch does, besides actually creating the AST_SORCERY function,
is the following...

* Creates ast_variable_list_append which is a helper to append one ast_variable
  list to another.
* Modifies the ast_sorcery_object_field_register functions to accept the
  already-defined sorcery_fields_handler callback.
* Modifies ast_sorcery_objectset_create to accept a parameter indicating return
  type preference...a single ast_variable with all values concatenated or an
  ast_variable list with multiple entries.  Also fixed a few bugs.
* Modifies individual sorcery object implementations to use the new function
  definition of the ast_sorcery_object_field_register functions.
* Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement
  sorcery_fields_handler handlers so they return multiple occurrences as an
  ast_variable_list.
* Added a whole bunch of tests to test_sorcery.

(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3254/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 15:13:03 +00:00
Matthew Jordan
a088e23f26 res_fax_spandsp: Fix crash when passing ulaw/alaw data to spandsp
When acting as a T.38 fax gateway, res_fax_spandsp would at times cause a crash
in libspandsp. This would occur when, during fax tone detection, a ulaw/alaw
frame would be passed to modem_connect_tones_rx. That particular routine
expects the data to be in slin format. This patch looks at the frame type and,
if the data is ulaw/alaw, converts the format to slin before passing it to
modem_connect_tones_rx.

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

(closes issue ASTERISK-20149)
Reported by: Alexandr Gordeev
Tested by: Michal Rybarik
patches:
  spandsp_g711decode.diff uploaded by Michal Rybarik (license 6578)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 02:05:26 +00:00
Richard Mudgett
d3498bd700 app_confbridge: Remove some noop code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 00:32:07 +00:00
Richard Mudgett
93f81ee4ef res_musiconhold.c: Remove some unnecessary RAII_VAR() usage.
* Made the moh_register() define use useful parameter names.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 00:17:11 +00:00
Kinsey Moore
774847cbde config: Fix inverted test
The test of the result of the stat() call was inverted such that its
output was only used if the call failed. This inverts the test so that
the output of stat() is used correctly. This was causing full reloads
on unchanged files.

(closes issue ASTERISK-23383)
Reported by: David Woolley
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 20:40:44 +00:00
Kinsey Moore
9650cb5f88 bridge_native_rtp: Fix crash involving masquerade
It is possible for a channel to be masqueraded out of a bridge which
means it may no longer have RTP glue to check upon leaving said bridge.
If this situation occurred (it's possible at least during dial and call
pickup) then Asterisk would crash. This change makes sure the glue is
checked before use.

(closes issue AST-1290)
Reported by: John Bigelow


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 19:21:39 +00:00
Mark Michelson
fd375c623c Fix documentation for PRESENCE_STATE to properly illustrate how to create a presence hint.
There was a missing comma.
This was discovered by Dan Kaplan.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 18:46:31 +00:00
Richard Mudgett
526d0ee4cf alembic: Add missing queue and CDR table creation scripts.
* Added the queues and queue_members tables to the config alembic scripts.

* Added the CDR table alembic creation script.  The CDR table is more of
an example for new setups since the actual table can be fully customized
in cdr_adaptive_odbc.conf.

(closes issue ASTERISK-23233)
Reported by: jmls

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 18:40:13 +00:00
David M. Lee
5ab9e72ed3 Corrected cross-platform stat nanosecond code
When nanosecond time resolution was added for identifying config file
changes, it didn't cover all of the myriad of ways that one might obtain
nanosecond time resolution off of struct stat.

Rather than complicate the #if even further figuring out one system from
the next, this patch directly tests for the three struct members I know
about today, and #ifdef's accordingly.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 16:57:12 +00:00
Sean Bright
804ee2c7d0 Fix references to 'keys' CLI commands in astgenkey
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 12:05:56 +00:00
Igor Goncharovskiy
fe17a176b4 Correct RTP handling in chan_unistim and fix transfer process broken in previous fix:
- Fixed too early RTP setup with phone, that cause no ringback tone on caller side
- Handle call transfer cancel only in STATE_CALL case (related to ASTERISK-23073)

(Reported by: Németh Tamás, niurkin sil)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 06:30:25 +00:00
Igor Goncharovskiy
9d963d4a54 Add update_peer function to unistim_rtp_glue, improve other unistim_rtp_glue functions conforming to other channel drivers. Do not forget auto-detected and user-selected phone settings on 'unistim reload'
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 06:11:21 +00:00
Moises Silva
3ce2740bed Fix res/res_http_websocket.c build failure in 32bit due to incorrect print format for uint64_t
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 04:59:21 +00:00
Moises Silva
25f0cd3e7d Fix WebRTC over WSS not working
Several fixes for the WebSockets implementation in res/res_http_websocket.c

* Flush the websocket session FILE* as fwrite() may not actually guarantee sending
  the data to the network. If we do not flush, it seems that buffering on the SSL
  socket for outbound messages causes issues

* Refactored ast_websocket_read to take into account that SSL file descriptors
  may be ready to read via fread() but poll() will not actually say so because
  the data was already read from the network buffers and is now in the libc buffers

(closes issue ASTERISK-23099)
(closes issue ASTERISK-21930)
Review: https://reviewboard.asterisk.org/r/3248/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 01:27:13 +00:00
Richard Mudgett
2b5d779807 stasis: Made internal_stasis_subscribe() prototype and definition match exactly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 00:55:50 +00:00
Michael L. Young
75d35258a4 func_audiohookinheritance: Check If A Channel Was Specified
This patch prevents a crash when using the function audiohookinheritance without
setting the channel.

(closes issue ASTERISK-23104)
Reported by: Joel Vandal
Tested by: Joel Vandal
Patches:
    asterisk-23104_audiohook_inherit_no_channel-11.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 19:34:05 +00:00
Jonathan Rose
9055e2b4b7 res_rtp_asterisk: Fix one way audio problems with hold/unhold when using ICE
ICE sessions will now be restarted if sessions are changed to use new sets of
remote candidates.

(closes issue ASTERISK-22911)
Reported by: Vytis Valentinavičius
Review: https://reviewboard.asterisk.org/r/3275/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 17:07:14 +00:00
Kinsey Moore
d06644dedc AO2: Add an assert for bad objects
This adds an assert that will only be active if Asterisk is compiled
with DO_CRASH and allows the testsuite to fail tests that would
otherwise require log file parsing.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 16:53:28 +00:00
Kinsey Moore
476bb7222b Blocked revisions 409524
........
rtp_engine: Clean up after a failed remote bridge

Upon failure of an INVITE transaction meant to initiate a remote native
bridge, rtp_engine.c would not clean up non-reference-counted bridge
instance pointers leaving a dangling pointer which was being used to
perform a local native bridge after the other channel had hung up. This
lead to dereferencing into freed memory and plenty of AO2 errors. This
change allows the remote native bridge loop to clean up properly when
the bridge fails.

(closes issue ASTERISK-23310)
Reported by: Jeremy Laine
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 15:39:43 +00:00
Sean Bright
7a11156543 Minor whitespace change to 'sip show peers' output.
(closes issue ASTERISK-23406)
Reported by: ibercom
Tested by: ibercom
Patches:
    asterisk-11.patch uploaded by ibercom
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 14:54:21 +00:00
Joshua Colp
3a04c1b1be res_stasis_recording: Fix memory leak of the absolute name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-03 19:44:20 +00:00
Matthew Jordan
f02fd0e725 doxygen: Tweak the link back to ye olde Digium website
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-03 02:08:14 +00:00
Tzafrir Cohen
d2c6e91971 Makefile: replace -O6 with -O3
-O6 is not a legal option of gcc. Unofficially gcc considers it to be
equivalent of -O3. clang chalks on it, though. This commit sets the 
default optimization flag to be -O3, like gcc actually considered it.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-02 15:14:45 +00:00
Joshua Colp
49c2d55c10 res_pjsip_session: Set options (100rel, timers) on incoming sessions.
This change passes options to the UAS creation function. This in turn
sets up 100rel and session timer properties on the incoming session.

Reported by Julian Russell on asterisk-users mailing list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-01 20:27:17 +00:00
Richard Mudgett
dccc215ba9 devicestate.c: Simplified some logic in _ast_device_state().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-01 00:04:47 +00:00
Richard Mudgett
4c840980cf stasis_cache.c: Remove some unnecessary RAII_VAR() usage.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-01 00:00:33 +00:00
Richard Mudgett
014010bf8e stasis.c: Misc code cleanups.
* Remove some unnecessary RAII_VAR() usage.

* Made the struct stasis_subscription ao2 object use the ao2 lock instead
of a redundant join_lock in the struct for ast_cond_wait().

* Removed locks on some ao2 objects that don't need the lock.

* Made the topic pool entries container use the ao2 template functions.

* Add some missing allocation failure checks.

* Add missing cleanup in off nominal path of dispatch_message().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 23:29:58 +00:00
Richard Mudgett
c38f3bd145 chan_sip: Add precautionary p->owner checks.
* Add precautionary p->owner checks in sip_hangup(), get_refer_info(),
get_also_info(), and interpret_t38_parameters().

* Simplify some tangled logic in get_refer_info(), get_also_info(), and
add_rpid().

* Removed some dead code in handle_request_invite().

(closes issue ASTERISK-23323)
Reported by: Walter Doekes
Patches:
      issueA23323-more_p_owner_checks-1.8.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-11.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-12.x.patch (license #5674) uploaded by wdoekes (modified)
      issueA23323-more_p_owner_checks-trunk.patch (license #5674) uploaded by wdoekes (modified)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:40:54 +00:00
Kinsey Moore
370b75e4e1 app_queue: Fix documented AMI event name
During the rewrite of AMI events to use the Stasis bus, the name of the
QueueMemberPaused event was changed to QueueMemberPause. This corrects
documentation to reflect that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:24:15 +00:00
Kinsey Moore
f0948cf239 Blocked revisions 409208
........
app_queue: Fix documentation generation

The documentation for QueueMemberPaused was causing documentation
generation to fail because the documentation for that AMI event was in
the wrong location. This moves that documentation the correct location
and adds a missing parameter.

(closes issue SWDAT-261)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 21:15:22 +00:00
Richard Mudgett
649dfa007c chan_sip: Fix crash in ast_channel_hangupcause_set().
* Fix crash in ast_channel_hangupcause_set() because p->owner not checked
before calling.  Regression introduced by the fix for ASTERISK-22621.

(closes issue ASTERISK-23135)
Reported by: OK

(issue ASTERISK-23323)
Reported by: Walter Doekes
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-28 18:02:11 +00:00
Jonathan Rose
5261fd7bc7 Multiple revisions 409129-409130
........
  r409129 | jrose | 2014-02-27 13:19:02 -0600 (Thu, 27 Feb 2014) | 15 lines
  
  res_rtp_asterisk: Fix checklist creating problems in ICE sessions
  
  Prior to this patch, local candidate lists including SRFLX would fail to start
  properly when building ICE candidate check lists. This patch fixes that problem
  by making sure that each SRFLX candidate is associated with the proper
  base address so that the check list can create matches properly.
  This patch was written by jcolp. The issue will be left open to await testing
  by the issue participants.
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........
  r409130 | jrose | 2014-02-27 13:38:10 -0600 (Thu, 27 Feb 2014) | 8 lines
  
  res_rtp_asterisk: correct build error from r409129
  
  Accidentally placed a declaration below functional code
  
  (issue ASTERISK-23213)
  Reported by: Andrea Suisani
  Review: https://reviewboard.asterisk.org/r/3256/
........

Merged revisions 409129-409130 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 19:42:17 +00:00
David M. Lee
7bf499290d Fix memory stomping bug in astman.
This memset complained in dev mod on my Ubuntu box. The memset is both
unnecessary and dangerous. At this point, m hasn't been initialized
yet, so the memset will write off to whatever address happens to be
on the stack at the time.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:25:32 +00:00
Corey Farrell
a976d09cdc res_fax: Warn that minrate=2400 is not valid for V.27 instead of failing load.
Change minrate from 2400 to 4800 on config reload in response to changes from
ASTERISK-22790 only.  Any config with minrate of 2400 that would fail before
r405693 will still fail.

Comment out many settings in res_fax.conf.sample. The defaults are set in
res_fax.c, so setting the same value in sample config does nothing but make
the sample config more fragile.

(closes issue ASTERISK-23231)
Reported by: David Brillert
Review: https://reviewboard.asterisk.org/r/3261/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:05:31 +00:00
Matthew Jordan
4488ca127b Blocked revisions 409002
Note that this is blocked in 12 as channels are no longer masqueraded out
of bridges. The channel cannot be replaced with a ZOMBIE channel in the
affected routine.

........
rtp_engine: fix crash during remote native bridging when calling get_codecs

When two RTP channels are in a remote bridge, the remote bridging loop in
rtp_engine will periodically check to see if the two channels can still be
bridged. One of the many things it checks is whether or not the codecs have
changed on the channel. If the codec has changed, it will break out of the
loop to re-determine which type of bridge is appropriate.

In order to perform this check, the ast_rtp_glue virtual table's get_codec
callback is called for each channel. The callback implementations assume
that the channel tech private is valid when called; as such, there has
always been some code in place to check whether or not the channel pvt is
NULL before calling. However, this check is insufficient.

The channels are unlocked during the remote bridging loop. It is possible
for a channel to get masqueraded between the check for the pvt being NULL and
the actual call to get_codec. When this occurs, the callback is called with a
ZOMBIE channel, which now has a NULL pvt. Crash.

While this has always been possible in Asterisk 1.8, it is much more likely to
occur in Asterisk 11 and later versions due to the timing changes that occur
when getting the codec from a channel. Note that this is much more likely to be
reproduced on slow, boggy hardware running Asterisk 11 - but fairly rarely
otherwise.

Also Note: This crash was also caught by the various SIP blind transfer tests,
in addition to the bug report Alec filed.

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

(closes issue ASTERISK-21737)
Reported by: Alec Davis
Tested by: Alec Davis
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@409003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 13:09:37 +00:00
Matthew Jordan
e7d0c35210 res_pjsip_sdp_rtp: Apply packetization rules on inbound SDP handling
The setting 'use_ptime' is supposed to tell Asterisk to honour the ptime
attribute in an offer, preferring it to whatever packetization
preferences have been set internally. Currently, however, something
rather quirky will happen:

(1) The SDP answer will be constructed in create_outgoing_sdp_stream.
    This will use the preferences from the endpoint, such that the 200 OK
    response will add the packetization preferences from the endpoint, and
    not what was offered.
(2) When the 200 response is issued, apply_negotiated_sdp_stream is called.
    This will call apply_packetization, which will use the ptime attribute
    from the offer internally.

We end up telling the offerer to use the internal ptime attribute, but we end
up using the offered ptime attribute. Hilarity ensues.

This patch modifies the behaviour by calling apply_packetization from
negotiate_incoming_sdp_stream, which is called prior to
create_outgoing_sdp_stream. This causes the format preferences on the
session's media object to be set to the inbound ptime value (if 'use_ptime'
is enabled), such that the construction of the answer gets the right value
immediately.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 12:28:04 +00:00
Richard Mudgett
312d0122c3 test_stasis.c: Misc cleanups.
* Make the consumer ao2 object use the ao2 lock instead of a redundant
lock in the struct for ast_cond_wait().

* Fixed some curly brace placements.

* Fixed use of malloc(0).  malloc(0) has variant behavior.  It is up to
the implementation to determine if it returns NULL or a valid pointer that
can be later passed to free().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 23:33:06 +00:00
Scott Griepentrog
33d60bed46 pjsip: avoid edge case potential crash in answer()
When accidentally compiling against a wrong version of
pjsip headers with a different pjsip_inv_session size,
the invite_tsx structure could be null in the answer()
function.  This led to a crash because it attempted to
send the session response with an uninitialized packet
pointer.  This patch presets packet to null and adds a
diagnostic log message to explain why the call fails.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 19:00:07 +00:00
Joshua Colp
ccfa79d2ba res_ari: Make some additional error responses consistent with the rest of the system.
This change makes some error cases use ast_ari_response_error to construct their
error responses instead of manually doing it. This ensures they are consistent
with the other error responses.

Based on the original patch as done by Paul Belanger on the associated review.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 17:03:47 +00:00
Kinsey Moore
b0655b6439 PJSIP: Fix some bad spacing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 13:46:44 +00:00
Kinsey Moore
a4dfffc124 PJSIP: Prevent crash if channel has gone away
It is currently possible for an ast_sip_session to exist without an
associated channel as is the case when a new invite is coming in or
just after a hangup is issued on a chan_pjsip channel. Part of the
attended transfer code assumed the channel would be non-NULL and used
it as such causing a crash. This bug was exposed thanks to the attended
transfer ARI test in the test suite.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-26 13:33:52 +00:00
Kevin Harwell
4cf4c0c61a res_pjsip_exten_state: Presence for digium phones
Added presence support for digium phones.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:50:54 +00:00
Kevin Harwell
138767895c res_pjsip_send_to_voicemail: transferring to voicemail for digium phones
Added the ability for transferring directly to voicemail on digium phones.
Added a new module that checks for the presence of a custom header and/or
diversion header within a sip REFER.  If either is found and they specify
a sending to voicemail action then variables are added to the channel
allowing the user access to them in the dialplan.  Dialplan can then be
written that branches based upon these values allowing, for instace, for
a single number to be used for dialing and/or accessing voicemail directly.

Also fixed a problem where the PJSIP_HEADER function was allowing non pjsip
channels through (checked to make sure it has the correct channel type before
proceeding).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:45:27 +00:00
Rusty Newton
fdbad7a21f configs/voicemail.conf.sample - Make mailcmd sample text more explicit
Made the wording a bit more explicit. Didn't really change the meaning.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-25 17:43:59 +00:00
Matthew Jordan
91991bbfe0 main: Initialize dialplan providing core components prior to module pre-load
It is possible to pre-load pbx_config. As a result, pbx_config - which will
load and parse the dialplan - will attempt to use various dialplan components,
such as device state providers and presence state providers, prior to them
being initialized by the core. This would lead to a crash, as the components
had not created their Stasis cache entries.

This patch moves a number of core component initializations before the module
pre-load. This guarantees that if someone does pre-load pbx_config - or other
pbx modules - that the Stasis caches for the various core components are
created.

(closes issue ASTERISK-23320)
Reported by: xrobau

(closes issue ASTERISK-23265)
Reported by: Andrew Nagy
Tested by: Andrew Nagy, Rusty Newton


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 19:56:23 +00:00